Documentation

apply_filters("whereused_save_term_scan", \WP_Term | \WP_Error $term)

Details

  • whereused_save_term_scan
  • filter hook
  • Active
  • 1.0.0

Description

Use this filter to prevent a specific term from being rescanned when a term is saved.

Parameters

$term \WP_Term | \WP_Error
WP Term object or WP Error object if no term can be found

Example Code To Prevent Rescan of Term

/**
 * Prevent a term from being rescanned by WhereUsed when a Term is saved
 *
 * @package WhereUsed
 * @since 1.0.4
 *
 * @param \WP_Term|\WP_Error $term
 *
 * @return bool
 **/
function custom_whereused_save_term_scan( object $term ): bool {

    $rescan_term = true;

    if ( 12 == $term->term_id ) {
        // Prevent specific term with the ID of 12 from being rescanned
        $rescan_term = false;
    }

	return $rescan_term;
}
add_filter( 'whereused_save_term_scan', 'custom_whereused_save_term_scan', 10, 1 );

If you notice any incorrect or missing information on this page, please let us know.