// Est. Reading Time $reading_speed = 200; // 200 words per minute $content = get_post_field( ‘post_content’, get_the_id() ); $word_count = str_word_count( strip_tags( $content ) ); $reading_time = ceil( $word_count / $reading_speed ); function post_read_time_shortcode($atts) { echo ‘ Estimated reading time:…Continue reading
add_filter( ‘user_can_richedit’, ‘__return_false’, 50 );Continue reading
// 1) Renombrar + sanitizar SOLO cuando se sube un archivo (Media, ACF, REST, etc.) add_filter( ‘wp_handle_upload_prefilter’, ‘fc_upload_rename_prefilter’, 10 ); add_filter( ‘wp_handle_sideload_prefilter’, ‘fc_upload_rename_prefilter’, 10 ); function fc_upload_rename_prefilter( $file ) { $file[‘name’] = fc_build_target_filename( $file[‘name’] ); return $file; } // 2)…Continue reading
// Display regular price excluding tax for specific user role add_filter(‘woocommerce_get_price_html’, ‘custom_display_regular_price_ex_tax_for_role’, 100, 2); function custom_display_regular_price_ex_tax_for_role($price_html, $product) { // Only run on frontend and for logged-in users if (is_admin() || !is_user_logged_in()) return $price_html; // Get current user and their roles…Continue reading
/* WCV – Show and save product brand taxonomy on the product edit form */ add_action( ‘wcv_after_product_details’, ‘wcv_product_brand_select2’ ); /** * Add the Brands taxonomy to the vendor product edit form. * * @param int $object_id The post ID. */…Continue reading
function typography_enqueue_styles() { // Enqueue Typeboost.css from Cloudflare CDN wp_enqueue_style(‘typeboost-css’, ‘https://cdnjs.cloudflare.com/ajax/libs/typeboost/1.0.0/typeboost.css’, array(), ‘1.0.0’); // Enqueue webfontloader.js from Cloudflare CDN wp_enqueue_script(‘webfontloader’, ‘https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js’, array(), ‘1.6.28’, true); } add_action(‘wp_enqueue_scripts’, ‘typography_enqueue_styles’);Continue reading
/** * WPCode Snippet: Gravity Forms & Feeds Sync Engine * Description: Manual sync functionality for forms and their feeds * Location: Run Everywhere * Priority: 20 */ defined( ‘ABSPATH’ ) || exit; // Add a manual test button in…Continue reading
/** * WPCode Snippet: Gravity Forms & Feeds ACF Fields * Description: Registers ACF fields for form and feed data * Location: Run Everywhere * Priority: 10 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘acf/init’, function() { if ( !…Continue reading
/** * WPCode Snippet: Gravity Forms & Feeds CPT Registration * Description: Registers custom post type for Gravity Forms with feed tracking * Location: Run Everywhere * Priority: 0 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘init’, function() { $labels…Continue reading
wp_mail( ‘[email protected]’, ‘Test from WP’, ‘If you see this, wp_mail is working!’ );Continue reading