File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
includes/indices/settings Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,21 @@ public function get_settings_needs_sync(): array {
49
49
return $ needs_sync ;
50
50
}
51
51
52
- public function push (): bool {
53
- $ settings_needs_sync = $ this ->get_settings_needs_sync ();
54
-
55
- if ( count ( $ settings_needs_sync ) === 0 ) {
52
+ /**
53
+ * Push settings to the Algolia
54
+ *
55
+ * @param array $overrides The settings array that will be forcefully pushed.
56
+ * @return bool
57
+ */
58
+ public function push ( $ overrides = [] ): bool {
59
+ $ settings = wp_parse_args ( $ overrides , $ this ->get_settings_needs_sync () );
60
+
61
+ if ( count ( $ settings ) === 0 ) {
56
62
return false ;
57
63
}
58
64
59
65
try {
60
- $ this ->get_algolia_index ()->setSettings ( $ settings_needs_sync );
66
+ $ this ->get_algolia_index ()->setSettings ( $ settings );
61
67
} catch ( Exception $ e ) {
62
68
return false ;
63
69
}
You can’t perform that action at this time.
0 commit comments