| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin settings registerer. |
| 4 |
* |
| 5 |
* @since 1.6.0 |
| 6 |
* |
| 7 |
* @package woo-additional-terms |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Woo_Additional_Terms\Settings; |
| 11 |
|
| 12 |
/** |
| 13 |
* Register plugin settings fields. |
| 14 |
*/ |
| 15 |
class Register { |
| 16 |
|
| 17 |
/** |
| 18 |
* Setup hooks and filters. |
| 19 |
* |
| 20 |
* @since 1.6.0 |
| 21 |
* |
| 22 |
* @return void |
| 23 |
*/ |
| 24 |
public function setup() { |
| 25 |
|
| 26 |
add_filter( 'woocommerce_get_settings_pages', array( $this, 'settings' ) ); |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* We will add our settings pages using the following filter, so that the code that |
| 31 |
* being used to hook into that filter is init by a filter later than `wp_loaded`. |
| 32 |
* |
| 33 |
* @since 1.6.0 |
| 34 |
* |
| 35 |
* @param array $settings Setting pages. |
| 36 |
* |
| 37 |
* @return array |
| 38 |
*/ |
| 39 |
public function settings( $settings ) { |
| 40 |
|
| 41 |
// Add our settings page. |
| 42 |
$settings[] = woo_additional_terms()->service( 'settings' ); |
| 43 |
return $settings; |
| 44 |
} |
| 45 |
} |
| 46 |
|