From 68fe4e429c0b9cf6343624e523f6982380a2cb00 Mon Sep 17 00:00:00 2001 From: seothemes Date: Sat, 9 Sep 2017 16:26:16 +0800 Subject: [PATCH] Coding standards update --- admin.php | 587 ++++++++++++++++++--------------- genesis-responsive-slider.php | 597 ++++++++++++++++++++-------------- 2 files changed, 668 insertions(+), 516 deletions(-) diff --git a/admin.php b/admin.php index 8eafe85..8b3d1b1 100644 --- a/admin.php +++ b/admin.php @@ -1,6 +1,8 @@ 'post', - 'posts_term' => '', - 'exclude_terms' => '', - 'include_exclude' => '', - 'post_id' => '', - 'posts_num' => 5, - 'posts_offset' => 0, - 'orderby' => 'date', - 'slideshow_timer' => 4000, - 'slideshow_delay' => 800, - 'slideshow_arrows' => 1, - 'slideshow_pager' => 1, - 'slideshow_loop' => 1, - 'slideshow_no_link' => 0, - 'slideshow_height' => 400, - 'slideshow_width' => 920, - 'slideshow_effect' => 'slide', - 'slideshow_excerpt_content' => 'excerpts', + 'post_type' => 'post', + 'posts_term' => '', + 'exclude_terms' => '', + 'include_exclude' => '', + 'post_id' => '', + 'posts_num' => 5, + 'posts_offset' => 0, + 'orderby' => 'date', + 'slideshow_timer' => 4000, + 'slideshow_delay' => 800, + 'slideshow_arrows' => 1, + 'slideshow_pager' => 1, + 'slideshow_loop' => 1, + 'slideshow_no_link' => 0, + 'slideshow_height' => 400, + 'slideshow_width' => 920, + 'slideshow_effect' => 'slide', + 'slideshow_excerpt_content' => 'excerpts', 'slideshow_excerpt_content_limit' => 150, - 'slideshow_more_text' => __( '[Continue Reading]', 'genesis-responsive-slider' ), - 'slideshow_excerpt_show' => 1, - 'slideshow_excerpt_width' => 50, - 'location_vertical' => 'bottom', - 'location_horizontal' => 'right', - 'slideshow_hide_mobile' => 1 + 'slideshow_more_text' => __( '[Continue Reading]', 'genesis-responsive-slider' ), + 'slideshow_excerpt_show' => 1, + 'slideshow_excerpt_width' => 50, + 'location_vertical' => 'bottom', + 'location_horizontal' => 'right', + 'slideshow_hide_mobile' => 1, ); return apply_filters( 'genesis_responsive_slider_settings_defaults', $defaults ); @@ -51,32 +53,41 @@ function register_genesis_responsive_slider_settings() { register_setting( GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD, GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD ); add_option( GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD, genesis_responsive_slider_defaults(), '', 'yes' ); - if ( ! isset($_REQUEST['page']) || $_REQUEST['page'] != 'genesis_responsive_slider' ) + if ( ! isset( $_REQUEST['page'] ) || 'genesis_responsive_slider' != $_REQUEST['page'] ) { return; + } if ( genesis_get_responsive_slider_option( 'reset' ) ) { update_option( GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD, genesis_responsive_slider_defaults() ); - genesis_admin_redirect( 'genesis_responsive_slider', array( 'reset' => 'true' ) ); + genesis_admin_redirect( 'genesis_responsive_slider', array( + 'reset' => 'true', + ) ); exit; } } -add_action('admin_notices', 'genesis_responsive_slider_notice'); +add_action( 'admin_notices', 'genesis_responsive_slider_notice' ); /** * This is the notice that displays when you successfully save or reset * the slider settings. */ function genesis_responsive_slider_notice() { - if ( ! isset( $_REQUEST['page'] ) || $_REQUEST['page'] != 'genesis_responsive_slider' ) + if ( ! isset( $_REQUEST['page'] ) || 'genesis_responsive_slider' != $_REQUEST['page'] ) { return; + } + + if ( isset( $_REQUEST['reset'] ) && 'true' == $_REQUEST['reset'] ) { - if ( isset( $_REQUEST['reset'] ) && 'true' == $_REQUEST['reset'] ) - echo '

' . __( 'Settings reset.', 'genesis-responsive-slider' ) . '

'; - elseif ( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) - echo '

' . __( 'Settings saved.', 'genesis-responsive-slider' ) . '

'; + echo '

' . esc_html__( 'Settings reset.', 'genesis-responsive-slider' ) . '

'; + + } elseif ( isset( $_REQUEST['settings-updated'] ) && 'true' == $_REQUEST['settings-updated'] ) { + + echo '

' . esc_html__( 'Settings saved.', 'genesis-responsive-slider' ) . '

'; + + } } @@ -86,97 +97,117 @@ function genesis_responsive_slider_notice() { * on the theme settings page only, and not the rest of the admin */ function genesis_responsive_slider_settings_init() { + global $_genesis_responsive_slider_settings_pagehook; - // Add "Design Settings" submenu + // Add "Design Settings" submenu. $_genesis_responsive_slider_settings_pagehook = add_submenu_page( 'genesis', __( 'Slider Settings', 'genesis-responsive-slider' ), __( 'Slider Settings', 'genesis-responsive-slider' ), 'manage_options', 'genesis_responsive_slider', 'genesis_responsive_slider_settings_admin' ); add_action( 'load-' . $_genesis_responsive_slider_settings_pagehook, 'genesis_responsive_slider_settings_scripts' ); add_action( 'load-' . $_genesis_responsive_slider_settings_pagehook, 'genesis_responsive_slider_settings_boxes' ); + } /** * Loads the scripts required for the settings page + * + * @return void */ function genesis_responsive_slider_settings_scripts() { + wp_enqueue_script( 'common' ); wp_enqueue_script( 'wp-lists' ); wp_enqueue_script( 'postbox' ); - wp_enqueue_script( 'genesis_responsive_slider_admin_scripts', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' ), GENESIS_RESPONSIVE_SLIDER_VERSION, TRUE ); + wp_enqueue_script( 'genesis_responsive_slider_admin_scripts', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' ), GENESIS_RESPONSIVE_SLIDER_VERSION, true ); + } -/* - * Loads the Meta Boxes +/** + * Loads the Meta Boxes. + * + * @return void */ function genesis_responsive_slider_settings_boxes() { + global $_genesis_responsive_slider_settings_pagehook; add_meta_box( 'genesis-responsive-slider-options', __( 'Genesis Responsive Slider Settings', 'genesis-responsive-slider' ), 'genesis_responsive_slider_options_box', $_genesis_responsive_slider_settings_pagehook, 'column1' ); -} +} add_filter( 'screen_layout_columns', 'genesis_responsive_slider_settings_layout_columns', 10, 2 ); /** - * Tell WordPress that we want only 1 column available for our meta-boxes + * Tell WordPress that we want only 1 column available for our meta-boxes. + * + * @param array $columns Slider columns. + * @param int $screen Slider screen. + * @return array */ function genesis_responsive_slider_settings_layout_columns( $columns, $screen ) { + global $_genesis_responsive_slider_settings_pagehook; if ( $screen == $_genesis_responsive_slider_settings_pagehook ) { - // This page should have 1 column settings - $columns[$_genesis_responsive_slider_settings_pagehook] = 1; + + // This page should have 1 column settings. + $columns[ $_genesis_responsive_slider_settings_pagehook ] = 1; + } return $columns; } /** - * This function is what actually gets output to the page. It handles the markup, - * builds the form, outputs necessary JS stuff, and fires do_meta_boxes() + * This function is what actually gets output to the page. + * It handles the markup, builds the form, outputs necessary + * JS stuff, and fires do_meta_boxes(). */ function genesis_responsive_slider_settings_admin() { - global $_genesis_responsive_slider_settings_pagehook, $screen_layout_columns; - - $width = "width: 99%;"; - $hide2 = $hide3 = " display: none;"; -?> -
-
- - - - - - -

- - - -

- -
-
- -
-
-
- - + global $_genesis_responsive_slider_settings_pagehook, $screen_layout_columns; + + $width = 'width: 99%;'; + $hide2 = ' display: none;'; + $hide3 = $hide2; + + ?> +
+ + + + + + + +

+ + + +

+ +
+
+
+
- +
+ +
- + + +
+ -
+ ?> -

+
-

- - foreach ( $post_types as $post_type ) { ?> + true, + ), 'names', 'and' ); + $post_types = array_filter( $post_types, 'genesis_responsive_slider_exclude_post_types' ); - + foreach ( $post_types as $post_type ) { -

+ ?> + + + + ?> -
+

-
+
-

+

- - foreach ( $taxonomies as $taxonomy ) { - $query_label = ''; - if ( !empty( $taxonomy->query_var ) ) - $query_label = $taxonomy->query_var; - else - $query_label = $taxonomy->name; - ?> - + + + true, + ), 'objects' ); - name, 'orderby=name&hide_empty=1' ); - foreach ( $terms as $term ) { - ?> - + $taxonomies = array_filter( $taxonomies, 'genesis_responsive_slider_exclude_taxonomies' ); + $test = get_taxonomies( array( + 'public' => true, + ), 'objects' ); - + foreach ( $taxonomies as $taxonomy ) { - -

- -

- -

- -

- -

- -

- -
- -

- -

- -

- -

- -

- -

-

-

- -

- -

- - -

- -

- - -

- -

- - -

+ $query_label = ''; -
+ if ( ! empty( $taxonomy->query_var ) ) { -
+ $query_label = $taxonomy->query_var; -

+ } else { -

- -

+ $query_label = $taxonomy->name; -

- -

+ } + ?> + -

-

+ name, 'orderby=name&hide_empty=1' ); + foreach ( $terms as $term ) { -
+ ?> + -

+
-

- -

+ +

-

- -

+

-

- /> -

- -

- /> -

+

+ +

-
+

+ +

-

+
-

- /> -

+

+ +

+ +

+ +

+ +

+ +

+

+

+ +

+ +

+ + +

+ +

+ + +

+ +

+ + +

+ +
+ +
+ +

+ +

+ +

+ +

+ +

+ +

+

+ +
+ +

+ +

+ +

+ +

+ +

+ +

+ /> +

+ +

+ /> +

-

- /> -

-

- /> -

- -

- /> -

- -

- - -

- -

- - -

- -

- - - -

+
+ +

+ +

+ /> +

+ +

+ /> +

+

+ /> +

+ +

+ /> +

-

- -

- -

- -

- - -

- -

- - -

+

+ + +

+ +

+ + +

+ +

+ + + +

+ +

+ +

+ +

+ +

+ + +

+ +

+ + +

'; -} \ No newline at end of file +function genesis_responsive_slider_form_submit( $args = array() ) { + echo '

'; +} diff --git a/genesis-responsive-slider.php b/genesis-responsive-slider.php index 955aef5..3b9dc83 100644 --- a/genesis-responsive-slider.php +++ b/genesis-responsive-slider.php @@ -1,56 +1,61 @@ = 2 && genesis_get_responsive_slider_option( 'slideshow_arrows' ) ) ? 'top: ' . $slideNavTop . 'px' : 'display: none'; + $vertical = genesis_get_responsive_slider_option( 'location_vertical' ); + $horizontal = genesis_get_responsive_slider_option( 'location_horizontal' ); + $display = ( genesis_get_responsive_slider_option( 'posts_num' ) >= 2 && genesis_get_responsive_slider_option( 'slideshow_arrows' ) ) ? 'top: ' . $slide_nav_top . 'px' : 'display: none'; - $hide_mobile = genesis_get_responsive_slider_option( 'slideshow_hide_mobile' ); - $slideshow_pager = genesis_get_responsive_slider_option( 'slideshow_pager' ); + $hide_mobile = genesis_get_responsive_slider_option( 'slideshow_hide_mobile' ); + $slideshow_pager = genesis_get_responsive_slider_option( 'slideshow_pager' ); - echo ' - '; - - if ( $hide_mobile == 1 ) { + echo ' + '; + + if ( 1 == $hide_mobile ) { echo ' '; - } + } } /** @@ -159,10 +165,10 @@ function genesis_responsive_slider_head() { */ function genesis_responsive_slider_flexslider_params() { - $timer = ( int ) genesis_get_responsive_slider_option( 'slideshow_timer' ); - $duration = ( int ) genesis_get_responsive_slider_option( 'slideshow_delay' ); - $effect = genesis_get_responsive_slider_option( 'slideshow_effect' ); - $controlnav = genesis_get_responsive_slider_option( 'slideshow_pager' ); + $timer = (int) genesis_get_responsive_slider_option( 'slideshow_timer' ); + $duration = (int) genesis_get_responsive_slider_option( 'slideshow_delay' ); + $effect = genesis_get_responsive_slider_option( 'slideshow_effect' ); + $controlnav = genesis_get_responsive_slider_option( 'slideshow_pager' ); $directionnav = genesis_get_responsive_slider_option( 'slideshow_arrows' ); $output = 'jQuery(document).ready(function($) { @@ -182,208 +188,296 @@ function genesis_responsive_slider_flexslider_params() { } /** - * Registers the slider widget + * Registers the slider widget. */ -function genesis_responsive_sliderRegister() { - register_widget( 'genesis_responsive_sliderWidget' ); +function genesis_responsive_slider_register() { + + register_widget( 'Genesis_Responsive_Slider_Widget' ); + } -/** Creates read more link after excerpt */ +/** + * Creates read more link after excerpt. + * + * @param string $more More text. + */ function genesis_responsive_slider_excerpt_more( $more ) { + global $post; + static $read_more = null; - if ( $read_more === null ) + if ( null === $read_more ) { $read_more = genesis_get_responsive_slider_option( 'slideshow_more_text' ); + } - if ( !$read_more ) + if ( ! $read_more ) { return ''; + } - return '… ' . __( $read_more, 'genesis-responsive-slider' ) . ''; + return '… ' . $read_more . ''; } /** - * Slideshow Widget Class + * Slideshow Widget Class. */ -class genesis_responsive_sliderWidget extends WP_Widget { - - function __construct() { - $widget_ops = array( 'classname' => 'genesis_responsive_slider', 'description' => __( 'Displays a slideshow inside a widget area', 'genesis-responsive-slider' ) ); - $control_ops = array( 'width' => 200, 'height' => 250, 'id_base' => 'genesisresponsiveslider-widget' ); - parent::__construct( 'genesisresponsiveslider-widget', __( 'Genesis - Responsive Slider', 'genesis-responsive-slider' ), $widget_ops, $control_ops ); +class Genesis_Responsive_Slider_Widget extends WP_Widget { + + /** + * Constructor. + */ + function __construct() { + $widget_ops = array( + 'classname' => 'genesis_responsive_slider', + 'description' => __( 'Displays a slideshow inside a widget area', 'genesis-responsive-slider' ), + ); + $control_ops = array( + 'width' => 200, + 'height' => 250, + 'id_base' => 'genesisresponsiveslider-widget', + ); + parent::__construct( 'genesisresponsiveslider-widget', __( 'Genesis - Responsive Slider', 'genesis-responsive-slider' ), $widget_ops, $control_ops ); + } + + /** + * Save settings. + * + * @param array $settings Slider settings. + * + * @return void + */ + function save_settings( $settings ) { + + $settings['_multiwidget'] = 0; + + update_option( $this->option_name, $settings ); + + } + + /** + * Display widget. + * + * @param array $args Slider args. + * @param object $instance Slider instance. + * @return void + */ + function widget( $args, $instance ) { + + extract( $args ); + + echo $before_widget; + + $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); + + if ( $title ) { + echo $before_title . $title . $after_title; } - function save_settings( $settings ) { - $settings['_multiwidget'] = 0; - update_option( $this->option_name, $settings ); - } + $term_args = array(); + + if ( 'page' != genesis_get_responsive_slider_option( 'post_type' ) ) { + + if ( genesis_get_responsive_slider_option( 'posts_term' ) ) { - // display widget - function widget( $args, $instance ) { - extract( $args ); + $posts_term = explode( ',', genesis_get_responsive_slider_option( 'posts_term' ) ); - echo $before_widget; + if ( 'category' == $posts_term['0'] ) { + $posts_term['0'] = 'category_name'; + } + + if ( 'post_tag' == $posts_term['0'] ) { + $posts_term['0'] = 'tag'; + } - $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); - if ( $title ) - echo $before_title . $title . $after_title; + if ( isset( $posts_term['1'] ) ) { + $term_args[ $posts_term['0'] ] = $posts_term['1']; + } + } - $term_args = array( ); + if ( ! empty( $posts_term['0'] ) ) { - if ( 'page' != genesis_get_responsive_slider_option( 'post_type' ) ) { + if ( 'category' == $posts_term['0'] ) { - if ( genesis_get_responsive_slider_option( 'posts_term' ) ) { + $taxonomy = 'category'; - $posts_term = explode( ',', genesis_get_responsive_slider_option( 'posts_term' ) ); + } elseif ( 'post_tag' == $posts_term['0'] ) { - if ( 'category' == $posts_term['0'] ) - $posts_term['0'] = 'category_name'; + $taxonomy = 'post_tag'; - if ( 'post_tag' == $posts_term['0'] ) - $posts_term['0'] = 'tag'; + } else { - if ( isset( $posts_term['1'] ) ) - $term_args[$posts_term['0']] = $posts_term['1']; + $taxonomy = $posts_term['0']; } + } else { - if ( !empty( $posts_term['0'] ) ) { + $taxonomy = 'category'; - if ( 'category' == $posts_term['0'] ) - $taxonomy = 'category'; + } - elseif ( 'post_tag' == $posts_term['0'] ) - $taxonomy = 'post_tag'; + if ( genesis_get_responsive_slider_option( 'exclude_terms' ) ) { - else - $taxonomy = $posts_term['0']; + $exclude_terms = explode( ',', str_replace( ' ', '', genesis_get_responsive_slider_option( 'exclude_terms' ) ) ); + $term_args[ $taxonomy . '__not_in' ] = $exclude_terms; - } else { + } + } - $taxonomy = 'category'; + if ( genesis_get_responsive_slider_option( 'posts_offset' ) ) { - } + $my_offset = genesis_get_responsive_slider_option( 'posts_offset' ); + $term_args['offset'] = $my_offset; - if ( genesis_get_responsive_slider_option( 'exclude_terms' ) ) { + } - $exclude_terms = explode( ',', str_replace( ' ', '', genesis_get_responsive_slider_option( 'exclude_terms' ) ) ); - $term_args[$taxonomy . '__not_in'] = $exclude_terms; + if ( genesis_get_responsive_slider_option( 'post_id' ) ) { - } - } + $ids = explode( ',', str_replace( ' ', '', genesis_get_responsive_slider_option( 'post_id' ) ) ); + + if ( 'include' == genesis_get_responsive_slider_option( 'include_exclude' ) ) { + + $term_args['post__in'] = $ids; + + } else { + + $term_args['post__not_in'] = $ids; - if ( genesis_get_responsive_slider_option( 'posts_offset' ) ) { - $myOffset = genesis_get_responsive_slider_option( 'posts_offset' ); - $term_args['offset'] = $myOffset; } + } - if ( genesis_get_responsive_slider_option( 'post_id' ) ) { - $IDs = explode( ',', str_replace( ' ', '', genesis_get_responsive_slider_option( 'post_id' ) ) ); - if ( 'include' == genesis_get_responsive_slider_option( 'include_exclude' ) ) - $term_args['post__in'] = $IDs; - else - $term_args['post__not_in'] = $IDs; + $query_args = array_merge( $term_args, array( + 'post_type' => genesis_get_responsive_slider_option( 'post_type' ), + 'posts_per_page' => genesis_get_responsive_slider_option( 'posts_num' ), + 'orderby' => genesis_get_responsive_slider_option( 'orderby' ), + 'order' => genesis_get_responsive_slider_option( 'order' ), + 'meta_key' => genesis_get_responsive_slider_option( 'meta_key' ), + ) ); + + $query_args = apply_filters( 'genesis_responsive_slider_query_args', $query_args ); + + add_filter( 'excerpt_more', 'genesis_responsive_slider_excerpt_more' ); + + ?> +
+
+
    + have_posts() ) { + $show_excerpt = genesis_get_responsive_slider_option( 'slideshow_excerpt_show' ); + $show_title = genesis_get_responsive_slider_option( 'slideshow_title_show' ); + $show_type = genesis_get_responsive_slider_option( 'slideshow_excerpt_content' ); + $show_limit = genesis_get_responsive_slider_option( 'slideshow_excerpt_content_limit' ); + $more_text = genesis_get_responsive_slider_option( 'slideshow_more_text' ); + $no_image_link = genesis_get_responsive_slider_option( 'slideshow_no_link' ); } + while ( $slider_posts->have_posts() ) : + $slider_posts->the_post(); + ?> +
  • + + +
    +
    +
    + + +

    + + + + + +
    +
    + + +
    + + + <?php the_title(); ?> + + - $query_args = array_merge( $term_args, array( - 'post_type' => genesis_get_responsive_slider_option( 'post_type' ), - 'posts_per_page' => genesis_get_responsive_slider_option( 'posts_num' ), - 'orderby' => genesis_get_responsive_slider_option( 'orderby' ), - 'order' => genesis_get_responsive_slider_option( 'order' ), - 'meta_key' => genesis_get_responsive_slider_option( 'meta_key' ) - ) ); - - $query_args = apply_filters( 'genesis_responsive_slider_query_args', $query_args ); - add_filter( 'excerpt_more', 'genesis_responsive_slider_excerpt_more' ); - -?> - -
    -
    -
      - have_posts() ) { - $show_excerpt = genesis_get_responsive_slider_option( 'slideshow_excerpt_show' ); - $show_title = genesis_get_responsive_slider_option( 'slideshow_title_show' ); - $show_type = genesis_get_responsive_slider_option( 'slideshow_excerpt_content' ); - $show_limit = genesis_get_responsive_slider_option( 'slideshow_excerpt_content_limit' ); - $more_text = genesis_get_responsive_slider_option( 'slideshow_more_text' ); - $no_image_link = genesis_get_responsive_slider_option( 'slideshow_no_link' ); - } - while ( $slider_posts->have_posts() ) : $slider_posts->the_post(); - ?> -
    • - - -
      -
      -
      - -

      - -
      -
      - - -
      - - <?php the_title(); ?> - - <?php the_title(); ?> - -
      - -
    • - -
    -
    -
    + <?php the_title(); ?> + + + +
    + +
  • + +
+
+
'') ); - $title = $instance['title']; -?> + /** + * Widget options. + * + * @param array $instance Widget instance. + * @return void + */ + function form( $instance ) { + + $instance = wp_parse_args( (array) $instance, array( + 'title' => '', + ) ); + $title = $instance['title']; + + ?>

-'; - printf( __( 'To configure slider options, please go to the Slider Settings page.', 'genesis-responsive-slider' ), menu_page_url( 'genesis_responsive_slider', 0 ) ); - echo '

'; - } - function update( $new_instance, $old_instance ) { - $instance = $old_instance; - $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '' ) ); - $instance['title'] = strip_tags( $new_instance['title'] ); - return $instance; - } + '; + + /* Translators: Slider options instructions. */ + printf( __( 'To configure slider options, please go to the Slider Settings page.', 'genesis-responsive-slider' ), menu_page_url( 'genesis_responsive_slider', 0 ) ); + + echo '

'; + + } + + /** + * Update widget settings. + * + * @param array $new_instance Instance. + * @param array $old_instance Instance. + * @return array + */ + function update( $new_instance, $old_instance ) { + $instance = $old_instance; + $new_instance = wp_parse_args( (array) $new_instance, array( + 'title' => '', + ) ); + $instance['title'] = strip_tags( $new_instance['title'] ); + return $instance; + } } @@ -393,7 +487,7 @@ function update( $new_instance, $old_instance ) { * @since 0.9 * @author Nick Croft * - * @param string $taxonomy 'taxonomy' being tested + * @param string $taxonomy Taxonomy being tested. * @return string */ function genesis_responsive_slider_exclude_taxonomies( $taxonomy ) { @@ -401,7 +495,7 @@ function genesis_responsive_slider_exclude_taxonomies( $taxonomy ) { $filters = array( '', 'nav_menu' ); $filters = apply_filters( 'genesis_responsive_slider_exclude_taxonomies', $filters ); - return ( ! in_array( $taxonomy->name, $filters ) ); + return ( ! in_array( $taxonomy->name, $filters, true ) ); } @@ -411,7 +505,7 @@ function genesis_responsive_slider_exclude_taxonomies( $taxonomy ) { * @since 0.9 * @author Nick Croft * - * @param string $type 'post_type' being tested + * @param string $type Post type being tested. * @return string */ function genesis_responsive_slider_exclude_post_types( $type ) { @@ -419,29 +513,32 @@ function genesis_responsive_slider_exclude_post_types( $type ) { $filters = array( '', 'attachment' ); $filters = apply_filters( 'genesis_responsive_slider_exclude_post_types', $filters ); - return ( ! in_array( $type, $filters ) ); + return ( ! in_array( $type, $filters, true ) ); } /** * Returns Slider Option * - * @param string $key key value for option + * @param string $key Key value for option. * @return string */ function genesis_get_responsive_slider_option( $key ) { + return genesis_get_option( $key, GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD ); + } /** * Echos Slider Option * - * @param string $key key value for option + * @param string $key Key value for option. */ function genesis_responsive_slider_option( $key ) { - if ( ! genesis_get_responsive_slider_option( $key ) ) + if ( ! genesis_get_responsive_slider_option( $key ) ) { return false; + } echo genesis_get_responsive_slider_option( $key ); -} \ No newline at end of file +}