WordPress.org

Make WordPress Core

Changeset 25697


Ignore:
Timestamp:
10/06/2013 12:55:38 PM (6 years ago)
Author:
nacin
Message:

Run _fix_attachment_links() when post_status is future or private in addition to publish.

Fixes regression caused by [20308].

props jond3r.
fixes #25268.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r25694 r25697  
    749749 * @access private
    750750 *
    751  * @param unknown_type $post_ID
    752  * @return unknown
    753  */
    754 function _fix_attachment_links( $post_ID ) {
    755     $post = get_post( $post_ID, ARRAY_A );
     751 * @param int|object $post Post ID or post object.
     752 * @return void|int|WP_Error Void if nothing fixed. 0 or WP_Error on update failure. The post ID on update success.
     753 */
     754function _fix_attachment_links( $post ) {
     755    $post = get_post( $post, ARRAY_A );
    756756    $content = $post['post_content'];
    757757
    758     // quick sanity check, don't run if no pretty permalinks or post is not published
    759     if ( !get_option('permalink_structure') || $post['post_status'] != 'publish' )
     758    // Don't run if no pretty permalinks or post is not published, scheduled, or privately published.
     759    if ( ! get_option( 'permalink_structure' ) || ! in_array( $post['post_status'], array( 'publish', 'future', 'private' ) ) )
    760760        return;
    761761
Note: See TracChangeset for help on using the changeset viewer.