Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_prepare_themes_for_js

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
649       * Passing a non-empty array will result in wp_prepare_themes_for_js() returning
650       * early with that value instead.
651       *
652       * @since 4.2.0
653       *
654       * @param array           $prepared_themes An associative array of theme data. Default empty array.
655       * @param WP_Theme[]|null $themes          An array of theme objects to prepare, if any.
656       * @param string          $current_theme   The current theme slug.
657       */
658      $prepared_themes = (array) apply_filters( 'pre_prepare_themes_for_js', array(), $themes, $current_theme );
659
660      if ( ! empty( $prepared_themes ) ) {
661           return $prepared_themes;
662      }
663
664      // Make sure the current theme is listed first.
665      $prepared_themes[ $current_theme ] = array();
666
667      if ( null === $themes ) {