Viewing 10 replies - 1 through 10 (of 10 total)
  • Jay

    (@phyrax)

    Thread Starter gameslopedy

    (@yiggory)

    How can I do that thing?

    Could you please change that code for logged-in users? My php experience is so weak. Please help me.

    Thread Starter gameslopedy

    (@yiggory)

    /**
     * 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 ( is_user_logged_in() ) {
            return false;
        }
    
        return $bool;
    }
    add_filter( 'cwv3_should_gate', 'maybe_show_dialog', 10, 2 );

    Ive changed that code with this , is that correct for logged-in users?
    and where to put it? in functions.php?

    Jay

    (@phyrax)

    Looks about right yes.

    Thread Starter gameslopedy

    (@yiggory)

    I put it in plugins file.
    Shall I put it in my child theme’s function php?

    Thread Starter gameslopedy

    (@yiggory)

    It works when I put that code into plugin’s file footer.
    But it doesnt work when I put that code into my child theme functions.php.

    If you update your plugin my code will be removed. How can I prevent this?

    Jay

    (@phyrax)

    If you update the plugin, yes, it will be removed. It should be put in the theme functions.php file. If it does not work with your current theme try the default to see if it’s theme related.

    Thread Starter gameslopedy

    (@yiggory)

    I am already using twenty fifteen theme so its a default theme. Which place should I put that code into my child theme functions php ?
    Or is there a way to create child plugin?

    Jay

    (@phyrax)

    The code should go in your functions.php file, and there is no easy way to create a child plugin.

    Thread Starter gameslopedy

    (@yiggory)

    In which location on functions.php? upper ones or below? thanks maybe i cannot put the code into the correct place in child theme functions.php, thats why its not working on functions..?

    Or could you please add this code as an option in the future release of this plugin? I am ready to help you to improve this plugin .

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to dont show this box to logged in users?’ is closed to new replies.