WordPress.org

Ready to get started?Download WordPress

Forums

How to get category ids attached to a post? (1 post)

  1. jeffb0
    Member
    Posted 4 years ago #

    What's the best way to get all category ids that are attached to a single post?

    Been playing around with get_the_terms() and wp_get_post_terms(), but just wondering if there is a simpler way that some of you plugin gurus know about?

    Thanks!
    -j

    EDIT:

    Just found out they can be accessed like this:

    var_dump( $wp_object_cache->cache[ 'category' ] );
    var_dump( $wp_object_cache->cache[ 'post_tag' ] );

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags