Search Only Post

function search_only_post($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘post_type’, ‘post’); } return $query; } add_filter(‘pre_get_posts’, ‘search_only_post’);Continue reading

Print Invoice – Keep Untouched Template Labels Translatable

/** * Print Invoice & Delivery Notes: keep untouched template labels translatable * * WPCode: PHP Snippet, Insert Method “Auto Insert”, Location “Run Everywhere”. * * Templates::all() (includes/helpers/class-templates.php) merges the saved wcdn_template_settings * over defaults built with __() at request…Continue reading

Gravity SMTP – BCC All Emails to Archive

/** * Gravity SMTP: BCC every outgoing email to the archive mailbox * * WPCode: PHP Snippet, Insert Method “Auto Insert”, Location “Run Everywhere”. * * Hooks gravitysmtp_after_connector_init, which only Gravity SMTP fires: once per send attempt, * from Connector_Base::init()…Continue reading

Terraform file

terraform { required_providers { stripe = { source = “stripe/stripe” version = “0.1.3” } } } provider “stripe” { # API key is read from STRIPE_API_KEY environment variable # Alternatively, set it explicitly (not recommended for production) # api_key =…Continue reading

Print Invoice – Fix Garbled Bold Japanese Text in PDFs

/** * Print Invoice & Delivery Notes: fix garbled bold Japanese text in PDFs * * WPCode: PHP Snippet, Insert Method “Auto Insert”, Location “Run Everywhere”. * * The plugin’s “Bold” font style setting emits CSS font-weight:600 * (includes/services/template/class-template-style.php:399), and…Continue reading