• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Featured_Content::get_setting() – Get featured content settings.

You appear to be a bot. Output may be restricted

Description

Get featured content settings.

Get all settings recognized by this module. This function will return all settings whether or not they have been stored in the database yet. This ensures that all keys are available at all times. In the event that you only require one setting, you may pass its name as the first parameter to the function and only that value will be returned.

Usage

$mixed = Featured_Content::get_setting( $key );

Parameters

$key
( string ) optional default: all – The key of a recognized setting.

Returns

mixed Array of all settings by default. A single value if passed as first parameter.

Source

File name: twentyfourteen/inc/featured-content.php


Lines:

1 to 19 of 19
  public static function get_setting( $key = 'all' ) {
    $saved = (array) get_option( 'featured-content' );

    $defaults = array(
      'hide-tag' => 1,
      'tag-id'   => 0,
      'tag-name' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ),
    );

    $options = wp_parse_args( $saved, $defaults );
    $options = array_intersect_key( $options, $defaults );

    if ( 'all' !== $key ) {
      return isset( $options[ $key ] ) ? $options[ $key ] : false;
    }

    return $options;
  }
 

 View on Trac

Published: 19th December 2019 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: Featured_Content::get_setting
Class ref: Featured_Content
Plugin ref: Twenty Fourteen
Version: 3.5
Sourcefile: inc/featured-content.php
File ref: inc/featured-content.php
Deprecated?: No
API Letters: C,F,G,S

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites