Changeset 13773
- Timestamp:
- 03/20/2010 02:05:32 AM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r13770 r13773 791 791 792 792 // Args prefixed with an underscore are reserved for internal use. 793 $defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null );793 $defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'permalink_epmask' => EP_NONE ); 794 794 $args = wp_parse_args($args, $defaults); 795 795 $args = (object) $args; … … 856 856 $args->rewrite['with_front'] = true; 857 857 $wp_rewrite->add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 858 $wp_rewrite->add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'] );858 $wp_rewrite->add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->permalink_epmask); 859 859 } 860 860 -
trunk/wp-includes/rewrite.php
r13769 r13773 55 55 * @param bool $with_front Prepend front base to permalink structure. 56 56 */ 57 function add_permastruct( $name, $struct, $with_front = true ) {57 function add_permastruct( $name, $struct, $with_front = true, $ep_mask = EP_NONE ) { 58 58 global $wp_rewrite; 59 return $wp_rewrite->add_permastruct( $name, $struct, $with_front );59 return $wp_rewrite->add_permastruct( $name, $struct, $with_front, $ep_mask ); 60 60 } 61 61 … … 1084 1084 1085 1085 if ( isset($this->extra_permastructs[$name]) ) 1086 return $this->extra_permastructs[$name] ;1086 return $this->extra_permastructs[$name][0]; 1087 1087 1088 1088 return false; … … 1360 1360 $ep_mask_specific = EP_DAY; 1361 1361 break; 1362 default: 1363 $ep_mask_specific = EP_NONE; 1362 1364 } 1363 1365 … … 1612 1614 1613 1615 // Extra permastructs 1614 foreach ( $this->extra_permastructs as $permastruct ) 1615 $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct, EP_NONE)); 1616 foreach ( $this->extra_permastructs as $permastruct ) { 1617 if ( is_array($permastruct) ) 1618 $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct[0], $permastruct[1])); 1619 else 1620 $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct, EP_NONE)); 1621 } 1616 1622 1617 1623 // Put them together. … … 1907 1913 * @param bool $with_front Prepend front base to permalink structure. 1908 1914 */ 1909 function add_permastruct($name, $struct, $with_front = true ) {1915 function add_permastruct($name, $struct, $with_front = true, $ep_mask = EP_NONE) { 1910 1916 if ( $with_front ) 1911 1917 $struct = $this->front . $struct; 1912 $this->extra_permastructs[$name] = $struct;1918 $this->extra_permastructs[$name] = array($struct, $ep_mask); 1913 1919 } 1914 1920
Note: See TracChangeset
for help on using the changeset viewer.