Make WordPress Core

Changeset 28533


Ignore:
Timestamp:
05/19/2014 05:40:08 PM (10 years ago)
Author:
wonderboymusic
Message:

WP_Query was only missing one access modifier.

Add access modifier (public) to applicable class methods/members of WP_Rewrite. I am not brave enough to set some of the vars to private without more testing.

See #27881, #22234.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r28523 r28533  
    34233423     * @access private
    34243424     */
    3425     function set_found_posts( $q, $limits ) {
     3425    private function set_found_posts( $q, $limits ) {
    34263426        global $wpdb;
    34273427
  • trunk/src/wp-includes/rewrite.php

    r28014 r28533  
    572572     * @var string
    573573     */
    574     var $index = 'index.php';
     574    public $index = 'index.php';
    575575
    576576    /**
     
    655655     * @var bool
    656656     */
    657     var $use_verbose_rules = false;
     657    public $use_verbose_rules = false;
    658658
    659659    /**
     
    673673     * @var bool
    674674     */
    675     var $use_verbose_page_rules = true;
     675    public $use_verbose_page_rules = true;
    676676
    677677    /**
     
    764764     * @return bool True, if permalinks are enabled.
    765765     */
    766     function using_permalinks() {
     766    public function using_permalinks() {
    767767        return ! empty($this->permalink_structure);
    768768    }
     
    778778     * @return bool
    779779     */
    780     function using_index_permalinks() {
     780    public function using_index_permalinks() {
    781781        if ( empty($this->permalink_structure) )
    782782            return false;
     
    799799     * @return bool
    800800     */
    801     function using_mod_rewrite_permalinks() {
     801    public function using_mod_rewrite_permalinks() {
    802802        if ( $this->using_permalinks() && ! $this->using_index_permalinks() )
    803803            return true;
     
    822822     * @return string
    823823     */
    824     function preg_index($number) {
     824    public function preg_index($number) {
    825825        $match_prefix = '$';
    826826        $match_suffix = '';
     
    845845     * @return array Array of page URIs as first element and attachment URIs as second element.
    846846     */
    847     function page_uri_index() {
     847    public function page_uri_index() {
    848848        global $wpdb;
    849849
     
    887887     * @return array
    888888     */
    889     function page_rewrite_rules() {
     889    public function page_rewrite_rules() {
    890890        // the extra .? at the beginning prevents clashes with other regular expressions in the rules array
    891891        $this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' );
     
    914914     * @return bool|string False on no permalink structure. Date permalink structure.
    915915     */
    916     function get_date_permastruct() {
     916    public function get_date_permastruct() {
    917917        if ( isset($this->date_structure) )
    918918            return $this->date_structure;
     
    968968     * @return bool|string False on failure. Year structure on success.
    969969     */
    970     function get_year_permastruct() {
     970    public function get_year_permastruct() {
    971971        $structure = $this->get_date_permastruct();
    972972
     
    993993     * @return bool|string False on failure. Year/Month structure on success.
    994994     */
    995     function get_month_permastruct() {
     995    public function get_month_permastruct() {
    996996        $structure = $this->get_date_permastruct();
    997997
     
    10161016     * @return bool|string False on failure. Year/Month/Day structure on success.
    10171017     */
    1018     function get_day_permastruct() {
     1018    public function get_day_permastruct() {
    10191019        return $this->get_date_permastruct();
    10201020    }
     
    10331033     * @return bool|string False on failure. Category permalink structure.
    10341034     */
    1035     function get_category_permastruct() {
     1035    public function get_category_permastruct() {
    10361036        return $this->get_extra_permastruct('category');
    10371037    }
     
    10501050     * @return bool|string False on failure. Tag permalink structure.
    10511051     */
    1052     function get_tag_permastruct() {
     1052    public function get_tag_permastruct() {
    10531053        return $this->get_extra_permastruct('post_tag');
    10541054    }
     
    10631063     * @return string|bool False if not found. Permalink structure string.
    10641064     */
    1065     function get_extra_permastruct($name) {
     1065    public function get_extra_permastruct($name) {
    10661066        if ( empty($this->permalink_structure) )
    10671067            return false;
     
    10851085     * @return string|bool False if not found. Permalink structure string.
    10861086     */
    1087     function get_author_permastruct() {
     1087    public function get_author_permastruct() {
    10881088        if ( isset($this->author_structure) )
    10891089            return $this->author_structure;
     
    11111111     * @return string|bool False if not found. Permalink structure string.
    11121112     */
    1113     function get_search_permastruct() {
     1113    public function get_search_permastruct() {
    11141114        if ( isset($this->search_structure) )
    11151115            return $this->search_structure;
     
    11371137     * @return string|bool False if not found. Permalink structure string.
    11381138     */
    1139     function get_page_permastruct() {
     1139    public function get_page_permastruct() {
    11401140        if ( isset($this->page_structure) )
    11411141            return $this->page_structure;
     
    11631163     * @return string|bool False if not found. Permalink structure string.
    11641164     */
    1165     function get_feed_permastruct() {
     1165    public function get_feed_permastruct() {
    11661166        if ( isset($this->feed_structure) )
    11671167            return $this->feed_structure;
     
    11891189     * @return string|bool False if not found. Permalink structure string.
    11901190     */
    1191     function get_comment_feed_permastruct() {
     1191    public function get_comment_feed_permastruct() {
    11921192        if ( isset($this->comment_feed_structure) )
    11931193            return $this->comment_feed_structure;
     
    12191219     * @param string $query String to append to the rewritten query. Must end in '='.
    12201220     */
    1221     function add_rewrite_tag( $tag, $regex, $query ) {
     1221    public function add_rewrite_tag( $tag, $regex, $query ) {
    12221222        $position = array_search( $tag, $this->rewritecode );
    12231223        if ( false !== $position && null !== $position ) {
     
    12511251     * @return array Rewrite rule list.
    12521252     */
    1253     function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {
     1253    public function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {
    12541254        //build a regex to match the feed section of URLs, something like (feed|atom|rss|rss2)/?
    12551255        $feedregex2 = '';
     
    15211521     * @return array
    15221522     */
    1523     function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {
     1523    public function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {
    15241524        return $this->generate_rewrite_rules($permalink_structure, EP_NONE, false, false, false, $walk_dirs);
    15251525    }
     
    15431543     * @return array An associate array of matches and queries.
    15441544     */
    1545     function rewrite_rules() {
     1545    public function rewrite_rules() {
    15461546        $rewrite = array();
    15471547
     
    17451745     * @return array Rewrite rules.
    17461746     */
    1747     function wp_rewrite_rules() {
     1747    public function wp_rewrite_rules() {
    17481748        $this->rules = get_option('rewrite_rules');
    17491749        if ( empty($this->rules) ) {
     
    17701770     * @return string
    17711771     */
    1772     function mod_rewrite_rules() {
     1772    public function mod_rewrite_rules() {
    17731773        if ( ! $this->using_permalinks() )
    17741774            return '';
     
    18681868     * @return string
    18691869     */
    1870     function iis7_url_rewrite_rules( $add_parent_tags = false ) {
     1870    public function iis7_url_rewrite_rules( $add_parent_tags = false ) {
    18711871
    18721872        if ( ! $this->using_permalinks() )
     
    19231923     * @param string $after Optional, default is bottom. Location to place rule.
    19241924     */
    1925     function add_rule($regex, $redirect, $after = 'bottom') {
     1925    public function add_rule($regex, $redirect, $after = 'bottom') {
    19261926        //get everything up to the first ?
    19271927        $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?'));
     
    19491949     * @param string $redirect URL regex redirects to when regex matches request.
    19501950     */
    1951     function add_external_rule($regex, $redirect) {
     1951    public function add_external_rule($regex, $redirect) {
    19521952        $this->non_wp_rules[$regex] = $redirect;
    19531953    }
     
    19671967     * @param string $query_var Name of the corresponding query variable. Default is value of $name.
    19681968     */
    1969     function add_endpoint( $name, $places, $query_var = null ) {
     1969    public function add_endpoint( $name, $places, $query_var = null ) {
    19701970        global $wp;
    19711971        if ( null === $query_var ) {
     
    20042004     *     - endpoints (bool) - Should endpoints be applied to the generated rewrite rules? Default is true.
    20052005     */
    2006     function add_permastruct( $name, $struct, $args = array() ) {
     2006    public function add_permastruct( $name, $struct, $args = array() ) {
    20072007        // backwards compatibility for the old parameters: $with_front and $ep_mask
    20082008        if ( ! is_array( $args ) )
     
    20432043     * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
    20442044     */
    2045     function flush_rules($hard = true) {
     2045    public function flush_rules($hard = true) {
    20462046        delete_option('rewrite_rules');
    20472047        $this->wp_rewrite_rules();
     
    20742074     * @access public
    20752075     */
    2076     function init() {
     2076    public function init() {
    20772077        $this->extra_rules = $this->non_wp_rules = $this->endpoints = array();
    20782078        $this->permalink_structure = get_option('permalink_structure');
     
    21112111     * @param string $permalink_structure Permalink structure.
    21122112     */
    2113     function set_permalink_structure($permalink_structure) {
     2113    public function set_permalink_structure($permalink_structure) {
    21142114        if ( $permalink_structure != $this->permalink_structure ) {
    21152115            $old_permalink_structure = $this->permalink_structure;
     
    21412141     * @param string $category_base Category permalink structure base.
    21422142     */
    2143     function set_category_base($category_base) {
     2143    public function set_category_base($category_base) {
    21442144        if ( $category_base != get_option('category_base') ) {
    21452145            update_option('category_base', $category_base);
     
    21602160     * @param string $tag_base Tag permalink structure base.
    21612161     */
    2162     function set_tag_base( $tag_base ) {
     2162    public function set_tag_base( $tag_base ) {
    21632163        if ( $tag_base != get_option( 'tag_base') ) {
    21642164            update_option( 'tag_base', $tag_base );
     
    21752175     * @return WP_Rewrite
    21762176     */
    2177     function __construct() {
     2177    public function __construct() {
    21782178        $this->init();
    21792179    }
Note: See TracChangeset for help on using the changeset viewer.