-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: property, method renamings and comments
- Loading branch information
Mustafa Şükrü Kapusuz
committed
May 19, 2023
1 parent
1be9677
commit 24f6bdf
Showing
6 changed files
with
24 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
* @since 1.0.0 | ||
*/ | ||
final class Algolia_Posts_Index extends Algolia_Index { | ||
protected $settings = [ | ||
protected array $default_settings = [ | ||
'searchableAttributes' => array( | ||
'unordered(post_title)', | ||
'unordered(taxonomies)', | ||
|
@@ -288,15 +288,16 @@ private function get_post_shared_attributes( WP_Post $post ) { | |
|
||
/** | ||
* Get settings. | ||
* Overridden to able to have "algolia_posts_index_settings" filter. | ||
* | ||
* @author WebDevStudios <[email protected]> | ||
* @since 1.0.0 | ||
* | ||
* @return array | ||
*/ | ||
public function get_settings() { | ||
$this->settings = (array) apply_filters( 'algolia_posts_index_settings', $this->settings, $this->post_type ); | ||
return parent::get_settings(); | ||
public function get_default_settings() { | ||
$this->default_settings = (array) apply_filters( 'algolia_posts_index_settings', $this->default_settings, $this->post_type ); | ||
return parent::get_default_settings(); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,14 +249,15 @@ private function get_post_shared_attributes( WP_Post $post ) { | |
/** | ||
* Get settings. | ||
* | ||
* Overridden to able to have "excerpt_length" WP filter hook for the attributesToSnippet.content | ||
* | ||
* @author WebDevStudios <[email protected]> | ||
* @since 1.0.0 | ||
* | ||
* @return array | ||
*/ | ||
public function get_settings() { | ||
// override settings prop to inject the WP Filter Hook. | ||
$this->settings = [ | ||
public function get_default_settings() { | ||
$this->default_settings = [ | ||
'searchableAttributes' => array( | ||
'unordered(post_title)', | ||
'unordered(taxonomies)', | ||
|
@@ -282,7 +283,7 @@ public function get_settings() { | |
'snippetEllipsisText' => '…', | ||
]; | ||
|
||
return parent::get_settings(); | ||
return parent::get_default_settings(); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters