Changeset 4630
- Timestamp:
- 12/08/2006 03:45:34 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/plugin.php
r4626 r4630 93 93 94 94 function do_action($tag, $arg = '') { 95 global $wp_filter; 95 global $wp_filter, $wp_actions; 96 96 97 $args = array(); 97 98 if ( is_array($arg) && 1 == count($arg) && is_object($arg[0]) ) // array(&$this) … … 124 125 } 125 126 } 127 128 if ( is_array($wp_actions) ) 129 $wp_actions[] = $tag; 130 else 131 $wp_actions = array($tag); 132 } 133 134 // Returns the number of times an action has been done 135 function did_action($tag) { 136 global $wp_actions; 137 138 return count(array_keys($wp_actions, $tag)); 126 139 } 127 140 128 141 function do_action_ref_array($tag, $args) { 129 global $wp_filter; 142 global $wp_filter, $wp_actions; 143 144 if ( !is_array($wp_actions) ) 145 $wp_actions = array($tag); 146 else 147 $wp_actions[] = $tag; 130 148 131 149 merge_filters($tag);
Note: See TracChangeset
for help on using the changeset viewer.