Ticket #22352: link-template.php.patch
| File link-template.php.patch, 978 bytes (added by doublesharp, 8 months ago) |
|---|
-
link-template.php
75 75 * 76 76 * @param int $id Optional. Post ID. 77 77 * @param bool $leavename Optional, defaults to false. Whether to keep post name or page name. 78 * @param string $permalink_structure Optional, the permalink structure to use instead of the current permalink structure. 78 79 * @return string 79 80 */ 80 function get_permalink( $id = 0, $leavename = false ) {81 function get_permalink( $id = 0, $leavename = false, $permalink_structure = false ) { 81 82 $rewritecode = array( 82 83 '%year%', 83 84 '%monthnum%', … … 110 111 elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) 111 112 return get_post_permalink($post->ID, $leavename, $sample); 112 113 113 $permalink = get_option('permalink_structure');114 $permalink = (!empty($permalink_structure))? $permalink_structure : get_option('permalink_structure'); 114 115 115 116 $permalink = apply_filters('pre_post_link', $permalink, $post, $leavename); 116 117