WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/01/2017 02:00:51 PM (5 years ago)
Author:
ocean90
Message:

Rosetta: Allow locale managers to view site stats.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/filter/class-options.php

    r4032 r5230  
    99     */
    1010    private $options = [];
     11
     12    /**
     13     * @var Option[]
     14     */
     15    private $filter_options = [];
     16
    1117
    1218    /**
     
    2430
    2531    /**
     32     * @param Option $option The option.
     33     */
     34    public function add_filter_option( Option $option ) {
     35        $this->filter_options[] = $option;
     36    }
     37
     38    /**
    2639     * Registers the filters.
    2740     */
     
    3548            );
    3649        }
     50
     51        foreach ( $this->filter_options as $option ) {
     52            add_filter(
     53                "option_{$option->get_name()}",
     54                $option->get_callback(),
     55                $option->get_priority(),
     56                $option->get_num_args()
     57            );
     58        }
    3759    }
    3860}
Note: See TracChangeset for help on using the changeset viewer.