jetpack_index_permalinks_rest_api_url

Fix the REST API URL for sites using index permalinks.

Description

(string) jetpack_index_permalinks_rest_api_url( (string) $prefix ); 

Returns (string)

Parameters (1)

0. $prefix (string)
REST API endpoint URL base prefix.

Usage

  1. if ( !function_exists( 'jetpack_index_permalinks_rest_api_url' ) ) { 
  2. require_once '/jetpack.php'; 
  3.  
  4. // REST API endpoint URL base prefix. 
  5. $prefix = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jetpack_index_permalinks_rest_api_url($prefix); 
  9.  

Defined (1)

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

/jetpack.php  
  1. function jetpack_index_permalinks_rest_api_url( $prefix ) { 
  2. global $wp_rewrite, $wp_version; 
  3. if ( version_compare( $wp_version, '4.7-alpha-38790', '<' ) 
  4. && isset( $wp_rewrite ) && $wp_rewrite instanceof WP_Rewrite 
  5. && method_exists( $wp_rewrite, 'using_index_permalinks' ) 
  6. && $wp_rewrite->using_index_permalinks() ) { 
  7. $prefix = $wp_rewrite->index . '/' . $prefix; 
  8.  
  9. return $prefix;