Why do Metabox use Nonces?

WordPress nonces are meant to prevent unauthorized execution of code. In the case of meta boxes, they are protecting you against malicious users potentially adding unauthorized meta-information to your posts and pages by forging POST requests. Why wouldn’t you want to use nonces?

Rename menu items for All except super admin

/** * Changes Label of Admin Menu items * @global array $menu * @global array $submenu */ function change_post_menu_label() { global $menu; global $submenu; $menu[2][0] = ‘Home’; $menu[5][0] = ‘Articles’; $submenu[‘edit.php’][5][0] = “All Articles”; // var_dump($submenu); // var_dump($menu); echo ”; } if(!is_super_admin()){ add_action( ‘admin_menu’, ‘change_post_menu_label’ ); } You can print the array echo “<pre>”; print_r($menu); … Read more

How can i force wp-admin to use 2-column dashboard layout? [closed]

This should help: function so_screen_layout_columns( $columns ) { $columns[‘dashboard’] = 2; return $columns; } add_filter( ‘screen_layout_columns’, ‘so_screen_layout_columns’ ); function so_screen_layout_dashboard() { return 2; } add_filter( ‘get_user_option_screen_layout_dashboard’, ‘so_screen_layout_dashboard’ ); On dashboard screen options it will show 1 or 2 columns, after clicking 1 column after refresh will still be 2 columns. You can change to whatever … Read more

add slug beside name in Admin Category Checklists

ok since i didn’t have any response im posting the SOLUTION my self so it can be useful for others wanting to do the same: add_filter(‘wp_terms_checklist_args’, ‘display_custom_checklist’); function display_custom_checklist( $args ){ if ( $args[‘taxonomy’] == ‘portfolio-type’ ) $args[‘walker’] = new my_custom_walk; return $args; } class my_custom_walk extends Walker { var $tree_type=”category”; var $db_fields = array … Read more

Cannot redeclare wp_update_core()

you probably need to reinstall manually the wordpress core with the help of FTP software download from wordpress.org the latest version of wordpress. rename or delete the wp-admin and wp-oncludes directories upload wordpress. to be fully safe during this process you might want to add a .maintenance file before step 2 and remove it after … Read more

How to hide Admin Tabs? [duplicate]

You could use this code (below is just an example for 3 random tabs) function disable_user_profile() { if ( !current_user_can( ‘publish_posts’ ) ) { wp_redirect( admin_url(‘index.php’) ); } } add_action( ‘load-profile.php’, ‘disable_user_profile’ ); // disable profile tab add_action( ‘load-tools.php’, ‘disable_user_profile’ ); // disable tools tab add_action( ‘load-edit.php’, ‘disable_user_profile’ ); // disable posts tab The if … Read more