Enable ACF Theme Options Page

if (function_exists(‘acf_add_options_page’)) { acf_add_options_page(array( ‘page_title’ => ‘Theme General Settings’, ‘menu_title’ => ‘Theme Settings’, ‘menu_slug’ => ‘theme-general-settings’, ‘capability’ => ‘edit_posts’, ‘redirect’ => false )); }Continue reading

Add Icon to the Left Side of the Order Number (Admin Order Page)

function g9_user_role_order_icon($column_name, $post_id) { if ($column_name == ‘order_number’) { $order = wc_get_order($post_id); // Get user id from order $user_id = $order->get_user_id(); if ($user_id > 0) { $user_meta = get_userdata($user_id); $user_roles = $user_meta->roles; // Check if user role my-custom-user-role is in…Continue reading

Display Related Products on 3 Columns

function g9_change_number_related_products($args) { $args[‘posts_per_page’] = 3; $args[‘columns’] = 3; return $args; } add_filter(‘woocommerce_output_related_products_args’, ‘g9_change_number_related_products’, 9999);Continue reading

WPForms: hide certain sections on a single entry page: notes, log, debug, meta, payment, actions, related, geolocation.

// Main content area. add_action( ‘wpforms_entry_details_content’, static function ( $entry, $form_data, $single_entry ) { $hook_name = ‘wpforms_entry_details_content’; remove_action( $hook_name, [ $single_entry, ‘details_fields’ ], 10 ); remove_action( $hook_name, [ $single_entry, ‘details_notes’ ], 10 ); remove_action( $hook_name, [ $single_entry, ‘details_log’ ], 40…Continue reading

Custom Countries

function pw_edd_custom_countries( $countries = array() ) { $countries = array( ‘US’ => ‘United States’, ‘CA’ => ‘Canada’ ); return $countries; } add_filter( ‘edd_countries’, ‘pw_edd_custom_countries’ );Continue reading