Downgrade admin account by mistake

Usually, this should help: Open your database (with phpmyadmin, navicat, etc) Open the wp_user table and have a look for the ID of your admin user (usually 1) Open the wp_usermeta table and search for the row that has the user_id of your user paste the following string into the meta_value field of the row: … Read more

How to change menu labels

In order to change the menu labels you will have to go to add this code into your functions.php: add_filter( ‘gettext’, ‘change_woocommerce_text’ ); function change_woocommerce_text( $translated ) { $translated = str_replace( ‘WooCommerce’, ‘Store’, $translated ); return $translated; } Tested.

Add menu page issues (permissions & position)

you can do something like: // create your own page add_menu_page(‘my-page’, ‘My Page’, ‘My Page’, ‘parent-slug’, ‘my_plugin_options’, ”, ’10’); // create the subpage under my-page add_submenu_page(‘parent-slug’, ‘Sidebars’, ‘Sidebars’, ‘manage_options’, __FILE__, array(‘sidebar_generator’,’admin_page’)); Note that the last parameter on add_menu_page is a 10. The higher the number the lower the position of the menu item. HTH

Wp admin – Set default value to 999 in comments

You can use add_filter(‘edit_comments_per_page’, ‘return_999’); function return_999(){ return 999; } since the user options are filtered in the WP_List_Table::get_items_per_page() class method : /** * Get number of items to display on a single page * * @since 3.1.0 * @access protected * * @return int */ function get_items_per_page( $option, $default = 20 ) { $per_page … Read more

How to isolate code to the post edit screen

Use the WP_Screen object to tell where you are at in the admin instead. Much more convenient. $screen = get_current_screen(); if ( $screen->id == ‘edit-post’ ) { // you’re on the posts screen } Note that you have to wait until at least the admin_head hook to run for the current screen to have been … Read more