Wordpress Common functions

add_action:  

add_action(string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1)

Actions are the hooks that launches at specific points during execution, or when specific events occur.

 

add_filter:  

add_filter(string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1)

filter hook, used to modify various types of internal data at run time. Will return result (different from action hook)

 

 

register_post_type:

register_post_type($post_type, $args); 

Create or modify a post type. Should be invoked through the 'init' action. It will not work if called before 'init', and aspects of the newly created or modified post type will work incorrectly if called later.

 

register_taxonomy:

register_taxononmy($taxonomy, $object_type, $args);

This function adds or overwrites a taxonomy. It takes in a name, an object name that it affects and an array of parameters. It doesn't return anything.

 

wp_verify_nonce:

wp_verify_nonce($nonce, $action);

Verify that a nounce is correct and unexpired with the respect to a specified action.  The function is used to verify the nonce sent in the current request usually accessed by the $_REQUEST PHP variable.

Guess you like

Origin www.cnblogs.com/victorchen/p/10984503.html