Archived topic
Password Protected Page showing hook
3 replies · Started by David on January 20, 2022
Hello
So I need this page to be password protected, which I've set up.
But the hook I've created for the document table, is in a hook position of generate_before_content
How can I get it so the Test archive document hook is part of the hidden password protected content.
https://cspw-org-uk.stackstaging.com/documents/archive/
Thanks
Dave
Hi there,
try this PHP Snippet:
add_filter( 'generate_element_display', function( $display, $element_id ) {
if ( 100 === $element_id && post_password_required() ) {
$display = false;
}
return $display;
}, 10, 2 );
the 100 is the Element ID, change this to match the specific element.
Excellent, thank you so much David :)
Happy to be of help