@@ -24,20 +24,20 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function get_title() { |
26 | 26 | |
27 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
27 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
28 | 28 | |
29 | - switch ( $parsed['dynamic'] ) { |
|
29 | + switch ($parsed['dynamic']) { |
|
30 | 30 | |
31 | 31 | case 'post': |
32 | - return __( 'Publish Post', 'wordpoints' ); |
|
32 | + return __('Publish Post', 'wordpoints'); |
|
33 | 33 | |
34 | 34 | case 'page': |
35 | - return __( 'Publish Page', 'wordpoints' ); |
|
35 | + return __('Publish Page', 'wordpoints'); |
|
36 | 36 | |
37 | 37 | default: |
38 | 38 | return sprintf( |
39 | 39 | // translators: singular name of the post type |
40 | - __( 'Publish %s', 'wordpoints' ) |
|
40 | + __('Publish %s', 'wordpoints') |
|
41 | 41 | , $this->get_entity_title() |
42 | 42 | ); |
43 | 43 | } |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function get_description() { |
50 | 50 | |
51 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
51 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
52 | 52 | |
53 | - switch ( $parsed['dynamic'] ) { |
|
53 | + switch ($parsed['dynamic']) { |
|
54 | 54 | |
55 | 55 | case 'post': |
56 | - return __( 'When a Post is published.', 'wordpoints' ); |
|
56 | + return __('When a Post is published.', 'wordpoints'); |
|
57 | 57 | |
58 | 58 | case 'page': |
59 | - return __( 'When a Page is published.', 'wordpoints' ); |
|
59 | + return __('When a Page is published.', 'wordpoints'); |
|
60 | 60 | |
61 | 61 | default: |
62 | 62 | return sprintf( |
63 | 63 | // translators: singular name of the post type |
64 | - __( 'When a %s is published.', 'wordpoints' ) |
|
64 | + __('When a %s is published.', 'wordpoints') |
|
65 | 65 | , $this->get_entity_title() |
66 | 66 | ); |
67 | 67 | } |
@@ -24,23 +24,23 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function get_title() { |
26 | 26 | |
27 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
27 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
28 | 28 | |
29 | - switch ( $parsed['dynamic'] ) { |
|
29 | + switch ($parsed['dynamic']) { |
|
30 | 30 | |
31 | 31 | case 'post': |
32 | - return __( 'Comment on a Post', 'wordpoints' ); |
|
32 | + return __('Comment on a Post', 'wordpoints'); |
|
33 | 33 | |
34 | 34 | case 'page': |
35 | - return __( 'Comment on a Page', 'wordpoints' ); |
|
35 | + return __('Comment on a Page', 'wordpoints'); |
|
36 | 36 | |
37 | 37 | case 'attachment': |
38 | - return __( 'Comment on a Media Upload', 'wordpoints' ); |
|
38 | + return __('Comment on a Media Upload', 'wordpoints'); |
|
39 | 39 | |
40 | 40 | default: |
41 | 41 | return sprintf( |
42 | 42 | // translators: singular name of the post type |
43 | - __( 'Comment on a %s', 'wordpoints' ) |
|
43 | + __('Comment on a %s', 'wordpoints') |
|
44 | 44 | , $this->get_entity_title() |
45 | 45 | ); |
46 | 46 | } |
@@ -51,23 +51,23 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function get_description() { |
53 | 53 | |
54 | - $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
|
54 | + $parsed = wordpoints_parse_dynamic_slug($this->slug); |
|
55 | 55 | |
56 | - switch ( $parsed['dynamic'] ) { |
|
56 | + switch ($parsed['dynamic']) { |
|
57 | 57 | |
58 | 58 | case 'post': |
59 | - return __( 'When a user leaves a comment on a Post.', 'wordpoints' ); |
|
59 | + return __('When a user leaves a comment on a Post.', 'wordpoints'); |
|
60 | 60 | |
61 | 61 | case 'page': |
62 | - return __( 'When a user leaves a comment on a Page.', 'wordpoints' ); |
|
62 | + return __('When a user leaves a comment on a Page.', 'wordpoints'); |
|
63 | 63 | |
64 | 64 | case 'attachment': |
65 | - return __( 'When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints' ); |
|
65 | + return __('When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints'); |
|
66 | 66 | |
67 | 67 | default: |
68 | 68 | return sprintf( |
69 | 69 | // translators: singular name of the post type |
70 | - __( 'When a user leaves a comment on a %s.', 'wordpoints' ) |
|
70 | + __('When a user leaves a comment on a %s.', 'wordpoints') |
|
71 | 71 | , $this->get_entity_title() |
72 | 72 | ); |
73 | 73 | } |
@@ -17,20 +17,20 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | - public function __construct( $slug ) { |
|
20 | + public function __construct($slug) { |
|
21 | 21 | |
22 | - parent::__construct( $slug ); |
|
22 | + parent::__construct($slug); |
|
23 | 23 | |
24 | - $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
|
24 | + $parts = wordpoints_parse_dynamic_slug($this->slug); |
|
25 | 25 | |
26 | - if ( $parts['dynamic'] ) { |
|
26 | + if ($parts['dynamic']) { |
|
27 | 27 | |
28 | - $parsed = $this->parse_slug( $this->related_entity_slug ); |
|
28 | + $parsed = $this->parse_slug($this->related_entity_slug); |
|
29 | 29 | |
30 | 30 | $this->primary_entity_slug = "{$this->primary_entity_slug}\\{$parts['dynamic']}"; |
31 | 31 | $this->related_entity_slug = "{$parsed['slug']}\\{$parts['dynamic']}"; |
32 | 32 | |
33 | - if ( $parsed['is_array'] ) { |
|
33 | + if ($parsed['is_array']) { |
|
34 | 34 | $this->related_entity_slug .= '{}'; |
35 | 35 | } |
36 | 36 | } |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get_title() { |
43 | 43 | |
44 | - $parsed = $this->parse_slug( $this->related_entity_slug ); |
|
44 | + $parsed = $this->parse_slug($this->related_entity_slug); |
|
45 | 45 | |
46 | - $entity = wordpoints_entities()->get( $parsed['slug'] ); |
|
46 | + $entity = wordpoints_entities()->get($parsed['slug']); |
|
47 | 47 | |
48 | - if ( $entity instanceof WordPoints_Entity ) { |
|
48 | + if ($entity instanceof WordPoints_Entity) { |
|
49 | 49 | return $entity->get_title(); |
50 | 50 | } else { |
51 | 51 | return $this->related_entity_slug; |
@@ -7,17 +7,17 @@ |
||
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -add_action( 'wordpoints_init_app-apps', 'wordpoints_hooks_register_admin_apps' ); |
|
10 | +add_action('wordpoints_init_app-apps', 'wordpoints_hooks_register_admin_apps'); |
|
11 | 11 | |
12 | -add_action( 'admin_menu', 'wordpoints_hooks_api_admin_menu' ); |
|
12 | +add_action('admin_menu', 'wordpoints_hooks_api_admin_menu'); |
|
13 | 13 | |
14 | -if ( is_wordpoints_network_active() ) { |
|
15 | - add_action( 'network_admin_menu', 'wordpoints_hooks_api_admin_menu' ); |
|
14 | +if (is_wordpoints_network_active()) { |
|
15 | + add_action('network_admin_menu', 'wordpoints_hooks_api_admin_menu'); |
|
16 | 16 | } |
17 | 17 | |
18 | -add_action( 'admin_init', 'wordpoints_hooks_admin_register_scripts' ); |
|
19 | -add_action( 'admin_init', 'wordpoints_hooks_admin_ajax' ); |
|
18 | +add_action('admin_init', 'wordpoints_hooks_admin_register_scripts'); |
|
19 | +add_action('admin_init', 'wordpoints_hooks_admin_ajax'); |
|
20 | 20 | |
21 | -add_filter( 'script_loader_tag', 'wordpoints_script_templates_filter', 10, 2 ); |
|
21 | +add_filter('script_loader_tag', 'wordpoints_script_templates_filter', 10, 2); |
|
22 | 22 | |
23 | 23 | // EOF |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | public function hooks() { |
63 | 63 | |
64 | 64 | /* Load the JavaScript needed for the settings screen. */ |
65 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
66 | - add_action( "admin_footer-{$this->id}", array( $this, 'footer_scripts' ) ); |
|
65 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
|
66 | + add_action("admin_footer-{$this->id}", array($this, 'footer_scripts')); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | |
99 | 99 | <div class="wrap"> |
100 | 100 | |
101 | - <h1><?php echo esc_html( $this->get_title() ); ?></h1> |
|
101 | + <h1><?php echo esc_html($this->get_title()); ?></h1> |
|
102 | 102 | |
103 | 103 | <?php settings_errors(); ?> |
104 | 104 | |
105 | - <?php if ( ! empty( $this->tabs ) ) : ?> |
|
106 | - <?php wordpoints_admin_show_tabs( $this->tabs, false ); ?> |
|
105 | + <?php if ( ! empty($this->tabs)) : ?> |
|
106 | + <?php wordpoints_admin_show_tabs($this->tabs, false); ?> |
|
107 | 107 | <?php endif; ?> |
108 | 108 | |
109 | 109 | <?php $this->display_content(); ?> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @since 1.0.0 |
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | - add_action( 'current_screen', array( $this, 'set_current_screen' ) ); |
|
30 | + add_action('current_screen', array($this, 'set_current_screen')); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -37,23 +37,23 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @param WP_Screen $current_screen The WP_Screen object for the current screen. |
39 | 39 | */ |
40 | - public function set_current_screen( $current_screen ) { |
|
40 | + public function set_current_screen($current_screen) { |
|
41 | 41 | |
42 | 42 | $screen_id = $current_screen->id; |
43 | 43 | |
44 | - if ( is_network_admin() ) { |
|
45 | - $screen_id = substr( $screen_id, 0, -8 /* -network */ ); |
|
44 | + if (is_network_admin()) { |
|
45 | + $screen_id = substr($screen_id, 0, -8 /* -network */); |
|
46 | 46 | } |
47 | 47 | |
48 | - $screen = $this->get( $screen_id ); |
|
48 | + $screen = $this->get($screen_id); |
|
49 | 49 | |
50 | - if ( ! ( $screen instanceof WordPoints_Admin_Screen ) ) { |
|
50 | + if ( ! ($screen instanceof WordPoints_Admin_Screen)) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | 54 | $this->current_screen = $screen; |
55 | 55 | |
56 | - add_action( "load-{$screen_id}", array( $this->current_screen, 'load' ) ); |
|
56 | + add_action("load-{$screen_id}", array($this->current_screen, 'load')); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function get_current_id() { |
23 | 23 | |
24 | - if ( ! is_multisite() ) { |
|
24 | + if ( ! is_multisite()) { |
|
25 | 25 | return 1; |
26 | 26 | } |
27 | 27 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | /** |
27 | 27 | * @since 1.0.0 |
28 | 28 | */ |
29 | - public function __construct( $slug ) { |
|
29 | + public function __construct($slug) { |
|
30 | 30 | |
31 | 31 | $this->slug = $slug; |
32 | 32 | } |
@@ -21,11 +21,11 @@ |
||
21 | 21 | */ |
22 | 22 | public function get_current_id() { |
23 | 23 | |
24 | - if ( ! is_multisite() ) { |
|
24 | + if ( ! is_multisite()) { |
|
25 | 25 | return 1; |
26 | 26 | } |
27 | 27 | |
28 | - if ( wordpoints_is_network_context() ) { |
|
28 | + if (wordpoints_is_network_context()) { |
|
29 | 29 | return false; |
30 | 30 | } |
31 | 31 |