Changeset 5230
- Timestamp:
- 04/01/2017 02:00:51 PM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/filter/class-options.php
r4032 r5230 9 9 */ 10 10 private $options = []; 11 12 /** 13 * @var Option[] 14 */ 15 private $filter_options = []; 16 11 17 12 18 /** … … 24 30 25 31 /** 32 * @param Option $option The option. 33 */ 34 public function add_filter_option( Option $option ) { 35 $this->filter_options[] = $option; 36 } 37 38 /** 26 39 * Registers the filters. 27 40 */ … … 35 48 ); 36 49 } 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 } 37 59 } 38 60 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-main.php
r4108 r5230 108 108 } ) 109 109 ); 110 $options->add_filter_option( 111 ( new Filter\Option() ) 112 ->set_name( 'stats_options' ) 113 ->set_callback( function( $options ) { 114 $options['roles'] = [ 115 'administrator', 116 'editor', 117 'author', 118 Role\Locale_Manager::get_name(), 119 ]; 120 return $options; 121 } ) 122 ->set_num_args( 1 ) 123 ); 124 110 125 $options->setup(); 111 126 }
Note: See TracChangeset
for help on using the changeset viewer.