PluginProbe
ElasticPress / 5.3.5
ElasticPress v5.3.5
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
← All changes | includes/classes/Indexables.php +10 -12 4.5.25.3.5 View file →
@@ -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
@@ -151,9 +149,9 @@
151 149
152 150 /**
153 151 * Return singleton instance of class
154 152 *
155 - * @return object
153 + * @return self
156 154 */
157 155 public static function factory() {
158 156 static $instance = false;
159 157