Add data to post edit page, when post is published
Search for add_meta_box(). This function is the key to add custom areas to the edit screen and inside this can you handle your custom requirements.
Search for add_meta_box(). This function is the key to add custom areas to the edit screen and inside this can you handle your custom requirements.
Use a conditional depending on capability. Admin’s and Editors can both moderate comments so we can use the moderate_comments capability. If a user cannot moderate comments, then remove the quick edit link. Then we can filter post_row_actions to remove the quick edit link. function remove_quick_edit(){ function unset_quick_edit( $actions ) { unset( $actions[‘inline hide-if-no-js’] ); return … Read more
I think what you’ll want to do is iterate over the $_GLOBALS[‘menu’] array. This should give you a list of all the items in the admin menu so you know what the hooks are that need to be removed. There are more details and good information in this answer: https://wordpress.stackexchange.com/a/136064/9080 The appropriate hook/slug can be … Read more
Finally got this working! This is just a basic test to get the form working, but if anyone else is working on a similar issue, this is how I got it to work. Another important thing, to keep the “Headers already sent” error away, make sure that there are NO errors i.e. all fields are … Read more
The function below should help you. It removes the default menu item from the “Apperance” menu item and a new menu item to the Dashboard. add_action( ‘admin_menu’, ‘fb_customize_admin_menu_hide’, 999 ); function fb_customize_admin_menu_hide(){ global $submenu; // Remove Appearance – Customize Menu unset( $submenu[ ‘themes.php’ ][ 6 ] ); // Create URL. $customize_url = add_query_arg( ‘return’, urlencode( … Read more
When doing AJAX call in WordPress, you should always post to admin-ajax.php file. Here’s how you do that. In your plugin or functions.php: function process_my_ajax_call() { // Do your processing here (save to database etc.) // All WP API functions are available for you here } // This will allow not logged in users to … Read more
I just found the solution. use this code instead public function register_voguepay_woocommerce_payouts_dashboard_widget(){ add_meta_box( ‘withdraw_to_bank’, ‘Withdraw to Bank’, array($this, ‘voguepay_woocommerce_payouts_dashboard_widget_display’), ‘dashboard’, ‘side’, ‘high’ ); } public function voguepay_woocommerce_payouts_dashboard_widget_display(){ echo “Hello World, I’m a great Dashboard Widget”; }
This does seem like a corrupt WP core with missing files. You can attempt to repair it by uploading a fresh copy of core in place. The procedure would be along the lines of Manual Update documented in Codex. However I want to note that pieces of WordPress core don’t just disappear for no reason. … Read more
No, you cannot (easily) choose what tag ID is assigned. It’s not random – it’s the next ID available after the last one that was created in the database. If you really want to control tag IDs, you’ll need to clear your database and start fresh, and create each tag in the order you want … Read more
You could hook to the get_terms_args filter conditionally depending on your user/role Something along those lines add_filter( ‘get_terms_args’, ‘restrict_cat’, 10, 2 ); function restrict_cat( $args, $taxonomies ){ // Don’t run if we are not dealing with categories if( ‘category’ != $taxonomies[0] ) return $args; // The check for the user we want to restrict // … Read more