Make WordPress Core

Changeset 16789


Ignore:
Timestamp:
12/08/2010 07:51:40 AM (14 years ago)
Author:
scribu
Message:

Use has_archive in get_post_type_archive_link(). See #13818

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r16475 r16789  
    837837        return false;
    838838
    839     if ( ! is_array( $post_type_obj->rewrite ) || false === $post_type_obj->rewrite['archive'] )
     839    if ( ! $post_type_obj->has_archive )
    840840        return false;
    841841
    842     if ( get_option( 'permalink_structure' ) ) {
    843         $struct = ( true === $post_type_obj->rewrite['archive'] ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->rewrite['archive'];
     842    if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {
     843        $struct = $post_type_obj->rewrite['slug'];
    844844        if ( $post_type_obj->rewrite['with_front'] )
    845845            $struct = $wp_rewrite->front . $struct;
Note: See TracChangeset for help on using the changeset viewer.