Making WordPress.org


Ignore:
Timestamp:
11/15/2018 01:35:26 AM (6 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Create DRY list of venue address post meta fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php

    r7693 r7853  
    333333
    334334    /**
    335      * Meta field keys to publicly expose in the v2 REST API
    336      *
    337      * @see wcorg_json_expose_whitelisted_meta_data() in mu-plugins/wcorg-json-api.php
     335     * Meta field keys that are safe to publicly expose in the v2 REST API.
     336     *
     337     * @see wcorg_json_expose_whitelisted_meta_data() in mu-plugins/wcorg-json-api.php.
    338338     *
    339339     * @return array
    340340     */
    341341    public static function get_public_meta_keys() {
    342         return array(
     342        require_once( __DIR__ . '/wordcamp-admin.php' );
     343
     344        $safe_fields = array(
    343345            // Sourced from wcorg_json_expose_whitelisted_meta_data()
    344346            'Start Date (YYYY-mm-dd)',
     
    357359            'Website URL',
    358360            'Exhibition Space Available',
    359             // Additional venue data
    360             '_venue_coordinates',
    361             '_venue_city',
    362             '_venue_state',
    363             '_venue_country_code',
    364             '_venue_country_name',
    365             '_venue_zip',
     361        );
     362
     363        return array_merge(
     364            $safe_fields,
     365            WordCamp_Admin::get_venue_address_meta_keys()
    366366        );
    367367    }
Note: See TracChangeset for help on using the changeset viewer.