WordPress.org

Make WordPress Core

Ticket #10912: 10912.diff

File 10912.diff, 1.2 KB (added by scribu, 9 years ago)
  • rewrite.php

     
    4646}
    4747
    4848/**
     49 * Add permalink structure.
     50 *
     51 * Warning: you must call this on init or earlier, otherwise the query var
     52 * addition stuff won't work.
     53 *
     54 * @since 2.9.0
     55 *
     56 * @param string $name Name for permalink structure.
     57 * @param string $struct Permalink structure.
     58 * @param bool $with_front Prepend front base to permalink structure.
     59 */
     60function add_permastruct($name, $struct, $with_front = true) {
     61        global $wp_rewrite;
     62
     63        return $wp_rewrite->add_permastruct($name, $struct, $with_front);
     64}
     65
     66/**
    4967 * Add a new feed type like /atom1/.
    5068 *
    5169 * @since 2.1.0
     
    6785}
    6886
    6987/**
     88 * Remove rewrite rules and then recreate rewrite rules.
     89 *
     90 * @see WP_Rewrite::flush_rules()
     91 *
     92 * @since 2.9.0
     93 *
     94 * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard).
     95 */
     96function flush_rewrite_rules($hard = true) {
     97        global $wp_rewrite;
     98        $wp_rewrite->flush_rules($hard);
     99}
     100
     101/**
    70102 * Endpoint Mask for Permalink.
    71103 *
    72104 * @since 2.1.0