1
元のpost_titleを変更を保存した後に同じ投稿のカスタムフィールドに置き換えようとしています。ライン113カスタム関数の引数2がありません
上の$ PATH/public_htmlの/ WP-コンテンツ/テーマ/ $テーマ/のfunctions.phpにwpse33385_filter_titleための欠落引数2():警告:しかし、私は、投稿ページに次のエラーを取得しています
// replaces the original post_title with the value of pac-short-title add_filter('the_title', 'wpse33385_filter_title', 10, 2); function wpse33385_filter_title($title, $post_id) { if($new_title = types_get_field_meta_value('pac-short-title', $post_id)) { return $new_title; } return $title; }
add_filterでいくつかの引数を定義したので混乱しますか?
関連する 'apply_filters()'コールはどこにありますか? – Tristan
@Tristanどういう意味ですか?この関数は機能しますが、フロントエンドに警告が表示されます。 – JanisOzolins