Remove Clear Link @ Variable Single Product Page
add_filter( ‘woocommerce_reset_variations_link’, ‘__return_empty_string’, 9999 );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘woocommerce_reset_variations_link’, ‘__return_empty_string’, 9999 );Continue reading
function generate_student_number( $user_id ) { // Generate a unique student number, e.g., STU + random 6 digits $student_number = ‘STU-‘ . strtoupper( wp_generate_password( 6, false ) ); // Save the student number to user meta update_user_meta( $user_id, ‘student_number’, $student_number );…Continue reading
add_filter( ‘http_request_args’, function( $args, $url ) { if ( strpos( $url, ‘snippet/save’ ) !== false ) { $args[‘timeout’] = 15; } return $args; }, 10, 2 );Continue reading
$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading
$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading
add_filter(‘cr_consent_checkbox’, function($output) { $output = str_replace(‘class=”cr-customer-consent”‘, ‘class=”cr-customer-consent” style=”display:none;”‘, $output); $output = str_replace(‘id=”cr_customer_consent”‘, ‘id=”cr_customer_consent” checked=”checked”‘, $output); return $output; });Continue reading
add_filter( ‘woocommerce_cart_crosssell_ids’, function( $cross_sells, $cart ) { $filtered_cross_sells = array(); foreach ($cross_sells as $product_id) { $product = wc_get_product($product_id); if (!$product->is_in_stock()) { continue; } $filtered_cross_sells[] = $product_id; } return $filtered_cross_sells; }, 10, 2 );Continue reading
function edcc_save_post_webhook($post_id, $post) { // Check to see if autosaving etc., if so ignore if ($post->post_status !== ‘publish’) { return; } if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) { return; } // Check if it is a REST Request if ( defined(…Continue reading
class GPEP_Edit_Entry { private $form_id; private $delete_partial; private $passed_through_entries; private $refresh_token; private $process_feeds; public function __construct( $options ) { if ( ! function_exists( ‘rgar’ ) ) { return; } $this->form_id = rgar( $options, ‘form_id’ ); $this->delete_partial = rgar( $options, ‘delete_partial’,…Continue reading
if(isset($_GET[‘uuid’])) { $braze_uuid = $_GET[‘uuid’]; } if (!empty($braze_uuid)) echo ” “;Continue reading