Created
March 29, 2020 15:44
-
-
Save tanjimahmmed/5568ecbe9ca043cdf53c5cde84eb729d to your computer and use it in GitHub Desktop.
Piklist Repeat Fun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function t_process_section_type($part){ | |
global $post; | |
if('section'== $post->post_type ){ | |
$section_type = get_post_meta($post->ID, 't_section_type', true); | |
$sections = array('banner','testimonial','service','newsletter','skill'); | |
foreach($sections as $section){ | |
if("section-{$section}.php"== $part['part'] && $section != $section_type){ | |
return false; | |
} | |
} | |
} | |
return $part; | |
} | |
add_filter('piklist_part_process', 't_process_section_type'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment