mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-08 20:01:12 +01:00
d8936a9fe7
Note: This is enforced by WPCS 3.0.0. Follow-up to [56536], [56547]. Props jrf. See #59161, #58831. Built from https://develop.svn.wordpress.org/trunk@56548 git-svn-id: http://core.svn.wordpress.org/trunk@56060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
66 lines
1.4 KiB
PHP
66 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Twenty Twenty-Two functions and definitions
|
|
*
|
|
* @link https://developer.wordpress.org/themes/basics/theme-functions/
|
|
*
|
|
* @package WordPress
|
|
* @subpackage Twenty_Twenty_Two
|
|
* @since Twenty Twenty-Two 1.0
|
|
*/
|
|
|
|
|
|
if ( ! function_exists( 'twentytwentytwo_support' ) ) :
|
|
|
|
/**
|
|
* Sets up theme defaults and registers support for various WordPress features.
|
|
*
|
|
* @since Twenty Twenty-Two 1.0
|
|
*
|
|
* @return void
|
|
*/
|
|
function twentytwentytwo_support() {
|
|
|
|
// Add support for block styles.
|
|
add_theme_support( 'wp-block-styles' );
|
|
|
|
// Enqueue editor styles.
|
|
add_editor_style( 'style.css' );
|
|
}
|
|
|
|
endif;
|
|
|
|
add_action( 'after_setup_theme', 'twentytwentytwo_support' );
|
|
|
|
if ( ! function_exists( 'twentytwentytwo_styles' ) ) :
|
|
|
|
/**
|
|
* Enqueue styles.
|
|
*
|
|
* @since Twenty Twenty-Two 1.0
|
|
*
|
|
* @return void
|
|
*/
|
|
function twentytwentytwo_styles() {
|
|
// Register theme stylesheet.
|
|
$theme_version = wp_get_theme()->get( 'Version' );
|
|
|
|
$version_string = is_string( $theme_version ) ? $theme_version : false;
|
|
wp_register_style(
|
|
'twentytwentytwo-style',
|
|
get_template_directory_uri() . '/style.css',
|
|
array(),
|
|
$version_string
|
|
);
|
|
|
|
// Enqueue theme stylesheet.
|
|
wp_enqueue_style( 'twentytwentytwo-style' );
|
|
}
|
|
|
|
endif;
|
|
|
|
add_action( 'wp_enqueue_scripts', 'twentytwentytwo_styles' );
|
|
|
|
// Add block patterns
|
|
require get_template_directory() . '/inc/block-patterns.php';
|