Replace all post and page content programatically
-
Question… I’ve been looking at the
add_action('template_redirect', 'vidyen_check_lock_cookie');
and other hooks for a plugin that requires the user to accept (its a bit different that GDPR though) but it won’t show any content or pages until they click the button to agree.The headers and side bars should be fine but I want to replace every singe pages and post with the message they must agree and then click the button.
I’m trying to make a content locker so its not just blocked by a js script but rather the php simply won’t load the content so I can’t be bypassed by the client.
The
template_redirect
is around the area, but I still want to load the theme but inject right before the content loads and replace the post and page contents until the cookie or other if conditions has been met.What add_action should I go with?
Thanks!
- The topic ‘Replace all post and page content programatically’ is closed to new replies.