Category archive / php
Php articles.
Browse 24 php articles, guides, and code snippets by Bonny Elangbam.
← View all notesPhp notes
Override the Default WordPress Email Sender Name and Address
Set a consistent WordPress email sender name and address with filters, while keeping the address aligned with the site's domain.
Auto-Delete Transient Rows and Orphaned Revisions via WP-Cron
Schedule a bounded WordPress maintenance task that removes expired transients and revisions whose parent post no longer exists.
Throttle or Disable the WordPress Heartbeat API Without a Plugin
Reduce WordPress Heartbeat requests by changing the interval or disabling the frontend heartbeat script while keeping the editor working.
How to Create a Custom WP-CLI Command in 5 Minutes
Register a small, namespaced WP-CLI command that reports and optionally deletes old draft posts.
Completely Hide the WordPress Version Number and Generator Tags for Security
Remove WordPress version output from generator tags, RSS, scripts, and styles without installing a security plugin.
Add Custom Columns and Filterable Dropdowns to WordPress Admin Post Lists
Add an ISBN column and a taxonomy dropdown filter to a WordPress custom post type in the admin list table.
Disable the Gutenberg Editor for Specific Custom Post Types or User Roles
Disable the WordPress block editor selectively for a custom post type or selected user roles while leaving Gutenberg enabled everywhere else.
Set a Minimum WooCommerce Order Amount Before Checkout
Prevent checkout until the cart reaches a configurable minimum subtotal, with a clear message on the cart and checkout pages.
Hide Specific Shipping Methods When a Product Category Is in the Cart
Remove selected WooCommerce shipping rates whenever the cart contains a product from a chosen product category.
Change WooCommerce Add to Cart Text Dynamically Based on Product Category or Price
Change the single-product Add to Cart button label according to product category, price, or both.