Make WordPress Core

Changeset 25028


Ignore:
Timestamp:
08/15/2013 04:24:08 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Avoid PHP notices in get_sample_permalink() and get_sample_permalink_html(). Remove unused global reference. props ocean90. fixes #25005.

File:
1 edited

Legend:

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

    r24884 r25028  
    997997 */
    998998function get_sample_permalink($id, $title = null, $name = null) {
    999     $post = get_post($id);
    1000     if ( !$post->ID )
    1001         return array('', '');
     999    $post = get_post( $id );
     1000    if ( ! $post )
     1001        return array( '', '' );
    10021002
    10031003    $ptype = get_post_type_object($post->post_type);
     
    10591059 */
    10601060function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
    1061     global $wpdb;
    1062     $post = get_post($id);
     1061    $post = get_post( $id );
     1062    if ( ! $post )
     1063        return '';
    10631064
    10641065    list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
Note: See TracChangeset for help on using the changeset viewer.