Skip to content

Instantly share code, notes, and snippets.

@dinhtungdu
Created August 9, 2016 08:01
Show Gist options
  • Save dinhtungdu/153567ccb1095cca10f16b18b38e5258 to your computer and use it in GitHub Desktop.
Save dinhtungdu/153567ccb1095cca10f16b18b38e5258 to your computer and use it in GitHub Desktop.
//framework-customizations/extensions/sidebars
function _filter_fw_ext_sidebars_add_conditional_tag($data) {
$data['is_archive_page_slug'] = array(
'order_option' => 2, // (optional: default is 1) position in the 'Others' lists in backend
'check_priority' => 'last', // (optional: default is last, can be changed to 'first') use it to change priority checking conditional tag
'name' => __('Shop Page', 'fw'), //conditional tag title
'conditional_tag' => array(
'callback' => 'is_post_type_archive', //existing callback
'params' => array('product') //parameters for callback
)
);
return $data;
}
add_filter('fw_ext_sidebars_conditional_tags', '_filter_fw_ext_sidebars_add_conditional_tag' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment