Plugin Directory

Changeset 3153927


Ignore:
Timestamp:
09/18/2024 12:12:33 PM (19 months ago)
Author:
wootro
Message:

Small fix

Location:
woot-ro/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • woot-ro/trunk/includes/class-woot-loader.php

    r3153520 r3153927  
    2222 * @author     Woot.ro <tehnic@woot.ro>
    2323 */
    24 class Woot_Loader {
     24class Woot_Loader
     25{
    2526
    2627    /**
     
    4748     * @since    1.0.0
    4849     */
    49     public function __construct() {
     50    public function __construct()
     51    {
    5052
    5153        $this->actions = array();
    5254        $this->filters = array();
    53 
    5455    }
    5556
     
    6465     * @param    int                  $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1.
    6566     */
    66     public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
    67         $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
     67    public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1)
     68    {
     69        $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args);
    6870    }
    6971
     
    7880     * @param    int                  $accepted_args    Optional. The number of arguments that should be passed to the $callback. Default is 1
    7981     */
    80     public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
    81         $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
     82    public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1)
     83    {
     84        $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args);
    8285    }
    8386
     
    9699     * @return   array                                  The collection of actions and filters registered with WordPress.
    97100     */
    98     private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
     101    private function add($hooks, $hook, $component, $callback, $priority, $accepted_args)
     102    {
    99103
    100104        $hooks[] = array(
     
    107111
    108112        return $hooks;
    109 
    110113    }
    111114
     
    115118     * @since    1.0.0
    116119     */
    117     public function run() {
     120    public function run()
     121    {
    118122
    119         foreach ( $this->filters as $hook ) {
    120             add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
     123        foreach ($this->filters as $hook) {
     124            add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
    121125        }
    122126
    123         foreach ( $this->actions as $hook ) {
    124             add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
     127        foreach ($this->actions as $hook) {
     128            add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
    125129        }
    126 
    127130    }
    128 
    129131}
Note: See TracChangeset for help on using the changeset viewer.