wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
wp_is_local_html_output is private and should not be used in themes or plugins directly.
wp_is_local_html_output › WordPress Function
Od5.7.0
Przestarzałyn/a
› wp_is_local_html_output ( $html )
Dostęp: |
|
Parametry: |
|
Powrót: |
|
Zdefiniowane na: |
|
Codex: |
Checks whether a given HTML string is likely an output from this WordPress site.
This function attempts to check for various common WordPress patterns whether they are included in the HTML string. Since any of these actions may be disabled through third-party code, this function may also return null to indicate that it was not possible to determine ownership.Powiązane Funkcje: wp_is_block_theme, wp_filter_global_styles_post, _wp_menu_output, wp_is_large_user_count, is_local_attachment
Źródło
function wp_is_local_html_output( $html ) { // 1. Check if HTML includes the site's Really Simple Discovery link. if ( has_action( 'wp_head', 'rsd_link' ) ) { $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) ) ); // See rsd_link(). return str_contains( $html, $pattern ); } // 2. Check if HTML includes the site's REST API link. if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) { // Try both HTTPS and HTTP since the URL depends on context. $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head(). return str_contains( $html, $pattern ); } // Otherwise the result cannot be determined. return null; }