Themosis\Hook\IHook::add PHP Method

add() public method

Add event using the WordPress hooks.
public add ( string $hook, Closure | string $callback, integer $priority = 10, integer $accepted_args = 2 ) : mixed
$hook string The hook name.
$callback Closure | string Using a class method like so "MyClass@method"
$priority integer
$accepted_args integer
return mixed
    public function add($hook, $callback, $priority = 10, $accepted_args = 2);

Usage Example

Beispiel #1
0
 /**
  * Add custom image sizes.
  *
  * @return \Themosis\Config\Images
  */
 public function make()
 {
     // Add registered image sizes.
     $this->addImages();
     // Add sizes to the media attachment settings dropdown list.
     $this->filter->add('image_size_names_choose', [$this, 'addImagesToDropDownList']);
     return $this;
 }
All Usage Examples Of Themosis\Hook\IHook::add