custom post types - Modify Publish Metabox location on CPT

I've been struggling with how to do this properly and have yet to find a solution.I have a CPT with ACF fields.

I've been struggling with how to do this properly and have yet to find a solution. I have a CPT with ACF fields. I can't use a front-end form because I'm synchronizing the CPT across several subsites so need to use the backend form. I've got it setup and the post form is defaulting to a single column but I cannot move the publish meta box to the bottom of the form... it's positioned below the post title field. This seems silly. S

Any help you could provide would be huge!

Thanks!

I've been struggling with how to do this properly and have yet to find a solution. I have a CPT with ACF fields. I can't use a front-end form because I'm synchronizing the CPT across several subsites so need to use the backend form. I've got it setup and the post form is defaulting to a single column but I cannot move the publish meta box to the bottom of the form... it's positioned below the post title field. This seems silly. S

Any help you could provide would be huge!

Thanks!

Share Improve this question edited Oct 2, 2019 at 17:15 user3311868 asked Oct 2, 2019 at 16:32 user3311868user3311868 134 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

This solution seems to work so far.

    add_filter('screen_layout_columns', 'one_column_on_screen_options');
function one_column_on_screen_options($columns) {
    $columns['post'] = 1;
    return $columns;
}

// Ignore user preferences stored in DB, and serve only one column layout    
add_filter('get_user_option_screen_layout_post', 'one_column_layout');
function one_column_layout($option) {
    return 1;
}

add_action( 'add_meta_boxes_sliding_panel', 'sds_do_meta_boxes', 0, 1 );
function sds_do_meta_boxes( $post )
{
    remove_meta_box( 'submitdiv', 'sliding_panel', 'side' );
    add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', 'sliding_panel', 'normal', 'high', null );
}


function translate_publish( $translated_text, $untranslated_text, $domain ) {
    if( stripos( $untranslated_text, 'Publish' ) !== FALSE ) {
        $translated_text = str_ireplace( 'Publish', 'Save', $untranslated_text ) ;
    }
    return $translated_text;
}
if(is_admin()){
    add_filter( 'gettext', 'translate_publish', 99, 3 );
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745105902a4611554.html

相关推荐

  • custom post types - Modify Publish Metabox location on CPT

    I've been struggling with how to do this properly and have yet to find a solution.I have a CPT with ACF fields.

    11小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信