0

各投稿管理ページに管理パネルを備えたカスタムスライドショーシステムを必要とするWordpressブログを構築しています(YoastのSEOプラグインが各ページにオプションを持っているのと同じように).

投稿管理ページに管理オプションを表示するにはどうすればよいですか?

ありがとう、

チャーリー

4

1 に答える 1

0

あなたはプロジェクトについてあまり詳細を提供していませんが、おそらくいくつかの meta_boxesを作成し、データをカスタム フィールドとして保存したいと思うでしょう。

これは、 wordpress.stackexchange での質問のためにまとめたものから切り捨てられた例です。一部の関数の詳細は、ここでの質問にとって重要ではありませんが、一般的な「方法」を示しています。リンクをたどって、動作するが誠実なベータコードを入手してください。

// author checkboxes
add_action( 'add_meta_boxes', 'assisting_editor' );
function assisting_editor() {
    add_meta_box(
        'assisting_editor', // id, used as the html id att
        __( 'Editorial Tasks' ), // meta box title
        'editor_tasks', // callback function, spits out the content
        'post', // post type or page. This adds to posts only
        'side', // context, where on the screen
        'low' // priority, where should this go in the context
    );
}

// this is the callback that creates the meta box content
function editor_tasks( $post ) {
  // function details skipped; follow the link
}

// to save the data
add_action( 'save_post', 'save_metadata');
// callback for the save hook ^^
function save_metadata($postid) {
  // function details skipped; follow the link
}
于 2013-01-29T20:09:34.050 に答える