WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/06/2004 02:18:37 AM (15 years ago)
Author:
rboren
Message:

Page/subpage URIs.

File:
1 edited

Legend:

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

    r1695 r1752  
    5050    }
    5151
     52    if ($idpost->post_status == 'static') {
     53        return get_page_link();
     54    }
     55   
    5256    $permalink = get_settings('permalink_structure');
    5357
    5458    if ('' != $permalink) {
    55         if ($idpost->post_status == 'static')
    56             $permalink = page_permastruct();
    57 
    5859        $unixtime = strtotime($idpost->post_date);
    5960
     
    7980    } else { // if they're not using the fancy permalink option
    8081        $permalink = get_settings('home') . '/' . get_settings('blogfilename') . '?p=' . $idpost->ID;
    81         if ($idpost->post_status == 'static')
    82             $permalink .=  '&static=1';
    8382        return $permalink;
    8483    }
     84}
     85
     86function get_page_link($id = false) {
     87    global $post;
     88
     89    if (! $id) {
     90        $id = $post->ID;
     91    }
     92
     93    $permalink = get_settings('permalink_structure');
     94
     95    if ('' != $permalink) {
     96        $link = get_page_uri($id);
     97        $link = get_settings('home') . "/$link/";
     98    } else {
     99        $link = get_settings('home') . "/index.php?p=$id&static=1";
     100    }
     101
     102    return $link;
    85103}
    86104
Note: See TracChangeset for help on using the changeset viewer.