wp plugin -9

do_action_ref_array( $tag, $args );

$tag — The name of the action hook.

$args — An array of arguments passed to actions registered for the hook. Generally, this would be an object that actions can change.

< ?php

do_action_ref_array( ‘pre_get_posts’, array( & $this ) );

add_action( ‘pre_get_posts’, ‘boj_randomly_order_blog_posts’ );

function boj_randomly_order_blog_posts( $query ) {

if ( $query- > is_home & & empty( $query- > query_vars[‘suppress_filters’] ) )

$query- > set( ‘orderby’, ‘rand’ );

}

? >

 

remove_action( $tag, $function_to_remove, $priority, $accepted_args );

$tag — The name of the action hook the action you want to remove is hooked to.

$function_to_remove — The name of the function that has been added to the hook.

$priority — The priority given in the add_action() function. This defaults to a value of 10 .

$accepted_args — The number of accepted arguments the action accepts. This defaults to a value of 1 .

 

 

remove_all_actions( $tag, $priority );

$tag — The name of the action hook that you want to remove all actions on.

$priority — The priority of the actions to remove. This parameter is optional and defaults to false . If you set this parameter, only actions with this specifi c priority will be removed.

 

has_action( $tag, $function_to_check );

$tag — The name of the action hook you want to check for actions registered to it.

$function_to_check — The name of a function to check if it has been added to the hook.This parameter is optional and defaults to a value of false .

did_action( $tag );

$tag — Name of the action hook to check.

posted on 2012-12-03 21:01  kalintw  阅读(116)  评论(0)    收藏  举报

导航