October 2, 2012 at 2:22 am #7531
Hi guys, I am developing a site which uses custom post types, each with a number of meta boxes for product data. A sample can be seen at [http://18.104.22.168/~advantag/wordpress/carpets/revamp/cruzin/]
The following sections are generated from custom meta boxes:
– Available Colours
– Warranty and Installation
The post has been set to Protected with only certain membership levels able to access it.
The description underneath the page title (before the HR line) is protected as expected. Can you explain why the meta box data is viewable to the public?
Thanks in advance for your assistance,
AdamOctober 2, 2012 at 4:06 am #49925
i am assuming you are using another plugin to generate metabox contents.
Wordpress has a filter called “the_content” and expected behavior is that all post/page contents pass through it.
eMember only takes care of contents that go through “the_content” filter.
If the other plugin you are using, doesn’t invoke “the_content”, eMember cannot protect it.
Thanks,October 2, 2012 at 6:24 am #49926
Thanks for your reply,
No plugins – the meta boxes were created using the native add_meta_box function.
Is there a way to make eMember look after this? Custom meta boxes (basically specified custom fields) are a big advantage with WordPress; would be a shame if eMember doesn’t protect these by default.
AdamOctober 3, 2012 at 2:50 am #49927
Lets try and change the filtering priority to see how that goes. Can you open the wp_eMember1.php file and go to line number 288 which looks like :Code:add_filter(‘the_content’,’secure_content’, 11);
replace it with:Code:add_filter(‘the_content’,’secure_content’, 1000);
let me know the result.October 3, 2012 at 12:28 pm #49928
No change, sorry.
I am working with add_filter to see if I can hook the meta box data into the_content, but it might take a big rewrite. Will see how I go.
If any other ideas come to mind, please do share!
AdamOctober 3, 2012 at 7:50 pm #49929
when you are outputting metabox content, Can you do someting like this:Code:apply_filters(‘the_content’, get_post_meta($post->ID, ‘meta_box_name’, true));
replace ‘meta_box_name’ as u need. let me know the result.October 4, 2012 at 9:33 am #49930October 5, 2012 at 11:31 pm #49931
Still no success, but the problem was how the filter was appending the meta boxes to the_content. Even though I used concatenation, the meta box data was overwriting the_content.
I have given up on this and sought another way to satisfy the project requirements. Thanks for your help. Perhaps a future upgrade can address this problem?November 4, 2012 at 10:36 pm #49932vithefiddlerMember
I’m having this same issue, except I’m using the genesis theme framework, and using the genesis hook genesis_post_content.
I tried to add a filter for genesis_post_content after the the_content line. (currently line 300 in the wp_Emember1.php file.
Looking in your file, it looks like that secure content runs on a post is auth_check post. I’m thinking that I might be able manually return auth_check_post on my content function.
Will this take care of it, or is there more that needs to be done to secure the content?
Thanks!November 4, 2012 at 11:19 pm #49933
if i understood your problem right then manually returning auth_check_post should work. let me know how you go.
- You must be logged in to reply to this topic.