WordPress.org

Making WordPress.org

Changeset 2366


Ignore:
Timestamp:
01/25/2016 09:17:54 PM (5 years ago)
Author:
iandunn
Message:

WordCamp Payments: Centralize payment category fields.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-dashboard.php

    r2356 r2366  
    117117    public static function prepare_for_index( $request ) {
    118118        $request = get_post( $request );
    119         $categories = WCP_Payment_Request::get_payment_categories();
     119        $categories = WordCamp_Budgets::get_payment_categories();
    120120
    121121        // All things search.
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-list-table.php

    r2298 r2366  
    160160    public function column_category( $request ) {
    161161        require_once( WP_PLUGIN_DIR . '/wordcamp-payments/includes/payment-request.php' );
    162         $categories        = WCP_Payment_Request::get_payment_categories();
     162        $categories        = WordCamp_Budgets::get_payment_categories();
    163163        $selected_category = get_post_meta( $request->ID, '_camppayments_payment_category', true );
    164164
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php

    r2365 r2366  
    239239        wp_nonce_field( 'general_info', 'general_info_nonce' );
    240240
    241         $categories        = self::get_payment_categories();
     241        $categories        = WordCamp_Budgets::get_payment_categories();
    242242        $assigned_category = get_post_meta( $post->ID, '_camppayments_payment_category', true );
    243243
     
    447447
    448448        return $value;
    449     }
    450 
    451     /**
    452      * Define the payment categories
    453      *
    454      * The slugs are explicitly registered in English so they will match across sites that use different locales,
    455      * which facilitates aggregating the data into reports.
    456      *
    457      * This is public so that WordCamp Payments Network Dashboard can access it, in order to aggregate posts by their slug.
    458      *
    459      * @return array
    460      */
    461     public static function get_payment_categories() {
    462         return array(
    463             'after-party'     => __( 'After Party',                    'wordcamporg' ),
    464             'audio-visual'    => __( 'Audio Visual',                   'wordcamporg' ),
    465             'food-beverages'  => __( 'Food & Beverage',                'wordcamporg' ),
    466             'office-supplies' => __( 'Office Supplies',                'wordcamporg' ),
    467             'signage-badges'  => __( 'Signage & Badges',               'wordcamporg' ),
    468             'speaker-event'   => __( 'Speaker Event',                  'wordcamporg' ),
    469             'swag'            => __( 'Swag (t-shirts, stickers, etc)', 'wordcamporg' ),
    470             'venue'           => __( 'Venue',                          'wordcamporg' ),
    471             'other'           => __( 'Other',                          'wordcamporg' ), // This one is intentionally last, regardless of alphabetical order
    472         );
    473449    }
    474450
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php

    r2365 r2366  
    160160    /**
    161161     * Get the names of all the fields that should be encrypted
    162      * 
     162     *
    163163     * @return array
    164164     */
     
    308308
    309309    /**
     310     * Define the payment categories
     311     *
     312     * The slugs are explicitly registered in English so they will match across sites that use different locales,
     313     * which facilitates aggregating the data into reports.
     314     *
     315     * @return array
     316     */
     317    public static function get_payment_categories() {
     318        return array(
     319            'after-party'     => __( 'After Party',                    'wordcamporg' ),
     320            'audio-visual'    => __( 'Audio Visual',                   'wordcamporg' ),
     321            'food-beverages'  => __( 'Food & Beverage',                'wordcamporg' ),
     322            'office-supplies' => __( 'Office Supplies',                'wordcamporg' ),
     323            'signage-badges'  => __( 'Signage & Badges',               'wordcamporg' ),
     324            'speaker-event'   => __( 'Speaker Event',                  'wordcamporg' ),
     325            'swag'            => __( 'Swag (t-shirts, stickers, etc)', 'wordcamporg' ),
     326            'venue'           => __( 'Venue',                          'wordcamporg' ),
     327            'other'           => __( 'Other',                          'wordcamporg' ), // This one is intentionally last, regardless of alphabetical order
     328        );
     329    }
     330
     331    /**
    310332     * Determines whether we want to perform actions on the given post based on the current context.
    311333     *
Note: See TracChangeset for help on using the changeset viewer.