jetpack_related_posts_customize_options

The WordPress Core jetpack related posts customize options hook.

Description

apply_filters( 'jetpack_related_posts_customize_options', (callback) $array ); 

Parameters (1)

0. $array — Optional. (callback) => array( 'enabled' => array( 'control_type' => 'hidden', 'default' => 1, 'setting_type' => 'option', 'transport' => $transport, ), 'show_headline' => array( 'label' => esc_html__( 'Show a headline', 'jetpack' ), 'description' => esc_html__( 'This helps to clearly separate the related posts from post content.', 'jetpack' ), 'control_type' => 'checkbox', 'default' => 1, 'setting_type' => 'option', 'transport' => $transport, ), 'headline' => array( 'label' => '', 'description' => esc_html__( 'Enter text to use as headline.', 'jetpack' ), 'control_type' => 'text', 'default' => esc_html( $headline ), 'setting_type' => 'option', 'transport' => $transport, ), 'show_thumbnails' => array( 'label' => esc_html__( 'Show thumbnails', 'jetpack' ), 'description' => esc_html__( 'Use a large and visually striking layout.', 'jetpack' ), 'control_type' => 'checkbox', 'default' => 1, 'setting_type' => 'option', 'transport' => $transport, ), 'show_date' => array( 'label' => esc_html__( 'Show date', 'jetpack' ), 'description' => esc_html__( 'Display date when entry was published.', 'jetpack' ), 'control_type' => 'checkbox', 'default' => 1, 'setting_type' => 'option', 'transport' => $transport, ), 'show_context' => array( 'label' => esc_html__( 'Show context', 'jetpack' ), 'description' => esc_html__( "Display entry's category or tag.", 'jetpack' ), 'control_type' => 'checkbox', 'default' => 1, 'setting_type' => 'option', 'transport' => $transport, ), 'layout' => array( 'label' => esc_html__( 'Layout', 'jetpack' ), 'description' => esc_html__( 'Arrange entries in different layouts.', 'jetpack' ), 'control_type' => 'select', 'choices' => array( 'grid' => esc_html__( 'Grid', 'jetpack' ), 'list' => esc_html__( 'List', 'jetpack' ), ), 'default' => 'grid', 'setting_type' => 'option', 'transport' => $transport, ), 'msg_go_to_single' => array( 'description' => esc_html__( 'Please visit a single post view to reveal the customization options.', 'jetpack' ), 'control_type' => 'message', 'active_callback' => __CLASS__ . '::is_not_single', ), 'msg_example' => array( 'description' => esc_html__( 'Please note that the related posts displayed now are only for previewing purposes.', 'jetpack' ), 'control_type' => 'message', ), )
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'jetpack_related_posts_customize_options', $array ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the jetpack_related_posts_customize_options callback 
  2. function filter_jetpack_related_posts_customize_options( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_related_posts_customize_options', 'filter_jetpack_related_posts_customize_options', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_related_posts_customize_options', 'filter_jetpack_related_posts_customize_options', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/modules/related-posts/class.related-posts-customize.php  
  1. return apply_filters(