mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Twenty Twenty: Add missing documentation for some filters.
Add missing `@since` tags for some functions. Correct alignment of some `@param` tags. Follow-up to [46271], [46278], [51304]. See #52628, #53461. Built from https://develop.svn.wordpress.org/trunk@51322 git-svn-id: http://core.svn.wordpress.org/trunk@50931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bf92ee343c
commit
af7a04318d
@ -11,6 +11,8 @@
|
||||
/**
|
||||
* Return a value for our partial refresh.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param {Object} partial Current partial.
|
||||
*
|
||||
* @return {jQuery.Promise} Resolved promise.
|
||||
@ -31,6 +33,8 @@
|
||||
/**
|
||||
* Override the refresh method.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @return {jQuery.Promise} Resolved promise.
|
||||
*/
|
||||
refresh: function() {
|
||||
@ -55,6 +59,7 @@
|
||||
/**
|
||||
* Input attributes.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
* @type {Object}
|
||||
*/
|
||||
attrs: {},
|
||||
@ -62,6 +67,8 @@
|
||||
/**
|
||||
* Override the refresh method.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @return {jQuery.Promise} Resolved promise.
|
||||
*/
|
||||
refresh: function() {
|
||||
|
@ -646,6 +646,8 @@ twentytwenty.toggles = {
|
||||
*
|
||||
* This implementation is coming from https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param {Function} fn Callback function to run.
|
||||
*/
|
||||
function twentytwentyDomReady( fn ) {
|
||||
@ -695,6 +697,8 @@ function twentytwentyToggleAttribute( element, attribute, trueVal, falseVal ) {
|
||||
/**
|
||||
* Toggle a menu item on or off.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param {HTMLElement} target
|
||||
* @param {number} duration
|
||||
*/
|
||||
@ -796,6 +800,8 @@ function twentytwentyMenuToggle( target, duration ) {
|
||||
/**
|
||||
* Traverses the DOM up to find elements matching the query.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param {HTMLElement} target
|
||||
* @param {string} query
|
||||
* @return {NodeList} parents matching query
|
||||
|
@ -6,6 +6,8 @@
|
||||
* This is the source file for what is minified in the twentytwenty_skip_link_focus_fix() PHP function.
|
||||
*
|
||||
* Learn more: https://git.io/vWdr2
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
( function() {
|
||||
var isIe = /(trident|msie)/i.test( navigator.userAgent );
|
||||
|
@ -10,12 +10,16 @@
|
||||
if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
|
||||
/**
|
||||
* CUSTOMIZER SETTINGS
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_Customize {
|
||||
|
||||
/**
|
||||
* Register customizer options.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
*/
|
||||
public static function register( $wp_customize ) {
|
||||
@ -412,9 +416,8 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
|
||||
/**
|
||||
* Sanitization callback for the "accent_accessible_colors" setting.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $value The value we want to sanitize.
|
||||
* @return array Returns sanitized value. Each item in the array gets sanitized separately.
|
||||
*/
|
||||
@ -436,7 +439,9 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
|
||||
/**
|
||||
* Sanitize select.
|
||||
*
|
||||
* @param string $input The input from the setting.
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $input The input from the setting.
|
||||
* @param object $setting The selected setting.
|
||||
* @return string The input from the setting or the default setting.
|
||||
*/
|
||||
@ -449,6 +454,8 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
|
||||
/**
|
||||
* Sanitize boolean for checkbox.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param bool $checked Whether or not a box is checked.
|
||||
* @return bool
|
||||
*/
|
||||
@ -469,6 +476,8 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
|
||||
if ( ! function_exists( 'twentytwenty_customize_partial_blogname' ) ) {
|
||||
/**
|
||||
* Render the site title for the selective refresh partial.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_customize_partial_blogname() {
|
||||
bloginfo( 'name' );
|
||||
@ -478,6 +487,8 @@ if ( ! function_exists( 'twentytwenty_customize_partial_blogname' ) ) {
|
||||
if ( ! function_exists( 'twentytwenty_customize_partial_blogdescription' ) ) {
|
||||
/**
|
||||
* Render the site description for the selective refresh partial.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_customize_partial_blogdescription() {
|
||||
bloginfo( 'description' );
|
||||
@ -489,6 +500,8 @@ if ( ! function_exists( 'twentytwenty_customize_partial_site_logo' ) ) {
|
||||
* Render the site logo for the selective refresh partial.
|
||||
*
|
||||
* Doing it this way so we don't have issues with `render_callback`'s arguments.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_customize_partial_site_logo() {
|
||||
twentytwenty_site_logo();
|
||||
@ -499,18 +512,22 @@ if ( ! function_exists( 'twentytwenty_customize_partial_site_logo' ) ) {
|
||||
/**
|
||||
* Input attributes for cover overlay opacity option.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @return array Array containing attribute names and their values.
|
||||
*/
|
||||
function twentytwenty_customize_opacity_range() {
|
||||
/**
|
||||
* Filters the input attributes for opacity
|
||||
* Filters the input attributes for opacity.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $attrs {
|
||||
* The attributes
|
||||
* The attributes.
|
||||
*
|
||||
* @type int $min Minimum value
|
||||
* @type int $max Maximum value
|
||||
* @type int $step Interval between numbers
|
||||
* @type int $min Minimum value.
|
||||
* @type int $max Maximum value.
|
||||
* @type int $step Interval between numbers.
|
||||
* }
|
||||
*/
|
||||
return apply_filters(
|
||||
|
@ -12,6 +12,8 @@
|
||||
if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
|
||||
/**
|
||||
* Language handling.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_Non_Latin_Languages {
|
||||
|
||||
@ -20,7 +22,9 @@ if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
|
||||
*
|
||||
* Return CSS for non-latin language, if available, or null
|
||||
*
|
||||
* @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $type Whether to return CSS for the "front-end", "block-editor", or "classic-editor".
|
||||
* @return void
|
||||
*/
|
||||
public static function get_non_latin_css( $type = 'front-end' ) {
|
||||
@ -28,7 +32,13 @@ if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
|
||||
// Fetch site locale.
|
||||
$locale = get_bloginfo( 'language' );
|
||||
|
||||
// Define fallback fonts for non-latin languages.
|
||||
/**
|
||||
* Filters the fallback fonts for non-latin languages.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $font_family An array of locales and font families.
|
||||
*/
|
||||
$font_family = apply_filters(
|
||||
'twentytwenty_get_localized_font_family_types',
|
||||
array(
|
||||
@ -98,7 +108,13 @@ if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Define elements to apply fallback fonts to.
|
||||
/**
|
||||
* Filters the elements to apply fallback fonts to.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $elements An array of elements for "front-end", "block-editor", or "classic-editor".
|
||||
*/
|
||||
$elements = apply_filters(
|
||||
'twentytwenty_get_localized_font_family_elements',
|
||||
array(
|
||||
|
@ -14,6 +14,8 @@
|
||||
if ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {
|
||||
/**
|
||||
* A class that provides a way to add `async` or `defer` attributes to scripts.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_Script_Loader {
|
||||
|
||||
@ -22,6 +24,8 @@ if ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {
|
||||
*
|
||||
* If #12009 lands in WordPress, this function can no-op since it would be handled in core.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @link https://core.trac.wordpress.org/ticket/12009
|
||||
*
|
||||
* @param string $tag The script tag.
|
||||
|
@ -12,10 +12,14 @@ if ( class_exists( 'WP_Customize_Control' ) ) {
|
||||
if ( ! class_exists( 'TwentyTwenty_Separator_Control' ) ) {
|
||||
/**
|
||||
* Separator Control.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_Separator_Control extends WP_Customize_Control {
|
||||
/**
|
||||
* Render the hr.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
public function render_content() {
|
||||
echo '<hr/>';
|
||||
|
@ -11,12 +11,16 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
|
||||
/**
|
||||
* SVG ICONS CLASS
|
||||
* Retrieve the SVG code for the specified icon. Based on a solution in Twenty Nineteen.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_SVG_Icons {
|
||||
/**
|
||||
* GET SVG CODE
|
||||
* Get the SVG code for the specified icon
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $icon Icon name.
|
||||
* @param string $group Icon group.
|
||||
* @param string $color Color.
|
||||
@ -69,6 +73,8 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
|
||||
* GET SOCIAL LINK SVG
|
||||
* Detects the social network from a URL and returns the SVG code for its icon.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $uri The URL to retrieve SVG for.
|
||||
*/
|
||||
public static function get_social_link_svg( $uri ) {
|
||||
@ -116,6 +122,7 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
|
||||
* ICON STORAGE
|
||||
* Store the code for all SVGs in an array.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
* @var array
|
||||
*/
|
||||
public static $ui_icons = array(
|
||||
@ -169,6 +176,7 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
|
||||
* By default, each Icon ID is matched against a .com TLD. To override this behavior,
|
||||
* specify all the domains it covers (including the .com TLD too, if applicable).
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
* @var array
|
||||
*/
|
||||
public static $social_icons_map = array(
|
||||
@ -224,6 +232,7 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
|
||||
/**
|
||||
* Social Icons – svg sources.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
* @var array
|
||||
*/
|
||||
public static $social_icons = array(
|
||||
|
@ -11,12 +11,16 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Comment' ) ) {
|
||||
/**
|
||||
* CUSTOM COMMENT WALKER
|
||||
* A custom walker for comments, based on the walker in Twenty Nineteen.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_Walker_Comment extends Walker_Comment {
|
||||
|
||||
/**
|
||||
* Outputs a comment in the HTML5 format.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @see wp_list_comments()
|
||||
* @see https://developer.wordpress.org/reference/functions/get_comment_author_url/
|
||||
* @see https://developer.wordpress.org/reference/functions/get_comment_author/
|
||||
|
@ -11,14 +11,17 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) {
|
||||
/**
|
||||
* CUSTOM PAGE WALKER
|
||||
* A custom walker for pages.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
class TwentyTwenty_Walker_Page extends Walker_Page {
|
||||
|
||||
/**
|
||||
* Outputs the beginning of the current element in the tree.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @see Walker::start_el()
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param string $output Used to append additional content. Passed by reference.
|
||||
* @param WP_Post $page Page data object.
|
||||
|
@ -30,6 +30,8 @@
|
||||
* Note that this function is hooked into the after_setup_theme hook, which
|
||||
* runs before the init hook. The init hook is too late for some features, such
|
||||
* as indicating support for post thumbnails.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_theme_support() {
|
||||
|
||||
@ -183,6 +185,8 @@ require get_template_directory() . '/inc/block-patterns.php';
|
||||
|
||||
/**
|
||||
* Register and Enqueue Styles.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_register_styles() {
|
||||
|
||||
@ -203,6 +207,8 @@ add_action( 'wp_enqueue_scripts', 'twentytwenty_register_styles' );
|
||||
|
||||
/**
|
||||
* Register and Enqueue Scripts.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_register_scripts() {
|
||||
|
||||
@ -225,6 +231,8 @@ add_action( 'wp_enqueue_scripts', 'twentytwenty_register_scripts' );
|
||||
* This does not enqueue the script because it is tiny and because it is only for IE11,
|
||||
* thus it does not warrant having an entire dedicated blocking script being loaded.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @link https://git.io/vWdr2
|
||||
*/
|
||||
function twentytwenty_skip_link_focus_fix() {
|
||||
@ -237,7 +245,8 @@ function twentytwenty_skip_link_focus_fix() {
|
||||
}
|
||||
add_action( 'wp_print_footer_scripts', 'twentytwenty_skip_link_focus_fix' );
|
||||
|
||||
/** Enqueue non-latin language styles
|
||||
/**
|
||||
* Enqueue non-latin language styles.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
@ -255,6 +264,8 @@ add_action( 'wp_enqueue_scripts', 'twentytwenty_non_latin_languages' );
|
||||
|
||||
/**
|
||||
* Register navigation menus uses wp_nav_menu in five places.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_menus() {
|
||||
|
||||
@ -274,6 +285,8 @@ add_action( 'init', 'twentytwenty_menus' );
|
||||
/**
|
||||
* Get the information about the logo.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $html The HTML output from get_custom_logo (core function).
|
||||
* @return string
|
||||
*/
|
||||
@ -331,14 +344,19 @@ if ( ! function_exists( 'wp_body_open' ) ) {
|
||||
|
||||
/**
|
||||
* Shim for wp_body_open, ensuring backward compatibility with versions of WordPress older than 5.2.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function wp_body_open() {
|
||||
/** This action is documented in wp-includes/general-template.php */
|
||||
do_action( 'wp_body_open' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Include a skip to content link at the top of the page so that users can bypass the menu.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_skip_link() {
|
||||
echo '<a class="skip-link screen-reader-text" href="#site-content">' . __( 'Skip to the content', 'twentytwenty' ) . '</a>';
|
||||
@ -349,6 +367,8 @@ add_action( 'wp_body_open', 'twentytwenty_skip_link', 5 );
|
||||
/**
|
||||
* Register widget areas.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
|
||||
*/
|
||||
function twentytwenty_sidebar_registration() {
|
||||
@ -391,6 +411,8 @@ add_action( 'widgets_init', 'twentytwenty_sidebar_registration' );
|
||||
|
||||
/**
|
||||
* Enqueue supplemental block editor styles.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_block_editor_styles() {
|
||||
|
||||
@ -412,6 +434,8 @@ add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1
|
||||
|
||||
/**
|
||||
* Enqueue classic editor styles.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_classic_editor_styles() {
|
||||
|
||||
@ -429,6 +453,8 @@ add_action( 'init', 'twentytwenty_classic_editor_styles' );
|
||||
* Output Customizer settings in the classic editor.
|
||||
* Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $mce_init TinyMCE styles.
|
||||
* @return array TinyMCE styles.
|
||||
*/
|
||||
@ -479,6 +505,8 @@ add_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_non_latin_s
|
||||
/**
|
||||
* Block Editor Settings.
|
||||
* Add custom colors and font sizes to the block editor.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_block_editor_settings() {
|
||||
|
||||
@ -632,7 +660,7 @@ add_action( 'customize_preview_init', 'twentytwenty_customize_preview_init' );
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $area The area we want to get the colors for.
|
||||
* @param string $area The area we want to get the colors for.
|
||||
* @param string $context Can be 'text' or 'accent'.
|
||||
* @return string Returns a HEX color.
|
||||
*/
|
||||
@ -750,11 +778,11 @@ function twentytwenty_get_elements_array() {
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters Twenty Twenty theme elements
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array Array of elements
|
||||
*/
|
||||
* Filters Twenty Twenty theme elements.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array Array of elements.
|
||||
*/
|
||||
return apply_filters( 'twentytwenty_get_elements_array', $elements );
|
||||
}
|
||||
|
@ -12,12 +12,14 @@ if ( ! function_exists( 'twentytwenty_generate_css' ) ) {
|
||||
/**
|
||||
* Generate CSS.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $selector The CSS selector.
|
||||
* @param string $style The CSS style.
|
||||
* @param string $value The CSS value.
|
||||
* @param string $prefix The CSS prefix.
|
||||
* @param string $suffix The CSS suffix.
|
||||
* @param bool $echo Echo the styles.
|
||||
* @param string $style The CSS style.
|
||||
* @param string $value The CSS value.
|
||||
* @param string $prefix The CSS prefix.
|
||||
* @param string $suffix The CSS suffix.
|
||||
* @param bool $echo Echo the styles.
|
||||
*/
|
||||
function twentytwenty_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) {
|
||||
|
||||
@ -50,7 +52,9 @@ if ( ! function_exists( 'twentytwenty_get_customizer_css' ) ) {
|
||||
* Get CSS Built from Customizer Options.
|
||||
* Build CSS reflecting colors, fonts and other options set in the Customizer, and return them for output.
|
||||
*
|
||||
* @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $type Whether to return CSS for the "front-end", "block-editor", or "classic-editor".
|
||||
*/
|
||||
function twentytwenty_get_customizer_css( $type = 'front-end' ) {
|
||||
|
||||
@ -78,7 +82,7 @@ if ( ! function_exists( 'twentytwenty_get_customizer_css' ) ) {
|
||||
|
||||
ob_start();
|
||||
|
||||
/**
|
||||
/*
|
||||
* Note – Styles are applied in this order:
|
||||
* 1. Element specific
|
||||
* 2. Helper classes
|
||||
@ -86,7 +90,7 @@ if ( ! function_exists( 'twentytwenty_get_customizer_css' ) ) {
|
||||
* This enables all helper classes to overwrite base element styles,
|
||||
* meaning that any color classes applied in the block editor will
|
||||
* have a higher priority than the base element styles.
|
||||
*/
|
||||
*/
|
||||
|
||||
// Front-End Styles.
|
||||
if ( 'front-end' === $type ) {
|
||||
|
@ -12,9 +12,11 @@ if ( ! function_exists( 'twentytwenty_the_theme_svg' ) ) {
|
||||
* Output and Get Theme SVG.
|
||||
* Output and get the SVG markup for an icon in the TwentyTwenty_SVG_Icons class.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $svg_name The name of the icon.
|
||||
* @param string $group The group the icon belongs to.
|
||||
* @param string $color Color code.
|
||||
* @param string $group The group the icon belongs to.
|
||||
* @param string $color Color code.
|
||||
*/
|
||||
function twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
|
||||
echo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg().
|
||||
@ -26,9 +28,11 @@ if ( ! function_exists( 'twentytwenty_get_theme_svg' ) ) {
|
||||
/**
|
||||
* Get information about the SVG icon.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $svg_name The name of the icon.
|
||||
* @param string $group The group the icon belongs to.
|
||||
* @param string $color Color code.
|
||||
* @param string $group The group the icon belongs to.
|
||||
* @param string $color Color code.
|
||||
*/
|
||||
function twentytwenty_get_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
|
||||
|
||||
|
@ -25,8 +25,10 @@
|
||||
/**
|
||||
* Displays the site logo, either text or image.
|
||||
*
|
||||
* @param array $args Arguments for displaying the site logo either as an image or text.
|
||||
* @param bool $echo Echo or return the HTML.
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $args Arguments for displaying the site logo either as an image or text.
|
||||
* @param bool $echo Echo or return the HTML.
|
||||
* @return string Compiled HTML based on our arguments.
|
||||
*/
|
||||
function twentytwenty_site_logo( $args = array(), $echo = true ) {
|
||||
@ -50,8 +52,10 @@ function twentytwenty_site_logo( $args = array(), $echo = true ) {
|
||||
/**
|
||||
* Filters the arguments for `twentytwenty_site_logo()`.
|
||||
*
|
||||
* @param array $args Parsed arguments.
|
||||
* @param array $defaults Function's default arguments.
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $args Parsed arguments.
|
||||
* @param array $defaults Function's default arguments.
|
||||
*/
|
||||
$args = apply_filters( 'twentytwenty_site_logo_args', $args, $defaults );
|
||||
|
||||
@ -70,6 +74,8 @@ function twentytwenty_site_logo( $args = array(), $echo = true ) {
|
||||
/**
|
||||
* Filters the arguments for `twentytwenty_site_logo()`.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $html Compiled HTML based on our arguments.
|
||||
* @param array $args Parsed arguments.
|
||||
* @param string $classname Class name based on current view, home or single.
|
||||
@ -88,6 +94,8 @@ function twentytwenty_site_logo( $args = array(), $echo = true ) {
|
||||
/**
|
||||
* Displays the site description.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param bool $echo Echo or return the html.
|
||||
* @return string The HTML to display.
|
||||
*/
|
||||
@ -107,9 +115,9 @@ function twentytwenty_site_description( $echo = true ) {
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $html The HTML to display.
|
||||
* @param string $description Site description via `bloginfo()`.
|
||||
* @param string $wrapper The format used in case you want to reuse it in a `sprintf()`.
|
||||
* @param string $html The HTML to display.
|
||||
* @param string $description Site description via `bloginfo()`.
|
||||
* @param string $wrapper The format used in case you want to reuse it in a `sprintf()`.
|
||||
*/
|
||||
$html = apply_filters( 'twentytwenty_site_description', $html, $description, $wrapper );
|
||||
|
||||
@ -127,6 +135,8 @@ function twentytwenty_site_description( $echo = true ) {
|
||||
/**
|
||||
* Checks if the specified comment is written by the author of the post commented on.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param object $comment Comment data.
|
||||
* @return bool
|
||||
*/
|
||||
@ -153,6 +163,8 @@ function twentytwenty_is_comment_by_post_author( $comment = null ) {
|
||||
* Filter the comment reply link to add a class indicating it should not use JS slow-scroll, as it
|
||||
* makes it scroll to the wrong position on the page.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $link Link to the top of the page.
|
||||
* @return string Link to the top of the page.
|
||||
*/
|
||||
@ -174,6 +186,8 @@ add_filter( 'comment_reply_link', 'twentytwenty_filter_comment_reply_link' );
|
||||
*
|
||||
* If it's a single post, outputs the post meta values specified in the Customizer settings.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param int $post_id The ID of the post for which the post meta should be output.
|
||||
* @param string $location Which post meta location to output – single or preview.
|
||||
*/
|
||||
@ -186,6 +200,8 @@ function twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' )
|
||||
/**
|
||||
* Filters the edit post link to add an icon and use the post meta structure.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $link Anchor tag for the edit link.
|
||||
* @param int $post_id Post ID.
|
||||
* @param string $text Anchor text.
|
||||
@ -223,7 +239,9 @@ add_filter( 'edit_post_link', 'twentytwenty_edit_post_link', 10, 3 );
|
||||
/**
|
||||
* Retrieves the post meta.
|
||||
*
|
||||
* @param int $post_id The ID of the post.
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param int $post_id The ID of the post.
|
||||
* @param string $location The location where the meta is shown.
|
||||
*/
|
||||
function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) {
|
||||
@ -241,7 +259,7 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array Array of post types
|
||||
* @param array Array of post types.
|
||||
*/
|
||||
$disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) );
|
||||
|
||||
@ -263,10 +281,10 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $args {
|
||||
* @type string 'author'
|
||||
* @type string 'post-date'
|
||||
* @type string 'comments'
|
||||
* @type string 'sticky'
|
||||
* @type string $author
|
||||
* @type string $post-date
|
||||
* @type string $comments
|
||||
* @type string $sticky
|
||||
* }
|
||||
*/
|
||||
$post_meta = apply_filters(
|
||||
@ -291,7 +309,7 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $args {
|
||||
* @type string 'tags'
|
||||
* @type string $tags
|
||||
* }
|
||||
*/
|
||||
$post_meta = apply_filters(
|
||||
@ -499,6 +517,8 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
|
||||
* Filter the class applied to wp_list_pages() items with children to match the menu class, to simplify.
|
||||
* styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string[] $css_class An array of CSS classes to be applied to each list item.
|
||||
* @param WP_Post $page Page data object.
|
||||
* @param int $depth Depth of page, used for padding.
|
||||
@ -534,6 +554,8 @@ add_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes',
|
||||
/**
|
||||
* Adds a Sub Nav Toggle to the Expanded Menu and Mobile Menu.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param stdClass $args An object of wp_nav_menu() arguments.
|
||||
* @param WP_Post $item Menu item data object.
|
||||
* @param int $depth Depth of menu item. Used for padding.
|
||||
@ -580,6 +602,8 @@ add_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 1
|
||||
/**
|
||||
* Displays SVG icons in social links menu.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $item_output The menu item's starting HTML output.
|
||||
* @param WP_Post $item Menu item data object.
|
||||
* @param int $depth Depth of the menu. Used for padding.
|
||||
@ -609,6 +633,8 @@ add_filter( 'walker_nav_menu_start_el', 'twentytwenty_nav_menu_social_icons', 10
|
||||
* Adds 'no-js' class.
|
||||
*
|
||||
* If we're missing JavaScript support, the HTML element will have a 'no-js' class.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
function twentytwenty_no_js_class() {
|
||||
|
||||
@ -623,6 +649,8 @@ add_action( 'wp_head', 'twentytwenty_no_js_class' );
|
||||
/**
|
||||
* Adds conditional body classes.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $classes Classes added to the body tag.
|
||||
* @return array Classes added to the body tag.
|
||||
*/
|
||||
@ -724,11 +752,20 @@ add_filter( 'body_class', 'twentytwenty_body_classes' );
|
||||
/**
|
||||
* Filters the archive title and styles the word before the first colon.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param string $title Current archive title.
|
||||
* @return string Current archive title.
|
||||
*/
|
||||
function twentytwenty_get_the_archive_title( $title ) {
|
||||
|
||||
/**
|
||||
* Filters the regular expression used to style the word before the first colon.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param array $regex An array of regular expression pattern and replacement.
|
||||
*/
|
||||
$regex = apply_filters(
|
||||
'twentytwenty_get_the_archive_title_regex',
|
||||
array(
|
||||
@ -756,6 +793,8 @@ add_filter( 'get_the_archive_title', 'twentytwenty_get_the_archive_title' );
|
||||
/**
|
||||
* Toggles animation duration in milliseconds.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @return int Duration in milliseconds
|
||||
*/
|
||||
function twentytwenty_toggle_duration() {
|
||||
@ -779,6 +818,8 @@ function twentytwenty_toggle_duration() {
|
||||
* with the optional prefix. As such the returned value is not universally unique,
|
||||
* but it is unique across the life of the PHP process.
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead.
|
||||
*
|
||||
* @param string $prefix Prefix for the returned ID.
|
||||
|
@ -59,7 +59,7 @@
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param bool Whether to show the categories in article header, Default true.
|
||||
* @param bool Whether to show the categories in article header. Default true.
|
||||
*/
|
||||
$show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );
|
||||
|
||||
@ -162,10 +162,10 @@
|
||||
get_template_part( 'template-parts/navigation' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Output comments wrapper if it's a post, or if comments are open,
|
||||
/*
|
||||
* Output comments wrapper if it's a post, or if comments are open,
|
||||
* or if there's a comment number – and check for password.
|
||||
* */
|
||||
*/
|
||||
if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
|
||||
?>
|
||||
|
||||
|
@ -74,10 +74,10 @@
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Output comments wrapper if it's a post, or if comments are open,
|
||||
/*
|
||||
* Output comments wrapper if it's a post, or if comments are open,
|
||||
* or if there's a comment number – and check for password.
|
||||
* */
|
||||
*/
|
||||
if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
|
||||
?>
|
||||
|
||||
|
@ -25,7 +25,7 @@ if ( is_singular() ) {
|
||||
*
|
||||
* @since Twenty Twenty 1.0
|
||||
*
|
||||
* @param bool Whether to show the categories in header, Default true.
|
||||
* @param bool Whether to show the categories in header. Default true.
|
||||
*/
|
||||
$show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );
|
||||
|
||||
|
@ -9,19 +9,21 @@
|
||||
* @since Twenty Twenty 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Translators:
|
||||
* This text contains HTML to allow the text to be shorter on small screens.
|
||||
* The text inside the span with the class nav-short will be hidden on small screens.
|
||||
*/
|
||||
|
||||
$prev_text = sprintf(
|
||||
'%s <span class="nav-prev-text">%s</span>',
|
||||
'<span aria-hidden="true">←</span>',
|
||||
/*
|
||||
* Translators: This text contains HTML to allow the text to be shorter on small screens.
|
||||
* The text inside the span with the class nav-short will be hidden on small screens.
|
||||
*/
|
||||
__( 'Newer <span class="nav-short">Posts</span>', 'twentytwenty' )
|
||||
);
|
||||
$next_text = sprintf(
|
||||
'<span class="nav-next-text">%s</span> %s',
|
||||
/*
|
||||
* Translators: This text contains HTML to allow the text to be shorter on small screens.
|
||||
* The text inside the span with the class nav-short will be hidden on small screens.
|
||||
*/
|
||||
__( 'Older <span class="nav-short">Posts</span>', 'twentytwenty' ),
|
||||
'<span aria-hidden="true">→</span>'
|
||||
);
|
||||
|
@ -507,7 +507,8 @@ function twenty_twenty_one_skip_link_focus_fix() {
|
||||
}
|
||||
add_action( 'wp_print_footer_scripts', 'twenty_twenty_one_skip_link_focus_fix' );
|
||||
|
||||
/** Enqueue non-latin language styles
|
||||
/**
|
||||
* Enqueue non-latin language styles.
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51321';
|
||||
$wp_version = '5.9-alpha-51322';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user