Skip to content

Commit

Permalink
#2795 Added in master
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Jan 16, 2019
1 parent 06226eb commit 4d5bd64
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions templates/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -2995,7 +2995,7 @@ function ampforwp_auto_flush_on_save($redux_builder_amp) {
$wp_rewrite->flush_rules();
}
$options = $new_options = array();
if ( is_array($redux_builder_amp['hide-amp-categories']) && !is_array($redux_builder_amp['hide-amp-categories2'])) {
if ( is_array(ampforwp_get_setting('hide-amp-categories')) && !is_array(ampforwp_get_setting('hide-amp-categories2'))) {
$options = array_keys(array_filter($redux_builder_amp['hide-amp-categories'] ) );
foreach ($options as $option ) {
$new_options[] = $option;
Expand Down Expand Up @@ -4675,8 +4675,8 @@ function ampforwp_posts_to_remove () {
$selected_cats = array();
$post_id_array = array();
$current_cats_ids = array();
if(isset($redux_builder_amp['hide-amp-categories2'])){
$get_categories_from_checkbox = $redux_builder_amp['hide-amp-categories2'];
if(ampforwp_get_setting('hide-amp-categories2')){
$get_categories_from_checkbox = ampforwp_get_setting('hide-amp-categories2');
if($get_categories_from_checkbox){
$get_selected_cats = array_filter($get_categories_from_checkbox);
foreach ($get_selected_cats as $key => $value) {
Expand All @@ -4693,8 +4693,8 @@ function ampforwp_posts_to_remove () {
return true;
}
}
if( is_array($redux_builder_amp['hide-amp-tags-bulk-option2']) ) {
$get_tags_checkbox = array_values(array_filter($redux_builder_amp['hide-amp-tags-bulk-option2']));
if( ampforwp_get_setting('hide-amp-tags-bulk-option2') ) {
$get_tags_checkbox = array_values(array_filter(ampforwp_get_setting('hide-amp-tags-bulk-option2') ));
$all_tags = get_the_tags(get_the_ID());
$tagsOnPost = array();
if ( $all_tags ) {
Expand All @@ -4715,13 +4715,13 @@ function ampforwp_exclude_archive($archive = 'cat'){
global $redux_builder_amp;
$exclude = array();
// Categories
if ( isset($redux_builder_amp['hide-amp-categories2']) && is_array($redux_builder_amp['hide-amp-categories2']) && 'cat' == $archive ) {
$exclude = array_values(array_filter($redux_builder_amp['hide-amp-categories2']));
if ( is_array(ampforwp_get_setting('hide-amp-categories2')) && 'cat' == $archive ) {
$exclude = array_values(array_filter(ampforwp_get_setting('hide-amp-categories2') ) );
return $exclude;
}
// Tags
if ( isset($redux_builder_amp['hide-amp-tags-bulk-option2']) && is_array($redux_builder_amp['hide-amp-tags-bulk-option2']) && 'tag' == $archive ) {
$exclude = array_values(array_filter($redux_builder_amp['hide-amp-tags-bulk-option2']));
if ( is_array(ampforwp_get_setting('hide-amp-tags-bulk-option2')) && 'tag' == $archive ) {
$exclude = array_values(array_filter(ampforwp_get_setting('hide-amp-tags-bulk-option2')));
return $exclude;
}
}
Expand Down Expand Up @@ -4971,15 +4971,15 @@ function is_category_amp_disabled(){
global $redux_builder_amp;
$current_cats_ids = $selected_cats = array();
if(is_archive() && $redux_builder_amp['ampforwp-archive-support']==1){
if(is_tag() && is_array($redux_builder_amp['hide-amp-tags-bulk-option2'])) {
if(is_tag() && is_array(ampforwp_get_setting('hide-amp-tags-bulk-option2') ) ) {
$all_tags = get_the_tags();
$tagsOnPost = array();
if ( $all_tags ) {
foreach ($all_tags as $tagskey => $tagsvalue) {
$tagsOnPost[] = $tagsvalue->term_id;
}
}
$get_tags_checkbox = array_values(array_filter($redux_builder_amp['hide-amp-tags-bulk-option2']));
$get_tags_checkbox = array_values(array_filter(ampforwp_get_setting('hide-amp-tags-bulk-option2')));

if( count(array_intersect($get_tags_checkbox,$tagsOnPost))>0 ){
return true;
Expand All @@ -4990,7 +4990,7 @@ function is_category_amp_disabled(){
}//tags check area closed
$categories = get_the_category();
if ( $categories) {
$get_categories_from_checkbox = $redux_builder_amp['hide-amp-categories2'];
$get_categories_from_checkbox = ampforwp_get_setting('hide-amp-categories2');
// Check if $get_categories_from_checkbox has some cats then only show
if ( $get_categories_from_checkbox ) {
$get_selected_cats = array_filter($get_categories_from_checkbox);
Expand Down

0 comments on commit 4d5bd64

Please sign in to comment.