diff --git a/includes/class-displayfeaturedimagegenesis-helper.php b/includes/class-displayfeaturedimagegenesis-helper.php
index 07a1b97..0f0f8ea 100644
--- a/includes/class-displayfeaturedimagegenesis-helper.php
+++ b/includes/class-displayfeaturedimagegenesis-helper.php
@@ -25,6 +25,8 @@ class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisG
* Generic function to add settings sections
*
* @since 2.4.0
+ *
+ * @param $sections
*/
protected function add_sections( $sections ) {
@@ -40,8 +42,9 @@ class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisG
/**
* Generic function to add settings fields
+ *
+ * @param $fields
* @param array $sections registered sections
- * @return array all settings fields
*
* @since 2.4.0
*/
@@ -54,7 +57,7 @@ class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisG
array( $this, $field['callback'] ),
$this->page . '_' . $sections[ $field['section'] ]['id'],
$this->page . '_' . $sections[ $field['section'] ]['id'],
- empty( $field['args'] ) ? array() : $field['args']
+ $field
);
}
}
@@ -65,13 +68,15 @@ class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisG
* @since 2.5.0
*/
protected function get_active_tab() {
- return isset( $_GET['tab'] ) ? $_GET['tab'] : 'main';
+ $tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_STRING );
+
+ return $tab ? $tab : 'main';
}
/**
* Echoes out the section description.
+ *
* @param string $description text string for description
- * @return string as paragraph and escaped
*
* @since 2.3.0
*/
@@ -83,62 +88,68 @@ class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisG
* Generic callback to create a number field setting.
*
* @since 2.3.0
+ *
+ * @param $args
*/
public function do_number( $args ) {
printf( '',
(int) $args['min'],
(int) $args['max'],
- esc_attr( $args['setting'] ),
- esc_attr( $this->setting[ $args['setting'] ] ),
+ esc_attr( $args['id'] ),
+ esc_attr( $this->setting[ $args['id'] ] ),
esc_attr( $this->page ),
esc_attr( $args['label'] )
);
- $this->do_description( $args['setting'] );
+ $this->do_description( $args );
}
/**
* generic checkbox function (for all checkbox settings)
- * @return 0 1 checkbox
*
* @since 2.3.0
+ *
+ * @param $args
*/
public function do_checkbox( $args ) {
$setting = $this->get_checkbox_setting( $args );
- printf( '', esc_attr( $this->page ), esc_attr( $args['setting'] ) );
+ printf( '', esc_attr( $this->page ), esc_attr( $args['id'] ) );
printf( '',
- esc_attr( $args['setting'] ),
+ esc_attr( $args['id'] ),
checked( 1, esc_attr( $setting ), false ),
esc_attr( $args['label'] ),
esc_attr( $this->page )
);
- $this->do_description( $args['setting'] );
+ $this->do_description( $args );
}
/**
* Get the current value for the checkbox.
+ *
* @param $args
*
* @return int
*/
protected function get_checkbox_setting( $args ) {
- $setting = isset( $this->setting[ $args['setting'] ] ) ? $this->setting[ $args['setting'] ] : 0;
+ $setting = isset( $this->setting[ $args['id'] ] ) ? $this->setting[ $args['id'] ] : 0;
if ( isset( $args['setting_name'] ) && isset( $this->setting[ $args['setting_name'] ][ $args['name'] ] ) ) {
$setting = $this->setting[ $args['setting_name'] ][ $args['name'] ];
}
+
return $setting;
}
/**
* Build a checkbox array.
+ *
* @param $args
*/
public function do_checkbox_array( $args ) {
foreach ( $args['options'] as $key => $value ) {
$type_args = array(
- 'setting' => "{$args['setting']}][{$key}",
+ 'id' => "{$args['id']}][{$key}",
'label' => $value,
- 'setting_name' => $args['setting'],
+ 'setting_name' => $args['id'],
'name' => $key,
);
$this->do_checkbox( $type_args );
@@ -147,17 +158,18 @@ class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisG
/**
* radio buttons
- * @return string radio button output
* @since 2.6.0
+ *
+ * @param $args
*/
public function do_radio_buttons( $args ) {
echo '