• Hi there,

    I’m trying to extend your nice plugin with a custom filter hook.

    I’m trying to show some content on a singular post that only shows up if the post author is viewing the post, so they can edit and view some statistics on the post. But I am having trouble…

    Here’s the code I used, in my functions.php file:

    add_filter($if_shortcode_filter_prefix.'current_user_is_author','my_condition_evaluator');
    
    function my_condition_evaluator($value)
        {
        $evaluate=current_user_can('author');
        return $evaluate;
        }

    First, do I have the general syntax correct?
    Second, do you know if my evaluation criteria of current_user_can(‘author’) will work for this? I’m using the shortcode on a singular post.

    Thanks!

    The page I need help with: [log in to see the link]

  • The topic ‘Custom filter hook usage’ is closed to new replies.