Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $blog_id and $indexable_slug to the ep_keep_index filter #2478

Merged
merged 1 commit into from
Nov 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions includes/classes/SyncManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,15 @@ public function action_delete_blog_from_index( $blog_id ) {
* Filter to whether to keep index on site deletion
*
* @hook ep_keep_index
* @param {bool} $keep True means don't delete index
* @return {boolean} New value
* @since 3.0
* @since 3.6.2 Moved from Post\SyncManager to the main SyncManager class
* @since 3.6.5 Added `$blog_id` and `$indexable_slug`
* @param {bool} $keep True means don't delete index
* @param {int} $blog_id WP Blog ID
* @param {string} $indexable_slug Indexable slug
* @return {bool} New value
*/
if ( $indexable->index_exists( $blog_id ) && ! apply_filters( 'ep_keep_index', false ) ) {
if ( $indexable->index_exists( $blog_id ) && ! apply_filters( 'ep_keep_index', false, $blog_id, $this->indexable_slug ) ) {
$indexable->delete_index( $blog_id );
}
}
Expand Down