@@ -33,7 +33,7 @@ |
||
33 | 33 | * @since 1.0.0 |
34 | 34 | */ |
35 | 35 | public function get_title() { |
36 | - return __( 'Author', 'wordpoints' ); |
|
36 | + return __('Author', 'wordpoints'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -12,17 +12,17 @@ |
||
12 | 12 | * |
13 | 13 | * @since 1.0.0 |
14 | 14 | */ |
15 | -require_once( dirname( __FILE__ ) . '/includes/functions.php' ); |
|
15 | +require_once(dirname(__FILE__).'/includes/functions.php'); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * The admin-side actions and filters. |
19 | 19 | * |
20 | 20 | * @since 1.0.0 |
21 | 21 | */ |
22 | -require_once( dirname( __FILE__ ) . '/includes/actions.php' ); |
|
22 | +require_once(dirname(__FILE__).'/includes/actions.php'); |
|
23 | 23 | |
24 | 24 | WordPoints_Class_Autoloader::register_dir( |
25 | - dirname( __FILE__ ) . '/includes/classes' |
|
25 | + dirname(__FILE__).'/includes/classes' |
|
26 | 26 | , 'WordPoints_Admin_' |
27 | 27 | ); |
28 | 28 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function get_title() { |
38 | 38 | |
39 | - $post_type = get_post_type_object( substr( $this->slug, 5 /* post\ */ ) ); |
|
39 | + $post_type = get_post_type_object(substr($this->slug, 5 /* post\ */)); |
|
40 | 40 | |
41 | - if ( $post_type ) { |
|
41 | + if ($post_type) { |
|
42 | 42 | return $post_type->labels->singular_name; |
43 | 43 | } else { |
44 | 44 | return $this->slug; |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * @since 1.0.0 |
50 | 50 | */ |
51 | - public function user_can_view( $user_id, $id ) { |
|
52 | - return user_can( $user_id, 'read_post', $id ); |
|
51 | + public function user_can_view($user_id, $id) { |
|
52 | + return user_can($user_id, 'read_post', $id); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | 31 | |
32 | - $taxonomy = get_taxonomy( substr( $this->slug, 5 /* term\ */ ) ); |
|
32 | + $taxonomy = get_taxonomy(substr($this->slug, 5 /* term\ */)); |
|
33 | 33 | |
34 | - if ( $taxonomy ) { |
|
34 | + if ($taxonomy) { |
|
35 | 35 | return $taxonomy->labels->singular_name; |
36 | 36 | } else { |
37 | 37 | return $this->slug; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @since 1.0.0 |
43 | 43 | */ |
44 | - public function get_entity( $id ) { |
|
45 | - return get_term( $id, 'taxonomy' ); |
|
44 | + public function get_entity($id) { |
|
45 | + return get_term($id, 'taxonomy'); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function get_title() { |
31 | 31 | |
32 | - $taxonomy = get_taxonomy( substr( $this->slug, 6 /* terms\ */ ) ); |
|
32 | + $taxonomy = get_taxonomy(substr($this->slug, 6 /* terms\ */)); |
|
33 | 33 | |
34 | - if ( $taxonomy ) { |
|
34 | + if ($taxonomy) { |
|
35 | 35 | return $taxonomy->labels->name; |
36 | 36 | } else { |
37 | 37 | return parent::get_title(); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @since 1.0.0 |
43 | 43 | */ |
44 | - protected function get_related_entity_ids( WordPoints_Entity $entity ) { |
|
44 | + protected function get_related_entity_ids(WordPoints_Entity $entity) { |
|
45 | 45 | |
46 | 46 | $id = $entity->get_the_id(); |
47 | 47 | |
48 | - $taxonomies = get_object_taxonomies( get_post( $id ) ); |
|
48 | + $taxonomies = get_object_taxonomies(get_post($id)); |
|
49 | 49 | |
50 | - return wp_get_object_terms( $id, $taxonomies, array( 'fields' => 'ids' ) ); |
|
50 | + return wp_get_object_terms($id, $taxonomies, array('fields' => 'ids')); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 |
@@ -46,17 +46,17 @@ |
||
46 | 46 | */ |
47 | 47 | protected function get_entity_title() { |
48 | 48 | |
49 | - $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
|
49 | + $parts = wordpoints_parse_dynamic_slug($this->slug); |
|
50 | 50 | |
51 | - if ( $parts['dynamic'] ) { |
|
51 | + if ($parts['dynamic']) { |
|
52 | 52 | $entity_slug = "{$this->generic_entity_slug}\\{$parts['dynamic']}"; |
53 | 53 | } else { |
54 | 54 | $entity_slug = $this->generic_entity_slug; |
55 | 55 | } |
56 | 56 | |
57 | - $entity = wordpoints_entities()->get( $entity_slug ); |
|
57 | + $entity = wordpoints_entities()->get($entity_slug); |
|
58 | 58 | |
59 | - if ( ! $entity instanceof WordPoints_Entity ) { |
|
59 | + if ( ! $entity instanceof WordPoints_Entity) { |
|
60 | 60 | return $this->slug; |
61 | 61 | } |
62 | 62 |
@@ -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(); ?> |