@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | private $form; |
| 10 | 10 | |
| 11 | - public function __construct( array $args = array() ) |
|
| 11 | + public function __construct(array $args = array()) |
|
| 12 | 12 | { |
| 13 | 13 | $this->config = array_merge($this->default_args(), $args); |
| 14 | 14 | $this->form = new \Amarkal\UI\Form($this->config['fields']); |
| 15 | 15 | |
| 16 | - \add_action('admin_menu', array($this,'add_submenu_page')); |
|
| 17 | - \add_action('admin_enqueue_scripts', array($this,'enqueue_scripts')); |
|
| 16 | + \add_action('admin_menu', array($this, 'add_submenu_page')); |
|
| 17 | + \add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function add_submenu_page() |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function enqueue_scripts() |
| 33 | 33 | { |
| 34 | 34 | // Only enqueue styles & scripts if this is a settings page |
| 35 | - if($this->config['slug'] === filter_input(INPUT_GET, 'page')) |
|
| 35 | + if ($this->config['slug'] === filter_input(INPUT_GET, 'page')) |
|
| 36 | 36 | { |
| 37 | 37 | \wp_enqueue_style('amarkal-settings'); |
| 38 | 38 | \wp_enqueue_script('amarkal-settings'); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public static function get_instance() |
| 22 | 22 | { |
| 23 | - if( null === static::$instance ) |
|
| 23 | + if (null === static::$instance) |
|
| 24 | 24 | { |
| 25 | 25 | static::$instance = new static(); |
| 26 | 26 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function add_page($args) |
| 31 | 31 | { |
| 32 | 32 | $slug = $args['slug']; |
| 33 | - if(array_key_exists($slug,$this->pages)) |
|
| 33 | + if (array_key_exists($slug, $this->pages)) |
|
| 34 | 34 | { |
| 35 | 35 | throw new \RuntimeException("A page with slug '$slug' has already been registered"); |
| 36 | 36 | } |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function register_settings() |
| 46 | 46 | { |
| 47 | - register_setting( 'myoption-group', 'new_option_name' ); |
|
| 48 | - register_setting( 'myoption-group', 'some_other_option' ); |
|
| 49 | - register_setting( 'myoption-group', 'option_etc' ); |
|
| 47 | + register_setting('myoption-group', 'new_option_name'); |
|
| 48 | + register_setting('myoption-group', 'some_other_option'); |
|
| 49 | + register_setting('myoption-group', 'option_etc'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function register_scripts() |
| 56 | 56 | { |
| 57 | - \wp_register_style('amarkal-settings',$this->get_url(__DIR__.'/assets/css/style.min.css')); |
|
| 58 | - \wp_register_script('amarkal-settings',$this->get_url(__DIR__.'/assets/js/script.min.js')); |
|
| 57 | + \wp_register_style('amarkal-settings', $this->get_url(__DIR__.'/assets/css/style.min.css')); |
|
| 58 | + \wp_register_script('amarkal-settings', $this->get_url(__DIR__.'/assets/js/script.min.js')); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | private function init() |
| 70 | 70 | { |
| 71 | - \add_action('admin_init',array($this,'register_scripts')); |
|
| 71 | + \add_action('admin_init', array($this, 'register_scripts')); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - private function get_url( $path ) |
|
| 74 | + private function get_url($path) |
|
| 75 | 75 | { |
| 76 | - $url = str_replace( ABSPATH, '', $path ); |
|
| 77 | - return esc_url_raw( site_url( $url ) ); |
|
| 76 | + $url = str_replace(ABSPATH, '', $path); |
|
| 77 | + return esc_url_raw(site_url($url)); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | \ No newline at end of file |