| @@ -2,13 +2,12 @@ | ||
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | 4 | * Register all actions and filters for the plugin |
| 5 | 5 | * |
| 6 | - * @link https://plugins360.com | |
| 7 | - * @since 1.0.0 | |
| 6 | + * @link https://plugins360.com | |
| 7 | + * @since 1.0.0 | |
| 8 | 8 | * |
| 9 | - * @package Automatic_YouTube_Gallery | |
| 10 | - * @subpackage Automatic_YouTube_Gallery/includes | |
| 9 | + * @package Automatic_YouTube_Gallery | |
| 11 | 10 | */ |
| 12 | 11 | |
| 13 | 12 | // Exit if accessed directly |
| 14 | 13 | if ( ! defined( 'WPINC' ) ) { |
| @@ -45,12 +44,10 @@ | ||
| 45 | 44 | * |
| 46 | 45 | * @since 1.0.0 |
| 47 | 46 | */ |
| 48 | 47 | public function __construct() { |
| 49 | - | |
| 50 | 48 | $this->actions = array(); |
| 51 | 49 | $this->filters = array(); |
| 52 | - | |
| 53 | 50 | } |
| 54 | 51 | |
| 55 | 52 | /** |
| 56 | 53 | * Add a new action to the collection to be registered with WordPress. |
| @@ -94,9 +91,8 @@ | ||
| 94 | 91 | * @param int $accepted_args The number of arguments that should be passed to the $callback. |
| 95 | 92 | * @return array The collection of actions and filters registered with WordPress. |
| 96 | 93 | */ |
| 97 | 94 | private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
| 98 | - | |
| 99 | 95 | $hooks[] = array( |
| 100 | 96 | 'hook' => $hook, |
| 101 | 97 | 'component' => $component, |
| 102 | 98 | 'callback' => $callback, |
| @@ -104,9 +100,8 @@ | ||
| 104 | 100 | 'accepted_args' => $accepted_args |
| 105 | 101 | ); |
| 106 | 102 | |
| 107 | 103 | return $hooks; |
| 108 | - | |
| 109 | 104 | } |
| 110 | 105 | |
| 111 | 106 | /** |
| 112 | 107 | * Register the filters and actions with WordPress. |
| @@ -113,9 +108,8 @@ | ||
| 113 | 108 | * |
| 114 | 109 | * @since 1.0.0 |
| 115 | 110 | */ |
| 116 | 111 | public function run() { |
| 117 | - | |
| 118 | 112 | foreach ( $this->filters as $hook ) { |
| 119 | 113 | add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
| 120 | 114 | } |
| 121 | 115 | |
| @@ -121,8 +115,7 @@ | ||
| 121 | 115 | |
| 122 | 116 | foreach ( $this->actions as $hook ) { |
| 123 | 117 | add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
| 124 | 118 | } |
| 125 | - | |
| 126 | 119 | } |
| 127 | 120 | |
| 128 | 121 | } |