// WC – limit one course at a time (id 50697 / Fundamentals Public Safety) add_filter( ‘woocommerce_add_to_cart_validation’, ‘wc_limit_one_50697_per_order’, 10, 2 ); function wc_limit_one_50697_per_order( $passed_validation, $product_id ) { if ( 50697 !== $product_id ) { return $passed_validation; } if ( WC()->cart->get_cart_contents_count()…Continue reading
// add order suffix add_filter(‘woe_get_order_value_order_number’, ‘suffix_order_id_for_product_50697’, 10, 2 ); function suffix_order_id_for_product_50697( $order_id, $order ) { // Check if the order contains the specified product $product_id_to_check = 50697; $order_contains_product = false; foreach ( $order->get_items() as $item_id => $item ) { if…Continue reading
// add order suffix add_filter(‘woe_get_order_value_order_number’, ‘suffix_order_id_for_product_45639’, 10, 2 ); function suffix_order_id_for_product_45639( $order_id, $order ) { // Check if the order contains the specified product $product_id_to_check = 45639; $order_contains_product = false; foreach ( $order->get_items() as $item_id => $item ) { if…Continue reading
// WC – avoid other items to be added to cart when a specific product category (free courses) is already in cart add_filter( ‘woocommerce_add_to_cart_validation’, ‘check_and_limit_cart_free_items’, 10, 3 ); function check_and_limit_cart_free_items ( $passed, $product_id, $quantity ){ // HERE set your product…Continue reading
function custom_remove_happy_addons_admin_bar_link( $wp_admin_bar ) { if ( ! current_user_can( ‘manage_options’ ) ) { return; } $wp_admin_bar->remove_menu(‘happy-addons’); } add_action( ‘admin_bar_menu’, ‘custom_remove_happy_addons_admin_bar_link’, 999 );Continue reading
function custom_remove_comments_admin_bar_links() { global $wp_admin_bar; if ( ! method_exists( $wp_admin_bar, ‘remove_menu’ ) ) { return; // Ensures $wp_admin_bar is an object with the remove_menu method. } $wp_admin_bar->remove_menu(‘comments’); } add_action( ‘admin_bar_menu’, ‘custom_remove_comments_admin_bar_links’, 1000 );Continue reading
// Removes the SEO from admin bar. add_filter( ‘aioseo_show_in_admin_bar’, ‘__return_false’ );Continue reading
function custom_remove_ur_admin_bar_links( $wp_admin_bar ) { $wp_admin_bar->remove_menu(‘user-registration-menu’); $wp_admin_bar->remove_menu(‘ur-edit-form’); $wp_admin_bar->remove_menu(‘user-registration-all-forms’); $wp_admin_bar->remove_menu(‘user-registration-add-new’); $wp_admin_bar->remove_menu(‘user-registration-settings’); $wp_admin_bar->remove_menu(‘user-registration-docs’); } // The priority should be higher than the one used by the plugin. add_action( ‘user_registration_top_admin_bar_menu’, ‘custom_remove_ur_admin_bar_links’, 1000 );Continue reading