Skip to content

Instantly share code, notes, and snippets.

@bologer
Last active October 19, 2017 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bologer/e3eaa6122c11a459202345790ffbfb0d to your computer and use it in GitHub Desktop.
Save bologer/e3eaa6122c11a459202345790ffbfb0d to your computer and use it in GitHub Desktop.
Show hidden products
  1. Open wp-content/themes/royal/woocommerce/content-product-gift.php and delete/comment the following lines:
//if ( ! $product || ! $product->is_visible() )
//	return;
  1. Open wp-content/themes/royal/page-profile-template.php

Change:

$gifts = new WP_query(array('post_type' => 'product', 'posts_per_page' => 100, 'post__in' => $gifts_ids, 'post__not_in' => $gifts_used_ids));

To:

$gifts = new WP_query([
    'post_type' => 'product',
    'post_status' => ['publish', 'pending', 'draft', 'private'],
    'posts_per_page' => 100,
    'post__in' => $gifts_ids,
    'post__not_in' => $gifts_used_ids
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment