Category archive / php

Php articles.

Browse 24 php articles, guides, and code snippets by Bonny Elangbam.

← View all notes
01 — archive

Php notes

10 total
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →
snippet

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.

Read →