2012-11-15 81 views
2

我想隐藏wordpress管理员中我的自定义页面上出现的1/2列单选按钮,我应该怎么做? (好吧,我能做到这一点在JavaScript中,我问了一个原生的WordPress溶液)如何禁用wordpress管理器中的1/2列屏幕布局单选按钮管理员

这是我说的无线电约

enter image description here

这里是页

的标记
<div class="wrap"> 

    <?php screen_icon(); ?> 

    <h2><?php echo $title; ?></h2> 

    <div id="poststuff"> 

     <form method="post" action="" enctype="multipart/form-data"> 
      <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> 
      <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?> 

      <div > 
       <div class="column-1-ai1ec timely"> 
        <?php do_meta_boxes($settings_page, 'left', null); ?> 
        <?php 
         // Show the submit button only in the settings page and not in the Feeds page. 
         if ($calendar_settings) { 
          submit_button(esc_attr__('Update Settings', AI1EC_PLUGIN_NAME), 'primary', 'ai1ec_save_settings'); 
         } 
        ?> 
       </div> 
       <div class="column-2-ai1ec timely"><?php do_meta_boxes($settings_page, 'right', null); ?></div> 
      </div> 
     </form> 

    </div><!-- #poststuff --> 

+0

如果你看到这个帖子在wordpress.stackexchange不知道,也许它可以帮助:http://wordpress.stackexchange.com/questions/56606/how-to-除去-某些屏幕选项和 - 元盒从 - 添加 - 编辑 - 后期型 – McNab

回答

3

过滤器!即,对于screen_layout_columnsget_user_option_screen_layout_post。喜欢那些记录不完善的钩子。

试试这个:

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

function force_single_column_layout_post() { 
    return 1; 
} 
add_filter('get_user_option_screen_layout_post', 'force_single_column_layout_post');