Make WordPress Core


Ignore:
Timestamp:
09/20/2015 03:25:45 AM (11 years ago)
Author:
wonderboymusic
Message:

The 'get_sample_permalink_html' filter​'s second parameter can be a post ID or a post object. This is confusing. We should pass the post ID and post object separately, for consistency with 'get_sample_permalink' filter added in [34309].

Props SergeyBiryukov.
Fixes #33927.

File:
1 edited

Legend:

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

    r34324 r34347  
    13511351         *
    13521352         * @since 2.9.0
    1353          *
    1354          * @param string      $return    Sample permalink HTML markup.
    1355          * @param int|WP_Post $id        Post object or ID.
    1356          * @param string      $new_title New sample permalink title.
    1357          * @param string      $new_slug  New sample permalink slug.
     1353         * @since 4.4.0 Added `$post` parameter.
     1354         *
     1355         * @param string  $return    Sample permalink HTML markup.
     1356         * @param int     $post_id   Post ID.
     1357         * @param string  $new_title New sample permalink title.
     1358         * @param string  $new_slug  New sample permalink slug.
     1359         * @param WP_Post $post      Post object.
    13581360         */
    1359         $return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug );
     1361        $return = apply_filters( 'get_sample_permalink_html', $return, $post->ID, $new_title, $new_slug, $post );
    13601362
    13611363        return $return;
Note: See TracChangeset for help on using the changeset viewer.