Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在wordpress管理中禁用1/2列屏幕布局单选按钮_Php_Wordpress - Fatal编程技术网

Php 如何在wordpress管理中禁用1/2列屏幕布局单选按钮

Php 如何在wordpress管理中禁用1/2列屏幕布局单选按钮,php,wordpress,Php,Wordpress,我想在wordpress admin中隐藏出现在我的自定义页面上的1/2列单选按钮,我应该怎么做?(好的,我可以用javascript来做,我要求一个本地wordpress解决方案) 这就是我说的收音机 这是页面的标记 <div class="wrap"> <?php screen_icon(); ?> <h2><?php echo $title; ?></h2> <div id="poststuf

我想在wordpress admin中隐藏出现在我的自定义页面上的1/2列单选按钮,我应该怎么做?(好的,我可以用javascript来做,我要求一个本地wordpress解决方案)

这就是我说的收音机

这是页面的标记

<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 -->


过滤器!即,对于
screen\u layout\u列
get\u user\u option\u screen\u layout\u 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' );

不知道您是否在wordpress.stackexchange中看到了这篇文章,也许它可以帮助您: