You appear to be a bot. Output may be restricted
Description
Validate featured content settings.
Make sure that all user supplied content is in an expected format before saving to the database. This function will also delete the transient set in Featured_Content::get_featured_content().
Usage
$array = Featured_Content::validate_settings( $input );
Parameters
- $input
- ( array ) required – Array of settings input.
Returns
array Validated settings output.
Source
File name: twentyfourteen/inc/featured-content.php
Lines:
1 to 29 of 29
public static function validate_settings( $input ) { $output = array(); if ( empty( $input['tag-name'] ) ) { $output['tag-id'] = 0; } else { $term = get_term_by( 'name', $input['tag-name'], 'post_tag' ); if ( $term ) { $output['tag-id'] = $term->term_id; } else { $new_tag = wp_create_tag( $input['tag-name'] ); if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) { $output['tag-id'] = $new_tag['term_id']; } } $output['tag-name'] = $input['tag-name']; } $output['hide-tag'] = isset( $input['hide-tag'] ) && $input['hide-tag'] ? 1 : 0; // Delete the featured post IDs transient. self::delete_transient(); return $output; }