3

You're getting the blank rows because your column headers are registered late. And you should register the headers (i.e. initialize the list table class instance) before admin notices are rendered on the page, i.e. before WordPress fires hooks like admin_notices. But your customer_list_page() function, which I believe, is a callback for either add_menu_page(...


2

By adding post_type to add_submenu_page menu slug it will active CPT page menu. then you have to add parent page as that CPT to that commnet page by using submenu_file filter. # Move comment to CPT function wpse354847_relocate_comments_in_admin_menu() { // Remove existing parent menu. remove_menu_page( 'edit-comments.php' ); // Move Comments ...


2

If this is what you want: ... you can do it like so: Step #1: Add the custom menu item (Retailer Sendout). function add_retailer_sendout_admin_menu() { $slug = 'edit.php?post_type=page&template=page-retailer-sendout.php'; add_menu_page( 'Retailer Sendout', 'Retailer Sendout', 'edit_pages', $slug, '', 'dashicons-admin-page', 19 ); } ...


1

//is there a $param here? None, the hook you're using does not pass any parameters to the callback. But you can instead use the admin_enqueue_scripts hook which passes the hook name for the current menu page — the hook name is also saved in the global $hook_suffix variable. You can then use get_plugin_page_hookname() to get the hook name for a ...


1

Your code is correct but just you have called wrong capability in add_submenu_page. You just need to replace this 'manage_options' instead of 'manage-options'. And please check it. It's works. Reference: https://developer.wordpress.org/reference/functions/add_submenu_page/


1

This is a great question. I have never seen any kind of framework inside Wordpress for building forms, and after a bit of searching now to verify this, I don't think there is one, although I'm sure others will correct me if there is ;-) So, you probably need to hand code forms as you would with a fresh HTML page. However, there are a bunch of guidelines out ...


1

The problem is that when the special subscriber tries to Add New a sub-cpt post, it is denied permission. However, when the CPT menu is a top-admin-menu, then everything works out fine. The issue is related to the placement of the CPT's UI menu in the back-end: if it's top-level (show_in_menu=TRUE), all is well; if its a submenu (show_in_menu='my-menu-...


1

There's indeed a WordPress function for counting posts: wp_count_posts(). So you can do something like: $memo_count = wp_count_posts( 'memo' )->pending;


1

The File field's documentation has some options you can try, but here's an example if your field's Return Value is array, where you can use $gradingForm['url'] to get the attachment URL: $gradingForm = get_field( 'grading_form', $post_id ); echo $gradingForm ? '<a href="' . esc_url( $gradingForm['url'] ) . '">Grading Form</a>' : 'N/A'; And the ...


1

the first step is to set edit-comments.php?post_type=complaint for the menu slug. and then you add this hook add_filter("submenu_file", function ($submenu_file, $parent_file) { $screen = get_current_screen(); if ("edit-comments" === $screen->id) { $submenu_file = "edit-comments.php?post_type=$screen->post_type"; } return $...


1

The order of the menu items can be changed using the filter menu_order add_filter( 'menu_order', 'se354759_menu_order' ); add_filter( 'custom_menu_order', '__return_true' ); function se354759_menu_order ($menu_order) { $cpts = [ 'edit.php?post_type=' . 'custom-post-type', 'edit.php?post_type=' . 'another-cpt' ]; // // ...


1

I had a similar issue within WordPress a few days ago but it doesn't really have anything to do with WordPress. Simply put, your code is loading the babel-polyfill library twice somehow. Most commonly it can happen if you're using the library yourself and on top of that a third-party library is including that too. The solution at Babel's Github worked out ...


1

You are almost there! If you check out where the plugin developer is adding this action, you'll see they are setting a priority of 1000. While the priority of your function is being called at 999. https://plugins.trac.wordpress.org/browser/all-in-one-seo-pack/trunk/aioseop_class.php#L3907 Update your priority to be greater than 1000: add_action( '...


1

This would work in WordPress 5 add_action( 'admin_menu', function() { remove_submenu_page( 'themes.php', 'customize.php?return=' . urlencode($_SERVER['SCRIPT_NAME'])); });


1

This would work for editors. You can swap the role in and out depending on which role you are trying to target (e.g., editor, subscriber, etc.). This would go in functions.php of your child theme. function remove_menus(){ // get current login user's role $roles = wp_get_current_user()->roles; // test role if( !in_array('editor',$roles)){ return; } //...


1

Follow up on @jmarceli's great answer to target specific menu locations function squarecandy_menu_admin_limit_depth( $hook ) { if ( 'nav-menus.php' !== $hook ) { return; } wp_enqueue_script( 'squarecandy-admin-menu-depth', get_stylesheet_directory() . '/js/admin-menu-depth.js', array(), '1.0.0', true ); } add_action( 'admin_enqueue_scripts', '...


1

Assign the first submenu slug similar to the parent menu. In your case, replace 'job-applications' with the slug of the main menu 'forms'. add_menu_page( 'Forms', 'Forms', 'administrator', 'forms', 'forms_job_menupage_cb' ); add_submenu_page( 'forms', 'Job Applications', 'Job Applications', 'administrator', 'forms', 'forms_job_menupage_cb' ); ...


Only top voted, non community-wiki answers of a minimum length are eligible