Title: Custom filter hook usage
Last modified: April 3, 2018

---

# Custom filter hook usage

 *  [mhamblin](https://wordpress.org/support/users/mhamblin/)
 * (@mhamblin)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-filter-hook-usage/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-filter-hook-usage%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 * ![](https://s.w.org/plugins/geopattern-icon/if-shortcode.svg)
 * [If Shortcode](https://wordpress.org/plugins/if-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/if-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/if-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/if-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/if-shortcode/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mhamblin](https://wordpress.org/support/users/mhamblin/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/custom-filter-hook-usage/)
 * Status: not resolved