Created
December 15, 2023 06:42
-
-
Save iamrealfarhanbd/500f389c3dda50eb8a1b71d5972812dc to your computer and use it in GitHub Desktop.
Code snippet to modify the delay time for Ninja Tables filter functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adjust the delay time for Ninja Tables filter functionality. | |
* | |
* @param int $delayTime The default delay time in milliseconds. | |
* @param int $tableId The ID of the Ninja Table. | |
* @return int The modified delay time. | |
*/ | |
add_filter('ninja_table_search_time_delay', function ($delayTime, $tableId) { | |
if ($tableId == 1) { | |
return 500; // 500ms for a particular table | |
} | |
return $delayTime; // default delay time (1000ms) for all tables except table id 1 | |
}, 10, 2); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code snippet checks if the table ID is 1, and if so, it sets the delay time to 500 milliseconds. For all other tables, the default delay time remains 1000 milliseconds.