Title: query arg
Last modified: February 25, 2023

---

# query arg

 *  Resolved [wstone508](https://wordpress.org/support/users/wstone508/)
 * (@wstone508)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/query-arg/)
 * I know I’ve touched on this before, but is there a query list of arguments for
   the WP_Query that return protected posts? I’m using a widget for elementor that
   displays posts and it accepts custom query code. I just don’t know what code 
   to put there because I’m a code novice.
 * Why use the widget? Because I can specify the styling of the returned posts, 
   which honestly is the major drawback of this plugin. Thanks for listening Matt.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/query-arg/#post-16509956)
 * hey [@wstone508](https://wordpress.org/support/users/wstone508/) I am sorry but
   there is not a single query for returning protected posts…
 * Well, if you are just wanting to get ALL protected posts and not determine if
   the user has access to those posts but just pull a list of posts that have a 
   product associated with them then you can use.
 *     ```wp-block-code
       $args['meta_query'] = [
       [
       	'key'     => 'wc_pay_per_post_product_ids',
       	'value'   => '',
       	'compare' => '!=',
       ],
       ];
       ```
   
 * But that Custom Query feature of elementor means you need to write your own custom
   query like [https://developers.elementor.com/docs/hooks/custom-query-filter/](https://developers.elementor.com/docs/hooks/custom-query-filter/)
 * You will need to find a developer to help you out with implementing this if you
   do not already know how to do so. Hope that helps!
    -  This reply was modified 3 years, 3 months ago by [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/).
      Reason: Edited code to replace the value of the CONST
 *  Thread Starter [wstone508](https://wordpress.org/support/users/wstone508/)
 * (@wstone508)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/query-arg/#post-16514091)
 * fair enough. Thanks anyway

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘query arg’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pay-per-post/assets/icon-256x256.png?rev=2252656)
 * [Pay For Post with WooCommerce](https://wordpress.org/plugins/woocommerce-pay-per-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pay-per-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pay-per-post/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pay-per-post/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [wstone508](https://wordpress.org/support/users/wstone508/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/query-arg/#post-16514091)
 * Status: resolved