[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentytwentytwo/ -> functions.php (source)

   1  <?php
   2  /**
   3   * Twenty Twenty-Two functions and definitions
   4   *
   5   * @link https://developer.wordpress.org/themes/basics/theme-functions/
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Twenty_Two
   9   * @since Twenty Twenty-Two 1.0
  10   */
  11  
  12  if ( ! function_exists( 'twentytwentytwo_support' ) ) :
  13  
  14      /**
  15       * Sets up theme defaults and registers support for various WordPress features.
  16       *
  17       * @since Twenty Twenty-Two 1.0
  18       *
  19       * @return void
  20       */
  21  	function twentytwentytwo_support() {
  22  
  23          // Add support for block styles.
  24          add_theme_support( 'wp-block-styles' );
  25  
  26          // Enqueue editor styles.
  27          add_editor_style( 'style.css' );
  28      }
  29  
  30  endif;
  31  
  32  add_action( 'after_setup_theme', 'twentytwentytwo_support' );
  33  
  34  if ( ! function_exists( 'twentytwentytwo_styles' ) ) :
  35  
  36      /**
  37       * Enqueue styles.
  38       *
  39       * @since Twenty Twenty-Two 1.0
  40       *
  41       * @return void
  42       */
  43  	function twentytwentytwo_styles() {
  44          // Register theme stylesheet.
  45          $theme_version = wp_get_theme()->get( 'Version' );
  46  
  47          $version_string = is_string( $theme_version ) ? $theme_version : false;
  48          wp_register_style(
  49              'twentytwentytwo-style',
  50              get_template_directory_uri() . '/style.css',
  51              array(),
  52              $version_string
  53          );
  54  
  55          // Enqueue theme stylesheet.
  56          wp_enqueue_style( 'twentytwentytwo-style' );
  57      }
  58  
  59  endif;
  60  
  61  add_action( 'wp_enqueue_scripts', 'twentytwentytwo_styles' );
  62  
  63  // Add block patterns.
  64  require get_template_directory() . '/inc/block-patterns.php';


Generated : Tue Dec 24 08:20:01 2024 Cross-referenced by PHPXref