filters – Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?
Question
I’d like to check if the wp_sitemaps_enabled
filter is enabled or disabled. I’ve tried the following and it doesn’t work i.e. the condition isn’t met.
if( array_key_exists( 'wp_sitemaps_enabled' , $GLOBALS['wp_filter'] ) ) {
// do something
}
if( has filter ( 'wp_sitemaps_enabled') ) {
// do something
}
Is there another way of checking?
0
2 months
2023-03-21T23:10:01-05:00
2023-03-21T23:10:01-05:00 0 Answers
0 views
0
Leave an answer