Make WordPress Core


Ignore:
Timestamp:
02/21/2008 08:19:34 PM (17 years ago)
Author:
ryan
Message:

Slug edit for pages. Hide advanced slug field if JS enabled. Trigger first autosave after 15 chars. Set autosave interval to 60s. Props filosofo. see #5749

File:
1 edited

Legend:

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

    r6777 r6955  
    6464
    6565    if ( $post->post_type == 'page' )
    66         return get_page_link($post->ID);
     66        return get_page_link($post->ID, $leavename);
    6767    elseif ($post->post_type == 'attachment')
    6868        return get_attachment_link($post->ID);
     
    119119
    120120// Respects page_on_front.  Use this one.
    121 function get_page_link($id = false) {
     121function get_page_link($id = false, $leavename = false) {
    122122    global $post;
    123123
     
    129129        $link = get_option('home');
    130130    else
    131         $link = _get_page_link( $id );
     131        $link = _get_page_link( $id , $leavename );
    132132
    133133    return apply_filters('page_link', $link, $id);
     
    135135
    136136// Ignores page_on_front.  Internal use only.
    137 function _get_page_link( $id = false ) {
     137function _get_page_link( $id = false, $leavename = false ) {
    138138    global $post, $wp_rewrite;
    139139
     
    147147    if ( '' != $pagestruct && isset($post->post_status) && 'draft' != $post->post_status ) {
    148148        $link = get_page_uri($id);
    149         $link = str_replace('%pagename%', $link, $pagestruct);
     149        $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct);
    150150        $link = get_option('home') . "/$link";
    151151        $link = user_trailingslashit($link, 'page');
Note: See TracChangeset for help on using the changeset viewer.