Add a Separator to the Admin Menu?

Here’s a quick and dirty way to get what you want. Background WordPress stores admin menu sections in a global array called $menu. To add a separator you add an element to the $menu array using an index that is between the indexes of the options that you want to separate. Using the add_admin_menu_separator() function … Read more

Add custom column to Users admin panel

Ok, Here is the code to allow your users to add phone numbers. Paste this full code in functions.php file. This will add new field on user profile for “Phone Number” and add a column user table on WordPress admin for phone. function new_contact_methods( $contactmethods ) { $contactmethods[‘phone’] = ‘Phone Number’; return $contactmethods; } add_filter( … Read more

How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?

I coded a plugin just for that and never got around to publish it : Usage: In the dropdown you have a list of all custom fields, so just select the field you want to filter by and click filter. if you want to filter to a specific value of a custom field then select … Read more

How to remove admin menu pages inserted by plugins?

You need to use the right hooks (which are not always the same as the URLs/slugs), and it doesn’t hurt to use a hook that runs later (e.g., admin_init): add_action( ‘admin_init’, ‘wpse_136058_remove_menu_pages’ ); function wpse_136058_remove_menu_pages() { remove_menu_page( ‘edit.php?post_type=acf’ ); remove_menu_page( ‘wpcf7’ ); } You can use the following to debug: add_action( ‘admin_init’, ‘wpse_136058_debug_admin_menu’ ); function … Read more

Creating a table in the admin-style?

This is what I generally use: <table class=”widefat fixed” cellspacing=”0″> <thead> <tr> <th id=”cb” class=”manage-column column-cb check-column” scope=”col”></th> // this column contains checkboxes <th id=”columnname” class=”manage-column column-columnname” scope=”col”></th> <th id=”columnname” class=”manage-column column-columnname num” scope=”col”></th> // “num” added because the column contains numbers </tr> </thead> <tfoot> <tr> <th class=”manage-column column-cb check-column” scope=”col”></th> <th class=”manage-column column-columnname” scope=”col”></th> … Read more