Ultra Shop button
Shop NowContinue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
Shop NowContinue reading
// Register menus add_action(‘admin_menu’, ‘register_vtc_form_menus’); function register_vtc_form_menus() { add_menu_page(‘VTC Form’, ‘VTC Form’, ‘manage_options’, ‘vtc_form’, ‘display_vtc_form_admin_page’, ‘dashicons-forms’, 6); add_submenu_page(‘vtc_form’, ‘Manage Clinics’, ‘Manage Clinics’, ‘manage_options’, ‘vtc_form_clinics’, ‘display_vtc_form_clinics_page’); } // Display the main admin page content function display_vtc_form_admin_page() { if (!current_user_can(‘manage_options’)) return; echo…Continue reading
Verify Email – nTask nTask Project Management Simplified You’ve got mail! You’ve been successfully registered if you weren’t before please check your email to complete the signup. Check your spam / junk folder if you don’t see the email in…Continue reading
function redirect_non_access_users_to_donation_page() { // Check if we are on a singular page and it’s not the admin area if (!is_admin() && is_singular()) { global $post; // Check if the current user has access to the post if (function_exists(‘pmpro_has_membership_access’)) { $has_access…Continue reading
// WC – limit one course at a time (id 45639 / Fundamentals Private Networks) add_filter( ‘woocommerce_add_to_cart_validation’, ‘wc_limit_one_45639_per_order’, 10, 2 ); function wc_limit_one_45639_per_order( $passed_validation, $product_id ) { if ( 45639 !== $product_id ) { return $passed_validation; } if ( WC()->cart->get_cart_contents_count()…Continue reading
// 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