How to go about modifying the Wordpress “Pages Add New Screen”

后端 未结 2 898
南旧
南旧 2020-12-11 08:47

I have been thinking about developing my own theme framework for worpdress. I\'d like to use jquery ui to build a bootstrap 3.0 drag and drop interface, which I already have

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 09:29

    We add a Custom Meta Box and do our thing inside it.

    There are some hooks that are not Meta Boxes and we can use to insert content into that admin page:

    add_action( 'edit_form_top', function( $post ) 
    {
        echo '

    edit_form_top

    '; }); add_action( 'edit_form_after_title', function( $post ) { echo '

    edit_form_after_title

    '; }); add_action( 'edit_form_after_editor', function( $post ) { echo '

    edit_form_after_editor

    '; }); add_action( 'edit_page_form', function( $post ) { // edit_page_form is ONLY for pages, the other is for the rest of post types echo '

    edit_page_form/edit_form_advanced

    '; }); add_action( 'dbx_post_sidebar', function( $post ) { echo '

    dbx_post_sidebar

    '; });

    The widget_text block belongs to Advanced Custom Fields (it's a repeatable/sortable field). I'm not sure anymore, but I think it removes the Meta Box borders with CSS or jQuery.

提交回复
热议问题