Beispiel #1
0
 /**
  * Filter the data that shows up in the columns in the "Orders" screen, define our own.
  */
 function columns_data($column)
 {
     global $post;
     if ('acp-links' != $post->post_type) {
         return;
     }
     switch ($column) {
         case 'filename':
             echo get_post_meta($post->ID, '_acp_link_filename', true);
             break;
         case 'uri':
             echo make_clickable(esc_url_raw(sprintf(home_url('/?download_id=%s'), get_post_meta($post->ID, '_acp_link_id', true))));
             break;
         case "access_level":
             echo memberaccess_get_accesslevel_list($post->ID);
             break;
     }
 }
Beispiel #2
0
 /**
  * Filter the data that shows up in the columns in the "Orders" screen, define our own.
  */
 function columns_data($column)
 {
     global $post;
     if ('acp-orders' != $post->post_type) {
         return;
     }
     switch ($column) {
         case 'member_name':
             $member_id = accesspress_get_custom_field('_acp_order_member_id');
             $member = get_user_by('id', $member_id);
             if (!$member) {
                 break;
             }
             printf(__('<p><a href="%s">%s - %s %s</a></p>', 'premise'), add_query_arg(array('user_id' => $member->ID), admin_url('user-edit.php')), $member->user_login, $member->first_name, $member->last_name);
             break;
         case 'member_product':
             $product_id = accesspress_get_custom_field('_acp_order_product_id');
             $product = get_post($product_id);
             if (!$product) {
                 break;
             }
             printf(__('<p><a href="%s">%s</a></p>', 'premise'), add_query_arg(array('post' => $product->ID, 'action' => 'edit'), admin_url('post.php')), $product->post_title);
             break;
         case 'member_discount':
             $coupon_id = accesspress_get_custom_field('_acp_order_coupon_id');
             $coupon = get_post($coupon_id);
             if (!$coupon) {
                 break;
             }
             $percentage = 'percent' == get_post_meta($coupon_id, '_acp_coupon_type', true);
             $format = $percentage ? __('%d%%', 'premise') : __('$ %.2f', 'premise');
             $discount = get_post_meta($coupon_id, $percentage ? '_acp_coupon_percent' : '_acp_coupon_flat', true);
             printf(__('<p><a href="%s">' . $format . '</a></p>', 'premise'), add_query_arg(array('post' => $coupon->ID, 'action' => 'edit'), admin_url('post.php')), $discount);
             break;
         case 'access_level':
             $product_id = accesspress_get_custom_field('_acp_order_product_id');
             $product = get_post($product_id);
             if (!$product) {
                 break;
             }
             echo memberaccess_get_accesslevel_list($product->ID);
             break;
     }
 }
Beispiel #3
0
 /**
  * Filter the data that shows up in the columns in the "Orders" screen, define our own.
  */
 function columns_data($column)
 {
     global $post;
     if ('acp-products' != $post->post_type) {
         return;
     }
     switch ($column) {
         case "product_price":
             $free = accesspress_get_custom_field('_acp_product_free_product');
             if ($free) {
                 _e('<p>Free Product</p>', 'premise');
                 break;
             }
             $price = accesspress_get_custom_field('_acp_product_price');
             if (!$price) {
                 break;
             }
             printf(__('<p>%.2f</p>', 'premise'), $price);
             break;
         case "access_level":
             echo memberaccess_get_accesslevel_list($post->ID);
             break;
     }
 }