Changeset 5223
- Timestamp:
- 03/30/2017 11:01:40 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/helper-functions.php
r5219 r5223 322 322 * @param array $meta_fields An array index by the field slug, with values to be passed to `register_meta()` as 323 323 * `$args`. For example, `array( '_wcpt_session_slides' => array( 'single' => true ) )` 324 * @param string $endpoint The full path of the endpoint. For example, '/wp-json/wp/v2/sessions/'324 * @param string $endpoint The partial path of the endpoint. For example, '/wp-json/wp/v2/sessions'. 325 325 */ 326 326 function wcorg_register_meta_only_on_endpoint( $meta_type, $meta_fields, $endpoint ) { 327 $is_correct_endpoint_request = false !== strpos( $_SERVER['REQUEST_URI'], $endpoint);327 $is_correct_endpoint_request = false !== strpos( $_SERVER['REQUEST_URI'], untrailingslashit( $endpoint ) ); 328 328 329 329 if ( ! $is_correct_endpoint_request ) {
Note: See TracChangeset
for help on using the changeset viewer.