WordPress.org

Make WordPress Core

Ticket #45121: 45121.diff

File 45121.diff, 590 bytes (added by kaggdesign, 10 months ago)
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index c9d1edbe67..55537c8b0b 100644
    function wp_update_post( $postarr = array(), $wp_error = false ) { 
    38173817        if ($postarr['post_type'] == 'attachment')
    38183818                return wp_insert_attachment($postarr);
    38193819
     3820        if ( isset( $postarr['tags_input'] ) ) {
     3821                $tags = get_the_terms( $postarr['ID'], 'post_tag' );
     3822                if ( ! empty( $tags ) ) {
     3823                        $postarr['tags_input'] = wp_list_pluck( $tags, 'term_id' );
     3824                }
     3825        }
     3826
    38203827        return wp_insert_post( $postarr, $wp_error );
    38213828}
    38223829