Role exception for a settings sub menu

You can see here a list of roles and capabilities, if you want to check if the user has a certain role, you can: $the_user = wp_get_current_user();//we get the current user if ( in_array( ‘the_name_of_your_role’, (array) $the_user->roles ) ) { //the user has the rol, add the submenu here } you can use current_user_can if … Read more

Restrict days in bootstrap datepicker using checkboxes in submenu

———— EDIT -> PROBLEM SOLVED ——— MY CODE WordPress submenu/HTML code <?php add_action( ‘admin_menu’, ‘reserveringsformulier_add_submenu_gesloten’ ); function reserveringsformulier_add_submenu_gesloten() { add_submenu_page( ‘edit.php?post_type=reserveringen’, __( ‘Gesloten dagen Restaurant’, ‘Gesloten dagen’ ), __( ‘Gesloten dagen’, ‘Gesloten dagen’ ), ‘manage_options’, ‘gesloten_restaurant’, ‘gesloten_restaurant_inger_display’ ); } function gesloten_restaurant_inger_display() { function gesloten_restaurant_inger_display() { if (isset($_POST[‘submit_datum_gesloten’])) { if (isset($_POST[‘maandag’])) { update_option(‘maandag’, $_POST[‘maandag’]); $maandag = … Read more

Can’t hover on Submenu

Reading through your question, your submenu is on class,normally your hover style is working on.. so we can use a filter “nav_menu_css_class” on your functions.php file. add_filter(‘nav_menu_css_class’ , ‘special_nav_class’ , 10 , 2); function special_nav_class ($classes, $item) { if (in_array(‘current-menu-item’, $classes) ){ $classes[] = ‘active ‘; } return $classes; } it would be more easy … Read more

Display specific main Sub Nav on Woocommerce product pages

Yes you can with conditional tags. https://docs.woocommerce.com/document/conditional-tags/ So depending on whether you wanted it to appear on all woocommerce pages (the listing page as well as the individual product pages) you could use is_woocommerce() if you wanted just on individual product pages you could use is_product() So you would use an if statement to check … Read more