Making WordPress.org


Ignore:
Timestamp:
02/24/2015 07:58:53 PM (10 years ago)
Author:
iandunn
Message:

Multi Event Sponsors: Refactor the Regions taxonomy into its own class.

There was arguably already enough code to warrant putting it in its own file, and I'm going to be adding more soon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/multi-event-sponsors.php

    r845 r1302  
    4141    public function shortcode_multi_event_sponsors( $parameters ) {
    4242        $sponsors           = $this->reindex_array_by_object_id( get_posts( array( 'post_type' => MES_Sponsor::POST_TYPE_SLUG, 'numberposts' => -1 ) ) );
    43         $regions            = $this->reindex_array_by_object_id( get_terms( MES_Sponsor::REGIONS_SLUG, array( 'hide_empty' => false ) ) );
     43        $regions            = $this->reindex_array_by_object_id( get_terms( MES_Region::TAXONOMY_SLUG, array( 'hide_empty' => false ) ) );
    4444        $sponsorship_levels = $this->reindex_array_by_object_id( get_posts( array( 'post_type' => MES_Sponsorship_Level::POST_TYPE_SLUG, 'numberposts' => -1 ) ) );
    4545        $grouped_sponsors   = $this->group_sponsors_by_region_and_level( $sponsors );
     
    5555     * This makes for efficient direct access when the ID is known.
    5656     *
    57      * @param $array
    58      * @return mixed
     57     * @param array $old_array
     58     * @return array
    5959     */
    6060    protected function reindex_array_by_object_id( $old_array ) {
     
    124124     */
    125125    protected function uksort_regions( $region_a_id, $region_b_id ) {
    126         $region_a = get_term( $region_a_id, MES_Sponsor::REGIONS_SLUG );
    127         $region_b = get_term( $region_b_id, MES_Sponsor::REGIONS_SLUG );
     126        $region_a = get_term( $region_a_id, MES_Region::TAXONOMY_SLUG );
     127        $region_b = get_term( $region_b_id, MES_Region::TAXONOMY_SLUG );
    128128
    129129        if ( $region_a->name == $region_b->name ) {
Note: See TracChangeset for help on using the changeset viewer.