Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8879105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:52:39+00:00 2026-06-14T19:52:39+00:00

I want to list some pod items on front end. To do this I

  • 0

I want to list some pod items on front end. To do this I am normally using pods shortcode. To filter the data I use where attribute inside pods shortcode. For example:

[pods name="salon" where="author.ID = '2'"]
    <li>{@name}</li>
[/pods]

I want to filter pod items by the author.ID. The user should see the pod items that are created by himself. It is possible to access the current user by wordpress api
global $current_user;. Also it is possible to get it by using magic tags of Pods {@user.ID}.

But the problem is I cannot use php code or magic tags inside shortcode such as this:

[pods name="salon" where="author.ID = '{@user.ID}'"]

I am looking for a way to overcome this problem.

I thought maybe I can write a new shortcode function where I can get the current user’s id and then call the pods shortcode function such as this:

function pods_by_current_user($atts) {
    $current_user = wp_get_current_user();
    $user_id = $current_user->ID;
    // put it into 'where' attribute and delegate to the "pods" function

Do you think that this is the right way to solve this problem? And do you know how to put $user_id into $atts and delegate the rest to the actual pods shortcode function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:52:40+00:00Added an answer on June 14, 2026 at 7:52 pm

    In your pods_by_current_user function, try doing:

    $atts[ 'where' ] = 'author.ID = ' . (int) $user_id;

    and then return the normal Pods shortcode:

    return pods_shortcode( $atts );

    This will let you use any of the normal [pods] shortcode attributes as usual, but will set the ‘where’ to automatically limit to the current user ID. I’m sure you can make this more complex, but that will do what you’re after.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to keep some data which is checkhed in array list. I added
For some reason this isn't working? I want to fill the ul#list with some
I want to ship some default data with my app. This data can be
I have list of some data items. Each has a method GetStyle which returns
I want to make a list from some data that I have in my
So I have an unordered list with some list-items. I want to show and
I want to clear the contents of some std::list . The order of removing
Semantically, I want an itemized list, but visually I just want some space. How
I want to have some kind of single list that is initialized in a
I want to make a long list short by hiding some elements in long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.