Changeset 2410
- Timestamp:
- 03/05/2005 06:13:31 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r2332 r2410 859 859 860 860 $this->date_structure = ''; 861 $date_endian = ''; 861 862 862 863 foreach ($endians as $endian) { 863 864 if (false !== strpos($this->permalink_structure, $endian)) { 864 $ this->date_structure = $this->front .$endian;865 $date_endian= $endian; 865 866 break; 866 867 } 867 868 } 869 870 if ( empty($date_endian) ) 871 $date_endian = '%year%/%monthnum%/%day%'; 868 872 869 873 // Do not allow the date tags and %post_id% to overlap in the permalink 870 874 // structure. If they do, move the date tags to $front/date/. 871 875 $front = $this->front; 872 if ( false !== strpos($this->permalink_structure, $this->front . '%post_id%') ) 873 $front = $front . 'date/'; 874 875 if (empty($this->date_structure)) { 876 $this->date_structure = $front . '%year%/%monthnum%/%day%'; 877 } 876 preg_match_all('/%.+?%/', $this->permalink_structure, $tokens); 877 $tok_index = 1; 878 foreach ($tokens[0] as $token) { 879 if ( ($token == '%post_id%') && ($tok_index <= 3) ) { 880 $front = $front . 'date/'; 881 break; 882 } 883 } 884 885 $this->date_structure = $front . $date_endian; 878 886 879 887 return $this->date_structure;
Note: See TracChangeset
for help on using the changeset viewer.