How to identify S2Member protected Posts
-
How does S2Member tag a post in the MySQL table(s) as being protected?
-
Take a look at this article.
Ok, thank you @kts915. But what I can’t figure out is I looked at
wp_postsandwp_postmetaover and over looking for the way that the posts got tagged and I found nothing. The article you just shared states thewp_postmetais where it is being tagged. But not anywhere in my table. So odd.After much digging, I found the location of the tagging.
I happens in the
wp_optionstable in row:
option_name = "ws_plugin__s2member_options".Look for the following in the “blob”:
s:12:"level0_posts";s:0:""; s:12:"level1_posts";s:0:""; s:12:"level2_posts";s:0:""; s:12:"level3_posts";s:0:""; s:12:"level4_posts";s:0:"";Thanks for sharing. Maybe the KB article needs updating.
There are two different types of restriction options, and two different places where they are stored. See: http://s2member.com/kb-article/where-is-the-s2member-data-stored-in-the-wordpress-database/#toc-9beefcc8
After a bit is digging and work, I finally got my script to identify the private posts and to selectively remove them on a conditional basis from the
option_name = "ws_plugin__s2member_options"settings.Objective: I want to make all private posts public after a certain defined number of weeks of being restricted.
My script re-writes the
"level0_posts","level1_posts","level2_posts","level3_posts", and"level4_posts"perfectly.However, when I run the script I get the following errors and my query fails to update the
wp_optionstable:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘options_checksum”;s:32:”620f01dcca7b6b9fe1508dacab099e37″;s:15:”options_version”‘ at line 2
Can anyone assist on how to resolve this error?
Thank you.
Plus here are posts on the S2 restriction array that no longer exist in the WordPress posts table. How do I remove them from S2 and sync to my WP tables?
After a bit is digging and work, I finally got my script to identify the private posts and to selectively remove them on a conditional basis from the option_name = “ws_plugin__s2member_options” settings.
Objective: I want to make all private posts public after a certain defined number of weeks of being restricted.
My script re-writes the “level0_posts”, “level1_posts”, “level2_posts”, “level3_posts”, and “level4_posts” perfectly.
However, when I run the script I get the following errors and my query fails to update the wp_options table:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘options_checksum”;s:32:”620f01dcca7b6b9fe1508dacab099e37″;s:15:”options_version”‘ at line 2
Can anyone assist on how to resolve this error?
Plus here are posts on the S2 restriction array that no longer exist in the WordPress posts table. How do I remove them from S2 and sync to my WP tables?
Thank you.
After a bit is digging and work, I finally got my script to identify the private posts and to selectively remove them on a conditional basis from the option_name = “ws_plugin__s2member_options” settings.
Objective: I want to make all private posts public after a certain defined number of weeks of being restricted.
My script re-writes the “level0_posts”, “level1_posts”, “level2_posts”, “level3_posts”, and “level4_posts” perfectly.
However, when I run the script I get the following errors and my query fails to update the wp_options table:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘options_checksum”;s:32:”620f01dcca7b6b9fe1508dacab099e37″;s:15:”options_version”‘ at line 2
Can anyone assist on how to resolve this error?
Plus here are posts on the S2 restriction array that no longer exist in the WordPress posts table. How do I remove them from S2 and sync to my WP tables?
Thank you.
The topic ‘How to identify S2Member protected Posts’ is closed to new replies.