Woocommerce Checkout fields

function custom_override_checkout_fields( $fields ) { // Unset billing fields // unset($fields[‘billing’][‘billing_first_name’]); // unset($fields[‘billing’][‘billing_last_name’]); unset($fields[‘billing’][‘billing_company’]); unset($fields[‘billing’][‘billing_address_1’]); unset($fields[‘billing’][‘billing_address_2’]); unset($fields[‘billing’][‘billing_city’]); unset($fields[‘billing’][‘billing_postcode’]); unset($fields[‘billing’][‘billing_country’]); unset($fields[‘billing’][‘billing_state’]); unset($fields[‘billing’][‘billing_phone’]); // Unset shipping fields if not needed unset($fields[‘shipping’][‘shipping_first_name’]); unset($fields[‘shipping’][‘shipping_last_name’]); unset($fields[‘shipping’][‘shipping_company’]); unset($fields[‘shipping’][‘shipping_address_1’]); unset($fields[‘shipping’][‘shipping_address_2’]); unset($fields[‘shipping’][‘shipping_city’]); unset($fields[‘shipping’][‘shipping_postcode’]); unset($fields[‘shipping’][‘shipping_country’]); unset($fields[‘shipping’][‘shipping_state’]); // Return the…Continue reading

Completely Disable Comments

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Untitled Snippet

$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

Onboarding PW Form

function my_custom_password_form() { global $post; $label = ‘pwbox-‘ . ( empty( $post->ID ) ? rand() : $post->ID ); $output = ‘ ‘ . __( ” ) . ‘ ‘ . esc_attr_x( ‘Get Your Forms’, ‘post password form’ ) . ‘…Continue reading

Progress Bar PHP

function enqueue_custom_styles_scripts() { wp_enqueue_style(‘progress-bar-style’, get_template_directory_uri() . ‘/progress-bar-style.css’); wp_enqueue_script(‘progress-bar-script’, get_template_directory_uri() . ‘/progress-bar.js’, array(‘jquery’), null, true); } add_action(‘wp_enqueue_scripts’, ‘enqueue_custom_styles_scripts’); function custom_progress_bar_shortcode($atts) { $atts = shortcode_atts([ ‘range_major’ => ‘100’, ‘current_major’ => ’50’, ‘label_major’ => ‘Major Progress’, ‘range_minor’ => ‘100’, ‘current_minor’ => ’25’ ],…Continue reading