08/14/2014 at 1:30 pm
#300894
Keymaster
@ Mike
First, install the Code Snippets plugin.
Add a new snippet with the following code:
add_filter( 'screen_layout_columns', 'cn_screen_layout', 99, 2 );
public static function screenLayout( $columns, $screen ) {
// Grab an instance of the Connections object.
$instance = Connections_Directory();
/*
* The Screen Layout options in the Screen Options tab only needs to be added on the manage page if performing an action to an entry.
* This is to prevent the Screen Layout options in the Screen Options tab from being displayed on the Manage
* admin page when viewing the manage entries table.
*/
if ( $screen == $instance->pageHook->manage && ! isset( $_GET['cn-action'] ) ) return $columns;
$columns[ $instance->pageHook->manage ] = 1;
$columns[ $instance->pageHook->add ] = 1;
return $columns;
}
Save and activate. This should make the default layout one column.
To move the the category metabox to the other side, yes, you can use similar code to that found on SO.
Add a new snippet with the following code:
function cn_category_metabox() {
remove_meta_box( 'categorydiv', 'users_page_connections_link', 'side' );
add_meta_box( 'categorydiv', __( 'Categories', 'connections' ), array( 'cnEntryMetabox', 'category' ), 'users_page_connections_link', 'core', 'normal' );
}
add_action( 'load-users_page_connections_link', 'cn_category_metabox' );
This snippet will only affect the Link admin edit entry page … its the one I think you really want to change, yes?
There’s not a really easy way to force position though. Oh, and it will not change the position and placement of users who have already visited the page.
Alternatively, you could probably use jQuery to do it for you. This SO answer provides a basic example which you could adapt to Connections.
I hope that helps!
