Cleanup_Posts_Categories_Tags_06_30

/* Plugin Name: Daily Cleanup with Report Description: Deletes selected post types, categories, and tags daily, stores summary data for digest reporting, and optionally sends an email confirmation. Version: 1.8 */ function delete_all_posts_categories_tags_with_report() { global $wpdb; // 🕒 Track last…Continue reading

Delete Post, Category, Tag Entries v2

/* Plugin Name: Daily Cleanup with Report Description: Deletes all posts, categories, and tags daily and emails a summary. Version: 1.4 */ function delete_all_posts_categories_tags_with_report() { global $wpdb; // 🕒 Track last cleanup execution time update_option( ‘last_run_cleanup’, current_time( ‘mysql’ ) );…Continue reading

Cron Last Run Notice

add_action( ‘admin_notices’, function() { if ( ! current_user_can( ‘manage_options’ ) ) return; $cleanup_time = get_option( ‘last_run_cleanup’, ‘Never’ ); $purge_time = get_option( ‘last_run_purge’, ‘Never’ ); echo ‘ ‘; echo ‘ 🧹 Cleanup Last Ran: ‘ . esc_html( $cleanup_time ) . ‘‘;…Continue reading

Teste temporário de compatibilidade

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

Post Shortcodes

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

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