| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/i/n/f/infrafs/INFRABIKEIT/wp-content/plugins/ |
Upload File : |
PK �1\���
�
icon-functions.phpnu &1i� <?php
/**
* SVG icons related functions
*
* @package WordPress
* @subpackage Twenty_Nineteen
* @since Twenty Nineteen 1.0
*/
/**
* Gets the SVG code for a given icon.
*/
function twentynineteen_get_icon_svg( $icon, $size = 24 ) {
return TwentyNineteen_SVG_Icons::get_svg( 'ui', $icon, $size );
}
/**
* Gets the SVG code for a given social icon.
*/
function twentynineteen_get_social_icon_svg( $icon, $size = 24 ) {
return TwentyNineteen_SVG_Icons::get_svg( 'social', $icon, $size );
}
/**
* Detects the social network from a URL and returns the SVG code for its icon.
*/
function twentynineteen_get_social_link_svg( $uri, $size = 24 ) {
return TwentyNineteen_SVG_Icons::get_social_link_svg( $uri, $size );
}
/**
* Display SVG icons in social links menu.
*
* @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.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string The menu item output with social icon.
*/
function twentynineteen_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
if ( 'social' === $args->theme_location ) {
$svg = twentynineteen_get_social_link_svg( $item->url, 26 );
if ( empty( $svg ) ) {
$svg = twentynineteen_get_icon_svg( 'link' );
}
$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons', 10, 4 );
/**
* Add a dropdown icon to top-level menu items.
*
* @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.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string Nav menu item start element.
*/
function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) {
// Only add class to 'top level' items on the 'primary' menu.
if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) {
return $item_output;
}
if ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) {
// Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item.
// @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely.
$link = sprintf(
'<button class="menu-item-link-return" tabindex="-1">%s',
twentynineteen_get_icon_svg( 'chevron_left', 24 )
);
// Replace opening <a> with <button>.
$item_output = preg_replace(
'/<a\s.*?>/',
$link,
$item_output,
1 // Limit.
);
// Replace closing </a> with </button>.
$item_output = preg_replace(
'#</a>#i',
'</button>',
$item_output,
1 // Limit.
);
} elseif ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
// Add SVG icon to parent items.
$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );
$item_output .= sprintf(
'<button class="submenu-expand" tabindex="-1">%s</button>',
$icon
);
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 );
PK �1\�>!� � back-compat.phpnu &1i� <?php
/**
* Back compat functionality
*
* Prevents the theme from running on WordPress versions prior to 5.3,
* since this theme is not meant to be backward compatible beyond that and
* relies on many newer functions and markup changes introduced in 5.3.
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
/**
* Display upgrade notice on theme switch.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twenty_twenty_one_switch_theme() {
add_action( 'admin_notices', 'twenty_twenty_one_upgrade_notice' );
}
add_action( 'after_switch_theme', 'twenty_twenty_one_switch_theme' );
/**
* Adds a message for unsuccessful theme switch.
*
* Prints an update nag after an unsuccessful attempt to switch to
* the theme on WordPress versions prior to 5.3.
*
* @since Twenty Twenty-One 1.0
*
* @global string $wp_version WordPress version.
*
* @return void
*/
function twenty_twenty_one_upgrade_notice() {
echo '<div class="error"><p>';
printf(
/* translators: %s: WordPress Version. */
esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
esc_html( $GLOBALS['wp_version'] )
);
echo '</p></div>';
}
/**
* Prevents the Customizer from being loaded on WordPress versions prior to 5.3.
*
* @since Twenty Twenty-One 1.0
*
* @global string $wp_version WordPress version.
*
* @return void
*/
function twenty_twenty_one_customize() {
wp_die(
sprintf(
/* translators: %s: WordPress Version. */
esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
esc_html( $GLOBALS['wp_version'] )
),
'',
array(
'back_link' => true,
)
);
}
add_action( 'load-customize.php', 'twenty_twenty_one_customize' );
/**
* Prevents the Theme Preview from being loaded on WordPress versions prior to 5.3.
*
* @since Twenty Twenty-One 1.0
*
* @global string $wp_version WordPress version.
*
* @return void
*/
function twenty_twenty_one_preview() {
if ( isset( $_GET['preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
wp_die(
sprintf(
/* translators: %s: WordPress Version. */
esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
esc_html( $GLOBALS['wp_version'] )
)
);
}
}
add_action( 'template_redirect', 'twenty_twenty_one_preview' );
PK �1\s9�+ + color-patterns.phpnu &1i� <?php
/**
* Twenty Nineteen: Color Patterns
*
* @package WordPress
* @subpackage Twenty_Nineteen
* @since Twenty Nineteen 1.0
*/
/**
* Generate the CSS for the current primary color.
*/
function twentynineteen_custom_colors_css() {
$primary_color = 199;
if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) {
$primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) );
}
/**
* Filters Twenty Nineteen default saturation level.
*
* @since Twenty Nineteen 1.0
*
* @param int $saturation Color saturation level.
*/
$saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 );
$saturation = absint( $saturation ) . '%';
/**
* Filters Twenty Nineteen default selection saturation level.
*
* @since Twenty Nineteen 1.0
*
* @param int $saturation_selection Selection color saturation level.
*/
$saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) );
$saturation_selection = $saturation_selection . '%';
/**
* Filters Twenty Nineteen default lightness level.
*
* @since Twenty Nineteen 1.0
*
* @param int $lightness Color lightness level.
*/
$lightness = apply_filters( 'twentynineteen_custom_colors_lightness', 33 );
$lightness = absint( $lightness ) . '%';
/**
* Filters Twenty Nineteen default hover lightness level.
*
* @since Twenty Nineteen 1.0
*
* @param int $lightness_hover Hover color lightness level.
*/
$lightness_hover = apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 );
$lightness_hover = absint( $lightness_hover ) . '%';
/**
* Filters Twenty Nineteen default selection lightness level.
*
* @since Twenty Nineteen 1.0
*
* @param int $lightness_selection Selection color lightness level.
*/
$lightness_selection = apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 );
$lightness_selection = absint( $lightness_selection ) . '%';
$theme_css = '
/*
* Set background for:
* - featured image :before
* - featured image :before
* - post thumbmail :before
* - post thumbmail :before
* - Submenu
* - Sticky Post
* - buttons
* - WP Block Button
* - Blocks
*/
.image-filters-enabled .site-header.featured-image .site-featured-image:before,
.image-filters-enabled .site-header.featured-image .site-featured-image:after,
.image-filters-enabled .entry .post-thumbnail:before,
.image-filters-enabled .entry .post-thumbnail:after,
.main-navigation .sub-menu,
.sticky-post,
.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background),
.entry .button, button, input[type="button"], input[type="reset"], input[type="submit"],
.entry .entry-content > .has-primary-background-color,
.entry .entry-content > *[class^="wp-block-"].has-primary-background-color,
.entry .entry-content > *[class^="wp-block-"] .has-primary-background-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-primary-background-color,
.entry .entry-content .wp-block-file .wp-block-file__button {
background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
/*
* Set Color for:
* - all links
* - main navigation links
* - Post navigation links
* - Post entry meta hover
* - Post entry header more-link hover
* - main navigation svg
* - comment navigation
* - Comment edit link hover
* - Site Footer Link hover
* - Widget links
*/
a,
a:visited,
.main-navigation .main-menu > li,
.main-navigation ul.main-menu > li > a,
.post-navigation .post-title,
.entry .entry-meta a:hover,
.entry .entry-footer a:hover,
.entry .entry-content .more-link:hover,
.main-navigation .main-menu > li > a + svg,
.comment .comment-metadata > a:hover,
.comment .comment-metadata .comment-edit-link:hover,
#colophon .site-info a:hover,
.widget a,
.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
.entry .entry-content > .has-primary-color,
.entry .entry-content > *[class^="wp-block-"] .has-primary-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color p {
color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
/*
* Set border color for:
* wp block quote
* :focus
*/
blockquote,
.entry .entry-content blockquote,
.entry .entry-content .wp-block-quote:not(.is-large),
.entry .entry-content .wp-block-quote:not(.is-style-large),
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="range"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="time"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="color"]:focus,
textarea:focus {
border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
.gallery-item > div > a:focus {
box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
/* Hover colors */
a:hover, a:active,
.main-navigation .main-menu > li > a:hover,
.main-navigation .main-menu > li > a:hover + svg,
.post-navigation .nav-links a:hover,
.post-navigation .nav-links a:hover .post-title,
.author-bio .author-description .author-link:hover,
.entry .entry-content > .has-secondary-color,
.entry .entry-content > *[class^="wp-block-"] .has-secondary-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color p,
.comment .comment-author .fn a:hover,
.comment-reply-link:hover,
.comment-navigation .nav-previous a:hover,
.comment-navigation .nav-next a:hover,
#cancel-comment-reply-link:hover,
.widget a:hover {
color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */
}
.main-navigation .sub-menu > li > a:hover,
.main-navigation .sub-menu > li > a:focus,
.main-navigation .sub-menu > li > a:hover:after,
.main-navigation .sub-menu > li > a:focus:after,
.main-navigation .sub-menu > li > .menu-item-link-return:hover,
.main-navigation .sub-menu > li > .menu-item-link-return:focus,
.main-navigation .sub-menu > li > a:not(.submenu-expand):hover,
.main-navigation .sub-menu > li > a:not(.submenu-expand):focus,
.entry .entry-content > .has-secondary-background-color,
.entry .entry-content > *[class^="wp-block-"].has-secondary-background-color,
.entry .entry-content > *[class^="wp-block-"] .has-secondary-background-color,
.entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-secondary-background-color {
background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */
}
/* Text selection colors */
::selection {
background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */
}
::-moz-selection {
background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */
}';
$editor_css = '
/*
* Set colors for:
* - links
* - blockquote
* - pullquote (solid color)
* - buttons
*/
.editor-block-list__layout .editor-block-list__block a,
.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color),
.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color),
.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color),
.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink {
color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
.editor-block-list__layout .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large),
.editor-styles-wrapper .editor-block-list__layout .wp-block-freeform blockquote {
border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
.editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color:not(.has-background-color) {
background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__button,
.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link,
.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:active,
.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
}
/* Hover colors */
.editor-block-list__layout .editor-block-list__block a:hover,
.editor-block-list__layout .editor-block-list__block a:active,
.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink:hover {
color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */
}
/* Do not overwrite solid color pullquote or cover links */
.editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color a,
.editor-block-list__layout .editor-block-list__block .wp-block-cover a {
color: inherit;
}
';
if ( function_exists( 'register_block_type' ) && is_admin() ) {
$theme_css = $editor_css;
}
/**
* Filters Twenty Nineteen custom colors CSS.
*
* @since Twenty Nineteen 1.0
*
* @param string $css Base theme colors CSS.
* @param int $primary_color The user's selected color hue.
* @param string $saturation Filtered theme color saturation level.
*/
return apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation );
}
PK �1\���� � customizer.phpnu &1i� <?php
/**
* Twenty Nineteen: Customizer
*
* @package WordPress
* @subpackage Twenty_Nineteen
* @since Twenty Nineteen 1.0
*/
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function twentynineteen_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial(
'blogname',
array(
'selector' => '.site-title a',
'render_callback' => 'twentynineteen_customize_partial_blogname',
)
);
$wp_customize->selective_refresh->add_partial(
'blogdescription',
array(
'selector' => '.site-description',
'render_callback' => 'twentynineteen_customize_partial_blogdescription',
)
);
}
/**
* Primary color.
*/
$wp_customize->add_setting(
'primary_color',
array(
'default' => 'default',
'transport' => 'postMessage',
'sanitize_callback' => 'twentynineteen_sanitize_color_option',
)
);
$wp_customize->add_control(
'primary_color',
array(
'type' => 'radio',
'label' => __( 'Primary Color', 'twentynineteen' ),
'choices' => array(
'default' => _x( 'Default', 'primary color', 'twentynineteen' ),
'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ),
),
'section' => 'colors',
'priority' => 5,
)
);
// Add primary color hue setting and control.
$wp_customize->add_setting(
'primary_color_hue',
array(
'default' => 199,
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'primary_color_hue',
array(
'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ),
'section' => 'colors',
'mode' => 'hue',
)
)
);
// Add image filter setting and control.
$wp_customize->add_setting(
'image_filter',
array(
'default' => 1,
'sanitize_callback' => 'absint',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
'image_filter',
array(
'label' => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ),
'section' => 'colors',
'type' => 'checkbox',
)
);
}
add_action( 'customize_register', 'twentynineteen_customize_register' );
/**
* Render the site title for the selective refresh partial.
*
* @return void
*/
function twentynineteen_customize_partial_blogname() {
bloginfo( 'name' );
}
/**
* Render the site tagline for the selective refresh partial.
*
* @return void
*/
function twentynineteen_customize_partial_blogdescription() {
bloginfo( 'description' );
}
/**
* Bind JS handlers to instantly live-preview changes.
*/
function twentynineteen_customize_preview_js() {
wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true );
}
add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );
/**
* Load dynamic logic for the customizer controls area.
*/
function twentynineteen_panels_js() {
wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true );
}
add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );
/**
* Sanitize custom color choice.
*
* @param string $choice Whether image filter is active.
* @return string
*/
function twentynineteen_sanitize_color_option( $choice ) {
$valid = array(
'default',
'custom',
);
if ( in_array( $choice, $valid, true ) ) {
return $choice;
}
return 'default';
}
PK �1\.(��Z �Z template-tags.phpnu &1i� <?php
/**
* Custom template tags for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/**
* Table of Contents:
* Logo & Description
* Comments
* Post Meta
* Menus
* Classes
* Archives
* Miscellaneous
*/
/**
* Logo & Description
*/
/**
* Displays the site logo, either text or image.
*
* @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 ) {
$logo = get_custom_logo();
$site_title = get_bloginfo( 'name' );
$contents = '';
$classname = '';
$defaults = array(
'logo' => '%1$s<span class="screen-reader-text">%2$s</span>',
'logo_class' => 'site-logo',
'title' => '<a href="%1$s">%2$s</a>',
'title_class' => 'site-title',
'home_wrap' => '<h1 class="%1$s">%2$s</h1>',
'single_wrap' => '<div class="%1$s faux-heading">%2$s</div>',
'condition' => ( is_front_page() || is_home() ) && ! is_page(),
);
$args = wp_parse_args( $args, $defaults );
/**
* Filters the arguments for `twentytwenty_site_logo()`.
*
* @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 );
if ( has_custom_logo() ) {
$contents = sprintf( $args['logo'], $logo, esc_html( $site_title ) );
$classname = $args['logo_class'];
} else {
$contents = sprintf( $args['title'], esc_url( get_home_url( null, '/' ) ), esc_html( $site_title ) );
$classname = $args['title_class'];
}
$wrap = $args['condition'] ? 'home_wrap' : 'single_wrap';
$html = sprintf( $args[ $wrap ], $classname, $contents );
/**
* 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.
* @param string $contents HTML for site title or logo.
*/
$html = apply_filters( 'twentytwenty_site_logo', $html, $args, $classname, $contents );
if ( ! $echo ) {
return $html;
}
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Displays the site description.
*
* @since Twenty Twenty 1.0
*
* @param bool $echo Echo or return the html.
* @return string The HTML to display.
*/
function twentytwenty_site_description( $echo = true ) {
$description = get_bloginfo( 'description' );
if ( ! $description ) {
return;
}
$wrapper = '<div class="site-description">%s</div><!-- .site-description -->';
$html = sprintf( $wrapper, esc_html( $description ) );
/**
* Filters the HTML for the site description.
*
* @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()`.
*/
$html = apply_filters( 'twentytwenty_site_description', $html, $description, $wrapper );
if ( ! $echo ) {
return $html;
}
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Comments
*/
/**
* 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
*/
function twentytwenty_is_comment_by_post_author( $comment = null ) {
if ( is_object( $comment ) && $comment->user_id > 0 ) {
$user = get_userdata( $comment->user_id );
$post = get_post( $comment->comment_post_ID );
if ( ! empty( $user ) && ! empty( $post ) ) {
return $comment->user_id === $post->post_author;
}
}
return false;
}
/**
* Filters comment reply link to not JS scroll.
*
* 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.
*/
function twentytwenty_filter_comment_reply_link( $link ) {
$link = str_replace( 'class=\'', 'class=\'do-not-scroll ', $link );
return $link;
}
add_filter( 'comment_reply_link', 'twentytwenty_filter_comment_reply_link' );
/**
* Post Meta
*/
/**
* Retrieves and displays the post meta.
*
* 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.
*/
function twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' ) {
echo twentytwenty_get_post_meta( $post_id, $location ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_post_meta().
}
/**
* 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.
*/
function twentytwenty_edit_post_link( $link, $post_id, $text ) {
if ( is_admin() ) {
return $link;
}
$edit_url = get_edit_post_link( $post_id );
if ( ! $edit_url ) {
return;
}
$text = sprintf(
wp_kses(
/* translators: %s: Post title. Only visible to screen readers. */
__( 'Edit <span class="screen-reader-text">%s</span>', 'twentytwenty' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title( $post_id )
);
return '<div class="post-meta-wrapper post-meta-edit-link-wrapper"><ul class="post-meta"><li class="post-edit meta-wrapper"><span class="meta-icon">' . twentytwenty_get_theme_svg( 'edit' ) . '</span><span class="meta-text"><a href="' . esc_url( $edit_url ) . '">' . $text . '</a></span></li></ul><!-- .post-meta --></div><!-- .post-meta-wrapper -->';
}
add_filter( 'edit_post_link', 'twentytwenty_edit_post_link', 10, 3 );
/**
* Retrieves the post meta.
*
* @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' ) {
// Require post ID.
if ( ! $post_id ) {
return;
}
/**
* Filters post types array.
*
* This filter can be used to hide post meta information of post, page or custom post type
* registered by child themes or plugins.
*
* @since Twenty Twenty 1.0
*
* @param array Array of post types.
*/
$disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) );
// Check whether the post type is allowed to output post meta.
if ( in_array( get_post_type( $post_id ), $disallowed_post_types, true ) ) {
return;
}
$post_meta_wrapper_classes = '';
$post_meta_classes = '';
// Get the post meta settings for the location specified.
if ( 'single-top' === $location ) {
/**
* Filters post meta info visibility.
*
* Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status.
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string $author
* @type string $post-date
* @type string $comments
* @type string $sticky
* }
*/
$post_meta = apply_filters(
'twentytwenty_post_meta_location_single_top',
array(
'author',
'post-date',
'comments',
'sticky',
)
);
$post_meta_wrapper_classes = ' post-meta-single post-meta-single-top';
} elseif ( 'single-bottom' === $location ) {
/**
* Filters post tags visibility.
*
* Use this filter to hide post tags.
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string $tags
* }
*/
$post_meta = apply_filters(
'twentytwenty_post_meta_location_single_bottom',
array(
'tags',
)
);
$post_meta_wrapper_classes = ' post-meta-single post-meta-single-bottom';
}
// If the post meta setting has the value 'empty', it's explicitly empty and the default post meta shouldn't be output.
if ( $post_meta && ! in_array( 'empty', $post_meta, true ) ) {
// Make sure we don't output an empty container.
$has_meta = false;
global $post;
$the_post = get_post( $post_id );
setup_postdata( $the_post );
ob_start();
?>
<div class="post-meta-wrapper<?php echo esc_attr( $post_meta_wrapper_classes ); ?>">
<ul class="post-meta<?php echo esc_attr( $post_meta_classes ); ?>">
<?php
/**
* Fires before post meta HTML display.
*
* Allow output of additional post meta info to be added by child themes and plugins.
*
* @since Twenty Twenty 1.0
* @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.
*
* @param int $post_id Post ID.
* @param array $post_meta An array of post meta information.
* @param string $location The location where the meta is shown.
* Accepts 'single-top' or 'single-bottom'.
*/
do_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location );
// Author.
if ( post_type_supports( get_post_type( $post_id ), 'author' ) && in_array( 'author', $post_meta, true ) ) {
$has_meta = true;
?>
<li class="post-author meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Post author', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'user' ); ?>
</span>
<span class="meta-text">
<?php
printf(
/* translators: %s: Author name. */
__( 'By %s', 'twentytwenty' ),
'<a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a>'
);
?>
</span>
</li>
<?php
}
// Post date.
if ( in_array( 'post-date', $post_meta, true ) ) {
$has_meta = true;
?>
<li class="post-date meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Post date', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'calendar' ); ?>
</span>
<span class="meta-text">
<a href="<?php the_permalink(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a>
</span>
</li>
<?php
}
// Categories.
if ( in_array( 'categories', $post_meta, true ) && has_category() ) {
$has_meta = true;
?>
<li class="post-categories meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Categories', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'folder' ); ?>
</span>
<span class="meta-text">
<?php _ex( 'In', 'A string that is output before one or more categories', 'twentytwenty' ); ?> <?php the_category( ', ' ); ?>
</span>
</li>
<?php
}
// Tags.
if ( in_array( 'tags', $post_meta, true ) && has_tag() ) {
$has_meta = true;
?>
<li class="post-tags meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Tags', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'tag' ); ?>
</span>
<span class="meta-text">
<?php the_tags( '', ', ', '' ); ?>
</span>
</li>
<?php
}
// Comments link.
if ( in_array( 'comments', $post_meta, true ) && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
$has_meta = true;
?>
<li class="post-comment-link meta-wrapper">
<span class="meta-icon">
<?php twentytwenty_the_theme_svg( 'comment' ); ?>
</span>
<span class="meta-text">
<?php comments_popup_link(); ?>
</span>
</li>
<?php
}
// Sticky.
if ( in_array( 'sticky', $post_meta, true ) && is_sticky() ) {
$has_meta = true;
?>
<li class="post-sticky meta-wrapper">
<span class="meta-icon">
<?php twentytwenty_the_theme_svg( 'bookmark' ); ?>
</span>
<span class="meta-text">
<?php _e( 'Sticky post', 'twentytwenty' ); ?>
</span>
</li>
<?php
}
/**
* Fires after post meta HTML display.
*
* Allow output of additional post meta info to be added by child themes and plugins.
*
* @since Twenty Twenty 1.0
* @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.
*
* @param int $post_id Post ID.
* @param array $post_meta An array of post meta information.
* @param string $location The location where the meta is shown.
* Accepts 'single-top' or 'single-bottom'.
*/
do_action( 'twentytwenty_end_of_post_meta_list', $post_id, $post_meta, $location );
?>
</ul><!-- .post-meta -->
</div><!-- .post-meta-wrapper -->
<?php
wp_reset_postdata();
$meta_output = ob_get_clean();
// If there is meta to output, return it.
if ( $has_meta && $meta_output ) {
return $meta_output;
}
}
}
/**
* Menus
*/
/**
* Filters classes of wp_list_pages items to match menu items.
*
* 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.
* @param array $args An array of arguments.
* @param int $current_page ID of the current page.
* @return array CSS class names.
*/
function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $page, $depth, $args, $current_page ) {
// Only apply to wp_list_pages() calls with match_menu_classes set to true.
$match_menu_classes = isset( $args['match_menu_classes'] );
if ( ! $match_menu_classes ) {
return $css_class;
}
// Add current menu item class.
if ( in_array( 'current_page_item', $css_class, true ) ) {
$css_class[] = 'current-menu-item';
}
// Add menu item has children class.
if ( in_array( 'page_item_has_children', $css_class, true ) ) {
$css_class[] = 'menu-item-has-children';
}
return $css_class;
}
add_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes', 10, 5 );
/**
* 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.
* @return stdClass An object of wp_nav_menu() arguments.
*/
function twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) {
// Add sub menu toggles to the Expanded Menu with toggles.
if ( isset( $args->show_toggles ) && $args->show_toggles ) {
// Wrap the menu item link contents in a div, used for positioning.
$args->before = '<div class="ancestor-wrapper">';
$args->after = '';
// Add a toggle to items with children.
if ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
$toggle_target_string = '.menu-modal .menu-item-' . $item->ID . ' > .sub-menu';
$toggle_duration = twentytwenty_toggle_duration();
// Add the sub menu toggle.
$args->after .= '<button class="toggle sub-menu-toggle fill-children-current-color" data-toggle-target="' . $toggle_target_string . '" data-toggle-type="slidetoggle" data-toggle-duration="' . absint( $toggle_duration ) . '" aria-expanded="false"><span class="screen-reader-text">' . __( 'Show sub menu', 'twentytwenty' ) . '</span>' . twentytwenty_get_theme_svg( 'chevron-down' ) . '</button>';
}
// Close the wrapper.
$args->after .= '</div><!-- .ancestor-wrapper -->';
// Add sub menu icons to the primary menu without toggles.
} elseif ( 'primary' === $args->theme_location ) {
if ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
$args->after = '<span class="icon"></span>';
} else {
$args->after = '';
}
}
return $args;
}
add_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 10, 3 );
/**
* 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.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string The menu item output with social icon.
*/
function twentytwenty_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
if ( 'social' === $args->theme_location ) {
$svg = TwentyTwenty_SVG_Icons::get_social_link_svg( $item->url );
if ( empty( $svg ) ) {
$svg = twentytwenty_get_theme_svg( 'link' );
}
$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentytwenty_nav_menu_social_icons', 10, 4 );
/**
* Classes
*/
/**
* 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() {
?>
<script>document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );</script>
<?php
}
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.
*/
function twentytwenty_body_classes( $classes ) {
global $post;
$post_type = isset( $post ) ? $post->post_type : false;
// Check whether we're singular.
if ( is_singular() ) {
$classes[] = 'singular';
}
// Check whether the current page should have an overlay header.
if ( is_page_template( array( 'templates/template-cover.php' ) ) ) {
$classes[] = 'overlay-header';
}
// Check whether the current page has full-width content.
if ( is_page_template( array( 'templates/template-full-width.php' ) ) ) {
$classes[] = 'has-full-width-content';
}
// Check for enabled search.
if ( true === get_theme_mod( 'enable_header_search', true ) ) {
$classes[] = 'enable-search-modal';
}
// Check for post thumbnail.
if ( is_singular() && has_post_thumbnail() ) {
$classes[] = 'has-post-thumbnail';
} elseif ( is_singular() ) {
$classes[] = 'missing-post-thumbnail';
}
// Check whether we're in the customizer preview.
if ( is_customize_preview() ) {
$classes[] = 'customizer-preview';
}
// Check if posts have single pagination.
if ( is_single() && ( get_next_post() || get_previous_post() ) ) {
$classes[] = 'has-single-pagination';
} else {
$classes[] = 'has-no-pagination';
}
// Check if we're showing comments.
if ( $post && ( ( 'post' === $post_type || comments_open() || get_comments_number() ) && ! post_password_required() ) ) {
$classes[] = 'showing-comments';
} else {
$classes[] = 'not-showing-comments';
}
// Check if avatars are visible.
$classes[] = get_option( 'show_avatars' ) ? 'show-avatars' : 'hide-avatars';
// Slim page template class names (class = name - file suffix).
if ( is_page_template() ) {
$classes[] = basename( get_page_template_slug(), '.php' );
}
// Check for the elements output in the top part of the footer.
$has_footer_menu = has_nav_menu( 'footer' );
$has_social_menu = has_nav_menu( 'social' );
$has_sidebar_1 = is_active_sidebar( 'sidebar-1' );
$has_sidebar_2 = is_active_sidebar( 'sidebar-2' );
// Add a class indicating whether those elements are output.
if ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {
$classes[] = 'footer-top-visible';
} else {
$classes[] = 'footer-top-hidden';
}
// Get header/footer background color.
$header_footer_background = get_theme_mod( 'header_footer_background_color', '#ffffff' );
$header_footer_background = strtolower( '#' . ltrim( $header_footer_background, '#' ) );
// Get content background color.
$background_color = get_theme_mod( 'background_color', 'f5efe0' );
$background_color = strtolower( '#' . ltrim( $background_color, '#' ) );
// Add extra class if main background and header/footer background are the same color.
if ( $background_color === $header_footer_background ) {
$classes[] = 'reduced-spacing';
}
return $classes;
}
add_filter( 'body_class', 'twentytwenty_body_classes' );
/**
* Archives
*/
/**
* 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(
'pattern' => '/(\A[^\:]+\:)/',
'replacement' => '<span class="color-accent">$1</span>',
)
);
if ( empty( $regex ) ) {
return $title;
}
return preg_replace( $regex['pattern'], $regex['replacement'], $title );
}
add_filter( 'get_the_archive_title', 'twentytwenty_get_the_archive_title' );
/**
* Miscellaneous
*/
/**
* Toggles animation duration in milliseconds.
*
* @since Twenty Twenty 1.0
*
* @return int Duration in milliseconds
*/
function twentytwenty_toggle_duration() {
/**
* Filters the animation duration/speed used usually for submenu toggles.
*
* @since Twenty Twenty 1.0
*
* @param int $duration Duration in milliseconds.
*/
$duration = apply_filters( 'twentytwenty_toggle_duration', 250 );
return $duration;
}
/**
* Gets unique ID.
*
* This is a PHP implementation of Underscore's uniqueId method. A static variable
* contains an integer that is incremented with each call. This number is returned
* 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.
* @return string Unique ID.
*/
function twentytwenty_unique_id( $prefix = '' ) {
static $id_counter = 0;
if ( function_exists( 'wp_unique_id' ) ) {
return wp_unique_id( $prefix );
}
return $prefix . (string) ++$id_counter;
}
PK �1\eX�g g block-patterns.phpnu �[��� <?php
/**
* Twenty Twenty-Two: Block Patterns
*
* @since Twenty Twenty-Two 1.0
*/
/**
* Registers block patterns and categories.
*
* @since Twenty Twenty-Two 1.0
*
* @return void
*/
function twentytwentytwo_register_block_patterns() {
$block_pattern_categories = array(
'featured' => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ),
'footer' => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ),
'header' => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ),
'query' => array( 'label' => __( 'Query', 'twentytwentytwo' ) ),
'pages' => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ),
);
/**
* Filters the theme block pattern categories.
*
* @since Twenty Twenty-Two 1.0
*
* @param array[] $block_pattern_categories {
* An associative array of block pattern categories, keyed by category name.
*
* @type array[] $properties {
* An array of block category properties.
*
* @type string $label A human-readable label for the pattern category.
* }
* }
*/
$block_pattern_categories = apply_filters( 'twentytwentytwo_block_pattern_categories', $block_pattern_categories );
foreach ( $block_pattern_categories as $name => $properties ) {
if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
register_block_pattern_category( $name, $properties );
}
}
$block_patterns = array(
'footer-default',
'footer-dark',
'footer-logo',
'footer-navigation',
'footer-title-tagline-social',
'footer-social-copyright',
'footer-navigation-copyright',
'footer-about-title-logo',
'footer-query-title-citation',
'footer-query-images-title-citation',
'footer-blog',
'general-subscribe',
'general-featured-posts',
'general-layered-images-with-duotone',
'general-wide-image-intro-buttons',
'general-large-list-names',
'general-video-header-details',
'general-list-events',
'general-two-images-text',
'general-image-with-caption',
'general-video-trailer',
'general-pricing-table',
'general-divider-light',
'general-divider-dark',
'header-default',
'header-large-dark',
'header-small-dark',
'header-image-background',
'header-image-background-overlay',
'header-with-tagline',
'header-text-only-green-background',
'header-text-only-salmon-background',
'header-title-and-button',
'header-text-only-with-tagline-black-background',
'header-logo-navigation-gray-background',
'header-logo-navigation-social-black-background',
'header-title-navigation-social',
'header-logo-navigation-offset-tagline',
'header-stacked',
'header-centered-logo',
'header-centered-logo-black-background',
'header-centered-title-navigation-social',
'header-title-and-button',
'hidden-404',
'hidden-bird',
'hidden-heading-and-bird',
'page-about-media-left',
'page-about-simple-dark',
'page-about-media-right',
'page-about-solid-color',
'page-about-links',
'page-about-links-dark',
'page-about-large-image-and-buttons',
'page-layout-image-and-text',
'page-layout-image-text-and-video',
'page-layout-two-columns',
'page-sidebar-poster',
'page-sidebar-grid-posts',
'page-sidebar-blog-posts',
'page-sidebar-blog-posts-right',
'query-default',
'query-simple-blog',
'query-grid',
'query-text-grid',
'query-image-grid',
'query-large-titles',
'query-irregular-grid',
);
/**
* Filters the theme block patterns.
*
* @since Twenty Twenty-Two 1.0
*
* @param array $block_patterns List of block patterns by name.
*/
$block_patterns = apply_filters( 'twentytwentytwo_block_patterns', $block_patterns );
foreach ( $block_patterns as $block_pattern ) {
$pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' );
register_block_pattern(
'twentytwentytwo/' . $block_pattern,
require $pattern_file
);
}
}
add_action( 'init', 'twentytwentytwo_register_block_patterns', 9 );
PK �1\4U�J�
�
helper-functions.phpnu &1i� <?php
/**
* Common theme functions
*
* @package WordPress
* @subpackage Twenty_Nineteen
* @since Twenty Nineteen 1.5
*/
/**
* Determines if post thumbnail can be displayed.
*/
function twentynineteen_can_show_post_thumbnail() {
return apply_filters( 'twentynineteen_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );
}
/**
* Returns true if image filters are enabled on the theme options.
*/
function twentynineteen_image_filters_enabled() {
return 0 !== get_theme_mod( 'image_filter', 1 );
}
/**
* Returns the size for avatars used in the theme.
*/
function twentynineteen_get_avatar_size() {
return 60;
}
/**
* Returns true if comment is by author of the post.
*
* @see get_comment_class()
*/
function twentynineteen_is_comment_by_post_author( $comment = null ) {
if ( is_object( $comment ) && $comment->user_id > 0 ) {
$user = get_userdata( $comment->user_id );
$post = get_post( $comment->comment_post_ID );
if ( ! empty( $user ) && ! empty( $post ) ) {
return $comment->user_id === $post->post_author;
}
}
return false;
}
/**
* Returns information about the current post's discussion, with cache support.
*/
function twentynineteen_get_discussion_data() {
static $discussion, $post_id;
$current_post_id = get_the_ID();
if ( $current_post_id === $post_id ) {
return $discussion; /* If we have discussion information for post ID, return cached object */
} else {
$post_id = $current_post_id;
}
$comments = get_comments(
array(
'post_id' => $current_post_id,
'orderby' => 'comment_date_gmt',
'order' => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings » Discussion. */
'status' => 'approve',
'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */
)
);
$authors = array();
foreach ( $comments as $comment ) {
$authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email;
}
$authors = array_unique( $authors );
$discussion = (object) array(
'authors' => array_slice( $authors, 0, 6 ), /* Six unique authors commenting on the post. */
'responses' => get_comments_number( $current_post_id ), /* Number of responses. */
);
return $discussion;
}
/**
* Converts HSL to HEX colors.
*/
function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) {
$h /= 360;
$s /= 100;
$l /= 100;
$r = $l;
$g = $l;
$b = $l;
$v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s );
if ( $v > 0 ) {
$m = $l + $l - $v;
$sv = ( $v - $m ) / $v;
$h *= 6.0;
$sextant = floor( $h );
$fract = $h - $sextant;
$vsf = $v * $sv * $fract;
$mid1 = $m + $vsf;
$mid2 = $v - $vsf;
switch ( $sextant ) {
case 0:
$r = $v;
$g = $mid1;
$b = $m;
break;
case 1:
$r = $mid2;
$g = $v;
$b = $m;
break;
case 2:
$r = $m;
$g = $v;
$b = $mid1;
break;
case 3:
$r = $m;
$g = $mid2;
$b = $v;
break;
case 4:
$r = $mid1;
$g = $m;
$b = $v;
break;
case 5:
$r = $v;
$g = $m;
$b = $mid2;
break;
}
}
$r = round( $r * 255, 0 );
$g = round( $g * 255, 0 );
$b = round( $b * 255, 0 );
if ( $to_hex ) {
$r = ( $r < 15 ) ? '0' . dechex( $r ) : dechex( $r );
$g = ( $g < 15 ) ? '0' . dechex( $g ) : dechex( $g );
$b = ( $b < 15 ) ? '0' . dechex( $b ) : dechex( $b );
return "#$r$g$b";
}
return "rgb($r, $g, $b)";
}
PK �1\���6 �6 template-functions.phpnu �[��� <?php
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\View;
function colibriwp_page_title( $atts = array() ) {
$title = '';
if ( is_404() ) {
$title = __( 'Page not found', 'colibri-wp' );
} elseif ( is_search() ) {
$title = sprintf( __( 'Search Results for “%s”', 'colibri-wp' ), get_search_query() );
} elseif ( is_home() ) {
if ( is_front_page() ) {
$title = get_bloginfo( 'name' );
} else {
$title = single_post_title( '', false );
}
} elseif ( is_archive() ) {
if ( is_post_type_archive() ) {
$title = post_type_archive_title( '', false );
} else {
$title = get_the_archive_title();
}
} elseif ( is_single() ) {
$title = get_bloginfo( 'name' );
global $post;
if ( $post ) {
// apply core filter
$title = apply_filters( 'single_post_title', $post->post_title, $post );
}
} else {
$title = get_the_title();
}
echo "<span><" . $atts['tag'] . ">" . $title . "</" . $atts['tag'] . "></span>";
}
function colibriwp_site_title() {
$site_title = get_bloginfo( 'name' );
echo esc_html( $site_title );
}
function colibriwp_post_title( $atts ) {
$atts = array_merge(
array(
'heading_type' => 'h3',
'classes' => 'colibri-word-wrap'
),
$atts
);
$title_tempalte = '<a href="%1$s"><%2$s class="%4$s">%3$s</%2$s></a>';
printf( $title_tempalte,
esc_url( get_the_permalink() ),
$atts['heading_type'],
get_the_title(),
$atts['classes']
);
}
function colibriwp_post_excerpt( $attrs = array() ) {
$atts = shortcode_atts(
array(
'max_length' => '',
),
$attrs
);
echo '<div class="colibri-post-excerpt">' . get_the_excerpt() . '</div>';
}
function colibriwp_post_thumb_placeholder_classes( $atts = array() ) {
$result = 'colibri-post-thumbnail-has-placeholder';
$show_placeholder = get_theme_mod( 'blog_show_post_thumb_placeholder',
\ColibriWP\Theme\Defaults::get( 'blog_show_post_thumb_placeholder', true )
);
if ( intval( $show_placeholder ) ) {
echo $result;
}
}
function colibriwp_post_thumbnail_classes( $atts = array() ) {
$result = 'colibri-post-has-no-thumbnail';
if ( has_post_thumbnail() ) {
$result = 'colibri-post-has-thumbnail';
}
if ( get_theme_mod( 'blog_show_post_thumb_placeholder',
\ColibriWP\Theme\Defaults::get( 'blog_show_post_thumb_placeholder', true ) ) ) {
$result .= ' colibri-post-thumbnail-has-placeholder';
}
echo $result;
}
function colibriwp_post_thumbnail( $atts = array() ) {
$show_placeholder = get_theme_mod( 'blog_show_post_thumb_placeholder',
\ColibriWP\Theme\Defaults::get( 'blog_show_post_thumb_placeholder', true ) );
if ( ! has_post_thumbnail() && ! $show_placeholder ) {
return;
}
if ( has_post_thumbnail() ) {
if ( Utils::pathGet( $atts, 'link', false ) ) {
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php
} else {
the_post_thumbnail();
}
}
}
function colibriwp_post_meta_date_url( $atts = array() ) {
$id = get_the_ID();
$link = get_day_link( get_post_time( 'Y', false, $id, true ),
get_post_time( 'm', false, $id, true ),
get_post_time( 'j', false, $id, true ) );
echo $link;
}
function colibriwp_post_categories( $attrs = array() ) {
$categories = get_the_category( get_the_ID() );
$atts = shortcode_atts(
array(
'prefix' => '',
),
$attrs
);
$html = "";
if ( $atts['prefix'] !== '' ) {
$html .= '<span class="d-inline-block categories-prefix">' . colibriwp_esc_html_preserve_spaces( $atts['prefix'] ) . '</span>';
}
if ( $categories ) {
foreach ( $categories as $category ) {
$html .= sprintf( '<a class="d-inline-block" href="%1$s">%2$s</a>',
esc_url( get_category_link( $category->term_id ) ),
esc_html( $category->name )
);
}
} else {
$html .= sprintf( '<span class="d-inline-block">%s</span>', esc_html__( 'No Category', 'colibri-wp' ) );
}
echo $html;
}
function colibriwp_esc_html_preserve_spaces( $text ) {
return esc_html( str_replace( " ", " ", $text ) );
}
function colibriwp_post_tags( $attrs = array() ) {
$atts = shortcode_atts(
array(
'prefix' => '',
),
$attrs
);
$tags = get_the_tags( get_the_ID() );
$html = '';
if ( $atts['prefix'] !== '' ) {
$html .= '<span class="d-inline-block tags-prefix">' . colibriwp_esc_html_preserve_spaces( $atts['prefix'] ) . '</span>';
}
if ( $tags ) {
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
$tag_title = sprintf( __( 'Tag: %s', 'colibri-wp' ), $tag->name );
$html .= sprintf( '<a class="d-inline-block" href="%s" title="%s">%s</a>',
esc_html( $tag_link ),
esc_attr( $tag_title ),
esc_html( $tag->name )
);
}
} else {
$html .= sprintf( '<span class="d-inline-block">%s</span>', esc_html__( 'No Tag', 'colibri-wp' ) );
}
echo $html;
}
function colibriwp_get_nav_direction_wp_name( $type ) {
return $type == "next" ? $type : "previous";
}
function colibriwp_print_navigation_button( $type, $button_text ) {
$args = array(
'prev_text' => '%title',
'next_text' => '%title',
'in_same_term' => false,
'excluded_terms' => '',
'taxonomy' => 'category',
'screen_reader_text' => __( 'Post navigation', 'colibri-wp' ),
);
$navigation = '';
$direction_wp_name = colibriwp_get_nav_direction_wp_name( $type );
$outer = "<div class=\"nav-{$direction_wp_name}\">%link</div>";
$nav_link_fct = "get_{$direction_wp_name}_post_link";
$navigation = call_user_func( $nav_link_fct,
$outer,
$button_text,
$args['in_same_term'],
$args['excluded_terms'],
$args['taxonomy']
);
// Only add markup if there's somewhere to navigate to.
if ( $navigation ) {
$navigation = _navigation_markup( $navigation, 'post-navigation',
$args['screen_reader_text'] );
}
echo $navigation;
}
function colibriwp_post_nav_button( $atts = array() ) {
$type = $atts['type'];
$meta = $atts["{$type}_post"];
$button_text = '<span class="meta-nav" aria-hidden="true">' . $meta . '</span> ' .
'<span class="post-title" title="%title">%title</span>';
colibriwp_print_navigation_button( $type, $button_text );
}
function colibriwp_button_pagination( $args, $atts ) {
$type = $atts['type'];
$nav_direction = colibriwp_get_nav_direction_wp_name( $type );
$label = $atts["{$type}_label"];
$link = call_user_func( "get_{$nav_direction}_posts_link", '<span>' . $label . '</span>' );
?>
<div class="navigation" role="navigation">
<h2 class="screen-reader-text"><?php echo $args['screen_reader_text'] ?></h2>
<div class="nav-links">
<div class="<?php echo $type ?>-navigation"><?php echo $link; ?></div>
</div>
</div>
<?php
}
function colibriwp_numbers_pagination( $args, $atts ) {
$links = paginate_links( $args );
$template
= '<div class="navigation" role="navigation">' .
' <h2 class="screen-reader-text">' . $args["screen_reader_text"] . '</h2>' .
' <div class="nav-links">' .
' <div class="numbers-navigation">' . $links . '</div>' .
' </div>' .
'</div>';
echo $template;
}
function colibriwp_render_pagination( $pagination_type, $atts = array(), $args = array() ) {
$args = wp_parse_args( $args, array(
'before_page_number' => '<span class="meta-nav screen-reader-text">'
. __( 'Page', 'colibri-wp' )
. ' </span>',
'prev_text' => '',
'next_text' => '',
'prev_next' => false,
'screen_reader_text' => __( 'Posts navigation',
'colibri-wp' ),
) );
call_user_func( $pagination_type, $args, $atts );
}
function colibriwp_archive_nav_button( $attrs = array() ) {
$atts = shortcode_atts(
array(
'type' => 'next',
'next_label' => '',
'prev_label' => ''
),
$attrs
);
colibriwp_render_pagination( 'colibriwp_button_pagination', $atts );
}
function colibriwp_archive_pagination() {
colibriwp_render_pagination( '\colibriwp_numbers_pagination' );
}
function colibriwp_render_page_comments() {
if ( ! comments_open() ) {
return;
}
?>
<div id="page-comments" class="page-comments">
<div
class="h-section h-section-global-spacing d-flex align-items-lg-center align-items-md-center align-items-center">
<div class="h-section-grid-container h-section-boxed-container">
<div class="gutters-row-md-2 gutters-row-0 position-relative">
<div class="h-px-lg-2 h-px-md-2 h-px-2 ">
<?php echo colibriwp_post_comments() ?>
</div>
</div>
</div>
</div>
</div>
<?php
}
function colibriwp_post_comments( $attrs = array() ) {
// comments won't render without post//
if ( is_customize_preview() ) {
the_post();
}
$atts = shortcode_atts(
array(
'none' => 'No responses yet',
'one' => 'One response',
'multiple' => 'Responses',
'avatar_size' => 32
),
$attrs
);
ob_start();
add_filter( 'comments_template', 'colibriwp_post_comments_template' );
if ( comments_open( get_the_ID() ) ) {
comments_template();
} else {
return "";
}
$content = ob_get_clean();
remove_filter( 'comments_template', 'colibriwp_post_comments_template' );
echo $content;
}
function colibriwp_post_comment_form() {
}
function colibriwp_widget_area( $atts ) {
if ( is_customize_preview() ) {
global $wp_customize;
$wp_customize->widgets->selective_refresh_init();
}
$atts = shortcode_atts(
array(
'id' => 'widget-1',
),
$atts
);
$id = "colibri-" . $atts['id'];
$id = Hooks::colibri_apply_filters( 'widget_area_id', $id );
ob_start();
dynamic_sidebar( $id );
$content = ob_get_clean();
echo $content;
}
function colibriwp_post_meta_time_url() {
return '';
}
function colibriwp_has_multiple_pages() {
global $wp_query;
$adjacent_post = get_next_post();
if ( empty( $adjacent_post ) ) {
$adjacent_post = get_previous_post();
}
if ( is_single() ) {
return ! empty( $adjacent_post );
}
return ( $wp_query->max_num_pages > 1 );
}
function colibriwp_output_sidebar_search_form( $form = '' ) {
ob_start();
get_template_part( 'template-parts/blog/searchform' );
return ob_get_clean();
}
function colibriwp_post_comments_template( $form = '' ) {
return 'template-parts/blog/comments.php';
}
function colibriwp_theme_print_footer_copyright() {
?>
<div class="h-global-transition-all">
© <?php echo date( 'Y' ); ?> <?php bloginfo( 'blogname' ); ?>.
<?php printf( __( 'Built using WordPress and %s', 'colibri-wp' ),
'<a target="_blank" href="https://colibriwp.com/">ColibriWP Theme</a>'
); ?> .
</div>
<?php
}
function colibriwp_copyright() {
?>
<div class="h-global-transition-all">
<span>© <?php echo date( 'Y' ); ?> <?php bloginfo( 'blogname' ); ?></span>.
</div>
<?php
}
function colibriwp_print_offscreen_copyright() {
echo "© " . date( 'Y' );
}
function colibriwp_the_date( $format = 'F j, Y' ) {
echo get_the_date( $format );
}
add_filter( 'get_search_form', "colibriwp_output_sidebar_search_form", 100 );
function colibriwp_layout_wrapper( $atts ) {
$atts = array_merge(
array(
"name" => "",
"slug" => ""
),
$atts
);
$name = $atts['name'];
?>
<!-- layout_wrapper_output:<?php echo esc_attr( $name ); ?>-start -->
<?php
Hooks::colibri_do_action( "layout_wrapper_output_{$name}", $atts );
?>
<!-- layout_wrapper_output:<?php echo esc_attr( $name ); ?>-end -->
<?php
}
function colibriwp_layout_wrapper_output_tags_container( $atts ) {
if ( has_tag() ) {
View::partial( 'layout-wrapper-content', $atts['slug'] );
}
}
function colibriwp_layout_wrapper_output_categories_container( $atts ) {
if ( has_category() ) {
View::partial( 'layout-wrapper-content', $atts['slug'] );
}
}
function colibriwp_layout_wrapper_output_navigation_container( $atts ) {
if ( colibriwp_has_multiple_pages() ) {
View::partial( 'layout-wrapper-content', $atts['slug'] );
}
}
Hooks::colibri_add_action( "layout_wrapper_output_tags_container",
'colibriwp_layout_wrapper_output_tags_container' );
Hooks::colibri_add_action( "layout_wrapper_output_categories_container",
'colibriwp_layout_wrapper_output_categories_container' );
Hooks::colibri_add_action( "layout_wrapper_output_navigation_container",
'colibriwp_layout_wrapper_output_navigation_container' );
PK -�1\>�"%% % menu-functions.phpnu &1i� <?php
/**
* Functions and filters related to the menus.
*
* Makes the default WordPress navigation use an HTML structure similar
* to the Navigation block.
*
* @link https://make.wordpress.org/themes/2020/07/06/printing-navigation-block-html-from-a-legacy-menu-in-themes/
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
/**
* Add a button to top-level menu items that has sub-menus.
* An icon is added using CSS depending on the value of aria-expanded.
*
* @since Twenty Twenty-One 1.0
*
* @param string $output Nav menu item start element.
* @param object $item Nav menu item.
* @param int $depth Depth.
* @param object $args Nav menu args.
* @return string Nav menu item start element.
*/
function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) {
if ( 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) {
// Add toggle button.
$output .= '<button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)">';
$output .= '<span class="icon-plus">' . twenty_twenty_one_get_icon_svg( 'ui', 'plus', 18 ) . '</span>';
$output .= '<span class="icon-minus">' . twenty_twenty_one_get_icon_svg( 'ui', 'minus', 18 ) . '</span>';
$output .= '<span class="screen-reader-text">' . esc_html__( 'Open menu', 'twentytwentyone' ) . '</span>';
$output .= '</button>';
}
return $output;
}
add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_add_sub_menu_toggle', 10, 4 );
/**
* Detects the social network from a URL and returns the SVG code for its icon.
*
* @since Twenty Twenty-One 1.0
*
* @param string $uri Social link.
* @param int $size The icon size in pixels.
* @return string
*/
function twenty_twenty_one_get_social_link_svg( $uri, $size = 24 ) {
return Twenty_Twenty_One_SVG_Icons::get_social_link_svg( $uri, $size );
}
/**
* Displays SVG icons in the footer navigation.
*
* @since Twenty Twenty-One 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.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string The menu item output with social icon.
*/
function twenty_twenty_one_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
if ( 'footer' === $args->theme_location ) {
$svg = twenty_twenty_one_get_social_link_svg( $item->url, 24 );
if ( ! empty( $svg ) ) {
$item_output = str_replace( $args->link_before, $svg, $item_output );
}
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons', 10, 4 );
/**
* Filters the arguments for a single nav menu item.
*
* @since Twenty Twenty-One 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.
* @return stdClass
*/
function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) {
$args->link_after = '';
if ( 0 === $depth && isset( $item->description ) && $item->description ) {
// The extra <span> element is here for styling purposes: Allows the description to not be underlined on hover.
$args->link_after = '<p class="menu-item-description"><span>' . $item->description . '</span></p>';
}
return $args;
}
add_filter( 'nav_menu_item_args', 'twenty_twenty_one_add_menu_description_args', 10, 3 );
PK -�1\��f� � block-styles.phpnu &1i� <?php
/**
* Block Styles
*
* @link https://developer.wordpress.org/reference/functions/register_block_style/
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
if ( function_exists( 'register_block_style' ) ) {
/**
* Register block styles.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twenty_twenty_one_register_block_styles() {
// Columns: Overlap.
register_block_style(
'core/columns',
array(
'name' => 'twentytwentyone-columns-overlap',
'label' => esc_html__( 'Overlap', 'twentytwentyone' ),
)
);
// Cover: Borders.
register_block_style(
'core/cover',
array(
'name' => 'twentytwentyone-border',
'label' => esc_html__( 'Borders', 'twentytwentyone' ),
)
);
// Group: Borders.
register_block_style(
'core/group',
array(
'name' => 'twentytwentyone-border',
'label' => esc_html__( 'Borders', 'twentytwentyone' ),
)
);
// Image: Borders.
register_block_style(
'core/image',
array(
'name' => 'twentytwentyone-border',
'label' => esc_html__( 'Borders', 'twentytwentyone' ),
)
);
// Image: Frame.
register_block_style(
'core/image',
array(
'name' => 'twentytwentyone-image-frame',
'label' => esc_html__( 'Frame', 'twentytwentyone' ),
)
);
// Latest Posts: Dividers.
register_block_style(
'core/latest-posts',
array(
'name' => 'twentytwentyone-latest-posts-dividers',
'label' => esc_html__( 'Dividers', 'twentytwentyone' ),
)
);
// Latest Posts: Borders.
register_block_style(
'core/latest-posts',
array(
'name' => 'twentytwentyone-latest-posts-borders',
'label' => esc_html__( 'Borders', 'twentytwentyone' ),
)
);
// Media & Text: Borders.
register_block_style(
'core/media-text',
array(
'name' => 'twentytwentyone-border',
'label' => esc_html__( 'Borders', 'twentytwentyone' ),
)
);
// Separator: Thick.
register_block_style(
'core/separator',
array(
'name' => 'twentytwentyone-separator-thick',
'label' => esc_html__( 'Thick', 'twentytwentyone' ),
)
);
// Social icons: Dark gray color.
register_block_style(
'core/social-links',
array(
'name' => 'twentytwentyone-social-icons-color',
'label' => esc_html__( 'Dark gray', 'twentytwentyone' ),
)
);
}
add_action( 'init', 'twenty_twenty_one_register_block_styles' );
}
PK -�1\�3 �f. f. starter-content.phpnu &1i� <?php
/**
* Twenty Twenty Starter Content
*
* @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/**
* Function to return the array of starter content for the theme.
*
* Passes it through the `twentytwenty_starter_content` filter before returning.
*
* @since Twenty Twenty 1.0
*
* @return array A filtered array of args for the starter_content.
*/
function twentytwenty_get_starter_content() {
// Define and register starter content to showcase the theme on new sites.
$starter_content = array(
'widgets' => array(
// Place one core-defined widgets in the first footer widget area.
'sidebar-1' => array(
'text_about',
),
// Place one core-defined widgets in the second footer widget area.
'sidebar-2' => array(
'text_business_info',
),
),
// Create the custom image attachments used as post thumbnails for pages.
'attachments' => array(
'image-opening' => array(
'post_title' => _x( 'The New UMoMA Opens its Doors', 'Theme starter content', 'twentytwenty' ),
'file' => 'assets/images/2020-landscape-1.png', // URL relative to the template directory.
),
),
// Specify the core-defined pages to create and add custom thumbnails to some of them.
'posts' => array(
'front' => array(
'post_type' => 'page',
'post_title' => __( 'The New UMoMA Opens its Doors', 'twentytwenty' ),
// Use the above featured image with the predefined about page.
'thumbnail' => '{{image-opening}}',
'post_content' => implode(
'',
array(
'<!-- wp:group {"align":"wide"} -->',
'<div class="wp-block-group alignwide"><div class="wp-block-group__inner-container"><!-- wp:heading {"align":"center"} -->',
'<h2 class="has-text-align-center">' . __( 'The premier destination for modern art in Northern Sweden. Open from 10 AM to 6 PM every day during the summer months.', 'twentytwenty' ) . '</h2>',
'<!-- /wp:heading --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:columns {"align":"wide"} -->',
'<div class="wp-block-columns alignwide"><!-- wp:column -->',
'<div class="wp-block-column"><!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-1.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'Works and Days', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'August 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-3.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'Theatre of Operations', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'October 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group --></div>',
'<!-- /wp:column -->',
'<!-- wp:column -->',
'<div class="wp-block-column"><!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-2.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'The Life I Deserve', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'August 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-4.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'From Signac to Matisse', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'October 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group --></div>',
'<!-- /wp:column --></div>',
'<!-- /wp:columns -->',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-landscape-2.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:group {"align":"wide"} -->',
'<div class="wp-block-group alignwide"><div class="wp-block-group__inner-container"><!-- wp:heading {"align":"center","textColor":"accent"} -->',
'<h2 class="has-accent-color has-text-align-center">' . __( '“Cyborgs, as the philosopher Donna Haraway established, are not reverent. They do not remember the cosmos.”', 'twentytwenty' ) . '</h2>',
'<!-- /wp:heading --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:paragraph {"dropCap":true} -->',
'<p class="has-drop-cap">' . __( 'With seven floors of striking architecture, UMoMA shows exhibitions of international contemporary art, sometimes along with art historical retrospectives. Existential, political and philosophical issues are intrinsic to our programme. As visitor you are invited to guided tours artist talks, lectures, film screenings and other events with free admission', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'The exhibitions are produced by UMoMA in collaboration with artists and museums around the world and they often attract international attention. UMoMA has received a Special Commendation from the European Museum of the Year, and was among the top candidates for the Swedish Museum of the Year Award as well as for the Council of Europe Museum Prize.', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:paragraph -->',
'<p></p>',
'<!-- /wp:paragraph -->',
'<!-- wp:group {"customBackgroundColor":"#ffffff","align":"wide"} -->',
'<div class="wp-block-group alignwide has-background" style="background-color:#ffffff"><div class="wp-block-group__inner-container"><!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:heading {"align":"center"} -->',
'<h2 class="has-text-align-center">' . __( 'Become a Member and Get Exclusive Offers!', 'twentytwenty' ) . '</h2>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph {"align":"center"} -->',
'<p class="has-text-align-center">' . __( 'Members get access to exclusive exhibits and sales. Our memberships cost $99.99 and are billed annually.', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"align":"center"} -->',
'<div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Join the Club', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:gallery {"ids":[39,38],"align":"wide"} -->',
'<figure class="wp-block-gallery alignwide columns-2 is-cropped"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img src="' . get_theme_file_uri() . '/assets/images/2020-square-2.png" alt="" data-id="39" data-full-url="' . get_theme_file_uri() . '/assets/images/2020-square-2.png" data-link="assets/images/2020-square-2/" class="wp-image-39"/></figure></li><li class="blocks-gallery-item"><figure><img src="' . get_theme_file_uri() . '/assets/images/2020-square-1.png" alt="" data-id="38" data-full-url="' . get_theme_file_uri() . '/assets/images/2020-square-1.png" data-link="' . get_theme_file_uri() . '/assets/images/2020-square-1/" class="wp-image-38"/></figure></li></ul></figure>',
'<!-- /wp:gallery -->',
)
),
),
'about',
'contact',
'blog',
),
// Default to a static front page and assign the front and posts pages.
'options' => array(
'show_on_front' => 'page',
'page_on_front' => '{{front}}',
'page_for_posts' => '{{blog}}',
),
// Set up nav menus for each of the two areas registered in the theme.
'nav_menus' => array(
// Assign a menu to the "primary" location.
'primary' => array(
'name' => __( 'Primary', 'twentytwenty' ),
'items' => array(
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
'page_about',
'page_blog',
'page_contact',
),
),
// This replicates primary just to demonstrate the expanded menu.
'expanded' => array(
'name' => __( 'Primary', 'twentytwenty' ),
'items' => array(
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
'page_about',
'page_blog',
'page_contact',
),
),
// Assign a menu to the "social" location.
'social' => array(
'name' => __( 'Social Links Menu', 'twentytwenty' ),
'items' => array(
'link_yelp',
'link_facebook',
'link_twitter',
'link_instagram',
'link_email',
),
),
),
);
/**
* Filters Twenty Twenty array of starter content.
*
* @since Twenty Twenty 1.0
*
* @param array $starter_content Array of starter content.
*/
return apply_filters( 'twentytwenty_starter_content', $starter_content );
}
PK -�1\Z�E�H$ H$ custom-css.phpnu &1i� <?php
/**
* Twenty Twenty Custom CSS
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
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.
*/
function twentytwenty_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) {
$return = '';
/*
* Bail early if we have no $selector elements or properties and $value.
*/
if ( ! $value || ! $selector ) {
return;
}
$return = sprintf( '%s { %s: %s; }', $selector, $style, $prefix . $value . $suffix );
if ( $echo ) {
echo $return; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;)
}
return $return;
}
}
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.
*
* @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' ) {
// Get variables.
$body = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) );
$body_default = '#000000';
$secondary = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'secondary' ) );
$secondary_default = '#6d6d6d';
$borders = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'borders' ) );
$borders_default = '#dcd7ca';
$accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) );
$accent_default = '#cd2653';
// Header.
$header_footer_background = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'background' ) );
$header_footer_background_default = '#ffffff';
// Cover.
$cover = sanitize_hex_color( get_theme_mod( 'cover_template_overlay_text_color' ) );
$cover_default = '#ffffff';
// Background.
$background = sanitize_hex_color_no_hash( get_theme_mod( 'background_color' ) );
$background_default = 'f5efe0';
ob_start();
/*
* Note – Styles are applied in this order:
* 1. Element specific
* 2. Helper classes
*
* 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 ) {
// Auto-calculated colors.
$elements_definitions = twentytwenty_get_elements_array();
foreach ( $elements_definitions as $context => $props ) {
foreach ( $props as $key => $definitions ) {
foreach ( $definitions as $property => $elements ) {
/*
* If we don't have an elements array or it is empty
* then skip this iteration early;
*/
if ( ! is_array( $elements ) || empty( $elements ) ) {
continue;
}
$val = twentytwenty_get_color_for_area( $context, $key );
if ( $val ) {
twentytwenty_generate_css( implode( ',', $elements ), $property, $val );
}
}
}
}
if ( $cover && $cover !== $cover_default ) {
twentytwenty_generate_css( '.overlay-header .header-inner', 'color', $cover );
twentytwenty_generate_css( '.cover-header .entry-header *', 'color', $cover );
}
// Block Editor Styles.
} elseif ( 'block-editor' === $type ) {
// Colors.
// Accent color.
if ( $accent && $accent !== $accent_default ) {
twentytwenty_generate_css( ':root .has-accent-color, .editor-styles-wrapper a, .editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter, .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link, .editor-styles-wrapper .wp-block-pullquote::before, .editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent );
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '' );
twentytwenty_generate_css( '.has-accent-background-color, .editor-styles-wrapper .wp-block-button__link, .editor-styles-wrapper .wp-block-file__button', 'background-color', $accent );
}
// Background color.
if ( $background && $background !== $background_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper', 'background-color', '#' . $background );
twentytwenty_generate_css( '.has-background.has-primary-background-color:not(.has-text-color),.has-background.has-primary-background-color *:not(.has-text-color),.has-background.has-accent-background-color:not(.has-text-color),.has-background.has-accent-background-color *:not(.has-text-color)', 'color', '#' . $background );
}
// Borders color.
if ( $borders && $borders !== $borders_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-code, .editor-styles-wrapper pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre, .editor-styles-wrapper fieldset, .editor-styles-wrapper .wp-block-table, .editor-styles-wrapper .wp-block-table *, .editor-styles-wrapper .wp-block-table.is-style-stripes, .editor-styles-wrapper .wp-block-latest-posts.is-grid li', 'border-color', $borders );
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-table caption, .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color', $borders );
}
// Text color.
if ( $body && $body !== $body_default ) {
twentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );
}
// Secondary color.
if ( $secondary && $secondary !== $secondary_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper figcaption, .editor-styles-wrapper cite, .editor-styles-wrapper .wp-block-quote__citation, .editor-styles-wrapper .wp-block-quote cite, .editor-styles-wrapper .wp-block-quote footer, .editor-styles-wrapper .wp-block-pullquote__citation, .editor-styles-wrapper .wp-block-pullquote cite, .editor-styles-wrapper .wp-block-pullquote footer, .editor-styles-wrapper ul.wp-block-archives li, .editor-styles-wrapper ul.wp-block-categories li, .editor-styles-wrapper ul.wp-block-latest-posts li, .editor-styles-wrapper ul.wp-block-categories__list li, .editor-styles-wrapper .wp-block-latest-comments time, .editor-styles-wrapper .wp-block-latest-posts time', 'color', $secondary );
}
// Header Footer Background Color.
if ( $header_footer_background && $header_footer_background !== $header_footer_background_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-pullquote::before', 'background-color', $header_footer_background );
}
} elseif ( 'classic-editor' === $type ) {
// Colors.
// Accent color.
if ( $accent && $accent !== $accent_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content a, body#tinymce.wp-editor.content a:focus, body#tinymce.wp-editor.content a:hover', 'color', $accent );
twentytwenty_generate_css( 'body#tinymce.wp-editor.content blockquote, body#tinymce.wp-editor.content .wp-block-quote', 'border-color', $accent, '', ' !important' );
twentytwenty_generate_css( 'body#tinymce.wp-editor.content button, body#tinymce.wp-editor.content .faux-button, body#tinymce.wp-editor.content .wp-block-button__link, body#tinymce.wp-editor.content .wp-block-file__button, body#tinymce.wp-editor.content input[type=\'button\'], body#tinymce.wp-editor.content input[type=\'reset\'], body#tinymce.wp-editor.content input[type=\'submit\']', 'background-color', $accent );
}
// Background color.
if ( $background && $background !== $background_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content', 'background-color', '#' . $background );
}
// Text color.
if ( $body && $body !== $body_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content', 'color', $body );
}
// Secondary color.
if ( $secondary && $secondary !== $secondary_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content hr:not(.is-style-dots), body#tinymce.wp-editor.content cite, body#tinymce.wp-editor.content figcaption, body#tinymce.wp-editor.content .wp-caption-text, body#tinymce.wp-editor.content .wp-caption-dd, body#tinymce.wp-editor.content .gallery-caption', 'color', $secondary );
}
// Borders color.
if ( $borders && $borders !== $borders_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content pre, body#tinymce.wp-editor.content hr, body#tinymce.wp-editor.content fieldset,body#tinymce.wp-editor.content input, body#tinymce.wp-editor.content textarea', 'border-color', $borders );
}
}
// Return the results.
return ob_get_clean();
}
}
PK �1\!Zd!&