The plugin is this :https://wordpress.org/plugins/content-warning-v2/
and I dont want to show it for logged-in users.
Plugin developer told me: https://wordpress.org/support/topic/how-to-dont-show-this-box-to-logged-in-users/#post-8411866
Basically instead of checking for post ID, look for if the user is logged in.
On this code:
/**
* Maybe Show Dialog
* @param bool $bool Default true
* @param WP_Post $post_ob A WP_Post object
* @return bool True to show the dialog, false to hide it.
*/
function maybe_show_dialog( $bool = true, $post_ob = null ) {
if ( isset( $post_obj->ID ) && 1 == $post_obj->ID ) {
return false;
}
return $bool;
}
add_filter( 'cwv3_should_gate', 'maybe_show_dialog', 10, 2 );
So, how can I do that? How to change looking for post id php code to users logged in on the above code?
if ( isset( $post_obj->ID ) && 1 == $post_obj->ID ) {
is the bit checking post ID, I see you mention your PHP skills are weak, but any answer you get here will be a technical answer assuming basic PHP skills