Make WordPress Core


Ignore:
Timestamp:
11/10/2005 11:25:39 PM (19 years ago)
Author:
ryan
Message:

Add radio button for our default permalink structure. Add got_mod_rewrite(). Props Mark Jaquith. fixes #1840

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-permalink.php

    r2762 r3029  
    104104<?php
    105105$prefix = '';
    106 if ( !$is_apache )
     106
     107if ( ! got_mod_rewrite() )
    107108    $prefix = '/index.php';
     109
     110$structures = array(
     111    '',
     112    $prefix . '/%year%/%monthnum%/%day%/%postname%/',
     113    $prefix . '/archives/%post_id%'
     114    );
    108115?>
    109116<form name="form" action="options-permalink.php" method="post">
     
    111118<p>
    112119    <label>
    113 <input name="selection" type="radio" value="<?php echo $prefix; ?>/%year%/%monthnum%/%day%/%postname%/" class="tog" <?php checked( $prefix . '/%year%/%monthnum%/%day%/%postname%/', $permalink_structure); ?> />
    114 <?php _e('Date and name based, example:'); ?> <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code>
     120<input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> />
     121<?php _e('Default'); ?><br /> <span> &raquo; <code><?php echo get_settings('home'); ?>/?p=123</code></span>
    115122   </label>
    116123</p>
    117124<p>
    118125    <label>
    119 <input name="selection" type="radio" value="<?php echo $prefix; ?>/archives/%post_id%" class="tog" <?php checked( $prefix . '/archives/%post_id%', $permalink_structure); ?> />
    120 <?php _e('Numeric, example:'); ?> <code><?php echo get_settings('home') . $prefix  ; ?>/archives/123</code>
     126<input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> />
     127<?php _e('Date and name based'); ?><br /> <span> &raquo; <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>
     128   </label>
     129</p>
     130<p>
     131    <label>
     132<input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> />
     133<?php _e('Numeric'); ?><br /> <span> &raquo; <code><?php echo get_settings('home') . $prefix  ; ?>/archives/123</code></span>
    121134   </label>
    122135</p>
     
    124137<label>
    125138<input name="selection" type="radio" value="custom" class="tog"
    126 <?php if ( $permalink_structure != $prefix . '/archives/%post_id%' && $permalink_structure != $prefix . '/%year%/%monthnum%/%day%/%postname%/' ) { ?>
     139<?php if ( !in_array($permalink_structure, $structures) ) { ?>
    127140checked="checked"
    128141<?php } ?>
Note: See TracChangeset for help on using the changeset viewer.