Changeset 59665
- Timestamp:
- 01/20/2025 02:30:02 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r59664 r59665 6088 6088 6089 6089 $categories = array(); 6090 $cat ids= wp_get_post_categories( $post_id );6091 foreach ( $cat ids as $catid ) {6092 $categories[] = get_cat_name( $cat id );6090 $cat_ids = wp_get_post_categories( $post_id ); 6091 foreach ( $cat_ids as $cat_id ) { 6092 $categories[] = get_cat_name( $cat_id ); 6093 6093 } 6094 6094 … … 6240 6240 6241 6241 $categories = array(); 6242 $cat ids= wp_get_post_categories( $entry['ID'] );6243 foreach ( $cat ids as $catid ) {6244 $categories[] = get_cat_name( $cat id );6242 $cat_ids = wp_get_post_categories( $entry['ID'] ); 6243 foreach ( $cat_ids as $cat_id ) { 6244 $categories[] = get_cat_name( $cat_id ); 6245 6245 } 6246 6246 … … 6640 6640 6641 6641 $categories = array(); 6642 $cat ids= wp_get_post_categories( (int) $post_id );6642 $cat_ids = wp_get_post_categories( (int) $post_id ); 6643 6643 // First listed category will be the primary category. 6644 $is Primary = true;6645 foreach ( $cat ids as $catid ) {6644 $is_primary = true; 6645 foreach ( $cat_ids as $cat_id ) { 6646 6646 $categories[] = array( 6647 'categoryName' => get_cat_name( $cat id ),6648 'categoryId' => (string) $cat id,6649 'isPrimary' => $is Primary,6647 'categoryName' => get_cat_name( $cat_id ), 6648 'categoryId' => (string) $cat_id, 6649 'isPrimary' => $is_primary, 6650 6650 ); 6651 $is Primary= false;6651 $is_primary = false; 6652 6652 } 6653 6653 … … 6694 6694 } 6695 6695 6696 $cat ids = array();6696 $cat_ids = array(); 6697 6697 foreach ( $categories as $cat ) { 6698 $cat ids[] = $cat['categoryId'];6699 } 6700 6701 wp_set_post_categories( $post_id, $cat ids );6698 $cat_ids[] = $cat['categoryId']; 6699 } 6700 6701 wp_set_post_categories( $post_id, $cat_ids ); 6702 6702 6703 6703 return true;
Note: See TracChangeset
for help on using the changeset viewer.