strangerstudios / pmpro-addon-packages

Charge for access to specific pages or other post types in WordPress. Requires the Paid Memberships Pro plugin.
https://www.paidmembershipspro.com/add-ons/pmpro-purchase-access-to-a-single-page/
25 stars 29 forks source link

working only for Standard post format #47

Closed sirol81 closed 1 month ago

sirol81 commented 3 years ago

if I create a Standard post format, it works ok. But if I create a Video post format for example, it gets overridden.

Is there a hook or filter where I can add custom logic to enable Video Post format to be restricted?

thanks

bethgee commented 3 years ago

Did you ever find a solution for this? I am trying to integrate PMP with an Events plugin and am trying to get around needing to create a Membership Level for each class to allow single class access...

Thanks, Beth

sirol81 commented 3 years ago

Not a real solution, but as a workaround I copy/pasted the logic found in this PMP plugin and put in a child theme php where it writes the html. This way I can protect the Video post format too, but I hoped in a hook or something to do that

bethgee commented 3 years ago

Sorry, do you mind sharing the logic you copy-pasted? I am pretty new to JS and JQuery and get confused. Is it the part referenced on https://github.com/strangerstudios/pmpro-addon-packages/issues/45 ?

Did you just make this $post_type = "page, 'CPT'"; ? Or would it be $post_type = array('post', 'page', 'CPT'); ?

Really appreciate your responding!!

sirol81 commented 3 years ago

I took this function from the plugin: function pmproap_pmpro_text_filter( $text ) { and added it to my function.php from my child theme, renamed it and called when needed to visualize my video post format content

bethgee commented 3 years ago

OK, will have a look in a bit, thank you!

andrewlimaza commented 3 years ago

You may use the following filter to add functionality of Addon Packages to any post type needed - https://github.com/strangerstudios/pmpro-addon-packages/blob/dev/pmpro-addon-packages.php#L103

Please note that Github is used for bug reporting. For any support related questions to this product, please reach out to www.paidmembershipspro.com

Thanks!

bethgee commented 3 years ago

For future, if anyone needs this info, I needed to add the Custom Post Type Add On as well as the Addon Packages Add On to get the Addon Packages box to show on my custom posts!!

bethgee commented 3 years ago

(also, I had reached out to support, but it has taken a week of back and forth to figure out I needed this extra add on...! So I thought it was worth asking here too just in case)