Make WordPress Core


Ignore:
Timestamp:
11/17/2022 06:13:47 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Update various DocBlocks and inline comments per the documentation standards.

Includes minor formatting edits for consistency.

Follow-up to [53/tests], [12179], [12946], [35288], [37884], [38810], [38928], [46596], [48131], [52955], [53548], [53813], [53873], [54118], [54316], [54420], [54421], [54803].

See #56792.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r54754 r54855  
    660660        ) {
    661661            /*
    662              * `wp_unique_post_slug()` returns the same
    663              * slug for 'draft' or 'pending' posts.
     662             * `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts.
    664663             *
    665              * To ensure that a unique slug is generated,
    666              * pass the post data with the 'publish' status.
     664             * To ensure that a unique slug is generated, pass the post data with the 'publish' status.
    667665             */
    668666            $prepared_post->post_name = wp_unique_post_slug(
     
    863861
    864862        /*
    865          * `wp_unique_post_slug()` returns the same
    866          * slug for 'draft' or 'pending' posts.
    867          *
    868          * To ensure that a unique slug is generated,
    869          * pass the post data with the 'publish' status.
     863         * `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts.
     864         *
     865         * To ensure that a unique slug is generated, pass the post data with the 'publish' status.
    870866         */
    871867        if ( ! empty( $post->post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) {
    872868            $post_parent     = ! empty( $post->post_parent ) ? $post->post_parent : 0;
    873             $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, 'publish', $post->post_type, $post_parent );
     869            $post->post_name = wp_unique_post_slug(
     870                $post->post_name,
     871                $post->ID,
     872                'publish',
     873                $post->post_type,
     874                $post_parent
     875            );
    874876        }
    875877
Note: See TracChangeset for help on using the changeset viewer.