Hey guys,
So I’m trying to hide the add listing buttons if you are not signed in on the page.
I tried this code snippet from a different topic but now it just doesn’t show the button even if I’m signed in as an administrator.
This is the code snippet I’m using and it’s not working.
add_filter(
'hivepress/v1/templates/site_header_block',
function( $template ) {
if(is_user_logged_in()){
$template = hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'listing_submit_link' => [
'type' => 'content',
],
],
]
);
}else{
$template = hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'listing_submit_link' => [
'type' => 'content',
],
],
]
);
}
return $template;
},
1000
);