[wp-trac] [WordPress Trac] #52727: wp_sitemaps_max_urls

WordPress Trac noreply at wordpress.org
Fri Mar 5 19:06:06 UTC 2021


#52727: wp_sitemaps_max_urls
-------------------------------+------------------------------
 Reporter:  pvde               |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Sitemaps           |     Version:  5.6.2
 Severity:  minor              |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => reporter-feedback


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the report.

 In your example, the `filter_function_name_9755()` function just returns
 the original result, and the second `return` line is for some reason
 outside of the function. Moving it inside the function as is would not
 exactly work either, as the `apply_filters()` call is not needed there and
 would lead to endless recursion.

 Does it work if you rewrite it like this?
 {{{
 add_filter( 'wp_sitemaps_max_urls', 'filter_function_name_9755', 10, 2 );
 function filter_function_name_9755( $max_urls, $object_type ){
         return 1000;
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52727#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list