Ticket #18975: 18975.diff

File 18975.diff, 15.5 KB (added by ryan, 7 months ago)
  • wp-includes/post-template.php

     
    995995         * @param string $output Passed by reference. Used to append additional content. 
    996996         * @param int $depth Depth of page. Used for padding. 
    997997         */ 
    998         function start_lvl(&$output, $depth) { 
     998        function start_lvl( &$output, $depth = 0, $args = array() ) { 
    999999                $indent = str_repeat("\t", $depth); 
    10001000                $output .= "\n$indent<ul class='children'>\n"; 
    10011001        } 
     
    10071007         * @param string $output Passed by reference. Used to append additional content. 
    10081008         * @param int $depth Depth of page. Used for padding. 
    10091009         */ 
    1010         function end_lvl(&$output, $depth) { 
     1010        function end_lvl( &$output, $depth = 0, $args = array() ) { 
    10111011                $indent = str_repeat("\t", $depth); 
    10121012                $output .= "$indent</ul>\n"; 
    10131013        } 
     
    10221022         * @param int $current_page Page ID. 
    10231023         * @param array $args 
    10241024         */ 
    1025         function start_el(&$output, $page, $depth, $args, $current_page) { 
     1025        function start_el( &$output, $page, $depth, $args, $current_page = 0 ) { 
    10261026                if ( $depth ) 
    10271027                        $indent = str_repeat("\t", $depth); 
    10281028                else 
     
    10651065         * @param object $page Page data object. Not used. 
    10661066         * @param int $depth Depth of page. Not Used. 
    10671067         */ 
    1068         function end_el(&$output, $page, $depth) { 
     1068        function end_el( &$output, $page, $depth = 0, $args = array() ) { 
    10691069                $output .= "</li>\n"; 
    10701070        } 
    10711071 
     
    11031103         * @param int $depth Depth of page in reference to parent pages. Used for padding. 
    11041104         * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element. 
    11051105         */ 
    1106         function start_el(&$output, $page, $depth, $args) { 
     1106        function start_el(&$output, $page, $depth, $args, $id = 0) { 
    11071107                $pad = str_repeat('&nbsp;', $depth * 3); 
    11081108 
    11091109                $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\""; 
  • wp-includes/nav-menu-template.php

     
    3737         * @param string $output Passed by reference. Used to append additional content. 
    3838         * @param int $depth Depth of page. Used for padding. 
    3939         */ 
    40         function start_lvl(&$output, $depth) { 
     40        function start_lvl( &$output, $depth = 0, $args = array() ) { 
    4141                $indent = str_repeat("\t", $depth); 
    4242                $output .= "\n$indent<ul class=\"sub-menu\">\n"; 
    4343        } 
     
    4949         * @param string $output Passed by reference. Used to append additional content. 
    5050         * @param int $depth Depth of page. Used for padding. 
    5151         */ 
    52         function end_lvl(&$output, $depth) { 
     52        function end_lvl( &$output, $depth = 0, $args = array() ) { 
    5353                $indent = str_repeat("\t", $depth); 
    5454                $output .= "$indent</ul>\n"; 
    5555        } 
     
    6464         * @param int $current_page Menu item ID. 
    6565         * @param object $args 
    6666         */ 
    67         function start_el(&$output, $item, $depth, $args) { 
     67        function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { 
    6868                global $wp_query; 
    6969                $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; 
    7070 
     
    103103         * @param object $item Page data object. Not used. 
    104104         * @param int $depth Depth of page. Not Used. 
    105105         */ 
    106         function end_el(&$output, $item, $depth) { 
     106        function end_el( &$output, $item, $depth = 0, $args = array() ) { 
    107107                $output .= "</li>\n"; 
    108108        } 
    109109} 
  • wp-includes/class-http.php

     
    346346         * @return array Processed string headers. If duplicate headers are encountered, 
    347347         *                                      Then a numbered array is returned as the value of that header-key. 
    348348         */ 
    349         function processHeaders($headers) { 
     349        public static function processHeaders($headers) { 
    350350                // split headers, one per array element 
    351351                if ( is_string($headers) ) { 
    352352                        // tolerate line terminator: CRLF = LF (RFC 2616 19.3) 
     
    413413         * 
    414414         * @param array $r Full array of args passed into ::request() 
    415415         */ 
    416         function buildCookieHeader( &$r ) { 
     416        public static function buildCookieHeader( &$r ) { 
    417417                if ( ! empty($r['cookies']) ) { 
    418418                        $cookies_header = ''; 
    419419                        foreach ( (array) $r['cookies'] as $cookie ) { 
     
    756756         * @static 
    757757         * @return boolean False means this class can not be used, true means it can. 
    758758         */ 
    759         function test( $args = array() ) { 
     759        public static function test( $args = array() ) { 
    760760                if ( ! function_exists( 'fsockopen' ) ) 
    761761                        return false; 
    762762 
     
    939939         * 
    940940         * @return boolean False means this class can not be used, true means it can. 
    941941         */ 
    942         function test( $args = array() ) { 
     942        public static function test( $args = array() ) { 
    943943                if ( ! function_exists( 'fopen' ) ) 
    944944                        return false; 
    945945 
     
    11661166         * 
    11671167         * @return boolean False means this class can not be used, true means it can. 
    11681168         */ 
    1169         function test( $args = array() ) { 
     1169        public static function test( $args = array() ) { 
    11701170                if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) 
    11711171                        return false; 
    11721172 
     
    15801580         * @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports. 
    15811581         * @return string|bool False on failure. 
    15821582         */ 
    1583         function compress( $raw, $level = 9, $supports = null ) { 
     1583        public static function compress( $raw, $level = 9, $supports = null ) { 
    15841584                return gzdeflate( $raw, $level ); 
    15851585        } 
    15861586 
     
    15981598         * @param int $length The optional length of the compressed data. 
    15991599         * @return string|bool False on failure. 
    16001600         */ 
    1601         function decompress( $compressed, $length = null ) { 
     1601        public static function decompress( $compressed, $length = null ) { 
    16021602 
    16031603                if ( empty($compressed) ) 
    16041604                        return $compressed; 
     
    16421642         * @param string $gzData String to decompress. 
    16431643         * @return string|bool False on failure. 
    16441644         */ 
    1645         function compatible_gzinflate($gzData) { 
     1645        public static function compatible_gzinflate($gzData) { 
    16461646 
    16471647                // Compressed data might contain a full header, if so strip it for gzinflate() 
    16481648                if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) { 
     
    16801680         * 
    16811681         * @return string Types of encoding to accept. 
    16821682         */ 
    1683         function accept_encoding() { 
     1683        public static function accept_encoding() { 
    16841684                $type = array(); 
    16851685                if ( function_exists( 'gzinflate' ) ) 
    16861686                        $type[] = 'deflate;q=1.0'; 
     
    17011701         * 
    17021702         * @return string Content-Encoding string to send in the header. 
    17031703         */ 
    1704         function content_encoding() { 
     1704        public static function content_encoding() { 
    17051705                return 'deflate'; 
    17061706        } 
    17071707 
     
    17131713         * @param array|string $headers All of the available headers. 
    17141714         * @return bool 
    17151715         */ 
    1716         function should_decode($headers) { 
     1716        public static function should_decode($headers) { 
    17171717                if ( is_array( $headers ) ) { 
    17181718                        if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) 
    17191719                                return true; 
     
    17351735         * 
    17361736         * @return bool 
    17371737         */ 
    1738         function is_available() { 
     1738        public static function is_available() { 
    17391739                return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') ); 
    17401740        } 
    17411741} 
  • wp-includes/post.php

     
    40334033                        $dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) ); 
    40344034                        $icon_files = array(); 
    40354035                        while ( $dirs ) { 
    4036                                 $dir = array_shift($keys = array_keys($dirs)); 
     4036                                $keys = array_keys( $dirs ); 
     4037                                $dir = array_shift( $keys ); 
    40374038                                $uri = array_shift($dirs); 
    40384039                                if ( $dh = opendir($dir) ) { 
    40394040                                        while ( false !== $file = readdir($dh) ) { 
  • wp-includes/comment-template.php

     
    12381238         * @param int $depth Depth of comment. 
    12391239         * @param array $args Uses 'style' argument for type of HTML list. 
    12401240         */ 
    1241         function start_lvl(&$output, $depth, $args) { 
     1241        function start_lvl( &$output, $depth = 0, $args = array() ) { 
    12421242                $GLOBALS['comment_depth'] = $depth + 1; 
    12431243 
    12441244                switch ( $args['style'] ) { 
     
    12621262         * @param int $depth Depth of comment. 
    12631263         * @param array $args Will only append content if style argument value is 'ol' or 'ul'. 
    12641264         */ 
    1265         function end_lvl(&$output, $depth, $args) { 
     1265        function end_lvl( &$output, $depth = 0, $args = array() ) { 
    12661266                $GLOBALS['comment_depth'] = $depth + 1; 
    12671267 
    12681268                switch ( $args['style'] ) { 
     
    13261326         * @param int $depth Depth of comment in reference to parents. 
    13271327         * @param array $args 
    13281328         */ 
    1329         function start_el(&$output, $comment, $depth, $args) { 
     1329        function start_el( &$output, $comment, $depth, $args, $id = 0 ) { 
    13301330                $depth++; 
    13311331                $GLOBALS['comment_depth'] = $depth; 
    13321332 
     
    13861386         * @param int $depth Depth of comment. 
    13871387         * @param array $args 
    13881388         */ 
    1389         function end_el(&$output, $comment, $depth, $args) { 
     1389        function end_el(&$output, $comment, $depth = 0, $args = array() ) { 
    13901390                if ( !empty($args['end-callback']) ) { 
    13911391                        call_user_func($args['end-callback'], $comment, $args, $depth); 
    13921392                        return; 
  • wp-includes/class-wp-walker.php

     
    5252         * 
    5353         * @param string $output Passed by reference. Used to append additional content. 
    5454         */ 
    55         function start_lvl(&$output) {} 
     55        function start_lvl( &$output, $depth = 0, $args = array() ) {} 
    5656 
    5757        /** 
    5858         * Ends the list of after the elements are added. 
     
    6666         * 
    6767         * @param string $output Passed by reference. Used to append additional content. 
    6868         */ 
    69         function end_lvl(&$output)   {} 
     69        function end_lvl( &$output, $depth = 0, $args = array() )   {} 
    7070 
    7171        /** 
    7272         * Start the element output. 
     
    8080         * 
    8181         * @param string $output Passed by reference. Used to append additional content. 
    8282         */ 
    83         function start_el(&$output)  {} 
     83        function start_el( &$output, $object, $depth, $args, $current_object_id = 0 )  {} 
    8484 
    8585        /** 
    8686         * Ends the element output, if needed. 
     
    9393         * 
    9494         * @param string $output Passed by reference. Used to append additional content. 
    9595         */ 
    96         function end_el(&$output)    {} 
     96        function end_el( &$output, $object, $depth = 0, $args = array() )    {} 
    9797 
    9898        /** 
    9999         * Traverse elements to create list from elements. 
  • wp-includes/general-template.php

     
    16211621        $args = wp_parse_args( $args, $defaults ); 
    16221622 
    16231623        if ( is_single() || is_page() ) { 
    1624                 $post = &get_post( $id = 0 ); 
     1624                $id = 0; 
     1625                $post = &get_post( $id ); 
    16251626 
    16261627                if ( comments_open() || pings_open() || $post->comment_count > 0 ) { 
    16271628                        $title = esc_attr(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) )); 
  • wp-includes/class-wp.php

     
    572572         * @param array  $matches data used for substitution 
    573573         * @return string 
    574574         */ 
    575         function apply($subject, $matches) { 
     575        public static function apply($subject, $matches) { 
    576576                $oSelf = new WP_MatchesMapRegex($subject, $matches); 
    577577                return $oSelf->output; 
    578578        } 
  • wp-includes/ms-load.php

     
    134134 */ 
    135135function wpmu_current_site() { 
    136136        global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain; 
     137 
     138        if ( empty( $current_site ) ) 
     139                $current_site = new stdClass; 
     140 
    137141        if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) { 
    138142                $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; 
    139143                $current_site->domain = DOMAIN_CURRENT_SITE; 
  • wp-includes/category-template.php

     
    794794         * @param int $depth Depth of category. Used for tab indentation. 
    795795         * @param array $args Will only append content if style argument value is 'list'. 
    796796         */ 
    797         function start_lvl(&$output, $depth, $args) { 
     797        function start_lvl( &$output, $depth = 0, $args = array() ) { 
    798798                if ( 'list' != $args['style'] ) 
    799799                        return; 
    800800 
     
    810810         * @param int $depth Depth of category. Used for tab indentation. 
    811811         * @param array $args Will only append content if style argument value is 'list'. 
    812812         */ 
    813         function end_lvl(&$output, $depth, $args) { 
     813        function end_lvl( &$output, $depth = 0, $args = array() ) { 
    814814                if ( 'list' != $args['style'] ) 
    815815                        return; 
    816816 
     
    827827         * @param int $depth Depth of category in reference to parents. 
    828828         * @param array $args 
    829829         */ 
    830         function start_el(&$output, $category, $depth, $args) { 
     830        function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { 
    831831                extract($args); 
    832832 
    833833                $cat_name = esc_attr( $category->name ); 
     
    902902         * @param int $depth Depth of category. Not used. 
    903903         * @param array $args Only uses 'list' for whether should append to output. 
    904904         */ 
    905         function end_el(&$output, $page, $depth, $args) { 
     905        function end_el( &$output, $page, $depth = 0, $args = array() ) { 
    906906                if ( 'list' != $args['style'] ) 
    907907                        return; 
    908908 
     
    943943         * @param int $depth Depth of category. Used for padding. 
    944944         * @param array $args Uses 'selected', 'show_count', and 'show_last_update' keys, if they exist. 
    945945         */ 
    946         function start_el(&$output, $category, $depth, $args) { 
     946        function start_el( &$output, $category, $depth, $args, $id = 0 ) { 
    947947                $pad = str_repeat('&nbsp;', $depth * 3); 
    948948 
    949949                $cat_name = apply_filters('list_cats', $category->name, $category); 
  • wp-admin/includes/template.php

     
    2222        var $tree_type = 'category'; 
    2323        var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this 
    2424 
    25         function start_lvl(&$output, $depth, $args) { 
     25        function start_lvl( &$output, $depth = 0, $args = array() ) { 
    2626                $indent = str_repeat("\t", $depth); 
    2727                $output .= "$indent<ul class='children'>\n"; 
    2828        } 
    2929 
    30         function end_lvl(&$output, $depth, $args) { 
     30        function end_lvl( &$output, $depth = 0, $args = array() ) { 
    3131                $indent = str_repeat("\t", $depth); 
    3232                $output .= "$indent</ul>\n"; 
    3333        } 
    3434 
    35         function start_el(&$output, $category, $depth, $args) { 
     35        function start_el( &$output, $category, $depth, $args, $id = 0 ) { 
    3636                extract($args); 
    3737                if ( empty($taxonomy) ) 
    3838                        $taxonomy = 'category'; 
     
    4646                $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>'; 
    4747        } 
    4848 
    49         function end_el(&$output, $category, $depth, $args) { 
     49        function end_el( &$output, $category, $depth = 0, $args = array() ) { 
    5050                $output .= "</li>\n"; 
    5151        } 
    5252}