[wp-trac] [WordPress Trac] #44727: WP 4.98 creates fatal on filet list_pages

WordPress Trac noreply at wordpress.org
Sat Aug 4 11:18:35 UTC 2018


#44727: WP 4.98 creates fatal on filet list_pages
--------------------------+-----------------------------
 Reporter:  BackuPs       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.9.8
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 Hi

 I have this function


 {{{
         function start_el(&$output, $page, $depth = 0, $args = array(),
 $current_object_id = 0) {
                 $pad = str_repeat(' ', $depth * 3);

                 $output .= "\t<option class=\"level-$depth\"
 value=\"$page->ID\"";
                 if(is_array($args['selected'])){
                         if ( in_array($page->ID, $args['selected']) ){
                                 $output .= ' selected="selected"';
                         }
                 }else{
                         if ( $page->ID == $args['selected'] ){
                                 $output .= ' selected="selected"';
                         }
                 }
                 $output .= '>';
                 $title = apply_filters( 'list_pages', $page->post_title );
                 $output .= $pad . esc_html( $title );
                 $output .= "</option>\n";
         }
 }}}



 The line


 {{{
 $title = apply_filters( 'list_pages', $page->post_title );

 }}}

 Creates a error in wp 4.9.8


 {{{
 <b>Fatal error</b>:  Uncaught ArgumentCountError: Too few arguments to
 function _wp_privacy_settings_filter_draft_page_titles(), 1 passed in
 /home/mydomain/public_html/wp-includes/class-wp-hook.php on line 286 and
 exactly 2 expected in /home/mydomain/public_html/wp-
 admin/includes/misc.php:1239
 Stack trace:
 #0 /home/mydomain/public_html/wp-includes/class-wp-hook.php(286):
 _wp_privacy_settings_filter_draft_page_titles('About')
 #1 /home/mydomain/public_html/wp-includes/plugin.php(203):
 WP_Hook->apply_filters('About', Array)
 #2 /home/mydomain/public_html/wp-
 content/themes/champion/framework/helpers/baseOptionsGenerator.php(1209):
 apply_filters('list_pages', 'About')
 #3 /home/mydomain/public_html/wp-includes/class-wp-walker.php(145):
 Walker_PageMultiSelect->start_el('\t<option class=...',
 Object(WP_Post), 0, Array)
 #4 /home/mydomain/public_html/wp-includes/class-wp-walker.php(243):
 Walker->display_element(Object(WP_Post), Array, '0', 0, Array,
 '\t<option class=...')
 #5 /home/mydomain/public_html/wp-content/themes/champion/framework/he in
 <b>/home/mydomain/public_html/wp-admin/includes/misc.php</b> on line
 <b>1239</b><br />
 }}}


 How to fix this?


 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44727>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list