@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
25 | 25 | |
26 | - if ( ! $parts['dynamic'] ) { |
|
26 | + if ( ! $parts[ 'dynamic' ] ) { |
|
27 | 27 | // Back-compat for pre-2.3.0, just in case of manual construction without |
28 | 28 | // the parent slug. |
29 | 29 | if ( isset( $parent_slug ) ) { |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | - if ( $parts['dynamic'] ) { |
|
34 | + if ( $parts[ 'dynamic' ] ) { |
|
35 | 35 | |
36 | 36 | // Back compat for pre-2.4.0, in case of manual construction. |
37 | 37 | if ( ! isset( $parent_slug ) ) { |
38 | - $this->primary_entity_slug = "{$this->primary_entity_slug}\\{$parts['dynamic']}"; |
|
38 | + $this->primary_entity_slug = "{$this->primary_entity_slug}\\{$parts[ 'dynamic' ]}"; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $parsed = $this->parse_slug( $this->related_entity_slug ); |
42 | 42 | |
43 | - $this->related_entity_slug = "{$parsed['slug']}\\{$parts['dynamic']}"; |
|
43 | + $this->related_entity_slug = "{$parsed[ 'slug' ]}\\{$parts[ 'dynamic' ]}"; |
|
44 | 44 | |
45 | - if ( $parsed['is_array'] ) { |
|
45 | + if ( $parsed[ 'is_array' ] ) { |
|
46 | 46 | $this->related_entity_slug .= '{}'; |
47 | 47 | } |
48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $parsed = $this->parse_slug( $this->related_entity_slug ); |
57 | 57 | |
58 | - $entity = wordpoints_entities()->get( $parsed['slug'] ); |
|
58 | + $entity = wordpoints_entities()->get( $parsed[ 'slug' ] ); |
|
59 | 59 | |
60 | 60 | if ( $entity instanceof WordPoints_Entity ) { |
61 | 61 | return $entity->get_title(); |
@@ -82,11 +82,11 @@ |
||
82 | 82 | 'type' => 'db', |
83 | 83 | 'info' => array( |
84 | 84 | 'type' => 'table', |
85 | - 'table_name' => $GLOBALS['wpdb']->{$this->wpdb_table_name}, |
|
85 | + 'table_name' => $GLOBALS[ 'wpdb' ]->{$this->wpdb_table_name}, |
|
86 | 86 | 'conditions' => array( |
87 | 87 | array( |
88 | 88 | 'field' => array( |
89 | - 'table_name' => $GLOBALS['wpdb']->term_taxonomy, |
|
89 | + 'table_name' => $GLOBALS[ 'wpdb' ]->term_taxonomy, |
|
90 | 90 | 'on' => array( |
91 | 91 | 'primary_field' => 'term_id', |
92 | 92 | 'join_field' => 'term_id', |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | protected function get_related_guids_from_ids( $related_ids ) { |
151 | 151 | |
152 | 152 | $parsed_slug = $this->parse_slug( $this->get_related_entity_slug() ); |
153 | - $slug = $parsed_slug['slug']; |
|
153 | + $slug = $parsed_slug[ 'slug' ]; |
|
154 | 154 | |
155 | 155 | /** @var WordPoints_Entity $related_entity */ |
156 | 156 | $related_entity = wordpoints_entities()->get( $slug ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $related_guids = array(); |
169 | 169 | |
170 | 170 | foreach ( $related_ids as $id ) { |
171 | - $related_guids[] = array( $slug => $id ) + $context; |
|
171 | + $related_guids[ ] = array( $slug => $id ) + $context; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | } else { |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | |
256 | 256 | $parsed_slug = $this->parse_slug( $child_slug ); |
257 | 257 | |
258 | - if ( $parsed_slug['is_array'] ) { |
|
259 | - $child = new WordPoints_Entity_Array( $parsed_slug['slug'] ); |
|
258 | + if ( $parsed_slug[ 'is_array' ] ) { |
|
259 | + $child = new WordPoints_Entity_Array( $parsed_slug[ 'slug' ] ); |
|
260 | 260 | } else { |
261 | - $child = wordpoints_entities()->get( $parsed_slug['slug'] ); |
|
261 | + $child = wordpoints_entities()->get( $parsed_slug[ 'slug' ] ); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | if ( isset( $this->the_value ) ) { |
@@ -84,7 +84,7 @@ |
||
84 | 84 | 'type' => 'db', |
85 | 85 | 'info' => array( |
86 | 86 | 'type' => 'table', |
87 | - 'table_name' => $GLOBALS['wpdb']->{$this->wpdb_table_name}, |
|
87 | + 'table_name' => $GLOBALS[ 'wpdb' ]->{$this->wpdb_table_name}, |
|
88 | 88 | 'conditions' => array( |
89 | 89 | array( |
90 | 90 | 'field' => 'post_type', |
@@ -55,10 +55,10 @@ |
||
55 | 55 | 'type' => 'db', |
56 | 56 | 'info' => array( |
57 | 57 | 'type' => 'table', |
58 | - 'table_name' => $GLOBALS['wpdb']->term_relationships, |
|
58 | + 'table_name' => $GLOBALS[ 'wpdb' ]->term_relationships, |
|
59 | 59 | 'primary_id_field' => 'object_id', |
60 | 60 | 'related_id_field' => array( |
61 | - 'table_name' => $GLOBALS['wpdb']->term_taxonomy, |
|
61 | + 'table_name' => $GLOBALS[ 'wpdb' ]->term_taxonomy, |
|
62 | 62 | 'on' => array( |
63 | 63 | 'primary_field' => 'term_taxonomy_id', |
64 | 64 | 'join_field' => 'term_taxonomy_id', |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | unset( $this->entities[ $slug ] ); |
78 | 78 | |
79 | 79 | if ( |
80 | - isset( $this->hierarchy[0] ) |
|
81 | - && $this->hierarchy[0]->get_slug() === $slug |
|
80 | + isset( $this->hierarchy[ 0 ] ) |
|
81 | + && $this->hierarchy[ 0 ]->get_slug() === $slug |
|
82 | 82 | ) { |
83 | 83 | $this->current = null; |
84 | 84 | $this->hierarchy = array(); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | if ( $this->current ) { |
115 | - $this->hierarchy[] = $this->current; |
|
115 | + $this->hierarchy[ ] = $this->current; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | $this->current = $child; |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $table_name = str_replace( '`', '``', $table_name ); |
88 | 88 | $table_schema = trim( $table_schema ); |
89 | 89 | |
90 | - $schema[] = "CREATE TABLE {$prefix}{$table_name} ( |
|
90 | + $schema[ ] = "CREATE TABLE {$prefix}{$table_name} ( |
|
91 | 91 | {$table_schema} |
92 | 92 | ) {$charset_collate}"; |
93 | 93 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | // Make sure the version is set properly even if the data is already |
39 | 39 | // there, in case the plugin is being reactivated and things had been |
40 | 40 | // corrupted somehow. |
41 | - $data['version'] = WORDPOINTS_VERSION; |
|
41 | + $data[ 'version' ] = WORDPOINTS_VERSION; |
|
42 | 42 | |
43 | 43 | wordpoints_update_maybe_network_option( 'wordpoints_data', $data ); |
44 | 44 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->installable->set_network_installed(); |
76 | 76 | |
77 | - if ( ! isset( $this->install_routines['site'] ) ) { |
|
77 | + if ( ! isset( $this->install_routines[ 'site' ] ) ) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | 80 | |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | */ |
104 | 104 | protected function run_for_network() { |
105 | 105 | |
106 | - if ( ! empty( $this->install_routines['network'] ) ) { |
|
107 | - $this->run_routines( $this->install_routines['network'] ); |
|
106 | + if ( ! empty( $this->install_routines[ 'network' ] ) ) { |
|
107 | + $this->run_routines( $this->install_routines[ 'network' ] ); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | $this->installable->set_db_version( null, true ); |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | */ |
116 | 116 | protected function run_for_site() { |
117 | 117 | |
118 | - if ( ! empty( $this->install_routines['site'] ) ) { |
|
119 | - $this->run_routines( $this->install_routines['site'] ); |
|
118 | + if ( ! empty( $this->install_routines[ 'site' ] ) ) { |
|
119 | + $this->run_routines( $this->install_routines[ 'site' ] ); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | if ( ! $this->network_wide ) { |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | */ |
131 | 131 | protected function run_for_single() { |
132 | 132 | |
133 | - if ( ! empty( $this->install_routines['single'] ) ) { |
|
134 | - $this->run_routines( $this->install_routines['single'] ); |
|
133 | + if ( ! empty( $this->install_routines[ 'single' ] ) ) { |
|
134 | + $this->run_routines( $this->install_routines[ 'single' ] ); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $this->installable->set_db_version(); |