$sitemap = preg_replace( '/[0-9]+/', '', $request ); // Checks if one of bbp sitemaps. if ( in_array( $sitemap, array( '/forum-sitemap.xml', '/topic-sitemap.xml', '/reply-sitemap.xml', '/topic-tag-sitemap.xml', ), true ) ) { $is_sitemap_request = true; } $sc_sitemap_active = Settings::get_setting( 'sitemap' ); if ( $sc_sitemap_active && $is_sitemap_request ) { $args['show_ui'] = true; } return $args; } /** * Adds shortcodes to the omitted list. * * @param array $omitted The current omitted shortcodes. * * @return array The updated omitted shortcodes. */ public function avada_omitted_shortcodes( $omitted ) { return array_merge( $omitted, array( 'fusion_code', 'fusion_imageframe', 'fusion_slide', 'fusion_syntax_highlighter', ) ); } /** * Adds Divi omitted shortcodes to the omitted list. * * @param array $omitted The current array of omitted shortcodes. * * @return array The updated array of omitted shortcodes. */ public function divi_omitted_shortcodes( $omitted ) { return array_merge( $omitted, array( 'et_pb_code', 'et_pb_fullwidth_code', ) ); } /** * Adds WPBakery shortcodes to the omitted list. * * @param array $omitted The current omitted shortcodes. * * @return array The updated omitted shortcodes. */ public function wpbakery_omitted_shortcodes( $omitted ) { return array_merge( $omitted, array( 'vc_raw_js', 'vc_raw_html', ) ); } /** * Adds Swift shortcodes to the omitted list. * * @param array $omitted The current omitted shortcodes array. * * @return array The updated omitted shortcodes array. */ public function swift_omitted_shortcodes( $omitted ) { return array_merge( $omitted, array( 'spb_raw_js', 'spb_raw_html', ) ); } /** * Ensures login redirect for Defender. * * @param string $url The current URL. * * @return string The updated URL. */ public function ensure_defender_login_redirect( $url ) { if ( is_user_logged_in() || ! method_exists( '\WP_Defender\Module\Advanced_Tools\Component\Mask_Api', 'maybeAppendTicketToUrl' ) ) { return $url; } return \WP_Defender\Module\Advanced_Tools\Component\Mask_Api::maybeAppendTicketToUrl( $url ); } /** * Changes the sitemap URL for domain map. * * @param string $sitemap_url The current sitemap URL. * * @return string The updated sitemap URL. */ public function change_sitemap_url_for_domain_map( $sitemap_url ) { if ( is_multisite() && class_exists( '\domain_map' ) && \smartcrawl_is_switch_active( '\SMARTCRAWL_SITEMAP_DM_SIMPLE_DISCOVERY_FALLBACK' ) ) { $sitemap_url = ( is_network_admin() ? '../../' : ( is_admin() ? '../' : '/' ) ) . 'sitemap.xml'; // Simplest possible logic. } return $sitemap_url; } }