Take the tour ×

I have a custom meta box added to the Page edit screen. I also have categories turned on for Pages.

I'm using get_categories($post->ID); to retrieve a list of categories, as you would in a page template, but it returns a list of all categories instead of just the ones selected.

Is it possible to only return selected categories?

Thank you.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Figured it out, I was using the wrong function.

Correct function was get_the_category_by_ID($cat);

share|improve this answer
add comment

Your Answer


