Restrict wordpress posts to patreon only via API

How do we restrict a post via REST API that is automated into WordPress, instead of manually posted from the backend portal?

You would set the post meta for that post. If you set patreon-level to any value higher than 0, it gets locked. If you have Patron Plugin Pro, you can update the below fields to set a more advanced restriction:

ppp_advanced_post_locking
ppp_advanced_post_locking_value
ppp_advanced_post_locking_info
ppp_advanced_post_locking_date

do you have any guides on how to do this, I’m sorry but I cant pay for more plugins, hence why I am trying to do it via the API myself

The base plugin is free. You can just install it from your WP admin.

If you change the patreon-level meta for any post to higher than 0, that post would be locked.

The plugin also auto syncs your posts to your WP site and locks them if they are locked. It doesnt currently set the exact tier for the post though - that will be implemented soon.

So you can just get the plugin, sync your posts, and then set the tiers by setting patreon-level meta for any post you want to lock.

No i have the free plugin, but I want to be able to restrict a post on a Wordpress site via the upload API to the Wordpress site, and when doing so set the patreon level to restrict the content in an automated way.

Im not interested at all in syncing with patreon posts.

What I don’t understand is setting the meta for the patreon level, is there any documentation for that?

You want to post the post at your WP site and not at Patreon, and you want to automatically lock it for a given tier, is that correct?

yes that is correct. can you help?

With Patreon WordPress, you can auto-lock your entire site in the settings. From a given $ tier.

If you have Patron Plugin Pro, then you can lock any specific post type, category, tag or custom taxonomy from a given tier. Also you can use advanced gating options with Patron Pro - like ‘Show after X days’ or ‘Only show last X posts / First X posts’ etc.

You don’t need to use the api for any of those since they have those built in.

actually i do need to use the API as I’m using that to automate posts into my Wordpress website, so I need to (as part of that API post to create a post) be able to set via the API the level to restrict the post.

However I do not want to LOCK the entire site, only specific posts that are set (currently by hand in the portal, but this is useless for me really)

I’m NOT logging in and posting by hand, so that doesn’t help me at all. All posts are via REST API

Then just set the meta patreon-level to something higher than 0 for any post you want to lock. Check the WP api docs for setting post meta values.

1 Like

Thanks managed to get that to work

1 Like