add_filter(‘acf/load_field/name=booth_id’, ‘populate_booth_id_array’, 20); function populate_booth_id_array($field) { global $post; if (!$post instanceof WP_Post || !is_admin()) return $field; $s_id = null; if (get_post_type($post->ID) == ‘show’) { $s_id = $post->ID; } elseif (get_post_type($post->ID) == ‘application’) { $s_id = get_field(‘show_relationship’, $post->ID)[0]; } else {…Continue reading
add_action( ‘save_post_show’, ‘save_post_show_default’, 1, 3); function save_post_show_default( $post_id, $post, $update ) { if( is_a( $post, ‘\WP_Post’ ) && ‘auto-draft’ == $post->post_status && post_type_supports( $post->post_type, ‘custom-fields’ ) && ‘0000-00-00 00:00:00’ == $post->post_date_gmt && $post_id > 0 && ! $update ) {…Continue reading
add_action(‘acf/save_post’, ‘add_show_children’); function add_show_children($post_id) { if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return $post_id; if (!wp_is_post_revision($post_id) && ‘show’ == get_post_type($post_id) && ‘auto-draft’ != get_post_status($post_id) && ‘draft’ == get_post_status($post_id) ) { if (0 == get_post($post_id)->post_parent) { $countInt = (int) 1; $count = (string) $countInt;…Continue reading
add_action(‘acf/save_post’, ‘add_show_children’); function add_show_children($post_id) { if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return $post_id; if (!wp_is_post_revision($post_id) && ‘show’ == get_post_type($post_id) && ‘auto-draft’ != get_post_status($post_id) && ‘draft’ == get_post_status($post_id) ) { if (0 == get_post($post_id)->post_parent) { $countInt = (int) 1; $count = (string) $countInt;…Continue reading
add_action(‘acf/save_post’, ‘add_show_children’); function add_show_children($post_id) { if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return $post_id; if (!wp_is_post_revision($post_id) && ‘show’ == get_post_type($post_id) && ‘auto-draft’ != get_post_status($post_id) && ‘draft’ == get_post_status($post_id) ) { if (0 == get_post($post_id)->post_parent) { $countInt = (int) 1; $count = (string) $countInt;…Continue reading
function get_email_data_from_options($key, $type) { $values = array(); if (have_rows($key, ‘option’)) while (have_rows($key, ‘option’)) : the_row(); if (get_sub_field(‘type’) == $type) { $values[‘from_email’] = get_sub_field(‘from_email’); $values[‘from_name’] = get_sub_field(‘from_name’); $values[‘subject’] = strip_tags(apply_filters(‘the_content’, get_sub_field(‘subject’))); // $values[‘message’] = apply_filters(‘the_content’, get_sub_field(‘message’)); $values[‘message’] = get_sub_field(‘message’); add_filter(‘wp_mail_from’, function…Continue reading
/** * Remove Caddy Premium conversions from showing on the WooCommerce orders page * * This prevents Caddy Premium from modifying the orders table and item display * * @author Mike Valera * @plugin Caddy – Premium Edition * @link…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
/** * Snippet Name: Vendor Claims Management Admin Pages * Description: Adds an admin menu for managing vendor claims, including pending, approved, and denied claims. // Key Objectives: * 1. Add “Vendor Claims” Admin Page and Subpages: * * –…Continue reading
/** * This snippet removes Gutenberg block comments from post content when saving posts from the WordPress admin. * It targets specific post types (‘vendor’ and ‘venue’) and ensures the comments are not saved in the database. * This prevents…Continue reading