Making WordPress.org

Changeset 997


Ignore:
Timestamp:
11/19/2014 07:46:47 PM (12 years ago)
Author:
iandunn
Message:

WordCamp Payments Dashboard: Use hardcoded category array instead of taxonomy.

Payments switched to using an array, so this needs to match.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/class-list-table.php

    r996 r997  
    150150         */
    151151        public function column_category( $request ) {
    152                 $terms = wp_get_object_terms( $request->ID, 'wcp_payment_category' );
    153                 if ( empty( $terms ) )
    154                         return;
    155 
    156                 return array_shift( $terms )->name;
     152                require_once( WP_PLUGIN_DIR . '/wordcamp-payments/classes/payment-request.php' );
     153                $categories        = WCP_Payment_Request::get_payment_categories();
     154                $selected_category = get_post_meta( $request->ID, '_camppayments_payment_category', true );
     155
     156                return isset( $categories[ $selected_category ] ) ? $categories[ $selected_category ] : '';
    157157        }
    158158
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/wordcamp-payments-network.php

    r996 r997  
    125125                $request = get_post( $request );
    126126
    127                 $terms = wp_get_object_terms( $request->ID, 'wcp_payment_category' );
    128                 $category_name = ! empty( $terms ) ? array_shift( $terms )->name : '';
    129 
    130127                return array(
    131128                        'blog_id' => get_current_blog_id(),
     
    135132                        'status' => $request->post_status,
    136133                        'method' => get_post_meta( $request->ID, '_camppayments_payment_method', true ),
    137                         'category' => $category_name,
     134                        'category' => get_post_meta( $request->ID, '_camppayments_payment_category', true ),
    138135                );
    139136        }
Note: See TracChangeset for help on using the changeset viewer.