Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buddydev_add_default_category_to_post( $post_id ) {
- $tax = array_filter( $_POST['tax_input'] );
- if( empty( $tax ) && $post_id ) {
- //no category was set
- $term = 79;//ID
- wp_set_object_terms( $post_id, $term, 'category' );
- }
- }
- function buddyblog_show_custom_cats( $settings ) {
- $tax = array();
- $tax['category'] = array(
- 'taxonomy' => 'category',
- 'view_type' => 'dd',
- 'child_of' => 91, //CHAGE It with the correct ID,
- 'orderby' => 'slug',
- 'order' => 'ASC'
- );
- $settings['tax'] = $tax;
- return $settings;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement