WordPress Functions
The following are a number of functions within WordPress that we utilized, with examples.
__
string __( string $text [, string $domain ])Retrieves the translated string into the current locale. The $domain is "default" by default, but when authoring your own plugin, you should define your own text domain.
Example:
print __('Hello', 'my_text_domain'); // Might print "Hola" in a Spanish speaking locale._e
_e( $text, $domain )Prints the translated string into the current locale. The result is the same as if you had done:
echo __('your-string');add_action
add_action( $event, $function_to_add, $priority, $accepted_args );Hooks an action event to a user-defined callback function; normally, no values are returned from these callback functions.
Example:
add_action('wp_head', 'MyClass::my_static_function');add_filter
add_filter( $event, $function_to_add, $priority, $accepted_args );Hooks a filter event to a user-defined callback function; filter events normally accept a string as input...