Admin Functions for posts.

// 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

Desbloquear HPOS

// ⚠️ Destrava o botão do HPOS mesmo que algum plugin force // Por [email protected] em 30/06/25 // 🔓 Força a liberação do botão de HPOS no WooCommerce, mesmo se plugin estiver forçando add_filter( ‘woocommerce_settings_features_force_enabled’, ‘__return_false’, 99 ); // 🧹…Continue reading

Untitled Snippet

/** * 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

FC – Mejoras en el procesamiento de archivos

//* Renombrar los nombres de archivos en cualquier lugar con contexto add_filter(‘sanitize_file_name’, function ($filename) { $post_types_to_ignore = array(‘elementor_library’, ‘elementor_font’, ‘page’); $info = pathinfo($filename); $ext = empty($info[‘extension’]) ? ” : ‘.’ . $info[‘extension’]; $name = basename($filename, $ext); $finalFileName = $name; //…Continue reading

Custom Tax Display Settings for Regular Prices by Specific Wholesale Roles

// 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

Typography Enqueue

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

SYNC – Gravity Forms, Fields

/** * 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

ACF – Forms & Feeds Settings

/** * 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