- Timestamp:
- 04/05/2016 04:05:02 PM (8 years ago)
- Location:
- sites/trunk/wordcamp.org
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org
-
Property
svn:mergeinfo
set to
/sites/branches/application-tracking/wordcamp.org merged eligible
-
Property
svn:mergeinfo
set to
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-json-api.php
r2358 r2898 1 1 <?php 2 3 2 /* 4 3 * Customizations to the JSON REST API … … 23 22 // Allow some routes to skip the JSON REST API v1 plugin. 24 23 add_action( 'parse_request', 'wcorg_json_v2_compat', 9 ); 24 25 // Allow users to read new post statuses. 26 add_filter( 'json_check_post_read_permission', 'wcorg_json_check_post_read_permission', 10, 2 ); 25 27 26 28 /** … … 372 374 return; 373 375 } 376 377 function wcorg_json_check_post_read_permission( $permission, $post ) { 378 if ( $permission || ! defined( 'WCPT_POST_TYPE_ID' ) ) { 379 return $permission; 380 } 381 382 if ( $post['post_type'] != WCPT_POST_TYPE_ID ) { 383 return $permission; 384 } 385 386 return in_array( $post['post_status'], WordCamp_Loader::get_public_post_statuses() ); 387 }
Note: See TracChangeset
for help on using the changeset viewer.