Support » Themes and Templates » More conditional tags?

  • Conditional Tags are quite helpful, but I am missing some tags there, e.g. comments_open(), pings_open() or have_posts().
    Do they just miss or is there another page available?

    I have searched, but could not find a list of all these tags.

    Currently I need to know if a user is permitted to edit a post (similar to edit_post_link() but this does not return true/false).


Viewing 4 replies - 1 through 4 (of 4 total)
  • If they prove to be used a lot, template tags will be added by developers. None of you suggested above is really popular at all.

    But you can always whip up your own function. Just find the function edit_post_link() in the source code and rip it off.

    The following is a portion of edit_post_link() which you can use/tailor for your purpose.


    if (user_can_edit_post($user_ID, $post->ID)) {
    // current user can edit this post

    And here’s the other two:

    comments_open() = $post->comment_status
    pings_open() = $post->ping_status

    Thanks for your responses.
    My apologies, I did not want the developers to add new conditional tags, I just was wondering if more conditional tags exist that are not mentioned in the codex.
    E.g. comments_open(), pings_open() or have_posts() are existing functions (at least on WP 2.0) and are being used by the default theme and/or the classic theme. So I was wondering:
    – Do more conditional tags exist that are not listed in the codex Conditional Tags page
    – Is there any other list of such functions somewhere available?


    I could only suggest that you look at the source code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘More conditional tags?’ is closed to new replies.