| @@ -110,9 +110,9 @@ | ||
| 110 | 110 | * @since 4.5.0 |
| 111 | 111 | * @param string $slug Indexable slug |
| 112 | 112 | * @return boolean |
| 113 | 113 | */ |
| 114 | - public function is_active( string $slug ) : bool { | |
| 114 | + public function is_active( string $slug ): bool { | |
| 115 | 115 | return ! empty( $this->active_indexables[ $slug ] ); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| @@ -117,32 +117,30 @@ | ||
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | 119 | * Get all indexable instances |
| 120 | 120 | * |
| 121 | - * @param boolean $global If true or false, will only get Indexables with that global property. | |
| 121 | + * @param boolean $global_property If true or false, will only get Indexables with that global property. | |
| 122 | 122 | * @param boolean $slug_only True returns an array of only string slugs. |
| 123 | 123 | * @param string $status Whether to return active indexables or all registered. |
| 124 | 124 | * @since 3.0, 4.5.0 Added $status |
| 125 | 125 | * @return array |
| 126 | 126 | */ |
| 127 | - public function get_all( $global = null, $slug_only = false, $status = 'active' ) { | |
| 127 | + public function get_all( $global_property = null, $slug_only = false, $status = 'active' ) { | |
| 128 | 128 | $indexables = []; |
| 129 | 129 | $list = ( 'active' === $status ) ? $this->active_indexables : $this->registered_indexables; |
| 130 | 130 | |
| 131 | 131 | foreach ( $list as $slug => $indexable ) { |
| 132 | - if ( null === $global ) { | |
| 132 | + if ( null === $global_property ) { | |
| 133 | 133 | if ( $slug_only ) { |
| 134 | 134 | $indexables[] = $slug; |
| 135 | 135 | } else { |
| 136 | 136 | $indexables[] = $indexable; |
| 137 | 137 | } |
| 138 | - } else { | |
| 139 | - if ( $global === $indexable->global ) { | |
| 140 | - if ( $slug_only ) { | |
| 141 | - $indexables[] = $slug; | |
| 142 | - } else { | |
| 143 | - $indexables[] = $indexable; | |
| 144 | - } | |
| 138 | + } elseif ( $global_property === $indexable->global ) { | |
| 139 | + if ( $slug_only ) { | |
| 140 | + $indexables[] = $slug; | |
| 141 | + } else { | |
| 142 | + $indexables[] = $indexable; | |
| 145 | 143 | } |
| 146 | 144 | } |
| 147 | 145 | } |
| 148 | 146 | |