@@ -85,6 +85,9 @@ |
||
| 85 | 85 | \add_action('wp_ajax_amarkal_settings_reset', array( $this, 'reset_settings')); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $path |
|
| 90 | + */ |
|
| 88 | 91 | private function get_url( $path ) |
| 89 | 92 | { |
| 90 | 93 | $url = str_replace( ABSPATH, '', $path ); |
@@ -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 | public function save_settings() |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | private function init() |
| 82 | 82 | { |
| 83 | - \add_action('admin_init',array($this,'register_scripts')); |
|
| 84 | - \add_action('wp_ajax_amarkal_settings_save', array( $this, 'save_settings')); |
|
| 85 | - \add_action('wp_ajax_amarkal_settings_reset', array( $this, 'reset_settings')); |
|
| 83 | + \add_action('admin_init', array($this, 'register_scripts')); |
|
| 84 | + \add_action('wp_ajax_amarkal_settings_save', array($this, 'save_settings')); |
|
| 85 | + \add_action('wp_ajax_amarkal_settings_reset', array($this, 'reset_settings')); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - private function get_url( $path ) |
|
| 88 | + private function get_url($path) |
|
| 89 | 89 | { |
| 90 | - $url = str_replace( ABSPATH, '', $path ); |
|
| 91 | - return esc_url_raw( site_url( $url ) ); |
|
| 90 | + $url = str_replace(ABSPATH, '', $path); |
|
| 91 | + return esc_url_raw(site_url($url)); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |