qsdklsqkdmqskdmlqskd azoepqikdomlqskdjmlqs qpfklqjsfmklqsjdmqlsjdsqd icon-functions.php000066600000007415152331230430010222 0ustar00theme_location ) { $svg = twentynineteen_get_social_link_svg( $item->url, 32 ); if ( empty( $svg ) ) { $svg = twentynineteen_get_icon_svg( 'link' ); } $item_output = str_replace( $args->link_after, '' . $svg, $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons', 10, 4 ); /** * Adds a dropdown icon to top-level menu items. * * @param string $item_output The menu item's starting HTML output. * @param WP_Post $item Menu item data object. * @param int $depth Depth of the menu. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @return string Nav menu item start element. */ function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) { // Only add class to 'top level' items on the 'primary' menu. if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) { return $item_output; } if ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) { // Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item. // @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely. $link = sprintf( '. $item_output = preg_replace( '##i', '', $item_output, 1 // Limit. ); } elseif ( in_array( 'menu-item-has-children', $item->classes, true ) ) { // Add SVG icon to parent items. $icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 ); $item_output .= sprintf( '', $icon ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 ); back-compat.php000066600000004570152331230430007444 0ustar00

'; printf( /* translators: %s: WordPress Version. */ esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ), esc_html( $GLOBALS['wp_version'] ) ); echo '

'; } /** * Prevents the Customizer from being loaded on WordPress versions prior to 5.3. * * @since Twenty Twenty-One 1.0 * * @global string $wp_version WordPress version. * * @return void */ function twenty_twenty_one_customize() { wp_die( sprintf( /* translators: %s: WordPress Version. */ esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ), esc_html( $GLOBALS['wp_version'] ) ), '', array( 'back_link' => true, ) ); } add_action( 'load-customize.php', 'twenty_twenty_one_customize' ); /** * Prevents the Theme Preview from being loaded on WordPress versions prior to 5.3. * * @since Twenty Twenty-One 1.0 * * @global string $wp_version WordPress version. * * @return void */ function twenty_twenty_one_preview() { if ( isset( $_GET['preview'] ) ) { wp_die( sprintf( /* translators: %s: WordPress Version. */ esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ), esc_html( $GLOBALS['wp_version'] ) ) ); } } add_action( 'template_redirect', 'twenty_twenty_one_preview' ); helper-functions.php000066600000010136152331230430010543 0ustar00user_id > 0 ) { $user = get_userdata( $comment->user_id ); $post = get_post( $comment->comment_post_ID ); if ( ! empty( $user ) && ! empty( $post ) ) { return $comment->user_id === $post->post_author; } } return false; } /** * Returns information about the current post's discussion, with cache support. */ function twentynineteen_get_discussion_data() { static $discussion, $post_id; $current_post_id = get_the_ID(); if ( $current_post_id === $post_id ) { return $discussion; /* If we have discussion information for post ID, return cached object */ } else { $post_id = $current_post_id; } $comments = get_comments( array( 'post_id' => $current_post_id, 'orderby' => 'comment_date_gmt', 'order' => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings » Discussion. */ 'status' => 'approve', 'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */ ) ); $authors = array(); foreach ( $comments as $comment ) { $authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email; } $authors = array_unique( $authors ); $discussion = (object) array( 'authors' => array_slice( $authors, 0, 6 ), /* Six unique authors commenting on the post. */ 'responses' => get_comments_number( $current_post_id ), /* Number of responses. */ ); return $discussion; } /** * Converts HSL to HEX or RGB colors. * * @param float $h The hue component (0-360). * @param float $s The saturation component (0-100). * @param float $l The lightness component (0-100). * @param bool $to_hex Whether to convert to HEX format (true) or RGB (false). Default true. */ function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) { $h /= 360; $s /= 100; $l /= 100; $r = $l; $g = $l; $b = $l; $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s ); if ( $v > 0 ) { $m = $l + $l - $v; $sv = ( $v - $m ) / $v; $h *= 6.0; $sextant = floor( $h ); $fract = $h - $sextant; $vsf = $v * $sv * $fract; $mid1 = $m + $vsf; $mid2 = $v - $vsf; switch ( $sextant ) { case 0: $r = $v; $g = $mid1; $b = $m; break; case 1: $r = $mid2; $g = $v; $b = $m; break; case 2: $r = $m; $g = $v; $b = $mid1; break; case 3: $r = $m; $g = $mid2; $b = $v; break; case 4: $r = $mid1; $g = $m; $b = $v; break; case 5: $r = $v; $g = $m; $b = $mid2; break; } } $r = round( $r * 255, 0 ); $g = round( $g * 255, 0 ); $b = round( $b * 255, 0 ); if ( $to_hex ) { $r = ( $r < 15 ) ? '0' . dechex( $r ) : dechex( $r ); $g = ( $g < 15 ) ? '0' . dechex( $g ) : dechex( $g ); $b = ( $b < 15 ) ? '0' . dechex( $b ) : dechex( $b ); return "#$r$g$b"; } return "rgb($r, $g, $b)"; } template-functions.php000066600000043127152331230430011105 0ustar00'; } } add_action( 'wp_head', 'twenty_twenty_one_pingback_header' ); /** * Removes the `no-js` class from body if JS is supported. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_supports_js() { $js = "document.body.classList.remove('no-js');"; $js .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ ); if ( function_exists( 'wp_print_inline_script_tag' ) ) { wp_print_inline_script_tag( $js ); } else { echo "\n"; } } add_action( 'wp_footer', 'twenty_twenty_one_supports_js' ); /** * Changes comment form default fields. * * @since Twenty Twenty-One 1.0 * * @param array $defaults The form defaults. * @return array Comment form defaults with adjusted textarea height. */ function twenty_twenty_one_comment_form_defaults( $defaults ) { // Adjust height of comment form. $defaults['comment_field'] = preg_replace( '/rows="\d+"/', 'rows="5"', $defaults['comment_field'] ); return $defaults; } add_filter( 'comment_form_defaults', 'twenty_twenty_one_comment_form_defaults' ); /** * Determines if post thumbnail can be displayed. * * @since Twenty Twenty-One 1.0 * * @return bool */ function twenty_twenty_one_can_show_post_thumbnail() { /** * Filters whether post thumbnail can be displayed. * * @since Twenty Twenty-One 1.0 * * @param bool $show_post_thumbnail Whether to show post thumbnail. */ return apply_filters( 'twenty_twenty_one_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() ); } /** * Returns the size for avatars used in the theme. * * @since Twenty Twenty-One 1.0 * * @return int */ function twenty_twenty_one_get_avatar_size() { return 60; } /** * Creates continue reading text. * * @since Twenty Twenty-One 1.0 */ function twenty_twenty_one_continue_reading_text() { $continue_reading = sprintf( /* translators: %s: Post title. Only visible to screen readers. */ esc_html__( 'Continue reading %s', 'twentytwentyone' ), the_title( '', '', false ) ); return $continue_reading; } /** * Creates the continue reading link for excerpt. * * @since Twenty Twenty-One 1.0 */ function twenty_twenty_one_continue_reading_link_excerpt() { if ( ! is_admin() ) { return '… ' . twenty_twenty_one_continue_reading_text() . ''; } } // Filter the excerpt more link. add_filter( 'excerpt_more', 'twenty_twenty_one_continue_reading_link_excerpt' ); /** * Creates the continue reading link. * * @since Twenty Twenty-One 1.0 */ function twenty_twenty_one_continue_reading_link() { if ( ! is_admin() ) { return ''; } } // Filter the content more link. add_filter( 'the_content_more_link', 'twenty_twenty_one_continue_reading_link' ); if ( ! function_exists( 'twenty_twenty_one_post_title' ) ) { /** * Adds a title to posts and pages that are missing titles. * * @since Twenty Twenty-One 1.0 * * @param string $title The title. * @return string */ function twenty_twenty_one_post_title( $title ) { return '' === $title ? esc_html_x( 'Untitled', 'Added to posts and pages that are missing titles', 'twentytwentyone' ) : $title; } } add_filter( 'the_title', 'twenty_twenty_one_post_title' ); /** * Gets the SVG code for a given icon. * * @since Twenty Twenty-One 1.0 * * @param string $group The icon group. * @param string $icon The icon. * @param int $size The icon size in pixels. * @return string SVG code for the requested icon. */ function twenty_twenty_one_get_icon_svg( $group, $icon, $size = 24 ) { return Twenty_Twenty_One_SVG_Icons::get_svg( $group, $icon, $size ); } /** * Changes the default navigation arrows to svg icons * * @since Twenty Twenty-One 1.0 * * @param string $calendar_output The generated HTML of the calendar. * @return string Calendar HTML with SVG navigation arrows. */ function twenty_twenty_one_change_calendar_nav_arrows( $calendar_output ) { $calendar_output = str_replace( '« ', is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ), $calendar_output ); $calendar_output = str_replace( ' »', is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ), $calendar_output ); return $calendar_output; } add_filter( 'get_calendar', 'twenty_twenty_one_change_calendar_nav_arrows' ); /** * Gets custom CSS. * * Return CSS for non-latin language, if available, or null * * @since Twenty Twenty-One 1.0 * * @param string $type Whether to return CSS for the "front-end", "block-editor", or "classic-editor". * @return string CSS styles for non-Latin languages based on the site locale. */ function twenty_twenty_one_get_non_latin_css( $type = 'front-end' ) { // Fetch site locale. $locale = get_bloginfo( 'language' ); /** * Filters the fallback fonts for non-latin languages. * * @since Twenty Twenty-One 1.0 * * @param array $font_family An array of locales and font families. */ $font_family = apply_filters( 'twenty_twenty_one_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 ''; } /** * Filters the elements to apply fallback fonts to. * * @since Twenty Twenty-One 1.0 * * @param array $elements An array of elements for "front-end", "block-editor", or "classic-editor". */ $elements = apply_filters( 'twenty_twenty_one_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', '.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 ''; } // Include file if function doesn't exist. if ( ! function_exists( 'twenty_twenty_one_generate_css' ) ) { require_once get_theme_file_path( 'inc/custom-css.php' ); } // Return the specified styles. return twenty_twenty_one_generate_css( implode( ',', $elements[ $type ] ), 'font-family', implode( ',', $font_family[ $locale ] ), '', '', false ); } /** * Prints the first instance of a block in the content, and then break away. * * @since Twenty Twenty-One 1.0 * * @param string $block_name The full block type name, or a partial match. * Example: `core/image`, `core-embed/*`. * @param string|null $content The content to search in. Use null for get_the_content(). * @param int $instances How many instances of the block will be printed (max). Default 1. * @return bool Returns true if a block was located & printed, otherwise false. */ function twenty_twenty_one_print_first_instance_of_block( $block_name, $content = null, $instances = 1 ) { $instances_count = 0; $blocks_content = ''; if ( ! $content ) { $content = get_the_content(); } // Parse blocks in the content. $blocks = parse_blocks( $content ); // Loop blocks. foreach ( $blocks as $block ) { // Confidence check. if ( ! isset( $block['blockName'] ) ) { continue; } // Check if this the block matches the $block_name. $is_matching_block = false; // If the block ends with *, try to match the first portion. if ( '*' === $block_name[-1] ) { $is_matching_block = 0 === strpos( $block['blockName'], rtrim( $block_name, '*' ) ); } else { $is_matching_block = $block_name === $block['blockName']; } if ( $is_matching_block ) { // Increment count. ++$instances_count; // Add the block HTML. $blocks_content .= render_block( $block ); // Break the loop if the $instances count was reached. if ( $instances_count >= $instances ) { break; } } } if ( $blocks_content ) { /** This filter is documented in wp-includes/post-template.php */ echo apply_filters( 'the_content', $blocks_content ); return true; } return false; } /** * Retrieves protected post password form content. * * @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.4 Corrected parameter name for `$output`, * added the `$post` parameter. * * @param string $output The password form HTML output. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. * @return string HTML content for password form for password protected post. */ function twenty_twenty_one_password_form( $output, $post = 0 ) { $post = get_post( $post ); $label = 'pwbox-' . ( empty( $post->ID ) ? wp_rand() : $post->ID ); $output = '

' . esc_html__( 'This content is password protected. Please enter a password to view.', 'twentytwentyone' ) . '

'; return $output; } add_filter( 'the_password_form', 'twenty_twenty_one_password_form', 10, 2 ); /** * Filters the list of attachment image attributes. * * @since Twenty Twenty-One 1.0 * * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). * @param WP_Post $attachment Image attachment post. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @return string[] The filtered attributes for the image markup. */ function twenty_twenty_one_get_attachment_image_attributes( $attr, $attachment, $size ) { if ( is_admin() ) { return $attr; } if ( isset( $attr['class'] ) && false !== strpos( $attr['class'], 'custom-logo' ) ) { return $attr; } $width = false; $height = false; if ( is_array( $size ) ) { $width = (int) $size[0]; $height = (int) $size[1]; } elseif ( $attachment && is_object( $attachment ) && $attachment->ID ) { $meta = wp_get_attachment_metadata( $attachment->ID ); if ( isset( $meta['width'] ) && isset( $meta['height'] ) ) { $width = (int) $meta['width']; $height = (int) $meta['height']; } } if ( $width && $height ) { // Add style. $attr['style'] = isset( $attr['style'] ) ? $attr['style'] : ''; $attr['style'] = 'width:100%;height:' . round( 100 * $height / $width, 2 ) . '%;max-width:' . $width . 'px;' . $attr['style']; } return $attr; } add_filter( 'wp_get_attachment_image_attributes', 'twenty_twenty_one_get_attachment_image_attributes', 10, 3 ); color-patterns.php000066600000025400152331230430010232 0ustar00 .has-primary-background-color, .entry .entry-content > *[class^="wp-block-"].has-primary-background-color, .entry .entry-content > *[class^="wp-block-"] .has-primary-background-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-primary-background-color, .entry .entry-content .wp-block-file .wp-block-file__button { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* * Set Color for: * - all links * - main navigation links * - Post navigation links * - Post entry meta hover * - Post entry header more-link hover * - main navigation svg * - comment navigation * - Comment edit link hover * - Site Footer Link hover * - Widget links */ a, a:visited, .main-navigation .main-menu > li, .main-navigation ul.main-menu > li > a, .post-navigation .post-title, .entry .entry-meta a:hover, .entry .entry-footer a:hover, .entry .entry-content .more-link:hover, .main-navigation .main-menu > li > a + svg, .comment .comment-metadata > a:hover, .comment .comment-metadata .comment-edit-link:hover, #colophon .site-info a:hover, .widget a, .entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), .entry .entry-content > .has-primary-color, .entry .entry-content > *[class^="wp-block-"] .has-primary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color p { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* * Set border color for: * wp block quote * :focus */ blockquote, .entry .entry-content blockquote, .entry .entry-content .wp-block-quote:not(.is-large), .entry .entry-content .wp-block-quote:not(.is-style-large), input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="number"]:focus, input[type="tel"]:focus, input[type="range"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="time"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="color"]:focus, textarea:focus { border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } .gallery-item > div > a:focus { box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* Hover colors */ a:hover, a:active, .main-navigation .main-menu > li > a:hover, .main-navigation .main-menu > li > a:hover + svg, .post-navigation .nav-links a:hover, .post-navigation .nav-links a:hover .post-title, .author-bio .author-description .author-link:hover, .entry .entry-content > .has-secondary-color, .entry .entry-content > *[class^="wp-block-"] .has-secondary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color p, .comment .comment-author .fn a:hover, .comment-reply-link:hover, .comment-navigation .nav-previous a:hover, .comment-navigation .nav-next a:hover, #cancel-comment-reply-link:hover, .widget a:hover { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ } .main-navigation .sub-menu > li > a:hover, .main-navigation .sub-menu > li > a:focus, .main-navigation .sub-menu > li > a:hover:after, .main-navigation .sub-menu > li > a:focus:after, .main-navigation .sub-menu > li > .menu-item-link-return:hover, .main-navigation .sub-menu > li > .menu-item-link-return:focus, .main-navigation .sub-menu > li > a:not(.submenu-expand):hover, .main-navigation .sub-menu > li > a:not(.submenu-expand):focus, .entry .entry-content > .has-secondary-background-color, .entry .entry-content > *[class^="wp-block-"].has-secondary-background-color, .entry .entry-content > *[class^="wp-block-"] .has-secondary-background-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-secondary-background-color { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ } /* Text selection colors */ ::selection { background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */ } ::-moz-selection { background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */ }'; $editor_css = ' /* * Set colors for: * - links * - blockquote * - pullquote (solid color) * - buttons, including buttons in the file and search blocks. */ .editor-styles-wrapper .wp-block a, .editor-styles-wrapper .wp-block .wp-block-file .wp-block-file__textlink, /* Before 5.8 */ .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), /* Before 5.8 */ .editor-styles-wrapper .wp-block.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), /* Before 5.8, the following hover style is needed to override the default color when the block is selected. */ .editor-styles-wrapper .wp-block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color) { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } .editor-styles-wrapper .wp-block.wp-block-quote:not(.is-large):not(.is-style-large), .editor-styles-wrapper .wp-block .wp-block-freeform blockquote, /* Before 5.8 */ .editor-styles-wrapper .wp-block.wp-block-freeform blockquote { border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* Pullquote: The solid color variation was removed in 5.9, the CSS is kept for backwards compatibility. */ .editor-styles-wrapper .wp-block .wp-block-pullquote.is-style-solid-color:not(.has-background-color), /* Before 5.8 */ .editor-styles-wrapper .wp-block.wp-block-pullquote.is-style-solid-color:not(.has-background-color), .editor-styles-wrapper .wp-block .wp-block-file .wp-block-file__button, /* Before 5.8, and when the block is aligned. */ .editor-styles-wrapper .wp-block.wp-block-file .wp-block-file__button, .editor-styles-wrapper .wp-block .wp-block-button:not(.is-style-outline) .wp-block-button__link, .editor-styles-wrapper .wp-block .wp-block-search .wp-block-search__button, /* Before 5.8, and when the block is aligned. */ .editor-styles-wrapper .wp-block.wp-block-search .wp-block-search__button { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* Link hover colors */ .editor-styles-wrapper .wp-block a:hover, .editor-styles-wrapper .wp-block a:active, .editor-styles-wrapper .wp-block.wp-block-file .wp-block-file__textlink:hover { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ } /* Do not overwrite solid color pullquote or cover links */ .editor-styles-wrapper .wp-block .wp-block-pullquote.is-style-solid-color a, /* Before 5.8 */ .editor-styles-wrapper .wp-block.wp-block-pullquote.is-style-solid-color a, .editor-styles-wrapper .wp-block.wp-block-cover a { color: inherit; } '; if ( function_exists( 'register_block_type' ) && is_admin() ) { $theme_css = $editor_css; } /** * Filters Twenty Nineteen custom colors CSS. * * @since Twenty Nineteen 1.0 * * @param string $css Base theme colors CSS. * @param int $primary_color The user's selected color hue. * @param string $saturation Filtered theme color saturation level. */ return apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation ); } block-patterns.php000066600000050010152331230430010201 0ustar00 esc_html__( 'Twenty Twenty-One', 'twentytwentyone' ) ) ); } add_action( 'init', 'twenty_twenty_one_register_block_pattern_category' ); } if ( function_exists( 'register_block_pattern' ) ) { /** * Registers Block Patterns. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_register_block_pattern() { // Large Text. register_block_pattern( 'twentytwentyone/large-text', array( 'title' => esc_html__( 'Large text', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'blockTypes' => array( 'core/heading' ), 'content' => '

' . esc_html__( 'A new portfolio default theme for WordPress', 'twentytwentyone' ) . '

', ) ); // Links Area. register_block_pattern( 'twentytwentyone/links-area', array( 'title' => esc_html__( 'Links area', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'blockTypes' => array( 'core/cover' ), 'description' => esc_html_x( 'A huge text followed by social networks and email address links.', 'Block pattern description', 'twentytwentyone' ), 'content' => '

' . wp_kses_post( __( 'Let’s Connect.', 'twentytwentyone' ) ) . '

', ) ); // Media & Text Article Title. register_block_pattern( 'twentytwentyone/media-text-article-title', array( 'title' => esc_html__( 'Media and text article title', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'description' => esc_html_x( 'A Media & Text block with a big image on the left and a heading on the right. The heading is followed by a separator and a description paragraph.', 'Block pattern description', 'twentytwentyone' ), 'content' => '
' . esc_attr__( '“Playing in the Sand” by Berthe Morisot', 'twentytwentyone' ) . '

' . esc_html__( 'Playing in the Sand', 'twentytwentyone' ) . '


' . wp_kses_post( __( 'Berthe Morisot
(French, 1841-1895)', 'twentytwentyone' ) ) . '

', ) ); // Overlapping Images. register_block_pattern( 'twentytwentyone/overlapping-images', array( 'title' => esc_html__( 'Overlapping images', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1024, 'blockTypes' => array( 'core/columns' ), 'description' => esc_html_x( 'Three images inside an overlapping columns block.', 'Block pattern description', 'twentytwentyone' ), 'content' => '
' . esc_attr__( '“Roses Trémières” by Berthe Morisot', 'twentytwentyone' ) . '
' . esc_attr__( '“In the Bois de Boulogne” by Berthe Morisot', 'twentytwentyone' ) . '
' . esc_attr__( '“Young Woman in Mauve” by Berthe Morisot', 'twentytwentyone' ) . '
', ) ); // Two Images Showcase. register_block_pattern( 'twentytwentyone/two-images-showcase', array( 'title' => esc_html__( 'Two images showcase', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'description' => esc_html_x( 'A media & text block with a big image on the left and a smaller one with bordered frame on the right.', 'Block pattern description', 'twentytwentyone' ), 'content' => '
' . esc_attr__( '“Daffodils” by Berthe Morisot', 'twentytwentyone' ) . '
' . esc_attr__( '“Self portrait” by Berthe Morisot', 'twentytwentyone' ) . '
', ) ); // Overlapping Images and Text. register_block_pattern( 'twentytwentyone/overlapping-images-and-text', array( 'title' => esc_html__( 'Overlapping images and text', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'blockTypes' => array( 'core/columns' ), 'description' => esc_html_x( 'An overlapping columns block with two images and a text description.', 'Block pattern description', 'twentytwentyone' ), 'content' => '
' . esc_attr__( '“The Garden at Bougival” by Berthe Morisot', 'twentytwentyone' ) . '

' . esc_html__( 'Beautiful gardens painted by Berthe Morisot in the late 1800s', 'twentytwentyone' ) . '

' . esc_attr__( '“Villa with Orange Trees, Nice” by Berthe Morisot', 'twentytwentyone' ) . '
', ) ); // Portfolio List. register_block_pattern( 'twentytwentyone/portfolio-list', array( 'title' => esc_html__( 'Portfolio list', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'description' => esc_html_x( 'A list of projects with thumbnail images.', 'Block pattern description', 'twentytwentyone' ), 'content' => '

' . esc_html__( 'Roses Trémières', 'twentytwentyone' ) . '

' . esc_attr__( '“Roses Trémières” by Berthe Morisot', 'twentytwentyone' ) . '

' . esc_html__( 'Villa with Orange Trees, Nice', 'twentytwentyone' ) . '

“Villa with Orange Trees, Nice” by Berthe Morisot

' . esc_html__( 'In the Bois de Boulogne', 'twentytwentyone' ) . '

' . esc_attr__( '“In the Bois de Boulogne” by Berthe Morisot', 'twentytwentyone' ) . '

' . esc_html__( 'The Garden at Bougival', 'twentytwentyone' ) . '

' . esc_attr__( '“The Garden at Bougival” by Berthe Morisot', 'twentytwentyone' ) . '

' . esc_html__( 'Young Woman in Mauve', 'twentytwentyone' ) . '

' . esc_attr__( '“Young Woman in Mauve” by Berthe Morisot', 'twentytwentyone' ) . '

' . esc_html__( 'Reading', 'twentytwentyone' ) . '

' . esc_attr__( '“Reading” by Berthe Morisot', 'twentytwentyone' ) . '

', ) ); register_block_pattern( 'twentytwentyone/contact-information', array( 'title' => esc_html__( 'Contact information', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'blockTypes' => array( 'core/columns' ), 'description' => esc_html_x( 'A block with 3 columns that display contact information and social media links.', 'Block pattern description', 'twentytwentyone' ), 'content' => '

' . esc_html_x( 'example@example.com', 'Block pattern sample content', 'twentytwentyone' ) . '
' . esc_html_x( '123-456-7890', 'Block pattern sample content', 'twentytwentyone' ) . '

' . esc_html_x( '123 Main Street', 'Block pattern sample content', 'twentytwentyone' ) . '
' . esc_html_x( 'Cambridge, MA, 02139', 'Block pattern sample content', 'twentytwentyone' ) . '

', ) ); } add_action( 'init', 'twenty_twenty_one_register_block_pattern' ); } customizer.php000066600000010106152331230430007457 0ustar00get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'twentynineteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'twentynineteen_customize_partial_blogdescription', ) ); } /** * Primary color. */ $wp_customize->add_setting( 'primary_color', array( 'default' => 'default', 'transport' => 'postMessage', 'sanitize_callback' => 'twentynineteen_sanitize_color_option', ) ); $wp_customize->add_control( 'primary_color', array( 'type' => 'radio', 'label' => __( 'Primary Color', 'twentynineteen' ), 'choices' => array( 'default' => _x( 'Default', 'primary color', 'twentynineteen' ), 'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ), ), 'section' => 'colors', 'priority' => 5, ) ); // Add primary color hue setting and control. $wp_customize->add_setting( 'primary_color_hue', array( 'default' => 199, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_color_hue', array( 'label' => __( 'Custom Color', 'twentynineteen' ), 'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ), 'section' => 'colors', 'mode' => 'hue', ) ) ); // Add image filter setting and control. $wp_customize->add_setting( 'image_filter', array( 'default' => 1, 'sanitize_callback' => 'absint', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'image_filter', array( 'label' => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ), 'section' => 'colors', 'type' => 'checkbox', ) ); } add_action( 'customize_register', 'twentynineteen_customize_register' ); /** * Renders the site title for the selective refresh partial. * * @return void */ function twentynineteen_customize_partial_blogname() { bloginfo( 'name' ); } /** * Renders the site tagline for the selective refresh partial. * * @return void */ function twentynineteen_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to instantly live-preview changes. */ function twentynineteen_customize_preview_js() { wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', array( 'in_footer' => true ) ); } add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' ); /** * Loads dynamic logic for the customizer controls area. */ function twentynineteen_panels_js() { wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20250717', array( 'in_footer' => true ) ); } add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' ); /** * Sanitizes custom color choice. * * @param string $choice Whether image filter is active. * @return string Sanitized color option. */ function twentynineteen_sanitize_color_option( $choice ) { $valid = array( 'default', 'custom', ); if ( in_array( $choice, $valid, true ) ) { return $choice; } return 'default'; } template-tags.php000066600000016432152331230430010032 0ustar00%2$s'; $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ) ); echo ''; printf( /* translators: %s: Publish date. */ esc_html__( 'Published %s', 'twentytwentyone' ), $time_string ); echo ''; } } if ( ! function_exists( 'twenty_twenty_one_posted_by' ) ) { /** * Prints HTML with meta information about theme author. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_posted_by() { if ( ! get_the_author_meta( 'description' ) && post_type_supports( get_post_type(), 'author' ) ) { echo ''; printf( /* translators: %s: Author name. */ esc_html__( 'By %s', 'twentytwentyone' ), '' ); echo ''; } } } if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) { /** * Prints HTML with meta information for the categories, tags and comments. * Footer entry meta is displayed differently in archives and single posts. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_entry_meta_footer() { // Early exit if not a post. if ( 'post' !== get_post_type() ) { return; } // Hide meta information on pages. if ( ! is_single() ) { if ( is_sticky() ) { echo '

' . esc_html_x( 'Featured post', 'Label for sticky posts', 'twentytwentyone' ) . '

'; } $post_format = get_post_format(); if ( 'aside' === $post_format || 'status' === $post_format ) { echo '

' . twenty_twenty_one_continue_reading_text() . '

'; } // Posted on. twenty_twenty_one_posted_on(); // Edit post link. edit_post_link( sprintf( /* translators: %s: Post title. Only visible to screen readers. */ esc_html__( 'Edit %s', 'twentytwentyone' ), '' . get_the_title() . '' ), '', '
' ); if ( has_category() || has_tag() ) { echo '
'; $categories_list = get_the_category_list( wp_get_list_item_separator() ); if ( $categories_list ) { printf( /* translators: %s: List of categories. */ '' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' ', $categories_list ); } $tags_list = get_the_tag_list( '', wp_get_list_item_separator() ); if ( $tags_list && ! is_wp_error( $tags_list ) ) { printf( /* translators: %s: List of tags. */ '' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '', $tags_list ); } echo '
'; } } else { echo '
'; // Posted on. twenty_twenty_one_posted_on(); // Posted by. twenty_twenty_one_posted_by(); // Edit post link. edit_post_link( sprintf( /* translators: %s: Post title. Only visible to screen readers. */ esc_html__( 'Edit %s', 'twentytwentyone' ), '' . get_the_title() . '' ), '', '' ); echo '
'; if ( has_category() || has_tag() ) { echo '
'; $categories_list = get_the_category_list( wp_get_list_item_separator() ); if ( $categories_list ) { printf( /* translators: %s: List of categories. */ '' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' ', $categories_list ); } $tags_list = get_the_tag_list( '', wp_get_list_item_separator() ); if ( $tags_list && ! is_wp_error( $tags_list ) ) { printf( /* translators: %s: List of tags. */ '' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '', $tags_list ); } echo '
'; } } } } if ( ! function_exists( 'twenty_twenty_one_post_thumbnail' ) ) { /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_post_thumbnail() { if ( ! twenty_twenty_one_can_show_post_thumbnail() ) { return; } ?>
false ) ); ?>
posts', 'twentytwentyone' ); $old_posts_text = __( 'Older posts', 'twentytwentyone' ); the_posts_pagination( array( 'before_page_number' => esc_html__( 'Page', 'twentytwentyone' ) . ' ', 'mid_size' => 0, 'prev_text' => sprintf( '%s %s', is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ), wp_kses( ( 'DESC' === $order ) ? $new_posts_text : $old_posts_text, array( 'span' => array( 'class' => array(), ), ) ) ), 'next_text' => sprintf( '%s %s', wp_kses( ( 'DESC' === $order ) ? $old_posts_text : $new_posts_text, array( 'span' => array( 'class' => array(), ), ) ), is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) ), ) ); } } slabtext.php000064400000006713152331543760007123 0ustar00 '', "max_width" => '', "style" => 'slab-style-1', "el_class" => '', ), $atts) ); wp_enqueue_script( 'jquery-slabtext' ); if ( trim($text_rows) != '' ) { $txt_rows = json_decode(base64_decode($text_rows), true); } if ( !empty($max_width) ) { $el_style = 'max-width:' . esc_attr( $max_width ) . ';'; } $output = ''; $output .= '
'; $output .= '
'; if ( !empty( $txt_rows ) ) { foreach ($txt_rows as $key => $txt_row) { $output .= '' . do_shortcode( $txt_row['value'] ) . ''; } } $output .= '
'; $output .= '
'; return $output; } add_action( 'init', function () { add_shortcode('shrk_slabtext', 'shrk_sc_slabtext'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes ) { $shrk_vc_shortcodes["shrk_slabtext"] = array( "name" => esc_html__("Slab text", 'dvl-uxshop-shortcodes'), "base" => "shrk_slabtext", "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "icon" => "icon-wpb-shrk", "show_settings_on_create" => true, "params" => array( array( "type" => "text_slides", "class" => "", "heading" => esc_html__("Add / remove text rows", 'dvl-uxshop-shortcodes'), "param_name" => "text_rows", "value" => "" ), array( "type" => "textfield", "heading" => esc_html__("Container max width", 'dvl-uxshop-shortcodes'), "param_name" => "max_width", "description" => esc_html__("Enter a (CSS) value to override the container\'s max width. For example you can enter '500px' or '75%'.", 'dvl-uxshop-shortcodes') ), array( "type" => "textfield", "heading" => esc_html__("Extra class name", 'dvl-uxshop-shortcodes'), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'dvl-uxshop-shortcodes') ), ), 'js_view' => 'shrkSlabTextView', 'custom_markup' => '

'. esc_html__( "BigText: ", 'dvl-uxshop-shortcodes' ) .'

', ); return $shrk_vc_shortcodes; } ); function shrk_sc_slabtext_scripts() { ob_start(); ?>(function ( $ ) { if ( typeof(vc) !== 'undefined' ) { window.shrkSlabTextView = vc.shortcode_view.extend( { changeShortcodeParams: function ( model ) { var params, txt, $res; params = model.get( 'params' ); if ( _.isObject( params ) && _.isString( params.text_rows ) ) { txt = json_decode(atob(params.text_rows)); $res = this.$el.find( '> .wpb_element_wrapper [name="text_rows"]' ); $res.html(''); if ( txt ) { for (var i = 0; i < txt.length; i++) { $res.append( '
' + txt[i].value + '
' ); } } } } }); } })( window.jQuery );styled_map.php000064400000016740152331543760007437 0ustar00 '', 'coord' => '47.376848,8.535347', 'height' => 450, 'zoom' => 16, 'type' => 'ROADMAP', 'mapstyle' => 'theme', 'scrollwheel' => 'no', 'marker' => 'no', 'marker_icon' => '', 'infowindowtitle' => '', 'infowindowhtml' => '', 'el_class' => '' ), $atts)); //Enqueue google maps api script wp_enqueue_script( 'google-maps-api' ); if ( $marker_icon && trim( $marker_icon ) != '') { $marker_icon = wp_get_attachment_image_src( $marker_icon, 'full' ); $marker_icon = $marker_icon[0]; } if ( !empty( $coord ) ) { $data_atts[] = 'data-map-coord="' . esc_attr( $coord ) . '"'; } if ( !empty( $zoom ) ) { $data_atts[] = 'data-map-zoom="' . esc_attr( $zoom ) . '"'; } if ( !empty( $type ) ) { $data_atts[] = 'data-map-type="' . esc_attr( $type ) . '"'; } if ( !empty( $mapstyle ) ) { $data_atts[] = 'data-map-mapstyle="' . esc_attr( $mapstyle ) . '"'; } if ( !empty( $scrollwheel ) ) { $data_atts[] = 'data-map-scrollwheel="' . esc_attr( $scrollwheel ) . '"'; } if ( !empty( $marker ) ) { $data_atts[] = 'data-map-marker="' . esc_attr( $marker ) . '"'; } if ( !empty( $infowindowtitle ) ) { $data_atts[] = 'data-map-infowindowtitle="' . esc_attr( $infowindowtitle ) . '"'; } if ( !empty( $marker_icon ) ) { $data_atts[] = 'data-map-marker-icon="' . esc_url( $marker_icon ) . '"'; } $output .= '
'; if ( '' != trim( $title ) ) { $output .= '

' . esc_html( $title ) . '

'; } $output .= '
'; if ( '' != trim($infowindowhtml) && '' != trim(base64_decode($infowindowhtml)) ) { $output .= ''; } $output .= '
'; return $output; } add_action( 'init', function () { add_shortcode('shrk_styled_map', 'shrk_sc_styled_map'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes ) { global $allowedtags; $shrk_vc_shortcodes["shrk_styled_map"] = array( "name" => esc_html__("Styled Map", 'dvl-uxshop-shortcodes'), "base" => "shrk_styled_map", "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "icon" => "icon-wpb-shrk", "show_settings_on_create" => true, "params" => array( array( "type" => "textfield", "heading" => esc_html__("Title", 'dvl-uxshop-shortcodes'), "param_name" => "title", "description" => esc_html__("What text to use as a map title. Leave blank if no title is needed.", 'dvl-uxshop-shortcodes') ), array( "type" => "textfield", "heading" => esc_html__("Map Height (px)", 'dvl-uxshop-shortcodes'), "param_name" => "height", "description" => esc_html__("The height of the map (in pixels)", 'dvl-uxshop-shortcodes'), "value" => "450", "save_always" => true ), array( "type" => "textfield", "heading" => esc_html__("Map Center", 'dvl-uxshop-shortcodes'), "param_name" => "coord", "description" => wp_kses( __("Coordinates in the form of latitude and longitude comma separated pair (for example: 51.509811, -0.114380 ). Get coordinates of an address", 'dvl-uxshop-shortcodes'), $allowedtags ) ), array( "type" => "dropdown", "heading" => esc_html__("Map Zoom level", 'dvl-uxshop-shortcodes'), "param_name" => "zoom", "description" => esc_html__("The map zoom level. The bigger the number the more zoom'ed in the map will be.", 'dvl-uxshop-shortcodes'), "value" => array( "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" ) ), array( "type" => "dropdown", "heading" => esc_html__("Map type", 'dvl-uxshop-shortcodes'), "param_name" => "type", "value" => array( esc_html__("Roadmap", 'dvl-uxshop-shortcodes') => "ROADMAP", esc_html__("Satellite", 'dvl-uxshop-shortcodes') => "SATELLITE", esc_html__("Hybrid", 'dvl-uxshop-shortcodes') => "HYBRID", esc_html__("Terrain", 'dvl-uxshop-shortcodes') => "TERRAIN" ), "description" => esc_html__("Initial map type", 'dvl-uxshop-shortcodes') ), array( "type" => 'dropdown', "heading" => esc_html__("Show marker", 'dvl-uxshop-shortcodes'), "param_name" => "marker", "description" => esc_html__("Show a marker at the center of the map.", 'dvl-uxshop-shortcodes'), "value" => Array(esc_html__("Yes, show a marker", 'dvl-uxshop-shortcodes') => 'yes', esc_html__("No don't show a marker", 'dvl-uxshop-shortcodes') => 'no'), "save_always" => true ), array( "type" => "attach_image", "class" => "", "heading" => esc_html__("Marker icon", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Select a custom icon for the marker", 'dvl-uxshop-shortcodes'), "param_name" => "marker_icon", "value" => '', ), array( "type" => "textfield", "heading" => esc_html__("Marker title", 'dvl-uxshop-shortcodes'), "param_name" => "infowindowtitle", "description" => esc_html__("The marker title. Leave empty if you don't need one.", 'dvl-uxshop-shortcodes'), "dependency" => Array('element' => "marker", 'value' => array('yes')) ), array( "type" => "textarea_raw_html", "heading" => esc_html__("Info Window Content", 'dvl-uxshop-shortcodes'), "param_name" => "infowindowhtml", "description" => esc_html__("The content of the info window that pops up when you click at the marker. You can use html. Leave empty for no info window.", 'dvl-uxshop-shortcodes'), "dependency" => Array('element' => "marker", 'value' => array('yes')) ), array( "type" => 'checkbox', "heading" => esc_html__("Scrollwheel zoom", 'dvl-uxshop-shortcodes'), "param_name" => "scrollwheel", "description" => esc_html__("Use mouse scrollwheel as zoom control, leave unchecked so that page scrolling doesn't interfere with the map.", 'dvl-uxshop-shortcodes'), "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes'), "save_always" => true, ), array( "type" => 'dropdown', "heading" => esc_html__("Applied Map style", 'dvl-uxshop-shortcodes'), "param_name" => "mapstyle", "description" => esc_html__("You can select between the default map style of the theme, the default (official) google maps style, or you can set up your own under 'theme options'\\'Advanced'.", 'dvl-uxshop-shortcodes'), "value" => Array( esc_html__("Theme map style", 'dvl-uxshop-shortcodes') => 'theme', esc_html__("Default map style (official)", 'dvl-uxshop-shortcodes') => 'default', esc_html__("Custom map style", 'dvl-uxshop-shortcodes') => 'custom' ) ), array( "type" => "textfield", "heading" => esc_html__("Extra class name", 'dvl-uxshop-shortcodes'), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'dvl-uxshop-shortcodes') ) ) ); return $shrk_vc_shortcodes; } ); ?>socialicons.php000064400000006325152331543760007602 0ustar00 '', 'link_colors' => 'normal', 'new_window' => false, 'css' => '' ), $atts) ); $social_networks = apply_filters( 'shrk-social-network-icons' , array( 'facebook' => 'ion-social-facebook', 'twitter' => 'ion-social-twitter', 'googleplus' => 'ion-social-googleplus', 'google' => 'ion-social-google', 'dribbble' => 'ion-social-dribbble', 'github' => 'ion-social-github', 'instagram' => 'ion-social-instagram', 'foursquare' => 'ion-social-foursquare', 'pinterest' => 'ion-social-pinterest', 'tumblr' => 'ion-social-tumblr', 'wordpress' => 'ion-social-wordpress', 'reddit' => 'ion-social-reddit', 'buffer' => 'ion-social-buffer', 'skype' => 'ion-social-skype', 'linkedin' => 'ion-social-linkedin', 'vimeo' => 'ion-social-vimeo', 'youtube' => 'ion-social-youtube', 'rss' => 'ion-social-rss', ) ); foreach ($social_networks as $network => $icon) { if ( !empty( $shrk_options['social_'.$network.'_url'] ) ) { $icons .= '
  • '; } } if ( $link_colors == 'inverted' ) { $class .= ' inv-link-colors'; } if ( function_exists( 'vc_shortcode_custom_css_class') ) { $class .= ' ' . apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), 'shrk_banner', $atts ); } if ( !empty($icons) ) { return ''; } else { return 'Social networks not specified.'; } } add_action( 'init', function () { add_shortcode('socialicons', 'shrk_sc_socialicons'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes ) { $shrk_vc_shortcodes["socialicons"] = array( "name" => esc_html__("Social Icons", 'dvl-uxshop-shortcodes'), "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "description" => esc_html__('Show the social icons configured in the theme options.', 'dvl-uxshop-shortcodes'), "base" => "socialicons", "icon" => "icon-wpb-shrk", "show_settings_on_create" => false, "params" => array( array( 'type' => 'dropdown', 'heading' => esc_html__('Link colors', 'dvl-uxshop-shortcodes'), 'param_name' => 'link_colors', 'value' => array( esc_html__( 'Main Color / Secondary on hover', 'dvl-uxshop-shortcodes' ) => 'normal', esc_html__( 'Secondary Color / Main on hover', 'dvl-uxshop-shortcodes' ) => 'inverted', ) ), array( 'type' => 'css_editor', 'heading' => __( 'Css', 'dvl-uxshop-shortcodes' ), 'param_name' => 'css', 'group' => __( 'Design options', 'dvl-uxshop-shortcodes' ), ), ), ); return $shrk_vc_shortcodes; } ); ?>assets/js/video-popup.js000064400000006253152331543760011306 0ustar00(function($) { $('.shrk-video-popup').click(function(event) { event.preventDefault(); var id = $(this).attr('data-video-popup-id'); var url = $(this).attr('data-video-popup-url'); var autoplay = $(this).attr('data-video-autoplay'); // Add the video wrapper $('body').append('
    '); var $video_wrapper = $('.shrk-video-popup-wrapper[data-video-popup-id="'+id+'"]'); setTimeout(function(){ $video_wrapper.addClass('visible'); }, 0); data = { action: 'shrk_get_video_popup', video_url: url, video_autoplay: autoplay }; jQuery.post(shrk.ajax.ajaxurl, data, function(response) { $video_wrapper.append(response); $video_wrapper.find('iframe').addClass('shrk-video-popup-video'); shrk_resize_video_popup(); $video_wrapper.addClass('ready'); }); }); // Close Function function shrk_close_video_popup() { $('.shrk-video-popup-wrapper, .shrk-video-popup-video').fadeOut(200); setTimeout(function(){ $('.shrk-video-popup-wrapper').remove(); }, 200); } // Close on click $('body').on('click touchend', '.shrk-video-popup-wrapper', function(event) { event.stopPropagation(); shrk_close_video_popup(); }); // Close on Escape $(document).keyup(function(e) { if (e.keyCode == 27) { if ( $('.shrk-video-popup-wrapper').is(':visible') ) { shrk_close_video_popup(); } } }); function shrk_resize_video_popup() { var videoWidth, videoHeight, ratio; var $video = $('.shrk-video-popup-video'); if ( typeof( $video.data('video-ratio') ) === 'undefined' ) { videoWidth = $video.width(); videoHeight = $video.height(); ratio = videoWidth/videoHeight; $video.data('video-ratio', ratio); } $video.css({ 'width' : '80%' }); videoWidth = $video.width(); $video.height(videoWidth*0.5625); } $('.shrk-video-popup .thumbnail-bg').each(function () { var video_url = $(this).closest('.shrk-video-popup').attr('data-video-popup-url'); var $thumb = $(this); var thumb_url = false; if ( video_url.indexOf('youtube') !== -1 ) { var video_id = video_url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/); if ( video_id !== null ) { thumb_url = 'https://i1.ytimg.com/vi/' + video_id[1] + '/0.jpg'; } if ( thumb_url ) { $thumb.css({ 'background-image': 'url('+thumb_url+')' }); } else { shrk.debug__log( 'Error getting video thumbnail for: ' + video_url ); } } else if ( video_url.indexOf('vimeo') !== -1 ) { $.ajax({ type:'GET', url: 'https://vimeo.com/api/oembed.json?url=' + encodeURIComponent(video_url), dataType: 'json', success: function(data) { thumb_url = data.thumbnail_url; if ( thumb_url ) { $thumb.css({ 'background-image': 'url('+thumb_url+')' }); } else { shrk.debug__log( 'Error getting video thumbnail for: ' + video_url ); } } }); } }); // Resize $(window).resize(function() { shrk_resize_video_popup(); }); })( jQuery );dropcap.php000064400000000463152331543760006721 0ustar00' . do_shortcode($content) . ''; } add_action( 'init', function () { add_shortcode('dropcap', 'shrk_sc_dropcap'); }); ?>ps-slider.php000064400000014557152331543760007204 0ustar00 false, 'slider_id' => null, 'swiper_mode' => 'horizontal', 'swiper_spv' => '1', //Slides per view 'swiper_effect' => 'slide', 'swiper_speed' => '5000', 'swiper_animation_speed' => '300', 'swiper_autoplay' => 'no', 'swiper_loop' => 'no', 'show_scrollbar' => 'no', 'hide_pagination' => 'no', 'slides_grid_width' => '12', // 12 = one per slide 'space_between_slides' => '0', 'partial_view' => 'no', 'partial_max_width' => '80%', 'slider_bg_color_inline' => '', 'swiper_controls_colors' => 'light', 'swiper_controls_transp' => 'no', 'arrows_hidden_xs' => 'no', 'pagination_only_xs' => 'no', 'swiper_breakpoints' => 'disable', ), $atts ); $slider_id = !empty( $atts['slider_id'] ) ? esc_attr( $atts['slider_id'] ) : false; if ( empty($content) ) { $content = '

    ' . esc_html__('Your Sections Slider has no sections in it!', 'dvl-uxshop-shortcodes') . '

    '; } if ( !function_exists( 'shrk_sc_swiper_get_atts' ) ) { return '
    ' . esc_html__('Your theme does not support the pagesections slider.', 'dvl-uxshop-shortcodes') . '
    '; } ob_start(); echo '
    '; echo '
    '; echo do_shortcode( $content ); echo '
    '; echo '
    '; return ob_get_clean(); } add_action( 'init', function () { add_shortcode('shrk_section_slider', 'shrk_sc_ps_slider'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes ) { $shrk_vc_shortcodes["shrk_section_slider"] = array( "name" => esc_html__("Page Sections Slider", 'dvl-uxshop-shortcodes'), "base" => "shrk_section_slider", "as_parent" => array('only' => 'shrk_section'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma) "content_element" => true, "icon" => "icon-wpb-shrk", "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "show_settings_on_create" => false, /** * Set the width of the Sections Slider by setting the width of the row it is in. * Set the height of each of the slides explicitly in that section's options. * Dont set full to width to rows inside the section * Dont set full height to the row containing the section slider. */ "params" => array( array( "type" => "textfield", "class" => "hidden", "param_name" => "slider_id", "value" => uniqid('swiper-'), ), array( "type" => "dropdown", "heading" => esc_html__("Slider effect", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_effect", "value" => array( esc_html__("Slide", 'dvl-uxshop-shortcodes') => "slide", esc_html__("Fade", 'dvl-uxshop-shortcodes') => "fade", esc_html__("Coverflow", 'dvl-uxshop-shortcodes') => "coverflow", esc_html__("Flip", 'dvl-uxshop-shortcodes') => "flip", ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Set slider background color.", 'dvl-uxshop-shortcodes'), "param_name" => "slider_bg_color_inline", ), array( "type" => "dropdown", "heading" => esc_html__("Slider controls theme", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_controls_colors", "value" => array( esc_html__("Light", 'dvl-uxshop-shortcodes') => "light", esc_html__("Dark", 'dvl-uxshop-shortcodes') => "dark", ), ), array( "type" => 'checkbox', "heading" => esc_html__("Transparent arrows", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_controls_transp", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes') ), array( "type" => 'checkbox', "heading" => esc_html__("Slider autoplay", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_autoplay", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes') ), array( "type" => "textfield", "heading" => esc_html__("Autoplay delay (in milliseconds)", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_speed", "value" => '7000', "description" => esc_html__("Set the number of milliseconds to wait before showing the next slide.", 'dvl-uxshop-shortcodes'), "dependency" => Array('element' => "swiper_autoplay", 'value' => array('yes')), ), array( "type" => "textfield", "heading" => esc_html__("Animation speed (in milliseconds)", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_animation_speed", "value" => '300', "description" => esc_html__("Set the speed for the transition between slides.", 'dvl-uxshop-shortcodes') ), array( "type" => 'checkbox', "heading" => esc_html__("Loop Slider", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_loop", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes') ), array( "type" => 'checkbox', "heading" => esc_html__("Show scrollbar", 'dvl-uxshop-shortcodes'), "param_name" => "show_scrollbar", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes') ), array( "type" => 'dropdown', "heading" => esc_html__("Hide pagination", 'dvl-uxshop-shortcodes'), "param_name" => "hide_pagination", "value" => array( esc_html__("Yes", 'dvl-uxshop-shortcodes') => "yes", esc_html__("No", 'dvl-uxshop-shortcodes') => "no", ), "save_always" => true ), array( "type" => 'checkbox', "heading" => esc_html__("Hide arrows on mobile", 'dvl-uxshop-shortcodes'), "param_name" => "arrows_hidden_xs", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes') ), array( "type" => 'checkbox', "heading" => esc_html__("Hide pagination on desktop", 'dvl-uxshop-shortcodes'), "param_name" => "pagination_only_xs", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes') ), ), 'js_view' => 'VcColumnView', ); return $shrk_vc_shortcodes; } ); ?>xy-woo-slider.php000064400000060101152331543760010006 0ustar00 null, 'cats_number' => null, // Max number of categories to show 'cats_orderby' => 'name', // Accepts term fields ('name', 'slug', 'term_group', 'term_id', 'id', 'description'), 'count' for term taxonomy count 'cats_order' => 'ASC', // ASC or DESC 'cats_hide_empty' => '1', // 'cats_parent' => '', // Show only children of.. 'cats_ids' => '', // Comma separated string of term ids to include 'el_class' => '', 'swiper_mode' => 'vertical', 'swiper_speed' => '5000', 'swiper_autoplay' => 'no', 'swiper_effect' => 'slide', 'swiper_autoheight' => 'no', 'slider_height_mode' => 'custom', 'slider_height' => '600px', 'show_scrollbar' => 'no', 'hide_pagination' => 'yes', 'slides_grid_width' => '12', // 12 = one per slide 'space_between_slides' => '', 'partial_view' => 'no', 'partial_max_width' => '80%', 'lazyload_next_slides' => false, 'preload_first_x_slides' => 'auto', 'inner_auto_load_slides' => 'yes', 'inner_per_page' => '10', 'inner_orderby' => 'date', 'inner_order' => 'DESC', 'inner_thumb_only' => 'no', 'inner_thumb_fb' => 'yes', 'inner_half_image' => 'no', 'inner_transp_content' => 'no', 'inner_transp_content_mob' => 'no', 'inner_content_bg_color' => '', 'inner_content_bg_color_mob' => '', 'inner_image_bg_color' => '', 'inner_image_bg_size' => '', 'slider_bg_color' => '', 'cat_overlay_bg_color' => '', 'cat_button_text' => 'Show me', 'swiper_breakpoints' => 'disable', 'nav_thumbs' => 'autohide', 'nav_thumbs_overlay_bg_color' => '', 'nav_thumbs_show_count' => 'no', ), $atts); if ( !function_exists( 'shrk_sc_swiper_get_atts' ) || !function_exists( 'WC' ) ) { return '
    ' . esc_html__('Your theme does not support the XY Products Slider or WooCommerce is not active.', 'dvl-uxshop-shortcodes') . '
    '; } wp_enqueue_script( 'shrk-swiper' ); $slider_id = !empty( $atts['slider_id'] ) ? $atts['slider_id'] : false; if ( isset( $atts['cats_ids'] ) ) { $ids = explode( ',', $atts['cats_ids'] ); $ids = array_map( 'trim', $ids ); } else { $ids = array(); } $hide_empty = ( $atts['cats_hide_empty'] == '1' ) ? 1 : 0; $args = array( 'orderby' => $atts['cats_orderby'], 'order' => $atts['cats_order'], 'hide_empty' => $hide_empty, 'include' => $ids, 'pad_counts' => true, 'child_of' => $atts['cats_parent'] ); $product_categories = get_terms( 'product_cat', $args ); $product_categories = is_wp_error( $product_categories ) ? array() : $product_categories; if ( '' !== $atts['cats_parent'] ) { $product_categories = wp_list_filter( $product_categories, array( 'parent' => $atts['cats_parent'] ) ); } if ( $hide_empty ) { foreach ( $product_categories as $key => $category ) { if ( $category->count == 0 ) { unset( $product_categories[ $key ] ); } } } if ( $atts['cats_number'] ) { $product_categories = array_slice( $product_categories, 0, $atts['cats_number'] ); } $inner_swiper_atts = array( 'swiper_mode' => 'horizontal', 'swiper_speed' => '5000', 'swiper_autoplay' => 'no', 'swiper_autoheight' => 'no', 'slides_grid_width' => '12', 'space_between_slides' => '', 'partial_view' => 'no', 'partial_max_width' => '80%', 'lazyload_next_slides' => false, 'preload_first_x_slides' => 'auto', 'show_scrollbar' => 'no', 'hide_pagination' => 'yes', 'auto_load_slides' => $atts['inner_auto_load_slides'], 'category_id' => '', 'page' => '1', 'per_page' => $atts['inner_per_page'], 'orderby' => $atts['inner_orderby'], 'order' => $atts['inner_order'], 'swiper_breakpoints' => 'disable', 'cover_atts' => array( 'thumb_fb' => ( $atts['inner_thumb_fb'] == 'yes' ? true : false ), 'thumb_only' => ( $atts['inner_thumb_only'] == 'yes' ? true : false ), ), ); ob_start(); // Loop throught categories to get // inner swipers // $outer_pagination = $cat_cover_srcset = ''; $i = 0; if ( $product_categories ) { foreach ( $product_categories as $category ) { $cat_cover = function_exists('woo_shrk_get_category_image') && woo_shrk_get_category_image( $category->term_id ) ? woo_shrk_get_category_image( $category->term_id, 'shrk_section_bg' ) : ''; $cat_cover_thumb = function_exists('woo_shrk_get_category_image') && woo_shrk_get_category_image( $category->term_id ) ? woo_shrk_get_category_image( $category->term_id, 'large' ) : ''; $inner_swiper_atts['category_id'] = $category->term_id; $sw_pc = shrk_swiper_product_category( $inner_swiper_atts ); $inner_swiper_content = $sw_pc['content']; $inner_swiper_product_count = intval( $sw_pc['count'] ); if ( function_exists( 'get_woocommerce_term_meta' ) && function_exists( 'shrk_get_image_aspect' ) ) { $cat_cover_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true ); $cat_cover_srcset = wp_get_attachment_image_srcset( $cat_cover_id, 'shrk_section_bg' ); $cat_cover_ar = shrk_get_image_aspect( $cat_cover_id, 'shrk_section_bg' ); } ?>
    '; echo '
    '; ?>

    name ); ?>

    '; echo '
    0 / ' . esc_html( $inner_swiper_product_count ) . '
    '; echo '
    '; ?>
    ' . esc_html( $category->name ) . '(' . esc_html( $inner_swiper_product_count ) . ')'; $i++; } } woocommerce_reset_loop(); $slides_cat = ob_get_clean(); $swiper_outer_classes = array('shrk-swiper-container', 'img-cover'); if ( $atts['nav_thumbs'] == 'show' ) { $swiper_outer_classes[] = 'swiper-nav-sticky'; } if ( $atts['nav_thumbs_show_count'] == '1' ) { $swiper_outer_classes[] = 'swiper-nav-show-count'; } // Outer swiper $output = ''; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= $slides_cat; $output .= '
    '; if ( $atts['nav_thumbs'] != 'hide' ) { $output .= '
    ' . $outer_pagination . '
    '; } $output .= '
    '; return '
    ' . $output . '
    '; } add_action( 'init', function () { add_shortcode('shrk_woo_catproducts', 'shrk_sc_woo_xy_slider'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes ) { $shrk_vc_shortcodes["shrk_flex"] = array( "name" => esc_html__("XY Products Slider", 'dvl-uxshop-shortcodes'), "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "icon" => "icon-wpb-shrk", "base" => "shrk_woo_catproducts", "show_settings_on_create" => true, "params" => array( array( "type" => "textfield", "class" => "hidden", "param_name" => "slider_id", "value" => uniqid('swiper-'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "heading" => esc_html__("Slider effect", 'dvl-uxshop-shortcodes'), "param_name" => "swiper_effect", "value" => array( esc_html__("Slide", 'dvl-uxshop-shortcodes') => "slide", esc_html__("Fade", 'dvl-uxshop-shortcodes') => "fade", esc_html__("Coverflow", 'dvl-uxshop-shortcodes') => "coverflow", esc_html__("Flip", 'dvl-uxshop-shortcodes') => "flip", ), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Slider height mode", 'dvl-uxshop-shortcodes'), "param_name" => "slider_height_mode", "value" => array( esc_html__("Custom", 'dvl-uxshop-shortcodes') => "custom", esc_html__("Window height (minus header height)", 'dvl-uxshop-shortcodes') => "windowheight_mh" ), "description" => esc_html__("You can enter a custom height or set the slider to match the parent row height.", 'dvl-uxshop-shortcodes'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Slider height", 'dvl-uxshop-shortcodes'), "description" => esc_html__("You can enter a value in pixels, em, or vh. For example entering `60vh` will make it 60% of the window height.", 'dvl-uxshop-shortcodes'), "param_name" => "slider_height", "value" => '600px', "dependency" => Array('element' => "slider_height_mode", 'value' => array('custom')), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "textfield", "heading" => esc_html__("Categories open button text", 'dvl-uxshop-shortcodes'), "param_name" => "cat_button_text", "value" => esc_html__( "Show me", 'dvl-uxshop-shortcodes' ), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Categories cover overlay color", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Set the color and opacity applied on the categories images (vertical slider).", 'dvl-uxshop-shortcodes'), "param_name" => "cat_overlay_bg_color", "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'checkbox', "heading" => esc_html__("Don't use cover image. (Use only product thumbnail)", 'dvl-uxshop-shortcodes'), "param_name" => "inner_thumb_only", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'checkbox', "heading" => esc_html__("Fallback to product thumbnail if no cover image available.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_thumb_fb", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'checkbox', "heading" => esc_html__("Make image 50% of the slide's width.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_half_image", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Set content box background color.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_content_bg_color", "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Set content box background color for mobile devices.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_content_bg_color_mob", "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'checkbox', "heading" => esc_html__("Transparent content box on mobile", 'dvl-uxshop-shortcodes'), "param_name" => "inner_transp_content_mob", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Set slider background color.", 'dvl-uxshop-shortcodes'), "param_name" => "slider_bg_color", "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Image background size", 'dvl-uxshop-shortcodes'), "description" => esc_html__("You can select `contain` if you want the product image never to get cropped by the container boundaries. You can also set a color below, to match the background color of your product image.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_image_bg_size", "value" => array( esc_html__("Cover", 'dvl-uxshop-shortcodes') => "cover", esc_html__("Contain", 'dvl-uxshop-shortcodes') => "contain", ), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Image background color.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_image_bg_color", "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), "dependency" => Array('element' => "inner_image_bg_size", 'value' => array('contain')), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Posts per page", 'dvl-uxshop-shortcodes'), "description" => esc_html__("How many slides to load in each ajax request.", 'dvl-uxshop-shortcodes'), "param_name" => "inner_per_page", "value" => '10', "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "textfield", "heading" => esc_html__("Extra class name", 'dvl-uxshop-shortcodes'), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'dvl-uxshop-shortcodes'), "group" => esc_html__( "Slider options", 'dvl-uxshop-shortcodes' ), ), array( "type" => "woo_categories", "heading" => esc_html__("Limit product categories.", 'dvl-uxshop-shortcodes'), "param_name" => "cats_ids", "multiple" => true, "output" => "id", "description" => esc_html__("Select one or more categories to show only these. Selecting none displays all. Use CTRL+click to select/de-select multiple items.", 'dvl-uxshop-shortcodes'), "value" => "", "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "woo_categories", "heading" => esc_html__("Only children of", 'dvl-uxshop-shortcodes'), "param_name" => "cats_parent", "multiple" => false, "output" => "id", "description" => esc_html__( "Select a parent category here to show only its children.", 'dvl-uxshop-shortcodes' ), "value" => "", "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'checkbox', "heading" => esc_html__("Hide empty categories.", 'dvl-uxshop-shortcodes'), "param_name" => "cats_hide_empty", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => '1'), "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Maximum number of categories to show.", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Leave empty to show all.", 'dvl-uxshop-shortcodes'), "param_name" => "cats_number", "value" => '', "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Categories Order By", 'dvl-uxshop-shortcodes'), "param_name" => "cats_orderby", "value" => array( esc_html__("Name", 'dvl-uxshop-shortcodes') => "name", esc_html__("Slug", 'dvl-uxshop-shortcodes') => "slug", esc_html__("Term group", 'dvl-uxshop-shortcodes') => "term_group", esc_html__("Term ID", 'dvl-uxshop-shortcodes') => "term_id", esc_html__("Description", 'dvl-uxshop-shortcodes') => "description", esc_html__("Count", 'dvl-uxshop-shortcodes') => "count", ), "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Categories Order", 'dvl-uxshop-shortcodes'), "param_name" => "cats_order", "value" => array( esc_html__("Descending", 'dvl-uxshop-shortcodes') => "desc", esc_html__("Ascending", 'dvl-uxshop-shortcodes') => "asc", ), "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Products Order By", 'dvl-uxshop-shortcodes'), "param_name" => "inner_orderby", "value" => array( esc_html__("Date", 'dvl-uxshop-shortcodes') => "date", esc_html__("Product ID", 'dvl-uxshop-shortcodes') => "ID", esc_html__("Product Title", 'dvl-uxshop-shortcodes') => "title", esc_html__("Product slug", 'dvl-uxshop-shortcodes') => "name", esc_html__("Random", 'dvl-uxshop-shortcodes') => "rand", esc_html__("Comments (reviews) count", 'dvl-uxshop-shortcodes') => "comment_count", esc_html__("Menu order", 'dvl-uxshop-shortcodes') => "menu_order", ), "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Products Order", 'dvl-uxshop-shortcodes'), "param_name" => "inner_order", "value" => array( esc_html__("Descending", 'dvl-uxshop-shortcodes') => "desc", esc_html__("Ascending", 'dvl-uxshop-shortcodes') => "asc", ), "group" => esc_html__( "Slider content", 'dvl-uxshop-shortcodes' ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Thumbnails visibility", 'dvl-uxshop-shortcodes'), "param_name" => "nav_thumbs", "value" => array( esc_html__("Auto show/hide", 'dvl-uxshop-shortcodes') => "autohide", esc_html__("Always Show", 'dvl-uxshop-shortcodes') => "show", esc_html__("Always Hide", 'dvl-uxshop-shortcodes') => "hide", ), "group" => esc_html__( "Category thumbnails", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'colorpicker', "heading" => esc_html__("Category thumbs overlay color", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Set the color and opacity applied on the category thumbnail images (vertical slider).", 'dvl-uxshop-shortcodes'), "param_name" => "nav_thumbs_overlay_bg_color", "group" => esc_html__( "Category thumbnails", 'dvl-uxshop-shortcodes' ), ), array( "type" => 'checkbox', "heading" => esc_html__("Show product count in category thumbnail.", 'dvl-uxshop-shortcodes'), "param_name" => "nav_thumbs_show_count", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => '1'), "group" => esc_html__( "Category thumbnails", 'dvl-uxshop-shortcodes' ), ), ) ); return $shrk_vc_shortcodes; } ); /** * Process $post content and extract custom css * attributes for XY Slider * * @param object $post the post object to process * @return string CSS rules */ function shrk_sc_get_xyslider_css( $post ) { $swiper_style = array(); $pattern = '\[(\[?)(shrk_woo_catproducts)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)'; if ( isset( $post->post_content ) && preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches ) ) { foreach ( $matches[3] as $val ) { $atts = array(); $args = explode( ' ', $val ); foreach ($args as $arg) { $arg_parsed = explode( '=', $arg ); if ( ! empty( $arg_parsed[0] ) ) { $atts[$arg_parsed[0]] = trim( $arg_parsed[1], " \t\n\r\0\x0B\"" ); } } if ( ! empty( $atts['slider_id'] ) ) { if ( !empty( $atts['cat_overlay_bg_color'] ) ) { $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner .category-cover:after {background-color:' . esc_attr( $atts['cat_overlay_bg_color'] ) . ';}'; } if ( !empty( $atts['slider_bg_color'] ) ) { $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner {background-color:' . esc_attr( $atts['slider_bg_color'] ) . ';}'; } if ( !empty( $atts['inner_content_bg_color'] ) ) { $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner .slide-content {background-color:' . esc_attr( $atts['inner_content_bg_color'] ) . ';}'; } if ( !empty( $atts['inner_content_bg_color_mob'] ) ) { $swiper_style[] = '@media screen and (max-width: 767px) { #' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner .slide-content {background-color:' . esc_attr( $atts['inner_content_bg_color_mob'] ) . ';} }'; } if ( !empty( $atts['inner_image_bg_color'] ) ) { $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner .slide-background {background-color:' . esc_attr( $atts['inner_image_bg_color'] ) . ';}'; $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner .slide-background:before {background-color:' . esc_attr( $atts['inner_image_bg_color'] ) . ';}'; } if ( !empty( $atts['inner_image_bg_size'] ) ) { $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .shrk-swiper-container.inner .slide-background {background-size:' . esc_attr( $atts['inner_image_bg_size'] ) . ';}'; } if ( !empty( $atts['nav_thumbs_overlay_bg_color'] ) ) { $swiper_style[] = '#' . esc_attr( $atts['slider_id'] ) . ' .swiper-nav-outer .nav-thumb:after {background-color:' . esc_attr( $atts['nav_thumbs_overlay_bg_color'] ) . ';}'; } } unset( $atts ); } } return !empty( $swiper_style ) && function_exists( 'shrk_simple_minify' ) ? shrk_simple_minify( implode(' ', $swiper_style) ) : ''; } /** * Tap into vc_base_build_shortcodes_custom_css * to save XY Slider's custom CSS output to * _wpb_shortcodes_custom_css meta. */ function shrk_sc_save_xyslider_css( $css ) { global $post; return $css . ' ' . shrk_sc_get_xyslider_css( $post ); } add_filter( 'vc_base_build_shortcodes_custom_css', 'shrk_sc_save_xyslider_css' ); ?>quote.php000064400000003245152331543760006427 0ustar00 '', 'quoteauthor' => '', 'alignment' => 'default', ), $atts ) ); $class = ''; if ( $alignment != 'default' ) { $class = $alignment; } return '
    ' . $quotetext . '
    ' . $quoteauthor . '
    '; } add_action( 'init', function () { add_shortcode('shrk_quote', 'shrk_sc_quote'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes, $d ) { $shrk_vc_shortcodes["shrk_quote"] = array( "name" => esc_html__("Quote", 'dvl-uxshop-shortcodes'), /* */ "base" => "shrk_quote", "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "icon" => "icon-wpb-shrk", "show_settings_on_create" => true, "params" => array( array( "type" => "textarea", "class" => "", "heading" => esc_html__("Quote text", 'dvl-uxshop-shortcodes'), "param_name" => "quotetext", ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Quote author", 'dvl-uxshop-shortcodes'), "param_name" => "quoteauthor", "value" => '', ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Text Alignment", 'dvl-uxshop-shortcodes'), "param_name" => "alignment", "value" => $d['alignment_text_options'] ), ) ); return $shrk_vc_shortcodes; },10 ,2 ); ?>section.php000064400000005302152331543760006732 0ustar00 false, ), $atts ) ); ob_start(); if ( !function_exists( 'shrk_get_sections' ) ) { return '
    ' . esc_html__('Your theme does not support the section shortcode.', 'dvl-uxshop-shortcodes') . '
    '; } echo '
    '; shrk_get_sections( $section_id ); echo '
    '; return ob_get_clean(); } add_action( 'init', function () { add_shortcode('shrk_section', 'shrk_sc_section'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes ) { $shrk_vc_shortcodes["shrk_section"] = array( "name" => esc_html__("Page Section", 'dvl-uxshop-shortcodes'), "base" => "shrk_section", "icon" => "icon-wpb-shrk", "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "content_element" => true, "params" => array( array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Section", 'dvl-uxshop-shortcodes'), "param_name" => "section_id", "value" => shrk_child_vc_get_posts( array( 'post_type' => 'pagesections' ) ) ) ), 'js_view' => 'shrkSectionView', 'custom_markup' => '

    '. esc_html__( "Section: ", 'dvl-uxshop-shortcodes' ) .'

    ' . esc_html__( 'Edit section', 'dvl-uxshop-shortcodes' ) . '', ); return $shrk_vc_shortcodes; } ); function shrk_sc_section_scripts() { ob_start(); ?>(function ( $ ) { if ( typeof(vc) !== 'undefined' ) { window.shrkSectionView = vc.shortcode_view.extend( { changeShortcodeParams: function ( model ) { var params; var admin_url = ''; //window.shrkSectionView.__super__.changeShortcodeParams.call( this, model ); params = model.get( 'params' ); if ( _.isObject( params ) && _.isString( params.section_id ) ) { //get selected option text var txt = shrk_getKeyByValue( model.view.params.section_id.value, parseInt(params.section_id, 10) ); this.$el.find( '> .wpb_element_wrapper [name="section_id"]' ).html(txt); // section edit link this.$el.find( '> .wpb_element_wrapper .edit-section-link' ).attr('href', admin_url+'post.php?post='+params.section_id+'&action=edit'); } } } ); } })( window.jQuery );simpleheading.php000064400000004120152331543760010074 0ustar00 'your Heading text', 'heading_style' => 'widget-title', 'heading_type' => 'h3', ), $atts ) ); return '
    <' . esc_attr( $heading_type ) . ' class="' . esc_attr( $heading_style ) . '">' . esc_html( $heading_text ) . '
    '; } add_action( 'init', function () { add_shortcode('shrk_simpleheading', 'shrk_sc_simpleheading'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes, $d ) { $shrk_vc_shortcodes['shrk_simpleheading'] = array( 'name' => esc_html__('Simple heading', 'dvl-uxshop-shortcodes'), /* */ 'category' => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), 'base' => 'shrk_simpleheading', 'icon' => 'icon-wpb-shrk', 'show_settings_on_create' => true, 'params' => array( array( 'type' => 'textarea', 'heading' => esc_html__('Heading text', 'dvl-uxshop-shortcodes'), 'param_name' => 'heading_text', 'value' => esc_html__( 'your Heading text', 'dvl-uxshop-shortcodes' ) ), array( 'type' => 'dropdown', 'heading' => esc_html__('Heading style', 'dvl-uxshop-shortcodes'), 'param_name' => 'heading_style', 'value' => array( esc_html__( 'Widget title', 'dvl-uxshop-shortcodes') => 'widget-title', esc_html__( 'Section title', 'dvl-uxshop-shortcodes') => 'section-title', ) ), array( 'type' => 'dropdown', 'heading' => esc_html__('Heading type', 'dvl-uxshop-shortcodes'), 'param_name' => 'heading_type', 'value' => array( 'H1' => 'h1', 'H2' => 'h2', 'H3' => 'h3', 'H4' => 'h4', 'H5' => 'h5', 'H6' => 'h6' ), 'std' => 'h3' ), ) ); return $shrk_vc_shortcodes; },10 ,2 ); ?>mailchimp.php000064400000002205152331543760007230 0ustar00name] = $mc_form_obj->ID; } } if ( shortcode_exists( 'mc4wp_form' ) ) { $shrk_vc_shortcodes['shrk_mailchimp'] = array( 'name' => esc_html__('MailChimp newsletter form', 'dvl-uxshop-shortcodes'), /* */ 'base' => 'mc4wp_form', 'category' => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), 'icon' => 'icon-wpb-shrk', 'show_settings_on_create' => true, 'params' => array( array( 'type' => 'dropdown', 'heading' => esc_html__('Mailchimp form', 'dvl-uxshop-shortcodes'), 'param_name' => 'id', 'value' => $mc_forms ), ) ); } return $shrk_vc_shortcodes; },10 ,2 ); ?>video-popup.php000064400000010654152331543760007543 0ustar00 null, 'video' => '', 'autoplay' => '0', 'linktext' => '', 'linktext' => '', 'link_style' => 'textlink', 'el_class' => '', ), $atts ) ); wp_enqueue_script( 'shrk-sc-video-popup' ); $video_popup_id = !empty( $atts['video_popup_id'] ) ? $atts['video_popup_id'] : false; if ( $link_style == 'theme-button' ) { $el_class .= ' button'; } if ( $link_style == 'theme-button-alt' ) { $el_class .= ' button alt'; } return '' . esc_html( $linktext ) . ''; } add_action( 'init', function () { add_shortcode('shrk_video_popup', 'shrk_sc_video_popup'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes, $d ) { $shrk_vc_shortcodes["shrk_video_popup"] = array( "name" => esc_html__("Video popup", 'dvl-uxshop-shortcodes'), /* */ "base" => "shrk_video_popup", "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "icon" => "icon-wpb-shrk", "show_settings_on_create" => true, "params" => array( array( "type" => "textfield", "class" => "hidden", "param_name" => "video_popup_id", "value" => uniqid('video-popup-'), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Video URL", 'dvl-uxshop-shortcodes'), "param_name" => "video", "description" => esc_html__("Enter the video URL. Youtube and Vimeo are supported.", 'dvl-uxshop-shortcodes'), ), array( "type" => 'checkbox', "heading" => esc_html__("Autoplay video", 'dvl-uxshop-shortcodes'), "param_name" => "autoplay", "value" => Array(esc_html__("Yes", 'dvl-uxshop-shortcodes') => 'yes'), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Link Text", 'dvl-uxshop-shortcodes'), "param_name" => "linktext", "save_always" => true, //required to save default value after vc 4.9.1 "value" => esc_html__("Play video", 'dvl-uxshop-shortcodes'), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Link style", 'dvl-uxshop-shortcodes'), "param_name" => "link_style", "value" => array( esc_html__("Text link", 'dvl-uxshop-shortcodes') => "textlink", esc_html__("Button", 'dvl-uxshop-shortcodes') => "theme-button", esc_html__("Button - Secondary color", 'dvl-uxshop-shortcodes') => "theme-button-alt", ), ), array( "type" => "textfield", "param_name" => "el_class", "heading" => esc_html__("Extra class name", 'dvl-uxshop-shortcodes'), "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'dvl-uxshop-shortcodes'), ), ) ); return $shrk_vc_shortcodes; },10 ,2 ); function shrk_sc_video_scripts() { wp_register_script( 'shrk-sc-video-popup', plugin_dir_url( __FILE__ ) . 'assets/js/video-popup.js', array( 'jquery' ), false, false ); } add_action( 'wp_enqueue_scripts', 'shrk_sc_video_scripts' ); // Handle AJAX call function shrk_sc_ajax_get_video_popup() { $video_url = isset( $_POST['video_url'] ) ? esc_url_raw( $_POST['video_url'] ) : null; $video_autoplay = isset( $_POST['video_autoplay'] ) && $_POST['video_autoplay'] == 'yes' ? true : false; if ( !$video_url ) { wp_die( esc_html__("No Video URL!", 'dvl-uxshop-shortcodes') ); } $embed_code = wp_oembed_get( $video_url ); if ( $video_autoplay ) { $embed_code = preg_replace('@embed/([^"&]*)@', 'embed/$1&showinfo=0&autoplay=1', $embed_code); // Match youtube $embed_code = preg_replace('@video/([^"&]*)@', 'video/$1?autoplay=1', $embed_code); // Match vimeo } echo $embed_code; wp_die(); } add_action( 'wp_ajax_shrk_get_video_popup', 'shrk_sc_ajax_get_video_popup' ); add_action( 'wp_ajax_nopriv_shrk_get_video_popup', 'shrk_sc_ajax_get_video_popup' ); ?>banner.php000064400000021130152331543760006530 0ustar00 'custom', 'product_cat' => '', // product_cat overrides product_cat_slug 'product_cat_slug' => '', 'product_id' => '', 'banner_image' => '', 'banner_height' => '300px', 'heading_text' => '', 'font_size' => 'medium', 'target_url' => '', 'el_class' => '', 'banner_style' => 'style-1', 'css' => '' ), $atts ) ); switch ( $banner_source ) { case 'product_category': $product_cat = absint( trim( $product_cat ) ); $term = !empty( $product_cat ) ? get_term_by( 'id', $product_cat, 'product_cat' ) : get_term_by( 'slug', $product_cat_slug, 'product_cat' ); if ( $term ) { $img_id = get_woocommerce_term_meta( absint($term->term_id), 'thumbnail_id', true ); $img_src = function_exists( 'woo_shrk_get_category_image' ) ? woo_shrk_get_category_image( absint($term->term_id), 'shrk_section_bg' ) : ''; $target_url = get_term_link( $term ); $heading = $term->name; $srcset = wp_get_attachment_image_srcset( $img_id, 'shrk_section_bg' ); $img_ar = shrk_get_image_aspect( $img_id, 'shrk_section_bg' ); } break; case 'product': $product_id = absint( trim( $product_id ) ); $heading = get_the_title( $product_id ); $target_url = get_permalink( $product_id ); if ( function_exists( 'shrk_get_meta_option' ) && shrk_get_meta_option( 'product_cover_image', $product_id ) ) { $cover_image_id = shrk_get_meta_option( 'product_cover_image', $product_id ); $cover = wp_get_attachment_image_src( $cover_image_id, 'shrk_section_bg' ); $srcset = wp_get_attachment_image_srcset( $cover_image_id, 'shrk_section_bg' ); $img_src = $cover[0]; $img_ar = shrk_get_image_aspect( $cover_image_id, 'shrk_section_bg' ); } break; case 'custom': $heading = $heading_text; if ( function_exists( 'vc_build_link' ) ) { $target = function_exists( 'vc_build_link' ) ? vc_build_link( $target_url ) : ''; $target_url = $target['url']; } $target_title = isset( $target['title'] ) ? $target['title'] : ''; $img = wp_get_attachment_image_src( preg_replace( '/[^\d]/', '', $banner_image ), 'shrk_section_bg' ); $srcset = wp_get_attachment_image_srcset( preg_replace( '/[^\d]/', '', $banner_image ), 'shrk_section_bg' ); $img_src = $img[0]; $img_ar = shrk_get_image_aspect( preg_replace( '/[^\d]/', '', $banner_image ), 'shrk_section_bg' ); break; default: $heading = 'No source set'; $img_src = ''; $img_ar = ''; break; } $el_class = $el_class . ' ' . $banner_style; if ( function_exists( 'vc_shortcode_custom_css_class') ) { $el_class .= ' ' . apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), 'shrk_banner', $atts ); } if ( !empty( $banner_height ) ) { $style_atts[] = 'height: ' . esc_attr( $banner_height ) . ';'; } $output = '
    '; if ( !empty( $target_url ) ) { $output .= ''; } $output .= '
    '; return $output; } add_action( 'init', function () { add_shortcode('shrk_banner', 'shrk_sc_banner'); }); add_filter( 'shrk_filter_vc_mappings', function ( $shrk_vc_shortcodes, $d ) { $shrk_vc_shortcodes["shrk_banner"] = array( "name" => esc_html__("Banner", 'dvl-uxshop-shortcodes'), /* */ "category" => esc_html__('Theme Specific', 'dvl-uxshop-shortcodes'), "base" => "shrk_banner", "icon" => "icon-wpb-shrk", "show_settings_on_create" => true, "params" => array( array( "type" => "dropdown", "heading" => esc_html__("Data source", 'dvl-uxshop-shortcodes'), "param_name" => "banner_source", "value" => array( esc_html__("Product category", 'dvl-uxshop-shortcodes') => "product_category", esc_html__("Product", 'dvl-uxshop-shortcodes') => "product", esc_html__("Custom", 'dvl-uxshop-shortcodes') => "custom", ), "save_always" => true, //required to save default value after vc 4.9.1 ), array( "type" => "woo_categories", "heading" => esc_html__("Product category", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Select the product category to get the title and image from.", 'dvl-uxshop-shortcodes'), "param_name" => "product_cat", "multiple" => false, "output" => "id", "value" => "", "dependency" => Array( 'element' => "banner_source", 'value' => array( 'product_category' ) ), ), array( "type" => "woo_products", "heading" => esc_html__("Product", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Select the product from which you want to get the title and image cover.", 'dvl-uxshop-shortcodes'), "param_name" => "product_id", "multiple" => false, "value" => "", "dependency" => Array( 'element' => "banner_source", 'value' => array( 'product' ) ), ), array( "type" => "attach_image", "heading" => esc_html__("Banner Image", 'dvl-uxshop-shortcodes'), "param_name" => "banner_image", "dependency" => Array( 'element' => "banner_source", 'value' => array( 'custom' ) ), ), array( "type" => "textfield", "heading" => esc_html__("Heading", 'dvl-uxshop-shortcodes'), "param_name" => "heading_text", "value" => '', "dependency" => Array( 'element' => "banner_source", 'value' => array( 'custom' ) ), ), array( "type" => "vc_link", "heading" => esc_html__("Target link", 'dvl-uxshop-shortcodes'), "param_name" => "target_url", "value" => '', "dependency" => Array( 'element' => "banner_source", 'value' => array( 'custom' ) ), ), array( "type" => "dropdown", "heading" => esc_html__("Font size", 'dvl-uxshop-shortcodes'), "description" => esc_html__("Override default font size if you wish.", 'dvl-uxshop-shortcodes'), "param_name" => "font_size", "value" => array( esc_html__("Large", 'dvl-uxshop-shortcodes') => "large", esc_html__("Medium", 'dvl-uxshop-shortcodes') => "medium", esc_html__("Small", 'dvl-uxshop-shortcodes') => "small", ), "save_always" => true, //required to save default value after vc 4.9.1 ), array( "type" => "textfield", "heading" => esc_html__("Banner height", 'dvl-uxshop-shortcodes'), "param_name" => "banner_height", "value" => '300px', ), array( "type" => "dropdown", "heading" => esc_html__("Banner style", 'dvl-uxshop-shortcodes'), "param_name" => "banner_style", "value" => array( esc_html__("Style A", 'dvl-uxshop-shortcodes') => "style-1", esc_html__("Style B", 'dvl-uxshop-shortcodes') => "style-2", ), "save_always" => true, //required to save default value after vc 4.9.1 ), array( "type" => "textfield", "heading" => esc_html__("Extra class name", 'dvl-uxshop-shortcodes'), "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'dvl-uxshop-shortcodes'), "param_name" => "el_class", ), array( 'type' => 'css_editor', 'heading' => __( 'Css', 'dvl-uxshop-shortcodes' ), 'param_name' => 'css', 'group' => __( 'Design options', 'dvl-uxshop-shortcodes' ), ), ) ); return $shrk_vc_shortcodes; },10 ,2 ); ?>starter-content.php000066600000021024152331647320010422 0ustar00 array( 'front' => array( 'post_type' => 'page', 'post_title' => esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ), 'post_content' => '

    ' . esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_attr__( '“Roses Trémières” by Berthe Morisot', 'twentytwentyone' ) . '
    ' . esc_attr__( '“In the Bois de Boulogne” by Berthe Morisot', 'twentytwentyone' ) . '
    ' . esc_attr__( '“Young Woman in Mauve” by Berthe Morisot', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Add block patterns', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Block patterns are pre-designed groups of blocks. To add one, select the Add Block button [+] in the toolbar at the top of the editor. Switch to the Patterns tab underneath the search bar, and choose a pattern.', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Frame your images', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Twenty Twenty-One includes stylish borders for your content. With an Image block selected, open the "Styles" panel within the Editor sidebar. Select the "Frame" block style to activate it.', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Overlap columns', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Twenty Twenty-One also includes an overlap style for column blocks. With a Columns block selected, open the "Styles" panel within the Editor sidebar. Choose the "Overlap" block style to try it out.', 'Theme starter content', 'twentytwentyone' ) . '

    ' . esc_html_x( 'Need help?', 'Theme starter content', 'twentytwentyone' ) . '

    ', ), 'about', 'contact', 'blog', ), // Default to a static front page and assign the front and posts pages. 'options' => array( 'show_on_front' => 'page', 'page_on_front' => '{{front}}', 'page_for_posts' => '{{blog}}', ), // Set up nav menus for each of the two areas registered in the theme. 'nav_menus' => array( // Assign a menu to the "primary" location. 'primary' => array( 'name' => esc_html__( 'Primary menu', 'twentytwentyone' ), 'items' => array( 'link_home', // Note that the core "home" page is actually a link in case a static front page is not used. 'page_about', 'page_blog', 'page_contact', ), ), // Assign a menu to the "footer" location. 'footer' => array( 'name' => esc_html__( 'Secondary menu', 'twentytwentyone' ), 'items' => array( 'link_facebook', 'link_twitter', 'link_instagram', 'link_email', ), ), ), ); /** * Filters the array of starter content. * * @since Twenty Twenty-One 1.0 * * @param array $starter_content Array of starter content. */ return apply_filters( 'twenty_twenty_one_starter_content', $starter_content ); } menu-functions.php000066600000007260152331647320010246 0ustar00theme_location && 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) { // Add toggle button. $output .= ''; } return $output; } add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_add_sub_menu_toggle', 10, 4 ); /** * Detects the social network from a URL and returns the SVG code for its icon. * * @since Twenty Twenty-One 1.0 * * @param string $uri Social link. * @param int $size The icon size in pixels. * @return string */ function twenty_twenty_one_get_social_link_svg( $uri, $size = 24 ) { return Twenty_Twenty_One_SVG_Icons::get_social_link_svg( $uri, $size ); } /** * Displays SVG icons in the footer navigation. * * @since Twenty Twenty-One 1.0 * * @param string $item_output The menu item's starting HTML output. * @param WP_Post $item Menu item data object. * @param int $depth Depth of the menu. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @return string The menu item output with social icon. */ function twenty_twenty_one_nav_menu_social_icons( $item_output, $item, $depth, $args ) { // Change SVG icon inside social links menu if there is supported URL. if ( 'footer' === $args->theme_location ) { $svg = twenty_twenty_one_get_social_link_svg( $item->url, 24 ); if ( ! empty( $svg ) ) { $item_output = str_replace( $args->link_before, $svg, $item_output ); } } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons', 10, 4 ); /** * Filters the arguments for a single nav menu item. * * @since Twenty Twenty-One 1.0 * * @param stdClass $args An object of wp_nav_menu() arguments. * @param WP_Post $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @return stdClass */ function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) { if ( '' !== $args->link_after ) { $args->link_after = ''; } if ( 0 === $depth && isset( $item->description ) && $item->description ) { // The extra element is here for styling purposes: Allows the description to not be underlined on hover. $args->link_after = ''; } return $args; } add_filter( 'nav_menu_item_args', 'twenty_twenty_one_add_menu_description_args', 10, 3 ); block-styles.php000066600000004612152331647320007705 0ustar00 'twentytwentyone-columns-overlap', 'label' => esc_html__( 'Overlap', 'twentytwentyone' ), ) ); // Cover: Borders. register_block_style( 'core/cover', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Group: Borders. register_block_style( 'core/group', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Image: Borders. register_block_style( 'core/image', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Image: Frame. register_block_style( 'core/image', array( 'name' => 'twentytwentyone-image-frame', 'label' => esc_html__( 'Frame', 'twentytwentyone' ), ) ); // Latest Posts: Dividers. register_block_style( 'core/latest-posts', array( 'name' => 'twentytwentyone-latest-posts-dividers', 'label' => esc_html__( 'Dividers', 'twentytwentyone' ), ) ); // Latest Posts: Borders. register_block_style( 'core/latest-posts', array( 'name' => 'twentytwentyone-latest-posts-borders', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Media & Text: Borders. register_block_style( 'core/media-text', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Separator: Thick. register_block_style( 'core/separator', array( 'name' => 'twentytwentyone-separator-thick', 'label' => esc_html__( 'Thick', 'twentytwentyone' ), ) ); // Social icons: Dark gray color. register_block_style( 'core/social-links', array( 'name' => 'twentytwentyone-social-icons-color', 'label' => esc_html__( 'Dark gray', 'twentytwentyone' ), ) ); } add_action( 'init', 'twenty_twenty_one_register_block_styles' ); } custom-css.php000066600000002217152331647320007371 0ustar00 tags and can only be interpreted as CSS on the browser. * Using wp_strip_all_tags() here is sufficient escaping to avoid * malicious attempts to close and open a