如何获取特定Wordpress页面分配的类别列表?

I can't seem to find an answer anywhere on the web to this, on posts i can do this, i'm sure there is a native Wordpress function for this. In Wordpress when your editing a "Page" and i mean a "Page" not a "Post", you can assign the page to one or more categories.

I would like to be able to get a list of the categories to which the page is signed to. I know i could ask the DATABASE directly but i'm sure there is native way to do this. After all it's allready implemented in the wordpress own editor.

Im looking for something like this:

$array = get_the_pages_categories($pageID);

Thanks!

Frist: wp dont have default category for page so you have to create custom taxonomy for page.

register_taxonomy( $taxonomy, $object_type, $args );

check this https://developer.wordpress.org/reference/functions/register_taxonomy/

Next: get that categoies list

$page_terms = get_the_terms( $page_id, $taxonomy );

check this https://developer.wordpress.org/reference/functions/get_the_terms/

i think it will be helpful for you.