Can’t add users in admin after copying database

The key turned out to be that the wp_users table lost its AUTO_INCREMENT setting when it was imported, for unknown reasons; the server may have timed out, etc. I found this out from the wp-cli error in the debug log that said “WordPress database error Duplicate entry ‘1000075’ for key ‘PRIMARY’ for query INSERT INTO … Read more

Get current logged in user under 3.1, re: remove “Howdy”

Why fiddle around with jQuery when you could just run a filter on gettext to specifically target that text? Perhaps you simply don’t know you can do that, so here’s how.. add_filter( ‘gettext’, ‘change_howdy_text’, 10, 2 ); function change_howdy_text( $translation, $original ) { if( ‘Howdy, %1$s’ == $original ) $translation = ‘Logged in as %1$s’; … Read more

Change wording of admin menu item?

Inside the plugin folder check for File: jigoshop_taxonomy.php Line no: 120 You will see register_post_type( “product”, array( ‘labels’ => array( ‘name’ => __( ‘Products’, ‘jigoshop’ ), ‘singular_name’ => __( ‘Product’, ‘jigoshop’ ), ‘all_items’ => __( ‘All Products’, ‘jigoshop’ ), ‘add_new’ => __( ‘Add Product’, ‘jigoshop’ ), ‘add_new_item’ => __( ‘Add New Product’, ‘jigoshop’ ), ‘edit’ … Read more

How to disable automatic excerpt generation *in admin*?

Just illustrating this in full effect here with the filters and functions for both the adding of custom column and testing for excerpt existence. Note, I’ve purposely ripped the guts out of has_excerpt to show you in effect what is occurring under the hood. You can use !has_excerpt in its place. add_filter(‘the_excerpt’, ‘no_excerpt’); add_filter(‘manage_posts_columns’ , … Read more

disable admin-bar search field for specific roles

Just in case anyone trips over this…here’s how you remove “search” and some examples of other things you can remove from the admin bar: public function remove_admin_menu_bar_items ($wp_toolbar) { $wp_toolbar->remove_node( ‘my-sites’ ); $wp_toolbar->remove_node( ‘wp-logo’ ); $wp_toolbar->remove_node( ‘new-content’ ); $wp_toolbar->remove_node( ‘view’ ); $wp_toolbar->remove_node( ‘logout’ ); //remove “logout” under “howdy” $wp_toolbar->remove_node( ‘user-info’ ); //remove “youraccount” under “howdy” … Read more

Where does WordPress store a list of Super Admins?

It’s stored in the main site options table, under the “site_admins” key. Edit: As pointed out in the comments, the “site options” table in multisite is actually named PREFIX_sitemeta, like “wp_sitemeta”. It’s referred to as a site option internally, like get_site_option(‘site_admins’). To adjust this without editing the database content directly, you could do this: $capes … Read more