Admin Panel pagination link styles

Fantastic, once again researching my question has provided an answer. For those interested, surround your pagination links in <div class=”tablenav”><div class=”tablenav-pages”>LINKS</div></div> to get better looking number links. (moved to answers as suggested by SickHippie)

Hide one admin from another admin

add_action(‘pre_user_query’,’yoursite_pre_user_query’); function yoursite_pre_user_query($user_search) { global $current_user; $username = $current_user->user_login; if ($username == ‘<USERNAME OF OTHER ADMIN>’) { global $wpdb; $user_search->query_where = str_replace(‘WHERE 1=1’, “WHERE 1=1 AND {$wpdb->users}.user_login != ‘<YOUR USERNAME>'”,$user_search->query_where); } } Replace text with the actual usernames of the users involved. You can also modify this to hide one admin from all other users … Read more

How can I show the contents of only a few users

To show content only for users with role ‘agent’, try to use this snippet: <?php if ( ( $user = wp_get_current_user() ) && in_array( ‘agent’, $user->roles ) ) { ?> ///here the content <?php } ?> If you want to block users by ID, check the following snippet: <?php if ( ( $user = wp_get_current_user() … Read more

Limit the menu child levels under “admin > appearance > menus”

Just use remove_submenu_page( $menu_slug, $submenu_slug );. $menu_slug = Parent page $submenu_slug = Submenu page Example usage: // Remove the submenu page for widgets add_action( ‘admin_menu’, ‘adjust_the_wp_menu’, 999 ); function adjust_the_wp_menu() { remove_submenu_page( ‘themes.php’, ‘widgets.php’ ); }

Hide Pages on Edit Pages based on Capability (edit_others_pages)?

I was using the wrong query_var. It’s author not post_author. add_action( ‘pre_get_posts’, ‘wps_admin_exclude_pages’ ); function wps_admin_exclude_pages( $query ) { if( ! is_admin() ) return $query; global $pagenow, $user_ID; if( ‘edit.php’ == $pagenow && ‘page’ == get_query_var( ‘post_type’ ) && ! current_user_can( ‘edit_others_pages’ ) ) $query->set( ‘author’, $user_ID ); return $query; }

Selectbox in admin panel function linking to CSS

Not Recommended <?php if(theme_get_option(‘theme_style_options’) == ‘style1’): ?> <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/55754/<?php echo get_template_directory_uri(); ?>/style1.css” /> <?php elseif(theme_get_option(‘theme_style_options’) == ‘style2’): ?> <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php echo get_template_directory_uri(); ?>/style2.css” /> <?php elseif(theme_get_option(‘theme_style_options’) == ‘style3’): ?> <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php echo get_template_directory_uri(); ?>/style3.css” /> <?php endif;?> OR <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/55754/<?php echo get_template_directory_uri(); ?>/<?php … Read more

Custom Post Type Nav to Subpage

You say that you know about show_in_menu parameter for register_post_type() but it seems like you missed the options for this parameter: ‘false’ – do not display in the admin menu ‘true’ – display as a top level menu ‘some string’ – If an existing top level page such as ‘tools.php’ or ‘edit.php?post_type=page’, the post type … Read more