WordPress.org

Make WordPress Core

Ticket #14299: incorrect_doc_and_variable_name.14299.diff

File incorrect_doc_and_variable_name.14299.diff, 1.4 KB (added by filosofo, 8 years ago)
  • wp-includes/link-template.php

     
    168168 *
    169169 * @since 3.0.0
    170170 *
    171  * @param int $id Optional. Post ID.
     171 * @param mixed $post Optional. Post object or ID.
    172172 * @param bool $leavename Optional, defaults to false. Whether to keep post name.
    173173 * @param bool $sample Optional, defaults to false. Is it a sample permalink.
    174174 * @return string
    175175 */
    176 function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
     176function get_post_permalink( $post = 0, $leavename = false, $sample = false ) {
    177177        global $wp_rewrite;
    178178
    179         $post = &get_post($id);
     179        $post = &get_post($post);
    180180
    181181        if ( is_wp_error( $post ) )
    182182                return $post;
     
    192192        if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
    193193                if ( ! $leavename ) {
    194194                        if ( $post_type->hierarchical )
    195                                 $slug = get_page_uri($id);
     195                                $slug = get_page_uri($post);
    196196                        $post_link = str_replace("%$post->post_type%", $slug, $post_link);
    197197                }
    198198                $post_link = home_url( user_trailingslashit($post_link) );
     
    204204                $post_link = home_url($post_link);
    205205        }
    206206
    207         return apply_filters('post_type_link', $post_link, $id, $leavename, $sample);
     207        return apply_filters('post_type_link', $post_link, $post, $leavename, $sample);
    208208}
    209209
    210210/**