aboutsummaryrefslogtreecommitdiff
path: root/srcs/wordpress/wp-content/themes/twentytwenty/classes
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-07-27 10:05:23 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-07-27 10:05:23 +0200
commit5bf66662a9bdd62c5bccab15e607cd95cfb8fcab (patch)
tree39a1a4629749056191c05dfd899f931701b7acf3 /srcs/wordpress/wp-content/themes/twentytwenty/classes
parent5afd237bbd22028b85532b8c0b3fcead49a00764 (diff)
downloadft_server-master.tar.gz
ft_server-master.tar.bz2
ft_server-master.zip
Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my famillyHEADmaster
Diffstat (limited to 'srcs/wordpress/wp-content/themes/twentytwenty/classes')
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php526
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php122
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php47
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-separator-control.php26
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php259
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php142
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php173
7 files changed, 0 insertions, 1295 deletions
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php b/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php
deleted file mode 100644
index cec2496..0000000
--- a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php
+++ /dev/null
@@ -1,526 +0,0 @@
-<?php
-/**
- * Customizer settings for this theme.
- *
- * @package WordPress
- * @subpackage Twenty_Twenty
- * @since 1.0.0
- */
-
-if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
- /**
- * CUSTOMIZER SETTINGS
- */
- class TwentyTwenty_Customize {
-
- /**
- * Register customizer options.
- *
- * @param WP_Customize_Manager $wp_customize Theme Customizer object.
- */
- public static function register( $wp_customize ) {
-
- /**
- * Site Title & Description.
- * */
- $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
- $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
-
- $wp_customize->selective_refresh->add_partial(
- 'blogname',
- array(
- 'selector' => '.site-title a',
- 'render_callback' => 'twentytwenty_customize_partial_blogname',
- )
- );
-
- $wp_customize->selective_refresh->add_partial(
- 'blogdescription',
- array(
- 'selector' => '.site-description',
- 'render_callback' => 'twentytwenty_customize_partial_blogdescription',
- )
- );
-
- $wp_customize->selective_refresh->add_partial(
- 'custom_logo',
- array(
- 'selector' => '.header-titles [class*=site-]:not(.site-description)',
- 'render_callback' => 'twentytwenty_customize_partial_site_logo',
- )
- );
-
- $wp_customize->selective_refresh->add_partial(
- 'retina_logo',
- array(
- 'selector' => '.header-titles [class*=site-]:not(.site-description)',
- 'render_callback' => 'twentytwenty_customize_partial_site_logo',
- )
- );
-
- /**
- * Site Identity
- */
-
- /* 2X Header Logo ---------------- */
- $wp_customize->add_setting(
- 'retina_logo',
- array(
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
- 'transport' => 'postMessage',
- )
- );
-
- $wp_customize->add_control(
- 'retina_logo',
- array(
- 'type' => 'checkbox',
- 'section' => 'title_tagline',
- 'priority' => 10,
- 'label' => __( 'Retina logo', 'twentytwenty' ),
- 'description' => __( 'Scales the logo to half its uploaded size, making it sharp on high-res screens.', 'twentytwenty' ),
- )
- );
-
- // Header & Footer Background Color.
- $wp_customize->add_setting(
- 'header_footer_background_color',
- array(
- 'default' => '#ffffff',
- 'sanitize_callback' => 'sanitize_hex_color',
- 'transport' => 'postMessage',
- )
- );
-
- $wp_customize->add_control(
- new WP_Customize_Color_Control(
- $wp_customize,
- 'header_footer_background_color',
- array(
- 'label' => __( 'Header &amp; Footer Background Color', 'twentytwenty' ),
- 'section' => 'colors',
- )
- )
- );
-
- // Enable picking an accent color.
- $wp_customize->add_setting(
- 'accent_hue_active',
- array(
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),
- 'transport' => 'postMessage',
- 'default' => 'default',
- )
- );
-
- $wp_customize->add_control(
- 'accent_hue_active',
- array(
- 'type' => 'radio',
- 'section' => 'colors',
- 'label' => __( 'Primary Color', 'twentytwenty' ),
- 'choices' => array(
- 'default' => __( 'Default', 'twentytwenty' ),
- 'custom' => __( 'Custom', 'twentytwenty' ),
- ),
- )
- );
-
- /**
- * Implementation for the accent color.
- * This is different to all other color options because of the accessibility enhancements.
- * The control is a hue-only colorpicker, and there is a separate setting that holds values
- * for other colors calculated based on the selected hue and various background-colors on the page.
- *
- * @since 1.0.0
- */
-
- // Add the setting for the hue colorpicker.
- $wp_customize->add_setting(
- 'accent_hue',
- array(
- 'default' => 344,
- 'type' => 'theme_mod',
- 'sanitize_callback' => 'absint',
- 'transport' => 'postMessage',
- )
- );
-
- // Add setting to hold colors derived from the accent hue.
- $wp_customize->add_setting(
- 'accent_accessible_colors',
- array(
- 'default' => array(
- 'content' => array(
- 'text' => '#000000',
- 'accent' => '#cd2653',
- 'secondary' => '#6d6d6d',
- 'borders' => '#dcd7ca',
- ),
- 'header-footer' => array(
- 'text' => '#000000',
- 'accent' => '#cd2653',
- 'secondary' => '#6d6d6d',
- 'borders' => '#dcd7ca',
- ),
- ),
- 'type' => 'theme_mod',
- 'transport' => 'postMessage',
- 'sanitize_callback' => array( __CLASS__, 'sanitize_accent_accessible_colors' ),
- )
- );
-
- // Add the hue-only colorpicker for the accent color.
- $wp_customize->add_control(
- new WP_Customize_Color_Control(
- $wp_customize,
- 'accent_hue',
- array(
- 'section' => 'colors',
- 'settings' => 'accent_hue',
- 'description' => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ),
- 'mode' => 'hue',
- 'active_callback' => function() use ( $wp_customize ) {
- return ( 'custom' === $wp_customize->get_setting( 'accent_hue_active' )->value() );
- },
- )
- )
- );
-
- // Update background color with postMessage, so inline CSS output is updated as well.
- $wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
-
- /**
- * Theme Options
- */
-
- $wp_customize->add_section(
- 'options',
- array(
- 'title' => __( 'Theme Options', 'twentytwenty' ),
- 'priority' => 40,
- 'capability' => 'edit_theme_options',
- )
- );
-
- /* Enable Header Search ----------------------------------------------- */
-
- $wp_customize->add_setting(
- 'enable_header_search',
- array(
- 'capability' => 'edit_theme_options',
- 'default' => true,
- 'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
- )
- );
-
- $wp_customize->add_control(
- 'enable_header_search',
- array(
- 'type' => 'checkbox',
- 'section' => 'options',
- 'priority' => 10,
- 'label' => __( 'Show search in header', 'twentytwenty' ),
- )
- );
-
- /* Show author bio ---------------------------------------------------- */
-
- $wp_customize->add_setting(
- 'show_author_bio',
- array(
- 'capability' => 'edit_theme_options',
- 'default' => true,
- 'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
- )
- );
-
- $wp_customize->add_control(
- 'show_author_bio',
- array(
- 'type' => 'checkbox',
- 'section' => 'options',
- 'priority' => 10,
- 'label' => __( 'Show author bio', 'twentytwenty' ),
- )
- );
-
- /* Display full content or excerpts on the blog and archives --------- */
-
- $wp_customize->add_setting(
- 'blog_content',
- array(
- 'capability' => 'edit_theme_options',
- 'default' => 'full',
- 'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),
- )
- );
-
- $wp_customize->add_control(
- 'blog_content',
- array(
- 'type' => 'radio',
- 'section' => 'options',
- 'priority' => 10,
- 'label' => __( 'On archive pages, posts show:', 'twentytwenty' ),
- 'choices' => array(
- 'full' => __( 'Full text', 'twentytwenty' ),
- 'summary' => __( 'Summary', 'twentytwenty' ),
- ),
- )
- );
-
- /**
- * Template: Cover Template.
- */
- $wp_customize->add_section(
- 'cover_template_options',
- array(
- 'title' => __( 'Cover Template', 'twentytwenty' ),
- 'capability' => 'edit_theme_options',
- 'description' => __( 'Settings for the "Cover Template" page template. Add a featured image to use as background.', 'twentytwenty' ),
- 'priority' => 42,
- )
- );
-
- /* Overlay Fixed Background ------ */
-
- $wp_customize->add_setting(
- 'cover_template_fixed_background',
- array(
- 'capability' => 'edit_theme_options',
- 'default' => true,
- 'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
- 'transport' => 'postMessage',
- )
- );
-
- $wp_customize->add_control(
- 'cover_template_fixed_background',
- array(
- 'type' => 'checkbox',
- 'section' => 'cover_template_options',
- 'label' => __( 'Fixed Background Image', 'twentytwenty' ),
- 'description' => __( 'Creates a parallax effect when the visitor scrolls.', 'twentytwenty' ),
- )
- );
-
- $wp_customize->selective_refresh->add_partial(
- 'cover_template_fixed_background',
- array(
- 'selector' => '.cover-header',
- 'type' => 'cover_fixed',
- )
- );
-
- /* Separator --------------------- */
-
- $wp_customize->add_setting(
- 'cover_template_separator_1',
- array(
- 'sanitize_callback' => 'wp_filter_nohtml_kses',
- )
- );
-
- $wp_customize->add_control(
- new TwentyTwenty_Separator_Control(
- $wp_customize,
- 'cover_template_separator_1',
- array(
- 'section' => 'cover_template_options',
- )
- )
- );
-
- /* Overlay Background Color ------ */
-
- $wp_customize->add_setting(
- 'cover_template_overlay_background_color',
- array(
- 'default' => twentytwenty_get_color_for_area( 'content', 'accent' ),
- 'sanitize_callback' => 'sanitize_hex_color',
- )
- );
-
- $wp_customize->add_control(
- new WP_Customize_Color_Control(
- $wp_customize,
- 'cover_template_overlay_background_color',
- array(
- 'label' => __( 'Overlay Background Color', 'twentytwenty' ),
- 'description' => __( 'The color used for the overlay. Defaults to the accent color.', 'twentytwenty' ),
- 'section' => 'cover_template_options',
- )
- )
- );
-
- /* Overlay Text Color ------------ */
-
- $wp_customize->add_setting(
- 'cover_template_overlay_text_color',
- array(
- 'default' => '#ffffff',
- 'sanitize_callback' => 'sanitize_hex_color',
- )
- );
-
- $wp_customize->add_control(
- new WP_Customize_Color_Control(
- $wp_customize,
- 'cover_template_overlay_text_color',
- array(
- 'label' => __( 'Overlay Text Color', 'twentytwenty' ),
- 'description' => __( 'The color used for the text in the overlay.', 'twentytwenty' ),
- 'section' => 'cover_template_options',
- )
- )
- );
-
- /* Overlay Color Opacity --------- */
-
- $wp_customize->add_setting(
- 'cover_template_overlay_opacity',
- array(
- 'default' => 80,
- 'sanitize_callback' => 'absint',
- 'transport' => 'postMessage',
- )
- );
-
- $wp_customize->add_control(
- 'cover_template_overlay_opacity',
- array(
- 'label' => __( 'Overlay Opacity', 'twentytwenty' ),
- 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'twentytwenty' ),
- 'section' => 'cover_template_options',
- 'type' => 'range',
- 'input_attrs' => twentytwenty_customize_opacity_range(),
- )
- );
-
- $wp_customize->selective_refresh->add_partial(
- 'cover_template_overlay_opacity',
- array(
- 'selector' => '.cover-color-overlay',
- 'type' => 'cover_opacity',
- )
- );
- }
-
- /**
- * Sanitization callback for the "accent_accessible_colors" setting.
- *
- * @static
- * @access public
- * @since 1.0.0
- * @param array $value The value we want to sanitize.
- * @return array Returns sanitized value. Each item in the array gets sanitized separately.
- */
- public static function sanitize_accent_accessible_colors( $value ) {
-
- // Make sure the value is an array. Do not typecast, use empty array as fallback.
- $value = is_array( $value ) ? $value : array();
-
- // Loop values.
- foreach ( $value as $area => $values ) {
- foreach ( $values as $context => $color_val ) {
- $value[ $area ][ $context ] = sanitize_hex_color( $color_val );
- }
- }
-
- return $value;
- }
-
- /**
- * Sanitize select.
- *
- * @param string $input The input from the setting.
- * @param object $setting The selected setting.
- *
- * @return string $input|$setting->default The input from the setting or the default setting.
- */
- public static function sanitize_select( $input, $setting ) {
- $input = sanitize_key( $input );
- $choices = $setting->manager->get_control( $setting->id )->choices;
- return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
- }
-
- /**
- * Sanitize boolean for checkbox.
- *
- * @param bool $checked Whether or not a box is checked.
- *
- * @return bool
- */
- public static function sanitize_checkbox( $checked ) {
- return ( ( isset( $checked ) && true === $checked ) ? true : false );
- }
-
- }
-
- // Setup the Theme Customizer settings and controls.
- add_action( 'customize_register', array( 'TwentyTwenty_Customize', 'register' ) );
-
-}
-
-/**
- * PARTIAL REFRESH FUNCTIONS
- * */
-if ( ! function_exists( 'twentytwenty_customize_partial_blogname' ) ) {
- /**
- * Render the site title for the selective refresh partial.
- */
- function twentytwenty_customize_partial_blogname() {
- bloginfo( 'name' );
- }
-}
-
-if ( ! function_exists( 'twentytwenty_customize_partial_blogdescription' ) ) {
- /**
- * Render the site description for the selective refresh partial.
- */
- function twentytwenty_customize_partial_blogdescription() {
- bloginfo( 'description' );
- }
-}
-
-if ( ! function_exists( 'twentytwenty_customize_partial_site_logo' ) ) {
- /**
- * Render the site logo for the selective refresh partial.
- *
- * Doing it this way so we don't have issues with `render_callback`'s arguments.
- */
- function twentytwenty_customize_partial_site_logo() {
- twentytwenty_site_logo();
- }
-}
-
-
-/**
- * Input attributes for cover overlay opacity option.
- *
- * @return array Array containing attribute names and their values.
- */
-function twentytwenty_customize_opacity_range() {
- /**
- * Filter the input attributes for opacity
- *
- * @param array $attrs {
- * The attributes
- *
- * @type int $min Minimum value
- * @type int $max Maximum value
- * @type int $step Interval between numbers
- * }
- */
- return apply_filters(
- 'twentytwenty_customize_opacity_range',
- array(
- 'min' => 0,
- 'max' => 90,
- 'step' => 5,
- )
- );
-}
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php b/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php
deleted file mode 100644
index a3a1336..0000000
--- a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/**
- * Non-latin language handling.
- *
- * Handle non-latin language styles.
- *
- * @package WordPress
- * @subpackage Twenty_Twenty
- * @since 1.0.0
- */
-
-if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
- /**
- * Language handling.
- */
- class TwentyTwenty_Non_Latin_Languages {
-
- /**
- * Get custom CSS.
- *
- * Return CSS for non-latin language, if available, or null
- *
- * @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
- *
- * @return void
- */
- public static function get_non_latin_css( $type = 'front-end' ) {
-
- // Fetch users locale.
- $locale = get_bloginfo( 'language' );
-
- // Define fallback fonts for non-latin languages.
- $font_family = apply_filters(
- 'twentytwenty_get_localized_font_family_types',
- array(
-
- // Arabic.
- 'ar' => array( 'Tahoma', 'Arial', 'sans-serif' ),
- 'ary' => array( 'Tahoma', 'Arial', 'sans-serif' ),
- 'azb' => array( 'Tahoma', 'Arial', 'sans-serif' ),
- 'ckb' => array( 'Tahoma', 'Arial', 'sans-serif' ),
- 'fa-IR' => array( 'Tahoma', 'Arial', 'sans-serif' ),
- 'haz' => array( 'Tahoma', 'Arial', 'sans-serif' ),
- 'ps' => array( 'Tahoma', 'Arial', 'sans-serif' ),
-
- // Chinese Simplified (China) - Noto Sans SC.
- 'zh-CN' => array( '\'PingFang SC\'', '\'Helvetica Neue\'', '\'Microsoft YaHei New\'', '\'STHeiti Light\'', 'sans-serif' ),
-
- // Chinese Traditional (Taiwan) - Noto Sans TC.
- 'zh-TW' => array( '\'PingFang TC\'', '\'Helvetica Neue\'', '\'Microsoft YaHei New\'', '\'STHeiti Light\'', 'sans-serif' ),
-
- // Chinese (Hong Kong) - Noto Sans HK.
- 'zh-HK' => array( '\'PingFang HK\'', '\'Helvetica Neue\'', '\'Microsoft YaHei New\'', '\'STHeiti Light\'', 'sans-serif' ),
-
- // Cyrillic.
- 'bel' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'bg-BG' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'kk' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'mk-MK' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'mn' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'ru-RU' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'sah' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'sr-RS' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'tt-RU' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
- 'uk' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
-
- // Devanagari.
- 'bn-BD' => array( 'Arial', 'sans-serif' ),
- 'hi-IN' => array( 'Arial', 'sans-serif' ),
- 'mr' => array( 'Arial', 'sans-serif' ),
- 'ne-NP' => array( 'Arial', 'sans-serif' ),
-
- // Greek.
- 'el' => array( '\'Helvetica Neue\', Helvetica, Arial, sans-serif' ),
-
- // Gujarati.
- 'gu' => array( 'Arial', 'sans-serif' ),
-
- // Hebrew.
- 'he-IL' => array( '\'Arial Hebrew\'', 'Arial', 'sans-serif' ),
-
- // Japanese.
- 'ja' => array( 'sans-serif' ),
-
- // Korean.
- 'ko-KR' => array( '\'Apple SD Gothic Neo\'', '\'Malgun Gothic\'', '\'Nanum Gothic\'', 'Dotum', 'sans-serif' ),
-
- // Thai.
- 'th' => array( '\'Sukhumvit Set\'', '\'Helvetica Neue\'', 'Helvetica', 'Arial', 'sans-serif' ),
-
- // Vietnamese.
- 'vi' => array( '\'Libre Franklin\'', 'sans-serif' ),
-
- )
- );
-
- // Return if the selected language has no fallback fonts.
- if ( empty( $font_family[ $locale ] ) ) {
- return;
- }
-
- // Define elements to apply fallback fonts to.
- $elements = apply_filters(
- 'twentytwenty_get_localized_font_family_elements',
- array(
- 'front-end' => array( 'body', 'input', 'textarea', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', '.has-drop-cap:not(:focus)::first-letter', '.has-drop-cap:not(:focus)::first-letter', '.entry-content .wp-block-archives', '.entry-content .wp-block-categories', '.entry-content .wp-block-cover-image', '.entry-content .wp-block-latest-comments', '.entry-content .wp-block-latest-posts', '.entry-content .wp-block-pullquote', '.entry-content .wp-block-quote.is-large', '.entry-content .wp-block-quote.is-style-large', '.entry-content .wp-block-archives *', '.entry-content .wp-block-categories *', '.entry-content .wp-block-latest-posts *', '.entry-content .wp-block-latest-comments *', '.entry-content p', '.entry-content ol', '.entry-content ul', '.entry-content dl', '.entry-content dt', '.entry-content cite', '.entry-content figcaption', '.entry-content .wp-caption-text', '.comment-content p', '.comment-content ol', '.comment-content ul', '.comment-content dl', '.comment-content dt', '.comment-content cite', '.comment-content figcaption', '.comment-content .wp-caption-text', '.widget_text p', '.widget_text ol', '.widget_text ul', '.widget_text dl', '.widget_text dt', '.widget-content .rssSummary', '.widget-content cite', '.widget-content figcaption', '.widget-content .wp-caption-text' ),
- 'block-editor' => array( '.editor-styles-wrapper > *', '.editor-styles-wrapper p', '.editor-styles-wrapper ol', '.editor-styles-wrapper ul', '.editor-styles-wrapper dl', '.editor-styles-wrapper dt', '.editor-post-title__block .editor-post-title__input', '.editor-styles-wrapper .wp-block h1', '.editor-styles-wrapper .wp-block h2', '.editor-styles-wrapper .wp-block h3', '.editor-styles-wrapper .wp-block h4', '.editor-styles-wrapper .wp-block h5', '.editor-styles-wrapper .wp-block h6', '.editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter', '.editor-styles-wrapper cite', '.editor-styles-wrapper figcaption', '.editor-styles-wrapper .wp-caption-text' ),
- 'classic-editor' => array( 'body#tinymce.wp-editor', 'body#tinymce.wp-editor p', 'body#tinymce.wp-editor ol', 'body#tinymce.wp-editor ul', 'body#tinymce.wp-editor dl', 'body#tinymce.wp-editor dt', 'body#tinymce.wp-editor figcaption', 'body#tinymce.wp-editor .wp-caption-text', 'body#tinymce.wp-editor .wp-caption-dd', 'body#tinymce.wp-editor cite', 'body#tinymce.wp-editor table' ),
- )
- );
-
- // Return if the specified type doesn't exist.
- if ( empty( $elements[ $type ] ) ) {
- return;
- }
-
- // Return the specified styles.
- return twentytwenty_generate_css( implode( ',', $elements[ $type ] ), 'font-family', implode( ',', $font_family[ $locale ] ), null, null, false );
-
- }
- }
-}
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php b/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
deleted file mode 100644
index a8af12f..0000000
--- a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Javascript Loader Class
- *
- * Allow `async` and `defer` while enqueuing Javascript.
- *
- * Based on a solution in WP Rig.
- *
- * @package WordPress
- * @subpackage Twenty_Twenty
- * @since 1.0.0
- */
-
-if ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {
- /**
- * A class that provides a way to add `async` or `defer` attributes to scripts.
- */
- class TwentyTwenty_Script_Loader {
-
- /**
- * Adds async/defer attributes to enqueued / registered scripts.
- *
- * If #12009 lands in WordPress, this function can no-op since it would be handled in core.
- *
- * @link https://core.trac.wordpress.org/ticket/12009
- *
- * @param string $tag The script tag.
- * @param string $handle The script handle.
- * @return string Script HTML string.
- */
- public function filter_script_loader_tag( $tag, $handle ) {
- foreach ( [ 'async', 'defer' ] as $attr ) {
- if ( ! wp_scripts()->get_data( $handle, $attr ) ) {
- continue;
- }
- // Prevent adding attribute when already added in #12009.
- if ( ! preg_match( ":\s$attr(=|>|\s):", $tag ) ) {
- $tag = preg_replace( ':(?=></script>):', " $attr", $tag, 1 );
- }
- // Only allow async or defer, not both.
- break;
- }
- return $tag;
- }
-
- }
-}
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-separator-control.php b/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-separator-control.php
deleted file mode 100644
index 8072257..0000000
--- a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-separator-control.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Customizer Separator Control settings for this theme.
- *
- * @package WordPress
- * @subpackage Twenty_Twenty
- * @since 1.0.0
- */
-
-if ( class_exists( 'WP_Customize_Control' ) ) {
-
- if ( ! class_exists( 'TwentyTwenty_Separator_Control' ) ) {
- /**
- * Separator Control.
- */
- class TwentyTwenty_Separator_Control extends WP_Customize_Control {
- /**
- * Render the hr.
- */
- public function render_content() {
- echo '<hr/>';
- }
-
- }
- }
-}
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php b/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php
deleted file mode 100644
index a4b2e7a..0000000
--- a/srcs/wordpress/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php
+++ /dev/null
@@ -1,259 +0,0 @@
-<?php
-/**
- * Custom icons for this theme.
- *
- * @package WordPress
- * @subpackage Twenty_Twenty
- * @since 1.0.0
- */
-
-if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
- /**
- * SVG ICONS CLASS
- * Retrieve the SVG code for the specified icon. Based on a solution in Twenty Nineteen.
- */
- class TwentyTwenty_SVG_Icons {
- /**
- * GET SVG CODE
- * Get the SVG code for the specified icon
- *
- * @param string $icon Icon name.
- * @param string $group Icon group.
- * @param string $color Color.
- */
- public static function get_svg( $icon, $group = 'ui', $color = '#1A1A1B' ) {
- if ( 'ui' === $group ) {
- $arr = self::$ui_icons;
- } elseif ( 'social' === $group ) {
- $arr = self::$social_icons;
- } else {
- $arr = array();
- }
- if ( array_key_exists( $icon, $arr ) ) {
- $repl = '<svg class="svg-icon" aria-hidden="true" role="img" focusable="false" ';
- $svg = preg_replace( '/^<svg /', $repl, trim( $arr[ $icon ] ) ); // Add extra attributes to SVG code.
- $svg = str_replace( '#1A1A1B', $color, $svg ); // Replace the color.
- $svg = str_replace( '#', '%23', $svg ); // Urlencode hashes.
- $svg = preg_replace( "/([\n\t]+)/", ' ', $svg ); // Remove newlines & tabs.
- $svg = preg_replace( '/>\s*</', '><', $svg ); // Remove white space between SVG tags.
- return $svg;
- }
- return null;
- }
-
- /**
- * GET SOCIAL LINK SVG
- * Detects the social network from a URL and returns the SVG code for its icon.
- *
- * @param string $uri The URL to retrieve SVG for.
- */
- public static function get_social_link_svg( $uri ) {
- static $regex_map; // Only compute regex map once, for performance.
- if ( ! isset( $regex_map ) ) {
- $regex_map = array();
- $map = &self::$social_icons_map; // Use reference instead of copy, to save memory.
- foreach ( array_keys( self::$social_icons ) as $icon ) {
- $domains = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) );
- $domains = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match.
- $domains = array_map( 'preg_quote', $domains );
- $regex_map[ $icon ] = sprintf( '/(%s)/i', implode( '|', $domains ) );
- }
- }
- foreach ( $regex_map as $icon => $regex ) {
- if ( preg_match( $regex, $uri ) ) {
- return twentytwenty_get_theme_svg( $icon, 'social' );
- }
- }
- return null;
- }
-
- /**
- * ICON STORAGE
- * Store the code for all SVGs in an array.
- *
- * @var array
- */
- public static $ui_icons = array(
- 'arrow-down' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="24" viewBox="0 0 22 24">
- <polygon fill="#FFF" points="721.105 856 721.105 874.315 728.083 867.313 730.204 869.41 719.59 880 709 869.41 711.074 867.313 718.076 874.315 718.076 856" transform="translate(-709 -856)"/>
- </svg>',
- 'arrow-down-circled ' => '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
- <path fill="#FFF" fill-rule="evenodd" d="M16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 Z M16.7934656,8 L15.4886113,8 L15.4886113,21.5300971 L10.082786,16.1242718 L9.18181515,17.0407767 L16.1410384,24 L23.1157957,17.0407767 L22.1915239,16.1242718 L16.7934656,21.5300971 L16.7934656,8 Z"/>
- </svg>',
- 'bookmark' => '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="18" viewBox="0 0 15 18">
- <path d="M12.598889,2.699762 C12.598889,2.20275 12.195981,1.799841 11.698969,1.799841 L2.699762,1.799841 C2.20275,1.799841 1.799841,2.20275 1.799841,2.699762 L1.799841,15.349777 L6.676297,11.866594 C6.989197,11.643094 7.409533,11.643094 7.722434,11.866594 L12.598889,15.349777 L12.598889,2.699762 Z M1.422989,17.830788 C0.82736,18.256238 0,17.830464 0,17.098493 L0,2.699762 C0,1.208725 1.208725,0 2.699762,0 L11.698969,0 C13.190006,0 14.398731,1.208725 14.398731,2.699762 L14.398731,17.098493 C14.398731,17.830464 13.571371,18.256238 12.975742,17.830788 L7.199365,13.704805 L1.422989,17.830788 Z"/>
- </svg>',
- 'calendar' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19">
- <path fill="#1A1A1B" d="M4.60069444,4.09375 L3.25,4.09375 C2.47334957,4.09375 1.84375,4.72334957 1.84375,5.5 L1.84375,7.26736111 L16.15625,7.26736111 L16.15625,5.5 C16.15625,4.72334957 15.5266504,4.09375 14.75,4.09375 L13.3993056,4.09375 L13.3993056,4.55555556 C13.3993056,5.02154581 13.0215458,5.39930556 12.5555556,5.39930556 C12.0895653,5.39930556 11.7118056,5.02154581 11.7118056,4.55555556 L11.7118056,4.09375 L6.28819444,4.09375 L6.28819444,4.55555556 C6.28819444,5.02154581 5.9104347,5.39930556 5.44444444,5.39930556 C4.97845419,5.39930556 4.60069444,5.02154581 4.60069444,4.55555556 L4.60069444,4.09375 Z M6.28819444,2.40625 L11.7118056,2.40625 L11.7118056,1 C11.7118056,0.534009742 12.0895653,0.15625 12.5555556,0.15625 C13.0215458,0.15625 13.3993056,0.534009742 13.3993056,1 L13.3993056,2.40625 L14.75,2.40625 C16.4586309,2.40625 17.84375,3.79136906 17.84375,5.5 L17.84375,15.875 C17.84375,17.5836309 16.4586309,18.96875 14.75,18.96875 L3.25,18.96875 C1.54136906,18.96875 0.15625,17.5836309 0.15625,15.875 L0.15625,5.5 C0.15625,3.79136906 1.54136906,2.40625 3.25,2.40625 L4.60069444,2.40625 L4.60069444,1 C4.60069444,0.534009742 4.97845419,0.15625 5.44444444,0.15625 C5.9104347,0.15625 6.28819444,0.534009742 6.28819444,1 L6.28819444,2.40625 Z M1.84375,8.95486111 L1.84375,15.875 C1.84375,16.6516504 2.47334957,17.28125 3.25,17.28125 L14.75,17.28125 C15.5266504,17.28125 16.15625,16.6516504 16.15625,15.875 L16.15625,8.95486111 L1.84375,8.95486111 Z"/>
- </svg>',
- 'chevron-down' => '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="12" viewBox="0 0 20 12">
- <polygon fill="#1A1A1B" fill-rule="evenodd" points="1319.899 365.778 1327.678 358 1329.799 360.121 1319.899 370.021 1310 360.121 1312.121 358" transform="translate(-1310 -358)"/>
- </svg>',
- 'comment' => '<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 19 19">
- <path d="M9.43016863,13.2235931 C9.58624731,13.094699 9.7823475,13.0241935 9.98476849,13.0241935 L15.0564516,13.0241935 C15.8581553,13.0241935 16.5080645,12.3742843 16.5080645,11.5725806 L16.5080645,3.44354839 C16.5080645,2.64184472 15.8581553,1.99193548 15.0564516,1.99193548 L3.44354839,1.99193548 C2.64184472,1.99193548 1.99193548,2.64184472 1.99193548,3.44354839 L1.99193548,11.5725806 C1.99193548,12.3742843 2.64184472,13.0241935 3.44354839,13.0241935 L5.76612903,13.0241935 C6.24715123,13.0241935 6.63709677,13.4141391 6.63709677,13.8951613 L6.63709677,15.5301903 L9.43016863,13.2235931 Z M3.44354839,14.766129 C1.67980032,14.766129 0.25,13.3363287 0.25,11.5725806 L0.25,3.44354839 C0.25,1.67980032 1.67980032,0.25 3.44354839,0.25 L15.0564516,0.25 C16.8201997,0.25 18.25,1.67980032 18.25,3.44354839 L18.25,11.5725806 C18.25,13.3363287 16.8201997,14.766129 15.0564516,14.766129 L10.2979143,14.766129 L6.32072889,18.0506004 C5.75274472,18.5196577 4.89516129,18.1156602 4.89516129,17.3790323 L4.89516129,14.766129 L3.44354839,14.766129 Z"/>
- </svg>',
- 'cross' => '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
- <polygon fill="#1A1A1B" fill-rule="evenodd" points="6.852 7.649 .399 1.195 1.445 .149 7.899 6.602 14.352 .149 15.399 1.195 8.945 7.649 15.399 14.102 14.352 15.149 7.899 8.695 1.445 15.149 .399 14.102"/>
- </svg>',
- 'ellipsis' => '<svg xmlns="http://www.w3.org/2000/svg" width="26" height="7" viewBox="0 0 26 7">
- <path fill-rule="evenodd" d="M332.5,45 C330.567003,45 329,43.4329966 329,41.5 C329,39.5670034 330.567003,38 332.5,38 C334.432997,38 336,39.5670034 336,41.5 C336,43.4329966 334.432997,45 332.5,45 Z M342,45 C340.067003,45 338.5,43.4329966 338.5,41.5 C338.5,39.5670034 340.067003,38 342,38 C343.932997,38 345.5,39.5670034 345.5,41.5 C345.5,43.4329966 343.932997,45 342,45 Z M351.5,45 C349.567003,45 348,43.4329966 348,41.5 C348,39.5670034 349.567003,38 351.5,38 C353.432997,38 355,39.5670034 355,41.5 C355,43.4329966 353.432997,45 351.5,45 Z" transform="translate(-329 -38)"/>
- </svg>',
- 'edit' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
- <path fill="#1A1A1B" d="M14.7272727,11.1763636 C14.7272727,10.7244943 15.0935852,10.3581818 15.5454545,10.3581818 C15.9973239,10.3581818 16.3636364,10.7244943 16.3636364,11.1763636 L16.3636364,15.5454545 C16.3636364,16.9010626 15.2646989,18 13.9090909,18 L2.45454545,18 C1.09893743,18 0,16.9010626 0,15.5454545 L0,4.09090909 C0,2.73530107 1.09893743,1.63636364 2.45454545,1.63636364 L6.82363636,1.63636364 C7.2755057,1.63636364 7.64181818,2.00267611 7.64181818,2.45454545 C7.64181818,2.9064148 7.2755057,3.27272727 6.82363636,3.27272727 L2.45454545,3.27272727 C2.00267611,3.27272727 1.63636364,3.63903975 1.63636364,4.09090909 L1.63636364,15.5454545 C1.63636364,15.9973239 2.00267611,16.3636364 2.45454545,16.3636364 L13.9090909,16.3636364 C14.3609602,16.3636364 14.7272727,15.9973239 14.7272727,15.5454545 L14.7272727,11.1763636 Z M6.54545455,9.33890201 L6.54545455,11.4545455 L8.66109799,11.4545455 L16.0247344,4.09090909 L13.9090909,1.97526564 L6.54545455,9.33890201 Z M14.4876328,0.239639906 L17.7603601,3.51236718 C18.07988,3.83188705 18.07988,4.34993113 17.7603601,4.669451 L9.57854191,12.8512692 C9.42510306,13.004708 9.21699531,13.0909091 9,13.0909091 L5.72727273,13.0909091 C5.27540339,13.0909091 4.90909091,12.7245966 4.90909091,12.2727273 L4.90909091,9 C4.90909091,8.78300469 4.99529196,8.57489694 5.14873082,8.42145809 L13.330549,0.239639906 C13.6500689,-0.0798799688 14.1681129,-0.0798799688 14.4876328,0.239639906 Z"/>
- </svg>',
- 'folder' => '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="19" viewBox="0 0 20 19"></