manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } endif; if ( ! function_exists( 'buzz_magazine_sanitize_checkbox' ) ) : /** * Sanitize checkbox. * @since 1.0.0 * * @param bool $checked Whether the checkbox is checked. * @return bool Whether the checkbox is checked. */ function buzz_magazine_sanitize_checkbox( $checked ) { return ( ( isset( $checked ) && true === $checked ) ? true : false ); } endif;