|[ Index ]||
PHP Cross Reference of WordPress Trunk (Updated Daily)
|File Size:||518 lines (15 kb)|
|Included or required:||0 times|
|Includes or requires:||0 files|
Featured_Content:: (16 methods):
All custom functionality will be hooked into the "init" action.
|Conditionally hook into WordPress.|
Theme must declare that they support this module by adding
add_theme_support( 'featured-content' ); during after_setup_theme.
If no theme support is found there is no need to hook into WordPress.
We'll just return early instead.
|Hide "featured" tag from the front end.|
Has to run on wp_loaded so that the preview filters of the Customizer
have a chance to alter the value.
|Get featured posts.|
return: array Array of featured posts.
|Get featured post IDs|
This function will return the an array containing the
post IDs of all featured posts.
Sets the "featured_content_ids" transient.
return: array Array of post IDs.
|Return an array with IDs of posts maked as sticky.|
return: array Array of sticky posts.
|Delete featured content ids transient.|
Hooks in the "save_post" action.
|pre_get_posts( $query ) X-Ref|
|Exclude featured posts from the home page blog query.|
Filter the home page posts, and remove any featured post ID's from it.
Hooked onto the 'pre_get_posts' action, this changes the parameters of
the query before it gets any posts.
param: WP_Query $query WP_Query object.
return: WP_Query Possibly-modified WP_Query.
|delete_post_tag( $tag_id ) X-Ref|
|Reset tag option when the saved tag is deleted.|
It's important to mention that the transient needs to be deleted,
too. While it may not be obvious by looking at the function alone,
the transient is deleted by Featured_Content::validate_settings().
Hooks in the "delete_post_tag" action.
param: int $tag_id The term_id of the tag that has been deleted.
|hide_featured_term( $terms, $taxonomies, $args ) X-Ref|
|Hide featured tag from displaying when global terms are queried from the front end.|
Hooks into the "get_terms" filter.
param: array $terms List of term objects. This is the return value of get_terms().
param: array $taxonomies An array of taxonomy slugs.
return: array A filtered array of terms.
|hide_the_featured_term( $terms, $id, $taxonomy ) X-Ref|
|Hide featured tag from display when terms associated with a post object|
are queried from the front end.
Hooks into the "get_the_terms" filter.
param: array $terms A list of term objects. This is the return value of get_the_terms().
param: int $id The ID field for the post object that terms are associated with.
param: array $taxonomy An array of taxonomy slugs.
return: array Filtered array of terms.
|Register custom setting on the Settings -> Reading screen.|
|customize_register( $wp_customize ) X-Ref|
|Add settings to the Customizer.|
param: WP_Customize_Manager $wp_customize Customizer object.
|Enqueue the tag suggestion script.|
|get_setting( $key = 'all' ) X-Ref|
|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.
param: string $key The key of a recognized setting.
return: mixed Array of all settings by default. A single value if passed as first parameter.
|validate_settings( $input ) X-Ref|
|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().
param: array $input Array of settings input.
return: array Validated settings output.
|Generated: Sat Nov 23 20:47:33 2019||Cross-referenced by PHPXref 0.7|