Make WordPress Core

Changeset 883


Ignore:
Timestamp:
02/17/2004 03:00:20 AM (21 years ago)
Author:
saxmatt
Message:

New *_action functions, removed alert_error.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import-greymatter.php

    r762 r883  
    3636
    3737    if (!chdir($archivespath))
    38         alert_error("Wrong path, $archivespath\ndoesn't exist\non the server");
     38        die("Wrong path, $archivespath\ndoesn't exist\non the server");
    3939
    4040    if (!chdir($gmpath))
    41         alert_error("Wrong path, $gmpath\ndoesn't exist\non the server");
     41        die("Wrong path, $gmpath\ndoesn't exist\non the server");
    4242?>
    4343<html>
  • trunk/wp-includes/functions.php

    r881 r883  
    459459        $gzip_compressed=1;
    460460    }
    461 }
    462 
    463 function alert_error($msg) { // displays a warning box with an error message (original by KYank)
    464     global $$HTTP_SERVER_VARS;
    465     ?>
    466     <html>
    467     <head>
    468     <script language="JavaScript">
    469     <!--
    470     alert("<?php echo $msg ?>");
    471     history.back();
    472     //-->
    473     </script>
    474     </head>
    475     <body>
    476     <!-- this is for non-JS browsers (actually we should never reach that code, but hey, just in case...) -->
    477     <?php echo $msg; ?><br />
    478     <a href="<?php echo $HTTP_SERVER_VARS["HTTP_REFERER"]; ?>">go back</a>
    479     </body>
    480     </html>
    481     <?php
    482     exit;
    483461}
    484462
     
    11761154}
    11771155
     1156// Filters: these are the core of WP's plugin architecture
     1157
    11781158function apply_filters($tag, $string) {
    11791159    global $wp_filter;
     
    12211201    //die(var_dump($wp_filter));
    12221202    return true;
     1203}
     1204
     1205// The *_action functions are just aliases for the *_filter functions, they take special strings instead of generic content
     1206
     1207function do_action($tag, $string) {
     1208    return apply_filter($tag, $string);
     1209}
     1210
     1211function add_action($tag, $function_to_add, $priority = 10) {
     1212    add_filter($tag, $function_to_add, $priority);
     1213}
     1214
     1215function remove_action($tag, $function_to_remove, $priority = 10) {
     1216    remove_filter($tag, $function_to_remove, $priority);
    12231217}
    12241218
Note: See TracChangeset for help on using the changeset viewer.