woocommerce-memberships

remove_action From PHP Class in WooCommerce Memberships

假如想象 提交于 2020-01-05 02:48:06
问题 I have previously used a solution described here: remove_action From PHP Class for removing an action in the WooCommerce membership plugin. However, the solution no longer works, as WooComemerce have changed the code behind the membership plugin. So this is the new code. Main woocommerce-memberships.php public function includes() { // load post types require_once( $this->get_plugin_path() . '/includes/class-wc-memberships-post-types.php' ); // load user messages helper require_once( $this-

WooCommerce Memberships: Conditional to check a page access

别说谁变了你拦得住时间么 提交于 2020-01-02 19:47:13
问题 I have a Wordpress Memberships website that is built on WooCommerce with WooCommerce Memberships plugin to restrict certain pages to members only. Some of those pages are "drip-fed"... ie. Access to those pages opens 3 days after purchase, etc. I have set this up in WooMemberships. I am trying to simply do a PHP conditional check to see if the current user has access to a certain page. I have found this code piece in the docs: wc_memberships_is_post_content_restricted() However, I have been

Get all active users for a membership plan in WooCommerce

对着背影说爱祢 提交于 2019-12-10 11:18:46
问题 I am Using Wordpress version 4.9.4 with WooCommerce an WooCommerce Memberships plugin. How can I get all users for specific membership plan ($memberships)? Is there a hook or should I use raw query? On the documentation, it says that plans / memberships are post type, so I tried to query this table: SELECT jsu.id, jsu.user_email, jsu.display_name, jsp.post_title, jsp.post_type FROM `wp_users` jsu LEFT JOIN `wp_posts` jsp ON (jsu.id = jsp.post_author) LEFT JOIN `wp_usermeta` jsum ON (jsu.id =

WooCommerce Memberships: Conditional to check a page access

青春壹個敷衍的年華 提交于 2019-12-06 11:13:57
I have a Wordpress Memberships website that is built on WooCommerce with WooCommerce Memberships plugin to restrict certain pages to members only. Some of those pages are "drip-fed"... ie. Access to those pages opens 3 days after purchase, etc. I have set this up in WooMemberships. I am trying to simply do a PHP conditional check to see if the current user has access to a certain page. I have found this code piece in the docs: wc_memberships_is_post_content_restricted() However, I have been unable to make it work. Is there a code snippet which will basically do a PHP IF statement on whether

Get all active users for a membership plan in WooCommerce

馋奶兔 提交于 2019-12-06 06:26:53
I am Using Wordpress version 4.9.4 with WooCommerce an WooCommerce Memberships plugin . How can I get all users for specific membership plan ($memberships)? Is there a hook or should I use raw query? On the documentation, it says that plans / memberships are post type, so I tried to query this table: SELECT jsu.id, jsu.user_email, jsu.display_name, jsp.post_title, jsp.post_type FROM `wp_users` jsu LEFT JOIN `wp_posts` jsp ON (jsu.id = jsp.post_author) LEFT JOIN `wp_usermeta` jsum ON (jsu.id = jsum.user_id) WHERE jsp.post_title IN ($memberships) AND post_type = 'wc_membership_plan' But I don't