wpseo_json_home_url

Filter: 'wpseo_json_home_url' - Allows filtering of the home URL for Yoast SEO's JSON+LD output.

Description

apply_filters( 'wpseo_json_home_url', (unknown) $wpseo_utils ); 

Parameters (1)

0. $wpseo_utils (unknown) => WPSEO_Utils::home_url()
The wpseo utils.

Usage

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

Defined (1)

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

/frontend/class-json-ld.php  
  1. return apply_filters( 'wpseo_json_home_url', WPSEO_Utils::home_url() );