> For the complete documentation index, see [llms.txt](https://metabolism.gitbook.io/symfony-wordpress-bundle/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metabolism.gitbook.io/symfony-wordpress-bundle/reference/controller/frontaction.md).

# FrontAction

{% hint style="info" %}
Code is executed only when Wordpress is loaded and the front is requested. Action is instantiated by a Wordpress mu-plugins.
{% endhint %}

{% hint style="info" %}
Please not that you may need to use init or loaded function depending of the context of the action to run.&#x20;

Init function run early and Wordpress configuration file is not yet loaded completely.
{% endhint %}

```php
<?php

// src/Action/FrontAction.php

namespace App\Action;

use Metabolism\WordpressBundle\Action\FrontAction as BaseFrontAction;

class FrontAction extends BaseFrontAction
{
	/**
	 * Equivalent to if( !is_admin() ) add_action('init', function(){ })
	 */
	public function init()
	{
		//add_action
	}
	
	/**
	 * Equivalent to KernelEventsSubscriber::onKernelRequest
	 */
	public function loaded()
	{
		//add_action
	}
}

```
