Skip to content

Commit b0f7882

Browse files
author
Mustafa Şükrü Kapusuz
committed
refactor: move some filter hooks which refactored with last commit to earlier
1 parent 637630a commit b0f7882

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

includes/indices/class-algolia-posts-index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ private function get_post_shared_attributes( WP_Post $post ) {
295295
* @return array
296296
*/
297297
public function get_settings() {
298-
return (array) apply_filters( 'algolia_posts_index_settings', parent::get_settings(), $this->post_type );
298+
$this->settings = (array) apply_filters( 'algolia_posts_index_settings', $this->settings, $this->post_type );
299+
return parent::get_settings();
299300
}
300301

301302
/**

includes/indices/class-algolia-terms-index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ protected function get_re_index_items_count() {
139139
* @return array
140140
*/
141141
public function get_settings() {
142-
return apply_filters( 'algolia_terms_index_settings', parent::get_settings(), $this->taxonomy );
142+
// override settings prop to have a custom WP filter hook for terms only
143+
$this->settings = apply_filters( 'algolia_terms_index_settings', $this->settings, $this->taxonomy );
144+
return parent::get_settings();
143145
}
144146

145147
/**

0 commit comments

Comments
 (0)