Opened 4 years ago
Closed 4 years ago
#52727 closed defect (bug) (worksforme)
wp_sitemaps_max_urls
Reported by: | pvde | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 5.6.2 |
Component: | Sitemaps | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description (last modified by )
Hello, The function to have more entries in one sitemap doesn't work.
I use this custom made code:
add_filter( 'wp_sitemaps_max_urls', 'filter_function_name_9755', 10, 2 ); function filter_function_name_9755( $max_urls, $object_type ){ // filter... return $max_urls; } return apply_filters( 'wp_sitemaps_max_urls', 1000, $object_type );
But nothing happens. In fact, it messes up the entire sitemap.
Change History (6)
Note: See
TracTickets for help on using
tickets.
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 secondreturn
line is for some reason outside of the function. Moving it inside the function as is would not exactly work either, as theapply_filters()
call is not needed there and would lead to endless recursion.Does it work if you rewrite it like this?