New *_action functions, removed alert_error.

git-svn-id: http://svn.automattic.com/wordpress/trunk@883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-02-17 03:00:20 +00:00
parent 984457b913
commit a0b1f690ef
2 changed files with 18 additions and 24 deletions

View File

@ -35,10 +35,10 @@ case "step1":
}
if (!chdir($archivespath))
alert_error("Wrong path, $archivespath\ndoesn't exist\non the server");
die("Wrong path, $archivespath\ndoesn't exist\non the server");
if (!chdir($gmpath))
alert_error("Wrong path, $gmpath\ndoesn't exist\non the server");
die("Wrong path, $gmpath\ndoesn't exist\non the server");
?>
<html>
<head>

View File

@ -460,28 +460,6 @@ function gzip_compression() {
}
}
function alert_error($msg) { // displays a warning box with an error message (original by KYank)
global $$HTTP_SERVER_VARS;
?>
<html>
<head>
<script language="JavaScript">
<!--
alert("<?php echo $msg ?>");
history.back();
//-->
</script>
</head>
<body>
<!-- this is for non-JS browsers (actually we should never reach that code, but hey, just in case...) -->
<?php echo $msg; ?><br />
<a href="<?php echo $HTTP_SERVER_VARS["HTTP_REFERER"]; ?>">go back</a>
</body>
</html>
<?php
exit;
}
function alert_confirm($msg) { // asks a question - if the user clicks Cancel then it brings them back one page
?>
<script language="JavaScript">
@ -1175,6 +1153,8 @@ function is_new_day() {
}
}
// Filters: these are the core of WP's plugin architecture
function apply_filters($tag, $string) {
global $wp_filter;
if (isset($wp_filter['all'])) {
@ -1222,6 +1202,20 @@ function remove_filter($tag, $function_to_remove, $priority = 10) {
return true;
}
// The *_action functions are just aliases for the *_filter functions, they take special strings instead of generic content
function do_action($tag, $string) {
return apply_filter($tag, $string);
}
function add_action($tag, $function_to_add, $priority = 10) {
add_filter($tag, $function_to_add, $priority);
}
function remove_action($tag, $function_to_remove, $priority = 10) {
remove_filter($tag, $function_to_remove, $priority);
}
/* Highlighting code c/o Ryan Boren */
function get_search_query_terms($engine = 'google') {
global $s, $s_array;