'1',
'intro_text' => '',
);
return apply_filters( 'skylark_default_theme_options', $default_theme_options );
}
/**
* Returns the options array for Skylark 1.0.1.
*/
function skylark_get_theme_options() {
return get_option( 'skylark_theme_options', skylark_get_default_theme_options() );
}
/**
* Renders the introductory message setting
*/
function skylark_settings_field_intro_text() {
$options = skylark_get_theme_options();
?>
array( 'title' => array(), 'href' => array() ),
'em' => array( 'title' => array() ),
'strong' => array( 'title' => array() ),
);
$output = wp_kses( $input, $allowed_tags );
return $output;
}
/**
* Sanitize and validate form input. Accepts an array, return a sanitized array.
*
* @see skylark_theme_options_init()
* @todo set up Reset Options action
*
* @param array $input Unknown values.
* @return array Sanitized theme options ready to be stored in the database.
*
* @since Skylark 1.0.1
*/
function skylark_theme_options_validate( $input ) {
$options = []; // This use of $options is possibly a bug; adding to pass rector 2023-09-28
$output = $defaults = skylark_get_default_theme_options();
// The text input must be filterd with skylark_input_text_validate().
if ( isset( $input['intro_text'] ) && ! empty( $input['intro_text'] ) )
$output['intro_text'] = skylark_input_text_validate( $input['intro_text'] );
// Set the primary category ID to "1" if the input value is not in the array of categories.
if ( array_key_exists( $input['primary_category'], skylark_primary_category() ) ) :
$options['primary_category'] = $input['primary_category'];
else :
$options['primary_category'] = 1;
endif;
return $input;
}