admin_notices don’t appear for vendors
-
I have admin_notices working fine to all users EXCEPT vendors. I am using 2 different well-documented methods below), but neither appear for Vendors (say, on their edit products page); otherhwise the code below works fine.
function admin_notice() { $screen = get_current_screen(); // Only render this notice in the post editor. //if ( ! $screen || 'post' !== $screen->base ) { // return; //} // Render the notice's HTML. // Each notice should be wrapped in a <div> // with a 'notice' class. $type = get_post_type(); if ($type == 'product') { echo '<div class="notice notice-success is-dismissible"><p>'; echo sprintf( __( 'Your WP install now has a custom plugin. <a href="/wp-admin/index.php" target="_blank">There are now 2 'WoodMtn.com Custom Plugin' panels on the Dashboard.</a>' ), get_preview_post_link() ); echo '</p></div>'; $screen = get_current_screen(); // Only render this notice in the post editor. if ( ! $screen || 'post' !== $screen->base ) { return; } // Render the notice's HTML. // Each notice should be wrapped in a <div> // with a 'notice' class. echo '<div class="notice notice-success is-dismissible"><p>'; echo sprintf( __( 'Post draft updated. <a href="%s" target="_blank">Preview post</a>' ), get_preview_post_link() ); echo '</p></div>'; } }
Any suggestions as to what I should try?? These ‘net naive’ vendors will need some help at some crucial points and I need to print admin-notices to them. I should note that some admin-notices such as ‘product saved OK’ appear just fine and I need to match that function/use of privs for Vendors.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘admin_notices don’t appear for vendors’ is closed to new replies.