Remove “p” tags Contact Form 7
// Remove tags add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
// Remove tags add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
// Add column: Product type add_filter( ‘manage_edit-product_columns’, ‘huk_admin_products_visibility_column’); function huk_admin_products_visibility_column( $columns ){ $columns[‘product_type’] = ‘Type’; return $columns; } add_action( ‘manage_product_posts_custom_column’, ‘huk_admin_products_visibility_column_content’, 20, 2 ); function huk_admin_products_visibility_column_content( $column, $product_id ){ if ( $column == ‘product_type’ ) { $product = wc_get_product( $product_id…Continue reading
// Go to Settings > Media after activating this snippet to set the default featured image. add_action( ‘admin_init’, function() { register_setting( ‘media’, ‘default_featured_image’, ‘absint’ ); add_settings_field( ‘default_featured_image’, __( ‘Default Featured Image’, ‘wpcode-snippet’ ), function() { wp_enqueue_media(); $image_id = get_option( ‘default_featured_image’,…Continue reading
// Hide text using the shortcode like this: [spoiler]hidden text here[/spoiler]. add_shortcode(‘spoiler’, ‘inline_spoiler_shortcode’); function inline_spoiler_shortcode($atts, $content = null) { // Start output buffering ob_start(); // Output the spoiler content with the necessary styles ?>Continue reading
add_action(‘add_meta_boxes’, function() { add_meta_box( ‘custom-logo-metabox’, ‘Custom Logo’, function($post) { // Add a nonce field so we can check for it later wp_nonce_field(‘custom_logo_meta_box’, ‘custom_logo_meta_box_nonce’); // Retrieve the existing value from the database $custom_logo_id = get_post_meta($post->ID, ‘_custom_logo_id’, true); $custom_logo_url = $custom_logo_id ?…Continue reading