Skip to content

Commit

Permalink
Merge pull request #2478 from 10up/feature/issue-2289
Browse files Browse the repository at this point in the history
Add `$blog_id` and `$indexable_slug` to the `ep_keep_index` filter
  • Loading branch information
felipeelia authored Nov 24, 2021
2 parents 06212bc + f2fea47 commit 9be622e
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 9be622e

Please sign in to comment.