WordPress.org

Make WordPress Core

Changeset 1324 in tests


Ignore:
Timestamp:
07/28/2013 10:26:59 PM (5 years ago)
Author:
nacin
Message:

Test for passing the correct argument to add_permastruct() when registering a post type.

props johnpbloch.
see #23302.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post/types.php

    r1020 r1324  
    6969        _unregister_post_type( 'foo' );
    7070    }
     71
     72    /**
     73     * @ticket 23302
     74     */
     75    function test_post_type_with_no_feed() {
     76        global $wp_rewrite;
     77        $old_permastruct = get_option( 'permalink_structure' );
     78        update_option( 'permalink_structure', '%postname%' );
     79        register_post_type( 'foo', array( 'rewrite' => array( 'feeds' => false ) ) );
     80        $this->assertFalse( $wp_rewrite->extra_permastructs['foo']['feed'] );
     81        update_option( 'permalink_structure', $old_permastruct );
     82        _unregister_post_type( 'foo' );
     83    }
    7184}
Note: See TracChangeset for help on using the changeset viewer.