Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
Version 9
MAREK ELSNER
0 points
Beginner
Hi,
I am new to WordPress and Business Directory and I am trying to develop dedicated plugin for importing data from CSV file. While using “wp_insert_post()” function I cannot add any category to listing_type posts.
I suppose this is because listing_type does not have ‘category’ taxonomy and “wp_insert_post()” is checking it:
Hi,
I am new to WordPress and Business Directory and I am trying to develop dedicated plugin for importing data from CSV file. While using “wp_insert_post()” function I cannot add any category to listing_type posts.
I suppose this is because listing_type does not have ‘category’ taxonomy and “wp_insert_post()” is checking it:
if ( is_object_in_taxonomy( $post_type, ‘category’ ) ) {
wp_set_post_categories( $post_ID, $post_category );
}
Result of “get_object_taxonomies(‘listing_type’); gives me:
Array
(
[0] => post_tag
[1] => listing
)
On the other hand I see / can add “categories” in “Listing Manager” in WordPress admin panel.
Can you tell me what can be a problem ?
Members Only Content
This reply is for PremiumPress customers only.
Login NowMembers Only Content
This reply is for PremiumPress customers only.
Login Now