Fix: Sync interruption message always mentions ElasticPress.io #2813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This PR fixes the the issue where the Sync interruption messages always show ElasticPress.io regardless of host settings. The issue was when
Utils\is_epio()
returns0
,wp_localize_script
convert it into string'0'
and in JSif ( '0' )
givestrue
.With the use of
FILTER_VALIDATE_BOOLEAN
is_epio
returns empty in case offalse
and1
if the value is true.Closes #2784
Verification Process
wp elasticpress stop-indexing
Your indexing process has been stopped by WP-CLI and your Elasticsearch index could be missing content
incase of self hosted ElasticSearchChangelog Entry
Fixed: Sync interruption message always mentions ElasticPress.io
Credits
Props @burhandodhy