Filter hook 'wp_prepare_themes_for_js'

in WP Core File wp-admin/includes/theme.php at line 816

View Source

wp_prepare_themes_for_js

Filter Hook
Description
Filters the themes prepared for JavaScript, for themes.php. Could be useful for changing the order, which is by name by default.

Hook Information

File Location wp-admin/includes/theme.php View on GitHub
Hook Type Filter
Line Number 816

Hook Parameters

Type Name Description
array $prepared_themes Array of theme data.

Usage Examples

Basic Usage
<?php
// Hook into wp_prepare_themes_for_js
add_filter('wp_prepare_themes_for_js', 'my_custom_filter', 10, 1);

function my_custom_filter($prepared_themes) {
    // Your custom filtering logic here
    return $prepared_themes;
}

Source Code Context

wp-admin/includes/theme.php:816 - How this hook is used in WordPress core
<?php
 811  	 *
 812  	 * @since 3.8.0
 813  	 *
 814  	 * @param array $prepared_themes Array of theme data.
 815  	 */
 816  	$prepared_themes = apply_filters( 'wp_prepare_themes_for_js', $prepared_themes );
 817  	$prepared_themes = array_values( $prepared_themes );
 818  	return array_filter( $prepared_themes );
 819  }
 820  
 821  /**

PHP Documentation

<?php
/**
	 * Filters the themes prepared for JavaScript, for themes.php.
	 *
	 * Could be useful for changing the order, which is by name by default.
	 *
	 * @since 3.8.0
	 *
	 * @param array $prepared_themes Array of theme data.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.