/** * wpsc_product_rows function, copies the functionality of the wordpress code for displaying posts and pages, but is for products * */ function wpsc_admin_product_listing($parent_product = null) { global $wp_query; add_filter('the_title', 'esc_html'); $args = array_merge($wp_query->query, array('posts_per_page' => '-1')); $GLOBALS['wpsc_products'] = get_posts($args); foreach ((array) $GLOBALS['wpsc_products'] as $product) { wpsc_product_row($product, $parent_product); } }
/** * wpsc_product_rows function, copies the functionality of the wordpress code for displaying posts and pages, but is for products * */ function wpsc_admin_product_listing($parent_product = null) { global $wp_query, $wpsc_products; add_filter('the_title', 'esc_html'); $args = array_merge($wp_query->query, array('posts_per_page' => '-1')); $wpsc_temp_query = query_posts($args); if (empty($wpsc_products)) { $wpsc_products =& $wpsc_temp_query; } foreach ((array) $wpsc_products as $product) { wpsc_product_row($product, $parent_product); } }
/** * wpsc_product_rows function, copies the functionality of the wordpress code for displaying posts and pages, but is for products * */ function wpsc_admin_product_listing($parent_product = null, $args = array()) { global $wp_query; if (empty($args)) { $args = $wp_query->query; } add_filter('the_title', 'esc_html'); $args = array_merge($args, array('posts_per_page' => '-1')); $GLOBALS['wpsc_products'] = get_posts($args); if (!$GLOBALS['wpsc_products']) { ?> <tr> <td colspan="8"> <?php _e('You have no Variations added.', 'wpsc'); ?> </td> </tr> <?php } foreach ((array) $GLOBALS['wpsc_products'] as $product) { wpsc_product_row($product, $parent_product); } }