catchresponsive_is_demo_featured_content_inactive

Return true if demo featured content is inactive.

Description

catchresponsive_is_demo_featured_content_inactive( $control ); 

Parameters (1)

0. $control
The control.

Usage

  1. if ( !function_exists( 'catchresponsive_is_demo_featured_content_inactive' ) ) { 
  2. require_once '/inc/customizer-includes/catchresponsive-customizer-active-callbacks.php'; 
  3.  
  4. // The control. 
  5. $control = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = catchresponsive_is_demo_featured_content_inactive($control); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/customizer-includes/catchresponsive-customizer-active-callbacks.php  
  1. function catchresponsive_is_demo_featured_content_inactive( $control ) { 
  2. global $wp_query; 
  3.  
  4. $page_id = $wp_query->get_queried_object_id(); 
  5.  
  6. // Front page display in Reading Settings 
  7. $page_for_posts = get_option('page_for_posts'); 
  8.  
  9. $enable = $control->manager->get_setting( 'catchresponsive_theme_options[featured_content_option]' )->value(); 
  10.  
  11. $type = $control->manager->get_setting( 'catchresponsive_theme_options[featured_content_type]' )->value(); 
  12.  
  13. //return true only if previwed page on customizer matches the type of content option selected and is not demo content 
  14. return ( ( 'entire-site' == $enable || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enable ) ) && !( 'demo-featured-content' == $type ) );