Plugin Directory

Changeset 3091615


Ignore:
Timestamp:
05/23/2024 02:56:30 PM (23 months ago)
Author:
skyword
Message:

Fix order of operations issue

Location:
skyword-publishing-api/tags/1.1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skyword-publishing-api/tags/1.1.2/php/routes/class-skyword-posts.php

    r3091546 r3091615  
    398398            $authorTerm      = $coauthors_plus->update_author_term( $author );
    399399            $newPost['post_author'] = (int)$data['author'];
     400        }
     401
     402        // If an ID is set on newPost it will update instead of insert
     403        $postId = wp_insert_post( $newPost );
     404
     405        if ( null !== $data['author'] && null !== $coauthors_plus ) {
    400406            if ( 'post' === $postType ) {
    401407                wp_set_post_terms( $postId, $authorTerm->slug, $coauthors_plus->coauthor_taxonomy, true );
     
    405411        }
    406412
    407         // If an ID is set on newPost it will update instead of insert
    408         $postId = wp_insert_post( $newPost );
    409413        wp_set_post_tags( $postId, $tags );
    410414
  • skyword-publishing-api/tags/1.1.2/readme.txt

    r3090934 r3091615  
    2525* Accept an author ID for images
    2626* Alter image MIME types for Yoast
     27* General fixes for author attribution
    2728
    2829= 1.1.1 =
Note: See TracChangeset for help on using the changeset viewer.