> For the complete documentation index, see [llms.txt](https://githubichsan.gitbook.io/journal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://githubichsan.gitbook.io/journal/wordpress-development/hooks/actions.md).

# Actions

[Actions](https://developer.wordpress.org/plugins/hooks/actions/) allow you to add data or change how WordPress operates. Actions will run at a specific point in the execution of WordPress Core, plugins, and themes. Callback functions for Actions can perform some kind of a task, like echoing output to the user or inserting something into the database. Callback functions for an Action do not return anything back to the calling Action hook.

They provide a way for running a function at a specific point in the execution of WordPress Core, plugins, and themes.

```php
function wporg_callback() {
    // do something
}
add_action( 'init', 'wporg_callback' );
```

Above code will running `wporg_callback`when init hook running.

`add_init` also support to ordering running of code using thrid parameter is for priority.

```php
add_action('init', 'aa');
add_action('init', 'bb',1); // run first than aa function
```

Action which running with `do_action()`and does'nt have second paramater we cannot do more with it.
