Category archive / php
Php articles.
Browse 9 php articles, guides, and code snippets by Bonny Elangbam.
← View all notesPhp notes
A safer WordPress hook for body classes
Add a useful context class to the body element without coupling your theme to a page template.
WooCommerce's default variation dropdowns into selectable radio buttons
Replace WooCommerce variation dropdowns with selectable radio-button pills while keeping the native selects and variation logic intact.
Disable XML-RPC in WordPress (Crucial Security Fix)
Disable the legacy WordPress XML-RPC API when your site does not use the mobile app or Jetpack, reducing an unnecessary brute-force attack surface.
Display In Stock or Out of Stock Status on WooCommerce Product Pages
Show a tailored In Stock or Out of Stock message on WooCommerce product pages using the product's real stock status.
Disable Flat Rate When Free Shipping Is Available in WooCommerce
Hide WooCommerce flat-rate methods whenever a free-shipping method is available in the current package.
Register New WordPress Users with Elementor Form Approval
Create WooCommerce customer accounts from an Elementor Pro form, add an admin approval column, and block login until approval.
Add WooCommerce Support to a WordPress Theme
Declare WooCommerce support in a classic WordPress theme with the after_setup_theme hook.
Remove Product Images When Deleting WooCommerce Products
Delete a WooCommerce product's featured image and gallery attachments when the product is permanently deleted.
Replace the WordPress Logo on the Login Page
Use the logo from WordPress Customizer settings on the login screen, with a fallback to the default WordPress logo.