private function get_row_actions($item)
 {
     $post_type_object = get_post_type_object('wpsc-product');
     $can_edit_post = current_user_can($post_type_object->cap->edit_post, $item->ID);
     $actions = array();
     if (apply_filters('wpsc_show_product_variations_edit_action', true, $item) && $can_edit_post && 'trash' != $item->post_status) {
         $actions['edit'] = '<a target="_blank" href="' . get_edit_post_link($item->ID, true) . '" title="' . esc_attr(__('Edit this item'), 'wpsc') . '">' . __('Edit') . '</a>';
     }
     $actions['stock hide-if-no-js'] = '<a class="wpsc-variation-stock-editor-link" href="#" title="' . __('Show shipping editor', 'wpsc') . '">' . __('Edit Shipping', 'wpsc') . '</a>';
     if ($item->post_status == 'draft') {
         $show_url = add_query_arg(array('bulk_action' => 'show', 'post' => $item->ID, 'bulk_action_nonce' => wp_create_nonce('wpsc_product_variations_bulk_action')));
         $actions['show'] = '<a class="wpsc-variation-show-link" href="' . esc_url($show_url) . '" title="' . __('Show this variation on the front-end', 'wpsc') . '">' . __('Publish', 'wpsc') . '</a>';
     } elseif (in_array($item->post_status, array('publish', 'inherit'))) {
         $hide_url = add_query_arg(array('bulk_action' => 'hide', 'post' => $item->ID, 'bulk_action_nonce' => wp_create_nonce('wpsc_product_variations_bulk_action')));
         $actions['hide'] = '<a class="wpsc-variation-hide-link" href="' . esc_url($hide_url) . '" title="' . __('Mark this variation as draft to hide from the front-end', 'wpsc') . '">' . __('Mark as Draft', 'wpsc') . '</a>';
     }
     if (current_user_can($post_type_object->cap->delete_post, $item->ID)) {
         $force_delete = 'trash' == $item->post_status || !EMPTY_TRASH_DAYS;
         $redirect_url = urlencode(_wpsc_get_product_variation_form_url($this->product_id));
         $delete_link = add_query_arg('_wp_http_referer', $redirect_url, get_delete_post_link($item->ID, '', $force_delete));
         if ('trash' == $item->post_status) {
             $restore_url = admin_url(sprintf($post_type_object->_edit_link, $item->ID));
             $restore_url = add_query_arg(array('action' => 'untrash', '_wp_http_referer' => $redirect_url), $restore_url);
             $restore_url = wp_nonce_url($restore_url, 'untrash-post_' . $item->ID);
             $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . esc_url($restore_url) . "'>" . __('Restore') . "</a>";
         } elseif (EMPTY_TRASH_DAYS) {
             $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . esc_url($delete_link) . "'>" . __('Trash') . "</a>";
         }
         if ($force_delete) {
             $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . esc_url($delete_link) . "'>" . __('Delete Permanently') . "</a>";
         }
     }
     return $actions;
 }
コード例 #2
0
function wpsc_product_variation_forms()
{
    ?>
	<iframe src="<?php 
    echo _wpsc_get_product_variation_form_url();
    ?>
"></iframe>
	<?php 
}