how to disable 1/2 column screen layout radio button in wordpress admin

I’d like to hide the 1/2 column radio button that appears on my custom page in wordpress admin, how should i do it? ( ok i could do it in javascript, i was asking for a native wordpress solution )

This is the radio i’m talking about

Read More

enter image description here

here is the markup of the page

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

Related posts

Leave a Reply

1 comment

  1. Filters! Namely, for screen_layout_columns and get_user_option_screen_layout_post. Gotta love those poorly documented hooks.

    Try this:

    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' );