Skip to content

Instantly share code, notes, and snippets.

@tanjimahmmed
Created March 29, 2020 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanjimahmmed/5568ecbe9ca043cdf53c5cde84eb729d to your computer and use it in GitHub Desktop.
Save tanjimahmmed/5568ecbe9ca043cdf53c5cde84eb729d to your computer and use it in GitHub Desktop.
Piklist Repeat Fun
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