Title: Tablepress row filter using userid
Last modified: July 1, 2020

---

# Tablepress row filter using userid

 *  Resolved [kent3205](https://wordpress.org/support/users/kent3205/)
 * (@kent3205)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/)
 * Hi, I am very new to WordPress and only have a basic understanding so any help
   greatly appreciated. I have created a table in TablePress and have installed 
   Row Filtering extension. The table has rows of data which apply to many users.
   The second column matches a users userid which is a 4 digit number. The row filter
   is working well when I use the command [table id=52 filter=”9999″ filter_columns
   =”2″ filter_full_cell_match=”true” /] where 9999 is the persons userid. My question
   is how do I obtain the userid for the particular user who is logged in and insert
   it into this code. I tried [table id=52 filter=get_current_user_id() filter_columns
   =”2″ filter_full_cell_match=”true” /] however no luck. Many thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/#post-13059263)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * You could define a wrapper Shortcode, like this: [https://wordpress.org/support/topic/tablepress-show-only-table-rows-that-contain-current-logged-in-user-id/#post-11261133](https://wordpress.org/support/topic/tablepress-show-only-table-rows-that-contain-current-logged-in-user-id/#post-11261133)
 * Regards,
    Tobias
 *  Thread Starter [kent3205](https://wordpress.org/support/users/kent3205/)
 * (@kent3205)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/#post-13062631)
 * Hi Tobias
 * Tank you very much for our response. Sorry I didn’t manage to find that in my
   searching. The plugin and extension are great and work really well.
 * I am using the Shortcode and it has worked well. I have loaded it using the Snippets
   plugin. (I am not confident enough to edit the .php file.)
 * The only strange things is that when I have the snippet active and I try to edit
   the page with the table, I get the message “There has been a critical error on
   your website. Please check your site admin email inbox for instructions.” When
   I turn off the snippet I can see the page fine.
 * It doesn’t seem to impact the operation of the site though.
 * Again many thanks
    Kent
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/#post-13062828)
 * Hi,
 * I could imagine that this is related to scoping issues, i.e. whether the request
   is in the admin or frontend. You could maybe put the entire code in an extra 
   check:
 *     ```
       if ( ! is_admin() ) {
         // Current code goes here.
       }
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [kent3205](https://wordpress.org/support/users/kent3205/)
 * (@kent3205)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/#post-13063009)
 * Thanks Tobias
 * You really know your WordPress! Reading your code made me realise in snippet 
   I have the option selected to run code everywhere vs just front end. Changing
   that I think effectively did the same thing.
 * Again many thanks
 * Kent
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/#post-13063599)
 * Hi,
 * yes, that’s probably the same thing 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Tablepress row filter using userid’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/tablepress-row-filter-using-userid/#post-13063599)
 * Status: resolved