Changeset 5222 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
- Timestamp:
- 03/30/2017 10:48:36 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
r5221 r5222 58 58 59 59 // REST API 60 add_action( 'init', array( $this, 'expose_public_post_meta' ) ); 60 61 add_filter( 'rest_prepare_wcb_speaker', array( $this, 'link_speaker_to_sessions' ), 10, 2 ); 61 62 add_filter( 'rest_prepare_wcb_session', array( $this, 'link_session_to_speakers' ), 10, 2 ); … … 1397 1398 1398 1399 return $content . $sessions_html; 1400 } 1401 1402 /** 1403 * Add non-sensitive meta fields to the speaker/session REST API endpoints 1404 * 1405 * if we ever want to register meta for purposes other than exposing it in the API, then this function will 1406 * probably need to be re-thought and re-factored. 1407 */ 1408 public function expose_public_post_meta() { 1409 $public_session_fields = array( 1410 '_wcpt_session_time' => array( 1411 'type' => 'integer', 1412 'single' => true, 1413 ), 1414 1415 '_wcpt_session_type' => array( 1416 'single' => true, 1417 ), 1418 1419 '_wcpt_session_slides' => array( 1420 'single' => true, 1421 ), 1422 1423 '_wcpt_session_video' => array( 1424 'single' => true, 1425 ), 1426 ); 1427 1428 wcorg_register_meta_only_on_endpoint( 'post', $public_session_fields, '/wp-json/wp/v2/sessions/' ); 1399 1429 } 1400 1430 … … 1924 1954 'labels' => $labels, 1925 1955 'rewrite' => array( 'slug' => 'speaker', 'with_front' => true ), 1926 'supports' => array( 'title', 'editor', 'author', 'revisions', 'comments' ),1956 'supports' => array( 'title', 'editor', 'author', 'revisions', 'comments', 'custom-fields' ), 1927 1957 'menu_position' => 20, 1928 1958 'public' => true, … … 1958 1988 'labels' => $labels, 1959 1989 'rewrite' => array( 'slug' => 'session', 'with_front' => false ), 1960 'supports' => array( 'title', 'editor', 'author', 'revisions', 'thumbnail' ),1990 'supports' => array( 'title', 'editor', 'author', 'revisions', 'thumbnail', 'custom-fields' ), 1961 1991 'menu_position' => 21, 1962 1992 'public' => true,
Note: See TracChangeset
for help on using the changeset viewer.