Location: everywhere
Save images as WEBP
/** * Convert Uploaded Images to WebP Format * * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme’s functions.php file, * or with plugins like Code Snippets…Continue reading
Change Arabic Currency symbol to the currency short code
/** * change arabic currency symbol to short Currency name for AED, SAR, QAR , BHD , OMR , KWD */ add_filter( ‘woocommerce_currency_symbol’, ‘wc_change_uae_currency_symbol’, 10, 2 ); function wc_change_uae_currency_symbol( $currency_symbol, $currency ) { switch ( $currency ) { case ‘AED’:…Continue reading
PHP: Insert Post Category Filter (using hooks)
function insert_post_filter () { echo ‘ ‘; // get the current taxonomy term $term = get_queried_object(); the_field(‘post_filters_section’, $term); echo ‘ ‘; echo ‘ ‘; } add_action(‘loop_start’, ‘insert_post_filter’);Continue reading
PHP: Query for Dynamic Creation of GridBuilder Grids for Vendor Taxonomies
// This script is designed to modify the query arguments used by WP Grid Builder // for vendor taxonomy archives, ensuring that only relevant posts are displayed // according to the current URL path. It targets a specific grid layout…Continue reading
PHP [Vendor Detail]: Update Post Term Link from Vendor Detail Page & Pre-filter Vendor Taxonomy
add_filter(‘term_link’, ‘custom_vendor_term_link’, 10, 3); // Vendor Detail Link Enrichment // Ensure that all post terms listed on vendor detail layout link back to their // respective (deep link) term page. function custom_vendor_term_link($url, $term, $taxonomy){ switch ($taxonomy) { case ‘vendor-location’: return…Continue reading
WP Fusion HubSpot Contact Lists & Meta On-Demand Sync
namespace ARI; class WPFusionHubSpotOnDemandSync { public function __constructor() { if(!is_admin()) { \add_action(‘wpf_woocommerce_payment_complete’, [$this, ‘handle_payment_complete’], 0, 2); } } public function log($msg, $level= ‘info’) { \wpf_log($level, \wpf_get_current_user_id(), $msg, [‘source’ => __CLASS__ . ‘::’ . __FUNCTION__]); } public function handle_payment_complete($order_id, $contact_id) {…Continue reading
Add Autofocus on Your Form
/* Add autofocus to the first form field of the form Original doc link: https://wpforms.com/developers/how-to-add-autofocus-on-your-form/ For support, please visit: https://www.facebook.com/groups/wpformsvip */ function wpf_dev_autofocus() { ?>Continue reading
Show Current Year
function display_year() { $year = date(‘Y’); return $year; } add_shortcode(‘year’, ‘display_year’);Continue reading
Show WordPress Messages only in Dashboard
function render_system_notices_page() { echo ‘ ‘; echo ‘ Systemmeldungen ‘; echo ‘ ‘; do_action( ‘admin_notices’ ); } function register_system_notices_submenu_page() { add_submenu_page( ‘index.php’, // Slug des Hauptmenüs (Dashboard) ‘Systemmeldungen’, ‘Systemmeldungen’, ‘manage_options’, ‘system-notices’, ‘render_system_notices_page’ ); } add_action(‘admin_menu’, ‘register_system_notices_submenu_page’); function move_plugin_notices_to_custom_view() { global…Continue reading