add_action( ‘init’, function() { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { $compat = \Automattic\WooCommerce\Utilities\FeaturesUtil::is_plugin_compatible( ‘custom_order_tables’, ‘ajax-search-for-woocommerce-premium/ajax-search-for-woocommerce.php’ ); add_action( ‘admin_notices’, function() use ( $compat ) { echo ‘ ‘; echo ‘📋 WooCommerce reconhece o FiboSearch como ‘ . ($compat ? ‘compatível…Continue reading
// Compatibilizar FiboSearch Pro com HPOS (WooCommerce) add_action( ‘before_woocommerce_init’, function() { if ( class_exists( AutomatticWooCommerceUtilitiesFeaturesUtil::class ) ) { AutomatticWooCommerceUtilitiesFeaturesUtil::declare_compatibility( ‘custom_order_tables’, ‘ajax-search-for-woocommerce-premium/ajax-search-for-woocommerce.php’, true ); } });Continue reading
// 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 an Edit Post Link to Archives edit_post_link( __( ‘{Edit}’ ) ); // Add page slug to body class for better styling. function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type…Continue reading
/** * DANGER: This will cause recursive loop with WPCode’s Simple HTML DOM * when auto-inserted into the_content */ // Attempt to parse and modify content using string operations // that might trigger WPCode’s HTML parsing function parse_and_enhance_content($content) { //…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