Index: wp-admin/includes/deprecated.php
===================================================================
--- wp-admin/includes/deprecated.php (revision 17488)
+++ wp-admin/includes/deprecated.php (working copy)
@@ -502,7 +502,7 @@
$this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
}
- do_action_ref_array( 'pre_user_search', array( &$this ) );
+ do_action( 'pre_user_search', $this );
}
/**
Index: wp-admin/includes/user.php
===================================================================
--- wp-admin/includes/user.php (revision 17488)
+++ wp-admin/includes/user.php (working copy)
@@ -135,7 +135,7 @@
$errors->add( 'user_login', __( 'ERROR: Please enter a username.' ));
/* checking the password has been typed twice */
- do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));
+ do_action( 'check_passwords', $user->user_login, & $pass1, & $pass2 );
if ( $update ) {
if ( empty($pass1) && !empty($pass2) )
@@ -176,7 +176,7 @@
}
// Allow plugins to return their own errors.
- do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) );
+ do_action_ref( 'user_profile_update_errors', $errors, $update, $user );
if ( $errors->get_error_codes() )
return $errors;
Index: wp-admin/load-scripts.php
===================================================================
--- wp-admin/load-scripts.php (revision 17488)
+++ wp-admin/load-scripts.php (working copy)
@@ -55,7 +55,7 @@
/**
* @ignore
*/
-function do_action_ref_array() {}
+function do_action() {}
/**
* @ignore
Index: wp-admin/load-styles.php
===================================================================
--- wp-admin/load-styles.php (revision 17488)
+++ wp-admin/load-styles.php (working copy)
@@ -55,7 +55,7 @@
/**
* @ignore
*/
-function do_action_ref_array() {}
+function do_action() {}
/**
* @ignore
Index: wp-cron.php
===================================================================
--- wp-cron.php (revision 17488)
+++ wp-cron.php (working copy)
@@ -52,7 +52,9 @@
wp_unschedule_event($timestamp, $hook, $v['args']);
- do_action_ref_array($hook, $v['args']);
+ array_unshift( $v['args'], $hook );
+
+ call_user_func_array( 'do_action', $v['args'] );
}
}
}
Index: wp-includes/admin-bar.php
===================================================================
--- wp-includes/admin-bar.php (revision 17488)
+++ wp-includes/admin-bar.php (working copy)
@@ -57,7 +57,7 @@
$wp_admin_bar->load_user_locale_translations();
- do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );
+ do_action( 'admin_bar_menu', $wp_admin_bar );
do_action( 'wp_before_admin_bar_render' );
Index: wp-includes/class-http.php
===================================================================
--- wp-includes/class-http.php (revision 17488)
+++ wp-includes/class-http.php (working copy)
@@ -1408,7 +1408,7 @@
// Cookies are not handled by the HTTP API currently. Allow for plugin authors to handle it
// themselves... Although, it is somewhat pointless without some reference.
- do_action_ref_array( 'http_api_curl', array(&$handle) );
+ do_action( 'http_api_curl', array(&$handle) );
// We don't need to return the body, so don't. Just execute request and return.
if ( ! $r['blocking'] ) {
Index: wp-includes/class-wp.php
===================================================================
--- wp-includes/class-wp.php (revision 17488)
+++ wp-includes/class-wp.php (working copy)
@@ -298,7 +298,7 @@
$this->query_vars = apply_filters('request', $this->query_vars);
- do_action_ref_array('parse_request', array(&$this));
+ do_action('parse_request', $this);
}
/**
@@ -373,7 +373,7 @@
if ( $exit_required )
exit();
- do_action_ref_array('send_headers', array(&$this));
+ do_action('send_headers', $this);
}
/**
@@ -501,7 +501,7 @@
$this->query_posts();
$this->handle_404();
$this->register_globals();
- do_action_ref_array('wp', array(&$this));
+ do_action('wp', &$this);
}
/**
Index: wp-includes/class.wp-scripts.php
===================================================================
--- wp-includes/class.wp-scripts.php (revision 17488)
+++ wp-includes/class.wp-scripts.php (working copy)
@@ -31,7 +31,7 @@
var $default_dirs;
function __construct() {
- do_action_ref_array( 'wp_default_scripts', array(&$this) );
+ do_action( 'wp_default_scripts', $this );
}
/**
Index: wp-includes/class.wp-styles.php
===================================================================
--- wp-includes/class.wp-styles.php (revision 17488)
+++ wp-includes/class.wp-styles.php (working copy)
@@ -28,7 +28,7 @@
var $default_dirs;
function __construct() {
- do_action_ref_array( 'wp_default_styles', array(&$this) );
+ do_action( 'wp_default_styles', $this );
}
function do_item( $handle ) {
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php (revision 17488)
+++ wp-includes/comment.php (working copy)
@@ -221,7 +221,7 @@
);
$this->query_vars = wp_parse_args( $query_vars, $defaults );
- do_action_ref_array( 'pre_get_comments', array( &$this ) );
+ do_action( 'pre_get_comments', $this );
extract( $this->query_vars, EXTR_SKIP );
// $args can be whatever, only use the args defined in defaults to compute the key
@@ -320,7 +320,7 @@
$where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) );
$pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits' );
- $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
+ $clauses = apply_filters( 'comments_clauses', compact( $pieces ), $this );
foreach ( $pieces as $piece )
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
@@ -330,7 +330,7 @@
return $wpdb->get_var( $query );
$comments = $wpdb->get_results( $query );
- $comments = apply_filters_ref_array( 'the_comments', array( $comments, &$this ) );
+ $comments = apply_filters( 'the_comments', $comments, $this );
wp_cache_add( $cache_key, $comments, 'comment' );
@@ -1796,7 +1796,7 @@
endif;
endforeach;
- do_action_ref_array('pre_ping', array(&$post_links, &$pung));
+ do_action('pre_ping', &$post_links, &$pung);
foreach ( (array) $post_links as $pagelinkedto ) {
$pingback_server_url = discover_pingback_server_uri( $pagelinkedto );
Index: wp-includes/deprecated.php
===================================================================
--- wp-includes/deprecated.php (revision 17488)
+++ wp-includes/deprecated.php (working copy)
@@ -2602,3 +2602,46 @@
return true;
}
+
+/**
+ * Execute functions hooked on a specific action hook, specifying arguments in an array.
+ *
+ * @see do_action() This function is identical, but the arguments passed to the
+ * functions hooked to $tag are supplied using an array.
+ *
+ * @since 2.1
+ * @deprecated 3.2
+ *
+ * @param string $tag The name of the action to be executed.
+ * @param array $args The arguments supplied to the functions hooked to $tag
+ * @return null Will return null if $tag does not exist in $wp_filter array
+ */
+function do_action_ref_array( $tag, $args ) {
+ _deprecated_function( __FUNCTION__, '3.2', 'do_action()' );
+
+ array_unshift( $args, $tag );
+
+ return call_user_func_array( 'do_action', $args );
+}
+
+/**
+ * Execute functions hooked on a specific filter hook, specifying arguments in an array.
+ *
+ * @see apply_filters() This function is identical, but the arguments passed to the
+ * functions hooked to $tag are supplied using an array.
+ *
+ * @since 3.0
+ * @deprecated 3.2
+ *
+ * @param string $tag The name of the filter hook.
+ * @param array $args The arguments supplied to the functions hooked to $tag
+ * @return mixed The filtered value after all hooked functions are applied to it.
+ */
+function apply_filters_ref_array( $tag, $args ) {
+ _deprecated_function( __FUNCTION__, '3.2', 'apply_filters()' );
+
+ array_unshift( $args, $tag );
+
+ return call_user_func_array( 'apply_filters', $args );
+}
+
Index: wp-includes/feed.php
===================================================================
--- wp-includes/feed.php (revision 17488)
+++ wp-includes/feed.php (working copy)
@@ -535,7 +535,7 @@
$feed->set_cache_class('WP_Feed_Cache');
$feed->set_file_class('WP_SimplePie_File');
$feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200, $url));
- do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
+ do_action( 'wp_feed_options', $feed, $url );
$feed->init();
$feed->handle_content_type();
Index: wp-includes/meta.php
===================================================================
--- wp-includes/meta.php (revision 17488)
+++ wp-includes/meta.php (working copy)
@@ -442,7 +442,7 @@
$where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
}
- return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context ) );
+ return apply_filter( 'get_meta_sql', compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context );
}
/**
Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php (revision 17488)
+++ wp-includes/pluggable.php (working copy)
@@ -256,8 +256,7 @@
* @uses apply_filters() Calls 'wp_mail_from_name' hook to get the from address name.
* @uses apply_filters() Calls 'wp_mail_content_type' hook to get the email content type.
* @uses apply_filters() Calls 'wp_mail_charset' hook to get the email charset
- * @uses do_action_ref_array() Calls 'phpmailer_init' hook on the reference to
- * phpmailer object.
+ * @uses do_action() Calls 'phpmailer_init' hook on the phpmailer object.
* @uses PHPMailer
* @
*
@@ -459,7 +458,7 @@
}
}
- do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
+ do_action( 'phpmailer_init', $phpmailer );
// Send!
$result = @$phpmailer->Send();
Index: wp-includes/plugin.php
===================================================================
--- wp-includes/plugin.php (revision 17488)
+++ wp-includes/plugin.php (working copy)
@@ -174,59 +174,6 @@
}
/**
- * Execute functions hooked on a specific filter hook, specifying arguments in an array.
- *
- * @see apply_filters() This function is identical, but the arguments passed to the
- * functions hooked to $tag are supplied using an array.
- *
- * @package WordPress
- * @subpackage Plugin
- * @since 3.0.0
- * @global array $wp_filter Stores all of the filters
- * @global array $merged_filters Merges the filter hooks using this function.
- * @global array $wp_current_filter stores the list of current filters with the current one last
- *
- * @param string $tag The name of the filter hook.
- * @param array $args The arguments supplied to the functions hooked to $tag
- * @return mixed The filtered value after all hooked functions are applied to it.
- */
-function apply_filters_ref_array($tag, $args) {
- global $wp_filter, $merged_filters, $wp_current_filter;
-
- $wp_current_filter[] = $tag;
-
- // Do 'all' actions first
- if ( isset($wp_filter['all']) ) {
- $all_args = func_get_args();
- _wp_call_all_hook($all_args);
- }
-
- if ( !isset($wp_filter[$tag]) ) {
- array_pop($wp_current_filter);
- return $args[0];
- }
-
- // Sort
- if ( !isset( $merged_filters[ $tag ] ) ) {
- ksort($wp_filter[$tag]);
- $merged_filters[ $tag ] = true;
- }
-
- reset( $wp_filter[ $tag ] );
-
- do {
- foreach( (array) current($wp_filter[$tag]) as $the_ )
- if ( !is_null($the_['function']) )
- $args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
-
- } while ( next($wp_filter[$tag]) !== false );
-
- array_pop( $wp_current_filter );
-
- return $args[0];
-}
-
-/**
* Removes a function from a specified filter hook.
*
* This function removes a function attached to a specified filter hook. This
@@ -420,64 +367,6 @@
}
/**
- * Execute functions hooked on a specific action hook, specifying arguments in an array.
- *
- * @see do_action() This function is identical, but the arguments passed to the
- * functions hooked to $tag are supplied using an array.
- *
- * @package WordPress
- * @subpackage Plugin
- * @since 2.1
- * @global array $wp_filter Stores all of the filters
- * @global array $wp_actions Increments the amount of times action was triggered.
- *
- * @param string $tag The name of the action to be executed.
- * @param array $args The arguments supplied to the functions hooked to $tag
- * @return null Will return null if $tag does not exist in $wp_filter array
- */
-function do_action_ref_array($tag, $args) {
- global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
-
- if ( ! isset($wp_actions) )
- $wp_actions = array();
-
- if ( ! isset($wp_actions[$tag]) )
- $wp_actions[$tag] = 1;
- else
- ++$wp_actions[$tag];
-
- $wp_current_filter[] = $tag;
-
- // Do 'all' actions first
- if ( isset($wp_filter['all']) ) {
- $all_args = func_get_args();
- _wp_call_all_hook($all_args);
- }
-
- if ( !isset($wp_filter[$tag]) ) {
- array_pop($wp_current_filter);
- return;
- }
-
- // Sort
- if ( !isset( $merged_filters[ $tag ] ) ) {
- ksort($wp_filter[$tag]);
- $merged_filters[ $tag ] = true;
- }
-
- reset( $wp_filter[ $tag ] );
-
- do {
- foreach( (array) current($wp_filter[$tag]) as $the_ )
- if ( !is_null($the_['function']) )
- call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
-
- } while ( next($wp_filter[$tag]) !== false );
-
- array_pop($wp_current_filter);
-}
-
-/**
* Check if any action has been registered for a hook.
*
* @package WordPress
@@ -678,10 +567,10 @@
* The 'all' hook passes all of the arguments or parameters that were used for
* the hook, which this function was called for.
*
- * This function is used internally for apply_filters(), do_action(), and
- * do_action_ref_array() and is not meant to be used from outside those
- * functions. This function does not check for the existence of the all hook, so
- * it will fail unless the all hook exists prior to this function call.
+ * This function is used internally for apply_filters() and do_action()
+ * and is not meant to be used from outside those functions. This function
+ * does not check for the existence of the all hook, so it will fail unless
+ * the all hook exists prior to this function call.
*
* @package WordPress
* @subpackage Plugin
Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php (revision 17488)
+++ wp-includes/query.php (working copy)
@@ -1627,7 +1627,7 @@
if ( '404' == $qv['error'] )
$this->set_404();
- do_action_ref_array('parse_query', array(&$this));
+ do_action('parse_query', $this);
}
/*
@@ -1865,7 +1865,7 @@
*
* @since 1.5.0
* @access public
- * @uses do_action_ref_array() Calls 'pre_get_posts' hook before retrieving posts.
+ * @uses do_action() Calls 'pre_get_posts' hook before retrieving posts.
*
* @return array List of posts.
*/
@@ -1874,7 +1874,7 @@
$this->parse_query();
- do_action_ref_array('pre_get_posts', array(&$this));
+ do_action('pre_get_posts', $this);
// Shorthand.
$q = &$this->query_vars;
@@ -2144,7 +2144,7 @@
}
// Allow plugins to contextually add/remove/modify the search section of the database query
- $search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
+ $search = apply_filters( 'posts_search', $search, $this );
// Taxonomies
$this->parse_tax_query( $q );
@@ -2448,8 +2448,8 @@
// Apply filters on where and join prior to paging so that any
// manipulations to them are reflected in the paging by day queries.
if ( !$q['suppress_filters'] ) {
- $where = apply_filters_ref_array('posts_where', array( $where, &$this ) );
- $join = apply_filters_ref_array('posts_join', array( $join, &$this ) );
+ $where = apply_filters( 'posts_where', $where, $this );
+ $join = apply_filters( 'posts_join', $join, $this );
}
// Paging
@@ -2482,11 +2482,11 @@
}
if ( !$q['suppress_filters'] ) {
- $cjoin = apply_filters_ref_array('comment_feed_join', array( $cjoin, &$this ) );
- $cwhere = apply_filters_ref_array('comment_feed_where', array( $cwhere, &$this ) );
- $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( $cgroupby, &$this ) );
- $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
- $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
+ $cjoin = apply_filters( 'comment_feed_join', $cjoin, $this );
+ $cwhere = apply_filters( 'comment_feed_where', $cwhere, $this );
+ $cgroupby = apply_filters( 'comment_feed_groupby', $cgroupby, $this );
+ $corderby = apply_filters( 'comment_feed_orderby', 'comment_date_gmt DESC', $this );
+ $climits = apply_filters( 'comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'), $this );
}
$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
@@ -2514,16 +2514,16 @@
// Apply post-paging filters on where and join. Only plugins that
// manipulate paging queries should use these hooks.
if ( !$q['suppress_filters'] ) {
- $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
- $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) );
- $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) );
- $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) );
- $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) );
- $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) );
- $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
+ $where = apply_filters( 'posts_where_paged', $where, $this );
+ $groupby = apply_filters( 'posts_groupby', $groupby, $this );
+ $join = apply_filters( 'posts_join_paged', $join, $this );
+ $orderby = apply_filters( 'posts_orderby', $orderby, $this );
+ $distinct = apply_filters( 'posts_distinct', $distinct, $this );
+ $limits = apply_filters( 'post_limits', $limits, $this );
+ $fields = apply_filters( 'posts_fields', $fields, $this );
// Filter all clauses at once, for convenience
- $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
+ $clauses = (array) apply_filters( 'posts_clauses', compact( $pieces ), $this );
foreach ( $pieces as $piece )
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
}
@@ -2533,16 +2533,16 @@
// Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
if ( !$q['suppress_filters'] ) {
- $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );
- $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );
- $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) );
- $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) );
- $distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) );
- $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) );
- $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );
+ $where = apply_filters( 'posts_where_request', $where, $this );
+ $groupby = apply_filters( 'posts_groupby_request', $groupby, $this );
+ $join = apply_filters( 'posts_join_request', $join, $this );
+ $orderby = apply_filters( 'posts_orderby_request', $orderby, $this );
+ $distinct = apply_filters( 'posts_distinct_request', $distinct, $this );
+ $fields = apply_filters( 'posts_fields_request', $fields, $this );
+ $limits = apply_filters( 'post_limits_request', $limits, $this );
// Filter all clauses at once, for convenience
- $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
+ $clauses = (array) apply_filters( 'posts_clauses_request', compact( $pieces ), $this );
foreach ( $pieces as $piece )
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
}
@@ -2558,7 +2558,7 @@
$this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
if ( !$q['suppress_filters'] )
- $this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) );
+ $this->request = apply_filters( 'posts_request', $this->request, $this );
if ( 'ids' == $q['fields'] ) {
$this->posts = $wpdb->get_col($this->request);
@@ -2580,25 +2580,25 @@
// Raw results filter. Prior to status checks.
if ( !$q['suppress_filters'] )
- $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
+ $this->posts = apply_filters( 'posts_results', $this->posts, $this );
if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
- $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) );
- $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
- $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( '', &$this ) );
+ $cjoin = apply_filters( 'comment_feed_join', '', $this );
+ $cwhere = apply_filters( 'comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", $this );
+ $cgroupby = apply_filters( 'comment_feed_groupby', '', $this );
$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
- $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
+ $corderby = apply_filters( 'comment_feed_orderby', 'comment_date_gmt DESC', $this );
$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
- $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
+ $climits = apply_filters( 'comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'), $this );
$comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
$this->comments = $wpdb->get_results($comments_request);
$this->comment_count = count($this->comments);
}
if ( !$q['no_found_rows'] && !empty($limits) ) {
- $found_posts_query = apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) );
+ $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()', $this );
$this->found_posts = $wpdb->get_var( $found_posts_query );
- $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
+ $this->found_posts = apply_filters( 'found_posts', $this->found_posts, $this );
$this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']);
}
@@ -2631,7 +2631,7 @@
}
if ( $this->is_preview && current_user_can( $edit_cap, $this->posts[0]->ID ) )
- $this->posts[0] = apply_filters_ref_array('the_preview', array( $this->posts[0], &$this ));
+ $this->posts[0] = apply_filters( 'the_preview', $this->posts[0], $this );
}
// Put sticky posts at the top of the posts array
@@ -2685,7 +2685,7 @@
}
if ( !$q['suppress_filters'] )
- $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) );
+ $this->posts = apply_filters( 'the_posts', $this->posts, $this );
$this->post_count = count($this->posts);
@@ -2729,14 +2729,14 @@
* @since 1.5.0
* @access public
* @uses $post
- * @uses do_action_ref_array() Calls 'loop_start' if loop has just started
+ * @uses do_action() Calls 'loop_start' if loop has just started
*/
function the_post() {
global $post;
$this->in_the_loop = true;
if ( $this->current_post == -1 ) // loop has just started
- do_action_ref_array('loop_start', array(&$this));
+ do_action('loop_start', $this);
$post = $this->next_post();
setup_postdata($post);
@@ -2749,7 +2749,7 @@
*
* @since 1.5.0
* @access public
- * @uses do_action_ref_array() Calls 'loop_end' if loop is ended
+ * @uses do_action() Calls 'loop_end' if loop is ended
*
* @return bool True if posts are available, false if end of loop.
*/
@@ -2757,7 +2757,7 @@
if ( $this->current_post + 1 < $this->post_count ) {
return true;
} elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
- do_action_ref_array('loop_end', array(&$this));
+ do_action('loop_end', $this);
// Do some cleaning up after the loop
$this->rewind_posts();
}
@@ -3482,7 +3482,7 @@
* @since 1.5.0
*
* @param object $post Post data.
- * @uses do_action_ref_array() Calls 'the_post'
+ * @uses do_action() Calls 'the_post'
* @return bool True when finished.
*/
function setup_postdata($post) {
@@ -3515,7 +3515,7 @@
$multipage = 0;
}
- do_action_ref_array('the_post', array(&$post));
+ do_action('the_post', $post);
return true;
}
Index: wp-includes/rewrite.php
===================================================================
--- wp-includes/rewrite.php (revision 17488)
+++ wp-includes/rewrite.php (working copy)
@@ -1562,7 +1562,7 @@
else
$this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
- do_action_ref_array('generate_rewrite_rules', array(&$this));
+ do_action('generate_rewrite_rules', $this);
$this->rules = apply_filters('rewrite_rules_array', $this->rules);
return $this->rules;
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php (revision 17488)
+++ wp-includes/script-loader.php (working copy)
@@ -46,7 +46,7 @@
*
* @param object $scripts WP_Scripts object.
*/
-function wp_default_scripts( &$scripts ) {
+function wp_default_scripts( $scripts ) {
if ( !$guessurl = site_url() )
$guessurl = wp_guess_url();
@@ -453,7 +453,7 @@
*
* @param object $styles
*/
-function wp_default_styles( &$styles ) {
+function wp_default_styles( $styles ) {
// This checks to see if site_url() returns something and if it does not
// then it assigns $guess_url to wp_guess_url(). Strange format, but it works.
if ( ! $guessurl = site_url() )
Index: wp-includes/user.php
===================================================================
--- wp-includes/user.php (revision 17488)
+++ wp-includes/user.php (working copy)
@@ -38,7 +38,7 @@
$credentials['remember'] = false;
// TODO do we deprecate the wp_authentication action?
- do_action_ref_array('wp_authenticate', array(&$credentials['user_login'], &$credentials['user_password']));
+ do_action('wp_authenticate', &$credentials['user_login'], &$credentials['user_password']);
if ( '' === $secure_cookie )
$secure_cookie = is_ssl();
@@ -531,7 +531,7 @@
$this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)";
}
- do_action_ref_array( 'pre_user_query', array( &$this ) );
+ do_action( 'pre_user_query', $this );
}
/**
Index: wp-includes/widgets.php
===================================================================
--- wp-includes/widgets.php (revision 17488)
+++ wp-includes/widgets.php (working copy)
@@ -270,7 +270,7 @@
$return = $this->form($instance);
// add extra fields in the widget form - be sure to set $return to null if you add any
// if the widget has no form the text echoed from the default form method can be hidden using css
- do_action_ref_array( 'in_widget_form', array(&$this, &$return, $instance) );
+ do_action( 'in_widget_form', $this, &$return, $instance );
}
return $return;
}