// 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
function custom_admin_bar_links($wp_admin_bar) { // Check if the current user has the ‘manage_options’ capability if (!current_user_can(‘manage_options’)) { return; // Exit if the user is not an administrator } // Add a link to the ‘Plugins’ admin page $wp_admin_bar->add_node(array( ‘id’ => ‘admin-bar-plugins’,…Continue reading
function extend_user_search($wp_user_query) { if (!is_admin() || strpos($wp_user_query->query_where, ‘@’) !== false) { return; } if (empty($_GET[“s”])) { return; } global $wpdb; $search_term = sanitize_text_field($_GET[“s”]); $search_terms = explode(‘ ‘, $search_term); // Prepare the search term for a LIKE query. $search_term_like = ‘%’…Continue reading
// Add custom JavaScript to hide the “Source” column in the user list function hide_source_column_script() { ?>Continue reading