Unregister widgets damore

//To get rid of the selected widgets function unregister_default_wp_widgets() { unregister_widget( ‘WP_Widget_Calendar’ ); unregister_widget( ‘WP_Widget_Archives’ ); unregister_widget( ‘WP_Widget_Categories’ ); unregister_widget( ‘WP_Widget_Recent_Posts’ ); unregister_widget( ‘WP_Widget_Recent_Comments’ ); unregister_widget( ‘WP_Widget_Tag_Cloud’ ); unregister_widget( ‘WP_Widget_Meta’ ); unregister_widget( ‘WP_Widget_Links’ ); unregister_widget( ‘WP_Widget_Pages’ ); unregister_widget( ‘WP_Widget_RSS’ );…Continue reading

MFP > Populate Booth ID Array

add_filter(‘acf/load_field/name=booth_id’, ‘populate_booth_id_array’, 20, 1); 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

MFP > Populate Booth ID Array

add_filter(‘acf/load_field/name=booth_id’, ‘populate_booth_id_array’, 20, 1); 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

MFP > Populate Booth ID Array

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

Copy All Post Meta to New Post

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

MFP > Deploy Show & Get Data

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

MFP > Deploy Show & Get Data

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

MFP > Deploy Show & Get Data

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

MFP > get_email_data_from_options($key, $type)

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