Home >Backend Development >PHP Tutorial >WordPress tips on using two PHP functions when debugging front-end pages

WordPress tips on using two PHP functions when debugging front-end pages

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:09:39791browse

Function esc_js() (filter Html embedded JS)
Parameters

$text

(string) (required) The string to be filtered.

Default value: None

Return value

(String) Returns the filtered string.

Example

<input type="text" value="<&#63;php echo esc_attr( $instance['input_text'] ); &#63;>"   name="email" />

More

This function is located at: wp-includes/formatting.php

nocache_headers() (disable browser caching)
nocache_headers() is used to send a header header information to tell the browser to prohibit Cache the current page, generally used during Ajax requests to prevent errors.

Usage

nocache_headers();

Attributes

This function has no attributes.

Return value

This function has no return value.

Example

function Bing_add_ajax(){
  nocache_headers();
  echo true;
  die;
}
add_action( 'template_redirect', 'Bing_add_ajax' );

Others

This function is located at: wp-includes/functions.php

The above introduces two tips for using PHP functions when debugging front-end pages in WordPress, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn