jetpack_get_freshly_pressed_data

The Jetpack by WordPress.com jetpack get freshly pressed data function.

Description

jetpack_get_freshly_pressed_data(); 

Usage

  1. if ( !function_exists( 'jetpack_get_freshly_pressed_data' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/enhanced-distribution.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_get_freshly_pressed_data(); 
  7.  

Defined (1)

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

/modules/enhanced-distribution.php  
  1. function jetpack_get_freshly_pressed_data() { 
  2. if ( is_single() ) { 
  3. wp_send_json_success( array( 
  4. 'blog_id' => Jetpack_Options::get_option( 'id' ),  
  5. 'post_id' => get_the_ID(),  
  6. ) ); 
  7. } else { 
  8. wp_send_json_error( array( 
  9. 'message' => 'Not Singular',  
  10. ) );