themes_update_check_locales
Filter HookDescription
Filters the locales requested for theme translations.Hook Information
File Location |
wp-includes/update.php
View on GitHub
|
Hook Type | Filter |
Line Number | 697 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$locales
|
Theme locales. Default is all available locales of the site. |
Usage Examples
Basic Usage
<?php
// Hook into themes_update_check_locales
add_filter('themes_update_check_locales', 'my_custom_filter', 10, 1);
function my_custom_filter($locales) {
// Your custom filtering logic here
return $locales;
}
Source Code Context
wp-includes/update.php:697
- How this hook is used in WordPress core
<?php
692 * @since 3.7.0
693 * @since 4.5.0 The default value of the `$locales` parameter changed to include all locales.
694 *
695 * @param string[] $locales Theme locales. Default is all available locales of the site.
696 */
697 $locales = apply_filters( 'themes_update_check_locales', $locales );
698 $locales = array_unique( $locales );
699
700 if ( $doing_cron ) {
701 $timeout = 30; // 30 seconds.
702 } else {
PHP Documentation
<?php
/**
* Filters the locales requested for theme translations.
*
* @since 3.7.0
* @since 4.5.0 The default value of the `$locales` parameter changed to include all locales.
*
* @param string[] $locales Theme locales. Default is all available locales of the site.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/update.php
Related Hooks
Related hooks will be displayed here in future updates.