• Resolved amytrecgb

    (@amytrecgb)


    I’m using a shortcode to display a list of Pods for the current logged in user however when I use the special magic tag {@user.id} I get the following sql error:

    Database Error; SQL: SELECT DISTINCT t.* FROM wp_posts AS t WHERE ( ( post_author = {@user.ID} ) AND ( t.post_type = “horse” ) AND ( t.post_status IN ( “publish” ) ) ) ORDER BY t.menu_order, t.post_title, t.post_date LIMIT 0, 15; Response: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘@user.id} ) AND ( t.post_type = “horse” ) AND ( t.post_status IN ( “‘ at line 7

    I have used the Pods Shortcode builder to create the shortcode and it works if I don’t use the where clause, however I need to restrict the display of the horses pod type to the current logged in user.

    Is there something extra that needs to be done in order for me to get the current logged in user id to be able to execute this query correctly?

    Many thanks for any help
    Amy

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Restricting Content to Custom Pod to Current logged in User’ is closed to new replies.