dvadf
File manager - Edit - /home/centroca/public_html/inc.tar
Back
core/tools.php 0000644 00000027634 15252476777 0007407 0 ustar 00 <?php /** * Resizes an image and returns an array containing the resized URL, width, height and file type. Uses native WordPress functionality. * * @author Matthew Ruddy (http://easinglider.com) * @return array An array containing the resized image URL, width, height and file type. */ function su_image_resize( $url, $width = null, $height = null, $crop = true, $retina = false ) { global $wp_version; //###################################################################### // First implementation //###################################################################### if ( isset( $wp_version ) && version_compare( $wp_version, '3.5' ) >= 0 ) { global $wpdb; if ( empty( $url ) ) { return new WP_Error( 'no_image_url', 'No image URL has been entered.', $url ); } // Get default size from database $width = ( $width ) ? $width : get_option( 'thumbnail_size_w' ); $height = ( $height ) ? $height : get_option( 'thumbnail_size_h' ); // Allow for different retina sizes $retina = $retina ? ( $retina === true ? 2 : $retina ) : 1; // Get the image file path $file_path = parse_url( $url ); $file_path = $_SERVER['DOCUMENT_ROOT'] . $file_path['path']; // Check for Multisite if ( is_multisite() ) { global $blog_id; $blog_details = get_blog_details( $blog_id ); $file_path = str_replace( $blog_details->path . 'files/', '/wp-content/blogs.dir/' . $blog_id . '/files/', $file_path ); } // Destination width and height variables $dest_width = intval( $width ) * intval( $retina ); $dest_height = intval( $height ) * intval( $retina ); // File name suffix (appended to original file name) $suffix = "{$dest_width}x{$dest_height}"; // Some additional info about the image $info = pathinfo( $file_path ); $dir = $info['dirname']; $ext = $info['extension']; $name = wp_basename( $file_path, ".$ext" ); // Suffix applied to filename $suffix = "{$dest_width}x{$dest_height}"; // Get the destination file name $dest_file_name = "{$dir}/{$name}-{$suffix}.{$ext}"; if ( ! file_exists( $dest_file_name ) ) { $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url ); $get_attachment = $wpdb->get_results( $query ); if ( ! $get_attachment ) { return array( 'url' => $url, 'width' => $width, 'height' => $height, ); } // Load WordPress Image Editor $editor = wp_get_image_editor( $file_path ); if ( is_wp_error( $editor ) ) { return array( 'url' => $url, 'width' => $width, 'height' => $height, ); } // Get the original image size $size = $editor->get_size(); $orig_width = $size['width']; $orig_height = $size['height']; $src_x = $src_y = 0; $src_w = $orig_width; $src_h = $orig_height; if ( $crop ) { $cmp_x = $orig_width / $dest_width; $cmp_y = $orig_height / $dest_height; // Calculate x or y coordinate, and width or height of source if ( $cmp_x > $cmp_y ) { $src_w = round( $orig_width / $cmp_x * $cmp_y ); $src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 ); } elseif ( $cmp_y > $cmp_x ) { $src_h = round( $orig_height / $cmp_y * $cmp_x ); $src_y = round( ( $orig_height - ( $orig_height / $cmp_y * $cmp_x ) ) / 2 ); } } // Time to crop the image! $editor->crop( $src_x, $src_y, $src_w, $src_h, $dest_width, $dest_height ); // Now let's save the image $saved = $editor->save( $dest_file_name ); // Get resized image information $resized_url = str_replace( basename( $url ), basename( $saved['path'] ), $url ); $resized_width = $saved['width']; $resized_height = $saved['height']; $resized_type = $saved['mime-type']; // Add the resized dimensions to original image metadata (so we can delete our resized images when the original image is delete from the Media Library) $metadata = wp_get_attachment_metadata( $get_attachment[0]->ID ); if ( isset( $metadata['image_meta'] ) ) { $metadata['image_meta']['resized_images'][] = $resized_width . 'x' . $resized_height; wp_update_attachment_metadata( $get_attachment[0]->ID, $metadata ); } // Create the image array $image_array = array( 'url' => $resized_url, 'width' => $resized_width, 'height' => $resized_height, 'type' => $resized_type, ); } else { $image_array = array( 'url' => str_replace( basename( $url ), basename( $dest_file_name ), $url ), 'width' => $dest_width, 'height' => $dest_height, 'type' => $ext, ); } // Return image array return $image_array; } //###################################################################### // Second implementation //###################################################################### else { global $wpdb; if ( empty( $url ) ) { return new WP_Error( 'no_image_url', 'No image URL has been entered.', $url ); } // Bail if GD Library doesn't exist if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) { return array( 'url' => $url, 'width' => $width, 'height' => $height, ); } // Get default size from database $width = ( $width ) ? $width : get_option( 'thumbnail_size_w' ); $height = ( $height ) ? $height : get_option( 'thumbnail_size_h' ); // Allow for different retina sizes $retina = $retina ? ( $retina === true ? 2 : $retina ) : 1; // Destination width and height variables $dest_width = $width * $retina; $dest_height = $height * $retina; // Get image file path $file_path = parse_url( $url ); $file_path = $_SERVER['DOCUMENT_ROOT'] . $file_path['path']; // Check for Multisite if ( is_multisite() ) { global $blog_id; $blog_details = get_blog_details( $blog_id ); $file_path = str_replace( $blog_details->path . 'files/', '/wp-content/blogs.dir/' . $blog_id . '/files/', $file_path ); } // Some additional info about the image $info = pathinfo( $file_path ); $dir = $info['dirname']; $ext = $info['extension']; $name = wp_basename( $file_path, ".$ext" ); // Suffix applied to filename $suffix = "{$dest_width}x{$dest_height}"; // Get the destination file name $dest_file_name = "{$dir}/{$name}-{$suffix}.{$ext}"; // No need to resize & create a new image if it already exists! if ( ! file_exists( $dest_file_name ) ) { /* * Bail if this image isn't in the Media Library either. * We only want to resize Media Library images, so we can be sure they get deleted correctly when appropriate. */ $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE guid='%s'", $url ); $get_attachment = $wpdb->get_results( $query ); if ( ! $get_attachment ) { return array( 'url' => $url, 'width' => $width, 'height' => $height, ); } $image = wp_load_image( $file_path ); if ( ! is_resource( $image ) ) { return new WP_Error( 'error_loading_image_as_resource', $image, $file_path ); } // Get the current image dimensions and type $size = @getimagesize( $file_path ); if ( ! $size ) { return new WP_Error( 'file_path_getimagesize_failed', 'Failed to get $file_path information using getimagesize.' ); } list( $orig_width, $orig_height, $orig_type ) = $size; // Create new image $new_image = wp_imagecreatetruecolor( $dest_width, $dest_height ); // Do some proportional cropping if enabled if ( $crop ) { $src_x = $src_y = 0; $src_w = $orig_width; $src_h = $orig_height; $cmp_x = $orig_width / $dest_width; $cmp_y = $orig_height / $dest_height; // Calculate x or y coordinate, and width or height of source if ( $cmp_x > $cmp_y ) { $src_w = round( $orig_width / $cmp_x * $cmp_y ); $src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 ); } elseif ( $cmp_y > $cmp_x ) { $src_h = round( $orig_height / $cmp_y * $cmp_x ); $src_y = round( ( $orig_height - ( $orig_height / $cmp_y * $cmp_x ) ) / 2 ); } // Create the resampled image imagecopyresampled( $new_image, $image, 0, 0, $src_x, $src_y, $dest_width, $dest_height, $src_w, $src_h ); } else { imagecopyresampled( $new_image, $image, 0, 0, 0, 0, $dest_width, $dest_height, $orig_width, $orig_height ); } // Convert from full colors to index colors, like original PNG. if ( IMAGETYPE_PNG == $orig_type && function_exists( 'imageistruecolor' ) && ! imageistruecolor( $image ) ) { imagetruecolortopalette( $new_image, false, imagecolorstotal( $image ) ); } // Remove the original image from memory (no longer needed) imagedestroy( $image ); // Check the image is the correct file type if ( IMAGETYPE_GIF == $orig_type ) { if ( ! imagegif( $new_image, $dest_file_name ) ) { return new WP_Error( 'resize_path_invalid', 'Resize path invalid (GIF)' ); } } elseif ( IMAGETYPE_PNG == $orig_type ) { if ( ! imagepng( $new_image, $dest_file_name ) ) { return new WP_Error( 'resize_path_invalid', 'Resize path invalid (PNG).' ); } } else { // All other formats are converted to jpg if ( 'jpg' != $ext && 'jpeg' != $ext ) { $dest_file_name = "{$dir}/{$name}-{$suffix}.jpg"; } if ( ! imagejpeg( $new_image, $dest_file_name, apply_filters( 'resize_jpeg_quality', 90 ) ) ) { return new WP_Error( 'resize_path_invalid', 'Resize path invalid (JPG).' ); } } // Remove new image from memory (no longer needed as well) imagedestroy( $new_image ); // Set correct file permissions $stat = stat( dirname( $dest_file_name ) ); $perms = $stat['mode'] & 0000666; @chmod( $dest_file_name, $perms ); // Get some information about the resized image $new_size = @getimagesize( $dest_file_name ); if ( ! $new_size ) { return new WP_Error( 'resize_path_getimagesize_failed', 'Failed to get $dest_file_name (resized image) info via @getimagesize', $dest_file_name ); } list( $resized_width, $resized_height, $resized_type ) = $new_size; // Get the new image URL $resized_url = str_replace( basename( $url ), basename( $dest_file_name ), $url ); // Add the resized dimensions to original image metadata (so we can delete our resized images when the original image is delete from the Media Library) $metadata = wp_get_attachment_metadata( $get_attachment[0]->ID ); if ( isset( $metadata['image_meta'] ) ) { $metadata['image_meta']['resized_images'][] = $resized_width . 'x' . $resized_height; wp_update_attachment_metadata( $get_attachment[0]->ID, $metadata ); } // Return array with resized image information $image_array = array( 'url' => $resized_url, 'width' => $resized_width, 'height' => $resized_height, 'type' => $resized_type, ); } else { $image_array = array( 'url' => str_replace( basename( $url ), basename( $dest_file_name ), $url ), 'width' => $dest_width, 'height' => $dest_height, 'type' => $ext, ); } return $image_array; } } /** * Deletes the resized images when the original image is deleted from the WordPress Media Library. * * @author Matthew Ruddy */ function su_delete_resized_images( $post_id ) { // Get attachment image metadata $metadata = wp_get_attachment_metadata( $post_id ); if ( ! $metadata ) { return; } // Do some bailing if we cannot continue if ( ! isset( $metadata['file'] ) || ! isset( $metadata['image_meta']['resized_images'] ) ) { return; } $pathinfo = pathinfo( $metadata['file'] ); $resized_images = $metadata['image_meta']['resized_images']; // Get WordPress uploads directory (and bail if it doesn't exist) $wp_upload_dir = wp_upload_dir(); $upload_dir = $wp_upload_dir['basedir']; if ( ! is_dir( $upload_dir ) ) { return; } // Delete the resized images foreach ( $resized_images as $dims ) { // Get the resized images filename $file = $upload_dir . '/' . $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '-' . $dims . '.' . $pathinfo['extension']; // Delete the resized image @unlink( $file ); } } add_action( 'delete_attachment', 'su_delete_resized_images' ); core/generator.php 0000644 00000105565 15252476777 0010235 0 ustar 00 <?php // phpcs:ignoreFile /** * Shortcode Generator */ class Su_Generator { public function __construct() { add_action( 'media_buttons', array(__CLASS__, 'button_classic_editor'), 1000 ); add_action( 'enqueue_block_editor_assets', array(__CLASS__, 'button_block_editor') ); add_action('wp_footer', array(__CLASS__, 'popup')); add_action('admin_footer', array(__CLASS__, 'popup')); add_action('wp_ajax_su_generator_settings', array(__CLASS__, 'settings')); add_action('wp_ajax_su_generator_preview', array(__CLASS__, 'preview')); add_action('su/generator/actions', array(__CLASS__, 'presets')); add_action('wp_ajax_su_generator_get_icons', array(__CLASS__, 'ajax_get_icons')); add_action('wp_ajax_su_generator_get_terms', array(__CLASS__, 'ajax_get_terms')); add_action('wp_ajax_su_generator_get_taxonomies', array(__CLASS__, 'ajax_get_taxonomies')); add_action('wp_ajax_su_generator_search_posts', array(__CLASS__, 'ajax_search_posts')); add_action('wp_ajax_su_generator_search_users', array(__CLASS__, 'ajax_search_users')); add_action('wp_ajax_su_generator_add_preset', array(__CLASS__, 'ajax_add_preset')); add_action('wp_ajax_su_generator_remove_preset', array(__CLASS__, 'ajax_remove_preset')); add_action('wp_ajax_su_generator_get_preset', array(__CLASS__, 'ajax_get_preset')); } /** * @deprecated 5.1.0 Replaced with Su_Generator::classic_editor_button() */ public static function button($args = array()) { return self::button_html_editor($args); } public static function classic_editor_button($args = array()) { return self::button_html_editor($args); } public static function button_html_editor($args = array()) { if (!self::access_check()) { return; } self::enqueue_generator(); $args = wp_parse_args( $args, array( 'target' => '', 'tag' => 'button', 'text' => __('Insert shortcode', 'shortcodes-ultimate'), 'class' => 'button', 'icon' => true, 'echo' => true, 'shortcode' => '', ) ); if ($args['icon']) { $args['icon'] = '<svg style="vertical-align:middle;position:relative;top:-1px;opacity:.8;width:18px;height:18px" viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><path fill="currentcolor" d="M8.48 2.75v2.5H5.25v9.5h3.23v2.5H2.75V2.75h5.73zm9.27 14.5h-5.73v-2.5h3.23v-9.5h-3.23v-2.5h5.73v14.5z"/></svg>'; } $onclick = sprintf( "SUG.App.insert('html',{editorID:'%s',shortcode:'%s'});return false;", esc_attr($args['target']), esc_attr($args['shortcode']) ); $button = sprintf( '<%6$s type="button" href="javascript:;" class="su-generator-button %1$s" title="%2$s" onclick="%3$s" >%4$s %5$s</%6$s>', esc_attr($args['class']), esc_attr($args['text']), $onclick, $args['icon'], esc_html($args['text']), sanitize_key($args['tag']) ); if ($args['echo']) { echo $button; } return $button; } public static function button_classic_editor($target) { if (!self::access_check()) { return; } self::enqueue_generator(); $onclick = sprintf( "SUG.App.insert('classic',{editorID:'%s',shortcode:''});", esc_attr($target) ); $icon = '<svg style="vertical-align:middle;position:relative;top:-1px;opacity:.8;width:18px;height:18px" viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><path fill="currentcolor" d="M8.48 2.75v2.5H5.25v9.5h3.23v2.5H2.75V2.75h5.73zm9.27 14.5h-5.73v-2.5h3.23v-9.5h-3.23v-2.5h5.73v14.5z"/></svg>'; $button = sprintf( '<button type="button" class="su-generator-button button" title="%1$s" onclick="%2$s" > %3$s %1$s </button>', __('Insert shortcode', 'shortcodes-ultimate'), $onclick, $icon ); echo $button; } public static function button_block_editor() { if (!self::access_check()) { return; } self::enqueue_generator(); wp_enqueue_script( 'shortcodes-ultimate-block-editor', plugins_url('includes/js/block-editor/index.js', SU_PLUGIN_FILE), array('wp-element', 'wp-components', 'wp-edit-post', 'wp-plugins', 'wp-blocks', 'wp-data'), SU_PLUGIN_VERSION, true ); wp_enqueue_style( 'shortcodes-ultimate-block-editor', plugins_url('includes/css/block-editor.css', SU_PLUGIN_FILE), array(), SU_PLUGIN_VERSION ); wp_localize_script( 'shortcodes-ultimate-block-editor', 'SUBlockEditorL10n', array( 'insertShortcode' => __('Insert shortcode', 'shortcodes-ultimate'), 'livePreviewTitle' => __('Live Preview', 'shortcodes-ultimate'), 'livePreviewDescription' => __('This is a Live Preview. Click this button to open the shortcode generator and try the plugin.', 'shortcodes-ultimate'), ) ); wp_localize_script( 'shortcodes-ultimate-block-editor', 'SUBlockEditorSettings', array( 'supportedBlocks' => get_option('su_option_supported_blocks', array()), 'showToolbarButton' => get_option('su_option_show_toolbar_button', 'on'), 'showBlockControlsButton' => get_option('su_option_show_block_controls_button', 'on'), 'isLivePreview' => su_is_live_preview_request(), ) ); } public static function enqueue_generator() { do_action('su/generator/enqueue'); self::enqueue_assets(); } public static function enqueue_assets() { wp_enqueue_media(); su_query_asset( 'css', array( 'simpleslider', 'farbtastic', 'magnific-popup', 'su-icons', 'su-generator', ) ); su_query_asset( 'js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'simpleslider', 'farbtastic', 'magnific-popup', 'su-generator', ) ); } public static function get_choice_icon($shortcode_id, $shortcode) { if (!isset($shortcode['icon'])) { $shortcode['icon'] = 'puzzle-piece'; } $svg_icon_path = 'admin/images/shortcodes/svgs/' . $shortcode_id . '.svg'; $svg_file = su_get_plugin_path() . $svg_icon_path; $svg_url = su_get_plugin_url() . $svg_icon_path; if (file_exists($svg_file)) { $shortcode['icon'] = $svg_url . '?v=' . SU_PLUGIN_VERSION; } if (strpos($shortcode['icon'], '/') === false) { $shortcode['icon'] = 'icon:' . $shortcode['icon']; } $shortcode['name'] = (isset($shortcode['name'])) ? $shortcode['name'] : 'untitled-shortcode'; if (!isset($shortcode['desc'])) { $shortcode['desc'] = ''; } return su_html_icon($shortcode['icon']); } /** * Generator popup form */ public static function popup() { if (!did_action('su/generator/enqueue')) { return; } $tools = apply_filters('su/generator/tools', array( '<a href="' . admin_url('admin.php?page=shortcodes-ultimate-settings') . '" target="_blank" title="' . __('Settings', 'shortcodes-ultimate') . '">' . __('Plugin settings', 'shortcodes-ultimate') . '</a>', '<a href="https://getshortcodes.com/" target="_blank" title="' . __('Plugin homepage', 'shortcodes-ultimate') . '">' . __('Plugin homepage', 'shortcodes-ultimate') . '</a>', )); if (!su_fs()->can_use_premium_code() && !su_has_all_active_addons()) { $tools[] = '<a href="' . esc_attr(su_get_utm_link('https://getshortcodes.com/pricing/', 'wp-dashboard', 'generator', 'badge')) . '" target="_blank" title="' . __('Upgrade to PRO', 'shortcodes-ultimate') . '" class="su-add-ons">★ ' . __('Upgrade to PRO', 'shortcodes-ultimate') . '</a>'; } ?> <div id="su-generator-wrap" style="display:none"> <div id="su-generator"> <div class="su-generator-header"> <!-- <div id="su-generator-tools"><?php echo implode(' <span></span> ', $tools); ?></div> --> <div class="su-generator-header-title"> <?php _e('Insert Shortcode', 'shortcodes-ultimate'); ?> </div> <div id="su-generator-search-wrapper"> <input type="text" name="su_generator_search" id="su-generator-search" value="" placeholder="<?php _e('Search for shortcodes', 'shortcodes-ultimate'); ?>" /> <button type="button" id="su-generator-search-clear" title="<?php esc_attr_e('Clear search', 'shortcodes-ultimate'); ?>" aria-label="<?php esc_attr_e('Clear search', 'shortcodes-ultimate'); ?>"> <i class="sui sui-times" aria-hidden="true"></i> </button> </div> </div> <!-- <p id="su-generator-search-pro-tip"><?php printf('<strong>%s:</strong> %s', __('Pro Tip', 'shortcodes-ultimate'), __('Hit enter to select highlighted shortcode, while searching', 'shortcodes-ultimate')) ?></p> --> <?php if (!su_fs()->can_use_premium_code() && !su_has_all_active_addons()): ?> <div class="su-generator-pro-nag"> <?php // translators: %s is replaced with "Shortcodes Ultimate Pro link" printf( __('Unlock 15 additional shortcodes, 60+ styles, and create your own shortcodes with %s', 'shortcodes-ultimate'), sprintf( '<a href="%s" target="_blank">%s ›</a>', esc_attr(su_get_utm_link('https://getshortcodes.com/pricing/', 'wp-dashboard', 'generator', 'pro-nag')), __('Shortcodes Ultimate Pro', 'shortcodes-ultimate') ) ); ?> <a href="<?php echo esc_attr(su_get_utm_link('https://getshortcodes.com/pricing/', 'wp-dashboard', 'generator', 'pro-nag')) ?>" target="_blank" class="su-generator-pro-nag-block-link" tabindex="-1" aria-hidden="true"><?php _e('Shortcodes Ultimate Pro', 'shortcodes-ultimate') ?></a> </div> <?php endif; ?> <div id="su-generator-choices"> <?php foreach (self::get_shortcodes_grouped() as $group_id => $group): ?> <div class="su-generator-choices-group"> <div class="su-generator-choices-group-title"> <?php echo esc_html($group['title']); ?> </div> <div class="su-generator-choices-group-items"> <?php foreach ($group['shortcodes'] as $shortcode_id => $shortcode): ?> <?php $is_pro_choice = !su_fs()->can_use_premium_code() && isset($shortcode['is_pro']) && $shortcode['is_pro']; ?> <div class="su-generator-choice<?php echo $is_pro_choice ? ' su-generator-choice-is-pro' : ''; ?>" data-name="<?php echo esc_attr($shortcode['name']); ?>" data-shortcode="<?php echo esc_attr($shortcode_id); ?>" title="<?php echo esc_attr($shortcode['desc']); ?>" data-desc="<?php echo esc_attr($shortcode['desc']); ?>" data-group="<?php echo esc_attr($shortcode['group']); ?>"> <?php echo self::get_choice_icon($shortcode_id, $shortcode); ?> <span><?php echo esc_html($shortcode['name']); ?></span> <?php if ($is_pro_choice): ?> <span class="su-generator-choice-pro-icon" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" focusable="false"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294zM5 21h14"/></svg> </span> <?php endif; ?> </div> <?php endforeach; ?> </div> </div> <?php endforeach; ?> </div> <div id="su-generator-settings"></div> <input type="hidden" name="su-generator-selected" id="su-generator-selected" value="<?php echo plugins_url('', SU_PLUGIN_FILE); ?>" /> <input type="hidden" name="su-generator-url" id="su-generator-url" value="<?php echo plugins_url('', SU_PLUGIN_FILE); ?>" /> <input type="hidden" name="su-compatibility-mode-prefix" id="su-compatibility-mode-prefix" value="<?php echo su_get_shortcode_prefix(); ?>" /> <input type="hidden" name="su-generator-option-skip" id="su-generator-option-skip" value="<?php echo esc_attr(get_option('su_option_skip', '')); ?>" /> <?php wp_nonce_field('su_generator_preset', 'su_generator_presets_nonce'); ?> <?php wp_nonce_field('su_generator_preview', 'su_generator_preview_nonce'); ?> <div id="su-generator-result" style="display:none"></div> </div> </div> <?php } /** * Normalize shortcode generator tabs. */ private static function get_generator_tabs($shortcode) { if ( empty($shortcode['tabs']) || !is_array($shortcode['tabs']) ) { return array(); } $tabs = array(); foreach ($shortcode['tabs'] as $tab_id => $tab_info) { $tab_id = sanitize_key($tab_id); if (!$tab_id) { continue; } if (is_string($tab_info)) { $tab_info = array( 'title' => $tab_info, ); } if (!is_array($tab_info)) { continue; } $tabs[$tab_id] = wp_parse_args( $tab_info, array( 'title' => $tab_id, 'icon' => '', ) ); } return $tabs; } private static function get_generator_tab_icon($tab) { if (empty($tab['icon'])) { return ''; } $icon = $tab['icon']; if (strpos($icon, '/') === false && strpos($icon, 'icon:') !== 0) { $icon = 'icon:' . $icon; } return su_html_icon($icon); } private static function render_generator_tabs($tabs) { if (empty($tabs)) { return ''; } $return = '<div class="su-generator-tabs" role="tablist">'; $count = 0; foreach ($tabs as $tab_id => $tab) { $active = $count === 0; $tab_dom_id = 'su-generator-tab-' . sanitize_html_class($tab_id); $panel_dom_id = 'su-generator-tab-panel-' . sanitize_html_class($tab_id); $icon = self::get_generator_tab_icon($tab); $return .= '<button type="button" class="su-generator-tab' . ($active ? ' su-generator-tab-active' : '') . '" data-tab="' . esc_attr($tab_id) . '" id="' . esc_attr($tab_dom_id) . '" role="tab" aria-selected="' . ($active ? 'true' : 'false') . '" aria-controls="' . esc_attr($panel_dom_id) . '">'; if ($icon) { $return .= '<span class="su-generator-tab-icon" aria-hidden="true">' . $icon . '</span>'; } $return .= '<span class="su-generator-tab-title">' . esc_html($tab['title']) . '</span>'; $return .= '</button>'; $count++; } $return .= '</div>'; return $return; } private static function render_generator_tab_panels($tabs, $panels) { if (empty($tabs)) { return ''; } $return = '<div class="su-generator-tab-panels">'; $count = 0; foreach ($tabs as $tab_id => $tab) { $active = $count === 0; $tab_dom_id = 'su-generator-tab-' . sanitize_html_class($tab_id); $panel_dom_id = 'su-generator-tab-panel-' . sanitize_html_class($tab_id); $content = isset($panels[$tab_id]) ? $panels[$tab_id] : ''; $return .= '<div class="su-generator-tab-panel' . ($active ? ' su-generator-tab-panel-active' : '') . '" data-tab="' . esc_attr($tab_id) . '" id="' . esc_attr($panel_dom_id) . '" role="tabpanel" aria-labelledby="' . esc_attr($tab_dom_id) . '" aria-hidden="' . ($active ? 'false' : 'true') . '">'; $return .= $content; $return .= '</div>'; $count++; } $return .= '</div>'; return $return; } private static function render_generator_attribute($attr_name, $attr_info, $skip) { if (isset($attr_info['hidden']) && $attr_info['hidden']) { return ''; } // Prepare default value $default = (string) (isset($attr_info['default'])) ? $attr_info['default'] : ''; $attr_info['name'] = (isset($attr_info['name'])) ? $attr_info['name'] : $attr_name; $return = '<div class="su-generator-attr-container' . $skip . '" data-default="' . esc_attr($default) . '">'; $return .= '<h5>' . $attr_info['name'] . '</h5>'; // Create field types if (!isset($attr_info['type']) && isset($attr_info['values']) && is_array($attr_info['values']) && count($attr_info['values'])) $attr_info['type'] = 'select'; elseif (!isset($attr_info['type'])) $attr_info['type'] = 'text'; if (is_callable(array('Su_Generator_Views', $attr_info['type']))) $return .= call_user_func(array('Su_Generator_Views', $attr_info['type']), $attr_name, $attr_info); elseif (isset($attr_info['callback']) && is_callable($attr_info['callback'])) $return .= call_user_func($attr_info['callback'], $attr_name, $attr_info); if (isset($attr_info['desc'])) $return .= '<div class="su-generator-attr-desc">' . str_replace(array('<b%value>', '<b_>'), '<b class="su-generator-set-value" title="' . __('Click to set this value', 'shortcodes-ultimate') . '">', $attr_info['desc']) . '</div>'; $return .= '</div>'; return $return; } private static function render_generator_content_field($shortcode) { if (!isset($shortcode['content'])) { $shortcode['content'] = ''; } if (is_array($shortcode['content'])) { $shortcode['content'] = self::get_shortcode_code($shortcode['content']); } return '<div class="su-generator-attr-container"><h5>' . __('Content', 'shortcodes-ultimate') . '</h5><textarea name="su-generator-content" id="su-generator-content" rows="5">' . esc_attr(str_replace(array('%prefix_', '__'), su_get_shortcode_prefix(), $shortcode['content'])) . '</textarea></div>'; } /** * Process AJAX request */ public static function settings() { self::access(); // Param check if (empty($_REQUEST['shortcode'])) wp_die(__('Shortcode not specified', 'shortcodes-ultimate')); // Request queried shortcode $shortcode = su_get_shortcode(sanitize_key($_REQUEST['shortcode'])); // Call custom callback if ( isset($shortcode['generator_callback']) && is_callable($shortcode['generator_callback']) ) { call_user_func($shortcode['generator_callback'], $shortcode); exit; } // Prepare skip-if-default option $skip = (get_option('su_option_skip') === 'on') ? ' su-generator-skip' : ''; // Prepare actions $actions = apply_filters('su/generator/actions', array( 'insert' => '<a href="javascript:void(0);" class="button button-primary button-large su-generator-insert"><i class="sui sui-check"></i> ' . __('Insert shortcode', 'shortcodes-ultimate') . '</a>', 'copy' => '<button type="button" class="button button-large su-generator-copy" data-label="' . esc_attr__( 'Copy shortcode', 'shortcodes-ultimate' ) . '" data-copied-label="' . esc_attr__( 'Copied', 'shortcodes-ultimate' ) . '" aria-label="' . esc_attr__( 'Copy shortcode', 'shortcodes-ultimate' ) . '"><i class="sui sui-copy" aria-hidden="true"></i><span class="su-generator-copy-label">' . esc_html__( 'Copy shortcode', 'shortcodes-ultimate' ) . '</span></button>', 'reset' => '<button type="button" class="button button-large su-generator-reset" aria-label="' . esc_attr__( 'Reset Settings', 'shortcodes-ultimate' ) . '"><i class="sui sui-undo" aria-hidden="true"></i>' . esc_html__( 'Reset Settings', 'shortcodes-ultimate' ) . '</button>', )); $return = '<div class="su-generator-settings-body">'; $return .= '<div class="su-generator-settings-fields">'; $tabs = self::get_generator_tabs($shortcode); $first_tab = empty($tabs) ? '' : key($tabs); $tab_panels = array(); foreach ($tabs as $tab_id => $tab) { $tab_panels[$tab_id] = ''; } // Shortcode header $return .= '<div id="su-generator-breadcrumbs">'; $return .= apply_filters('su/generator/breadcrumbs', '<a href="javascript:void(0);" class="su-generator-home" title="' . __('Click to return to the shortcodes list', 'shortcodes-ultimate') . '">' . __('All shortcodes', 'shortcodes-ultimate') . '</a> → <span>' . $shortcode['name'] . '</span> <small class="alignright">' . $shortcode['desc'] . '</small><div class="su-generator-clear"></div>'); $return .= '</div>'; // Shortcode note if (isset($shortcode['note'])) { $return .= '<div class="su-generator-note"><i class="sui sui-info-circle"></i><div class="su-generator-note-content">' . wpautop($shortcode['note']) . '</div></div>'; } // Shortcode CTA if (isset($shortcode['generator_cta'])) { $return .= '<div class="su-generator-cta"><div class="su-generator-cta-content">' . $shortcode['generator_cta'] . '</div></div>'; } // Shortcode has atts if (isset($shortcode['atts']) && count($shortcode['atts'])) { // Loop through shortcode parameters foreach ($shortcode['atts'] as $attr_name => $attr_info) { if (empty($tabs)) { $return .= self::render_generator_attribute($attr_name, $attr_info, $skip); continue; } $tab_id = isset($attr_info['tab']) ? sanitize_key($attr_info['tab']) : $first_tab; if (!isset($tab_panels[$tab_id])) { $tab_id = $first_tab; } $tab_panels[$tab_id] .= self::render_generator_attribute($attr_name, $attr_info, $skip); } } // Single shortcode (not closed) if ($shortcode['type'] == 'single') $return .= '<input type="hidden" name="su-generator-content" id="su-generator-content" value="false" />'; // Wrapping shortcode else { if (empty($tabs)) { $return .= self::render_generator_content_field($shortcode); } else { $tab_panels[$first_tab] .= self::render_generator_content_field($shortcode); } } $return .= self::render_generator_tabs($tabs); $return .= self::render_generator_tab_panels($tabs, $tab_panels); $return .= '</div>'; $return .= '<div class="su-generator-preview-panel"><div id="su-generator-preview"></div></div>'; $return .= '</div>'; $return .= '<div class="su-generator-actions su-generator-clearfix">' . implode(' ', array_values($actions)) . '</div>'; echo $return; exit; } /** * Process AJAX request and generate preview HTML */ public static function preview() { // Check nonce if ( empty($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'su_generator_preview') ) { return; } // Check authentication self::access(); // Output results do_action('su/generator/preview/before'); $shortcode = wp_unslash($_POST['shortcode']); echo '<h5>' . __('Preview', 'shortcodes-ultimate') . '</h5>'; echo apply_filters('su/generator/preview/output', do_shortcode($shortcode), $shortcode); echo '<div style="clear:both"></div>'; do_action('su/generator/preview/after'); die(); } public static function access() { if (!self::access_check()) wp_die(__('Access denied', 'shortcodes-ultimate')); } public static function access_check() { $required_capability = (string) get_option( 'su_option_generator_access', 'manage_options' ); return current_user_can($required_capability); } public static function ajax_get_icons() { self::access(); $icons = array(); foreach (su_get_config('icons') as $icon) { $icons[] = '<i class="sui sui-' . $icon . '" title="' . $icon . '"></i>'; } die(implode('', $icons)); } public static function ajax_get_terms() { self::access(); $args = array(); if (isset($_REQUEST['tax'])) $args['options'] = (array) self::get_terms(sanitize_key($_REQUEST['tax'])); if (isset($_REQUEST['class'])) $args['class'] = (string) sanitize_key($_REQUEST['class']); if (isset($_REQUEST['multiple'])) $args['multiple'] = (bool) sanitize_key($_REQUEST['multiple']); if (isset($_REQUEST['size'])) $args['size'] = (int) sanitize_key($_REQUEST['size']); if (isset($_REQUEST['noselect'])) $args['noselect'] = (bool) sanitize_key($_REQUEST['noselect']); die(su_html_dropdown($args)); } public static function ajax_get_taxonomies() { self::access(); $args = array(); $args['options'] = self::get_taxonomies(); die(su_html_dropdown($args)); } public static function ajax_search_posts() { self::access(); $ids = array(); if (isset($_REQUEST['ids'])) { $ids = is_array($_REQUEST['ids']) ? $_REQUEST['ids'] : explode(',', (string) wp_unslash($_REQUEST['ids'])); $ids = array_filter(array_map('absint', $ids)); } $args = array( 'no_found_rows' => true, 'post_status' => 'publish', 'post_type' => self::get_searchable_post_types(), 'posts_per_page' => 20, 'suppress_filters' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, ); if (!empty($ids)) { $args['orderby'] = 'post__in'; $args['post__in'] = $ids; $args['posts_per_page'] = count($ids); } else { $search = isset($_REQUEST['search']) ? sanitize_text_field(wp_unslash($_REQUEST['search'])) : ''; if (strlen($search) < 2) { wp_send_json_success(array('results' => array())); } $args['s'] = $search; } $query = new WP_Query($args); $results = array(); foreach ($query->posts as $post) { $results[] = self::format_post_search_result($post); } wp_send_json_success(array('results' => $results)); } private static function get_searchable_post_types() { $post_types = array(); foreach (get_post_types(array(), 'objects') as $post_type) { if (true === $post_type->show_ui) { $post_types[] = $post_type->name; } } return array_values( (array) apply_filters( 'su/generator/search_posts/post_types', $post_types ) ); } private static function format_post_search_result($post) { $post_type = get_post_type_object($post->post_type); $post_type_label = $post_type ? $post_type->labels->singular_name : $post->post_type; $title = get_the_title($post); if ('' === $title) { $title = __('(no title)', 'shortcodes-ultimate'); } return array( 'value' => (string) $post->ID, 'label' => sprintf( '%1$s (#%2$d, %3$s)', $title, $post->ID, $post_type_label ), ); } public static function ajax_search_users() { self::access(); $ids = array(); if (isset($_REQUEST['ids'])) { $ids = is_array($_REQUEST['ids']) ? $_REQUEST['ids'] : explode(',', (string) wp_unslash($_REQUEST['ids'])); $ids = array_filter(array_map('absint', $ids)); } $args = array( 'fields' => 'all', 'number' => 20, ); if (!empty($ids)) { $args['include'] = $ids; $args['number'] = count($ids); $args['orderby'] = 'include'; } else { $search = isset($_REQUEST['search']) ? sanitize_text_field(wp_unslash($_REQUEST['search'])) : ''; if (strlen($search) < 2) { wp_send_json_success(array('results' => array())); } $args['search'] = '*' . $search . '*'; $args['search_columns'] = array( 'user_login', 'user_nicename', 'display_name', 'user_email', ); } $results = array(); foreach (get_users($args) as $user) { $results[] = self::format_user_search_result($user); } wp_send_json_success(array('results' => $results)); } private static function format_user_search_result($user) { $label = $user->display_name ? $user->display_name : $user->user_login; return array( 'value' => (string) $user->ID, 'label' => sprintf( '%1$s (%2$s, #%3$d)', $label, $user->user_login, $user->ID ), ); } public static function presets($actions) { ob_start(); ?> <div class="su-generator-presets alignright" data-shortcode="<?php echo sanitize_key($_REQUEST['shortcode']); ?>"> <a href="javascript:void(0);" class="button button-large su-gp-button"><i class="sui sui-bars"></i> <?php _e('Presets', 'shortcodes-ultimate'); ?></a> <div class="su-gp-popup"> <div class="su-gp-head"> <a href="javascript:void(0);" class="button button-small button-primary su-gp-new"><?php _e('Save current settings as preset', 'shortcodes-ultimate'); ?></a> </div> <div class="su-gp-list"> <?php self::presets_list(); ?> </div> </div> </div> <?php $actions['presets'] = ob_get_contents(); ob_end_clean(); return $actions; } public static function presets_list($shortcode = false) { // Shortcode isn't specified, try to get it from $_REQUEST if (!$shortcode) $shortcode = $_REQUEST['shortcode']; // Shortcode name is still doesn't exists, exit if (!$shortcode) return; // Shortcode has been specified, sanitize it $shortcode = sanitize_key($shortcode); // Get presets $presets = get_option('su_presets_' . $shortcode); // Presets has been found if (is_array($presets) && count($presets)) { // Print the presets foreach ($presets as $preset) { echo '<span data-id="' . $preset['id'] . '"><em>' . stripslashes($preset['name']) . '</em> <i class="sui sui-times"></i></span>'; } // Hide default text echo sprintf('<b style="display:none">%s</b>', __('Presets not found', 'shortcodes-ultimate')); } // Presets doesn't found else echo sprintf('<b>%s</b>', __('Presets not found', 'shortcodes-ultimate')); } public static function ajax_add_preset() { self::access(); // Check incoming data if (empty($_POST['id'])) return; if (empty($_POST['name'])) return; if (empty($_POST['settings'])) return; if (empty($_POST['shortcode'])) return; // Check Nonce if ( empty($_POST['nonce']) || !is_string($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'su_generator_preset') ) { return; } // Clean-up incoming data $id = sanitize_key($_POST['id']); $name = sanitize_text_field($_POST['name']); $shortcode = sanitize_key($_POST['shortcode']); // Validate and sanitize settings $settings = is_array($_POST['settings']) ? stripslashes_deep($_POST['settings']) : array(); $settings = array_map('wp_kses_post', $settings); // Prepare option name $option = 'su_presets_' . $shortcode; // Get the existing presets $current = get_option($option); // Create array with new preset $new = array( 'id' => $id, 'name' => $name, 'settings' => $settings, ); // Add new array to the option value if (!is_array($current)) $current = array(); $current[$id] = $new; // Save updated option update_option($option, $current); // Clear cache delete_transient('su/generator/settings/' . $shortcode); } public static function ajax_remove_preset() { self::access(); // Check incoming data if (empty($_POST['id'])) return; if (empty($_POST['shortcode'])) return; // Check Nonce if ( empty($_POST['nonce']) || !is_string($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'su_generator_preset') ) { return; } // Clean-up incoming data $id = sanitize_key($_POST['id']); $shortcode = sanitize_key($_POST['shortcode']); // Prepare option name $option = 'su_presets_' . $shortcode; // Get the existing presets $current = get_option($option); // Check that preset is exists if (!is_array($current) || empty($current[$id])) return; // Remove preset unset($current[$id]); // Save updated option update_option($option, $current); // Clear cache delete_transient('su/generator/settings/' . $shortcode); } public static function ajax_get_preset() { self::access(); // Check incoming data if (empty($_GET['id'])) return; if (empty($_GET['shortcode'])) return; // Check Nonce if ( empty($_GET['nonce']) || !is_string($_GET['nonce']) || !wp_verify_nonce($_GET['nonce'], 'su_generator_preset') ) { return; } // Clean-up incoming data $id = sanitize_key($_GET['id']); $shortcode = sanitize_key($_GET['shortcode']); // Default data $data = array(); // Get the existing presets $presets = get_option('su_presets_' . $shortcode); // Check that preset is exists if (is_array($presets) && isset($presets[$id]['settings'])) $data = $presets[$id]['settings']; // Print results die(json_encode($data)); } /** * Helper function to create shortcode code with default settings. * * Example output: "[su_button color="#ff0000" ... ] Click me [/su_button]". * * @param mixed $args Array with settings * @since 5.0.0 * @return string Shortcode code */ public static function get_shortcode_code($args) { $defaults = array( 'id' => '', 'number' => 1, 'nested' => false, ); // Accept shortcode ID as a string if (is_string($args)) { $args = array('id' => $args); } $args = wp_parse_args($args, $defaults); // Check shortcode ID if (empty($args['id'])) { return ''; } // Get shortcode data $shortcode = su_get_shortcode($args['id']); // Prepare shortcode prefix $prefix = get_option('su_option_prefix'); // Prepare attributes container $attributes = ''; // Loop through attributes foreach ($shortcode['atts'] as $attr_id => $attribute) { // Skip hidden attributes if (isset($attribute['hidden']) && $attribute['hidden']) { continue; } // Add attribute $attributes .= sprintf(' %s="%s"', esc_html($attr_id), esc_attr($attribute['default'])); } // Create opening tag with attributes $output = "[{$prefix}{$args['id']}{$attributes}]"; // Indent nested shortcodes if ($args['nested']) { $output = "\t" . $output; } // Insert shortcode content if (isset($shortcode['content'])) { if (is_string($shortcode['content'])) { $output .= $shortcode['content']; } // Create complex content else if (is_array($shortcode['content']) && $args['id'] !== $shortcode['content']['id']) { $shortcode['content']['nested'] = true; $output .= self::get_shortcode_code($shortcode['content']); } } // Add closing tag if (isset($shortcode['type']) && $shortcode['type'] === 'wrap') { $output .= "[/{$prefix}{$args['id']}]"; } // Repeat shortcode if ($args['number'] > 1) { $output = implode("\n", array_fill(0, $args['number'], $output)); } // Add line breaks around nested shortcodes if ($args['nested']) { $output = "\n{$output}\n"; } return $output; } /** * Helper function to check if all available addons were activated. * * @since 5.0.5 * @return boolean True if all addons active, False otherwise. */ public static function is_addons_active() { return false; } /** * Get available shortcodes, skipping deprecated ones. * * @since 5.0.5 * @return array Available shortcodes data. */ public static function get_shortcodes() { $shortcodes = su_get_all_shortcodes(); if (get_option('su_option_hide_deprecated')) { $shortcodes = array_filter( $shortcodes, array(__CLASS__, 'filter_deprecated_shortcodes') ); } return $shortcodes; } public static function get_shortcodes_grouped() { $result = []; $groups = su_get_groups(); $shortcodes = self::get_shortcodes(); foreach ($groups as $group => $group_title) { $group_shortcodes = array_filter($shortcodes, function ($shortcode) use ($group) { return $shortcode['group'] === $group; }); if (count($group_shortcodes)) { $result[$group] = [ 'id' => $group, 'title' => $group_title, 'shortcodes' => $group_shortcodes, ]; } } return $result; } /** * Filter shortcodes and skip deprecated ones. * * @since 5.0.5 * @param array $shortcode A single shortcode data. * @return boolean False if shortcode deprecated, True otherwise. */ public static function filter_deprecated_shortcodes($shortcode) { return !isset($shortcode['deprecated']); } /** * Get list of taxonomies as key-value pairs. * * @since 5.0.5 * @return array List of taxonomies. */ public static function get_taxonomies() { $taxes = array(); foreach ((array) get_taxonomies('', 'objects') as $tax) { $taxes[$tax->name] = $tax->label; } return $taxes; } /** * Get list of terms as key-value pairs. * * @since 5.0.5 * @return array List of terms. */ public static function get_terms($tax = 'category', $key = 'id') { $terms = array(); if ($key === 'id') { foreach ((array) get_terms($tax, array('hide_empty' => false)) as $term) { $terms[$term->term_id] = $term->name; } } elseif ($key === 'slug') { foreach ((array) get_terms($tax, array('hide_empty' => false)) as $term) { $terms[$term->slug] = $term->name; } } return $terms; } } new Su_Generator; class Shortcodes_Ultimate_Generator extends Su_Generator { function __construct() { parent::__construct(); } } core/assets.php 0000644 00000024646 15252476777 0007551 0 ustar 00 <?php /** * Class for managing plugin assets */ class Su_Assets { /** * Set of queried assets * * @var array */ static $assets = array( 'css' => array(), 'js' => array() ); /** * Constructor */ function __construct() { // Register add_action( 'wp_head', array( __CLASS__, 'register' ) ); add_action( 'admin_head', array( __CLASS__, 'register' ) ); add_action( 'su/generator/preview/before', array( __CLASS__, 'register' ) ); add_action( 'su/examples/preview/before', array( __CLASS__, 'register' ) ); // Enqueue add_action( 'wp_footer', array( __CLASS__, 'enqueue' ) ); add_action( 'admin_footer', array( __CLASS__, 'enqueue' ) ); // Print add_action( 'su/generator/preview/after', array( __CLASS__, 'prnt' ) ); add_action( 'su/examples/preview/after', array( __CLASS__, 'prnt' ) ); // Custom CSS add_action( 'wp_footer', array( __CLASS__, 'custom_css' ), 99 ); add_action( 'su/generator/preview/after', array( __CLASS__, 'custom_css' ), 99 ); add_action( 'su/examples/preview/after', array( __CLASS__, 'custom_css' ), 99 ); // RTL support add_action( 'su/assets/custom_css/after', array( __CLASS__, 'rtl_shortcodes' ) ); } /** * Register assets */ public static function register() { // Chart.js wp_register_script( 'chartjs', plugins_url( 'vendor/chartjs/chart.js', SU_PLUGIN_FILE ), false, '0.2', true ); // SimpleSlider wp_register_script( 'simpleslider', plugins_url( 'vendor/simpleslider/simpleslider.js', SU_PLUGIN_FILE ), array( 'jquery' ), '1.0.0', true ); wp_register_style( 'simpleslider', plugins_url( 'vendor/simpleslider/simpleslider.css', SU_PLUGIN_FILE ), false, '1.0.0', 'all' ); // Owl Carousel wp_register_script( 'owl-carousel', plugins_url( 'vendor/owl-carousel/owl-carousel.js', SU_PLUGIN_FILE ), array( 'jquery' ), '2.3.4', true ); wp_register_style( 'owl-carousel', plugins_url( 'vendor/owl-carousel/owl-carousel.css', SU_PLUGIN_FILE ), false, '2.3.4', 'all' ); // Animate.css wp_register_style( 'animate', plugins_url( 'vendor/animatecss/animate.css', SU_PLUGIN_FILE ), false, '3.1.1', 'all' ); // InView wp_register_script( 'jquery-inview', plugins_url( 'vendor/jquery-inview/jquery-inview.js', SU_PLUGIN_FILE ), array( 'jquery' ), '1.1.2', true ); // PopperJS wp_register_script( 'popper', plugins_url( 'vendor/popper/popper.min.js', SU_PLUGIN_FILE ), array(), '2.9.2', true ); // Magnific Popup wp_register_style( 'magnific-popup', plugins_url( 'vendor/magnific-popup/magnific-popup.css', SU_PLUGIN_FILE ), false, '1.2.0', 'all' ); wp_register_script( 'magnific-popup', plugins_url( 'vendor/magnific-popup/magnific-popup.js', SU_PLUGIN_FILE ), array( 'jquery' ), '1.2.0', true ); // Swiper if ( ! get_option( 'su_option_hide_deprecated' ) ) { wp_register_script( 'swiper', plugins_url( 'vendor/swiper/swiper.js', SU_PLUGIN_FILE ), array( 'jquery' ), '2.6.1', true ); } // Flickity wp_register_script( 'flickity', plugins_url( 'vendor/flickity/flickity.js', SU_PLUGIN_FILE ), array(), '2.2.1', true ); wp_register_style( 'flickity', plugins_url( 'vendor/flickity/flickity.css', SU_PLUGIN_FILE ), array(), '2.2.1', 'all' ); // jPlayer wp_register_script( 'jplayer', plugins_url( 'vendor/jplayer/jplayer.js', SU_PLUGIN_FILE ), array( 'jquery' ), '2.4.0', true ); // Generator wp_register_style( 'su-generator', plugins_url( 'admin/css/generator.css', SU_PLUGIN_FILE ), array( 'farbtastic', 'magnific-popup', 'simpleslider' ), SU_PLUGIN_VERSION, 'all' ); wp_register_script( 'su-generator', plugins_url( 'includes/js/generator/index.js', SU_PLUGIN_FILE ), array( 'farbtastic', 'magnific-popup', 'jquery-ui-sortable', 'simpleslider' ), SU_PLUGIN_VERSION, true ); wp_localize_script( 'su-generator', 'SUGL10n', array( 'upload_title' => __( 'Choose file', 'shortcodes-ultimate' ), 'upload_insert' => __( 'Insert', 'shortcodes-ultimate' ), 'isp_media_title' => __( 'Select images', 'shortcodes-ultimate' ), 'isp_media_insert' => __( 'Add selected images', 'shortcodes-ultimate' ), 'presets_prompt_msg' => __( 'Please enter a name for new preset', 'shortcodes-ultimate' ), 'presets_prompt_value' => __( 'New preset', 'shortcodes-ultimate' ), 'last_used' => __( 'Last used settings', 'shortcodes-ultimate' ), 'remove_selected' => __( 'Remove selected item', 'shortcodes-ultimate' ), ) ); // Shortcodes stylesheets wp_register_style( 'su-shortcodes', plugins_url( 'includes/css/shortcodes.css', SU_PLUGIN_FILE ), false, SU_PLUGIN_VERSION, 'all' ); // Plugin Icons (Fork Awesome) wp_register_style( 'su-icons', plugins_url( 'includes/css/icons.css', SU_PLUGIN_FILE ), false, '1.1.5', 'all' ); // DEPRECATED - Shortcodes stylesheets // wp_register_style( 'su-content-shortcodes', '', false, SU_PLUGIN_VERSION, 'all' ); // wp_register_style( 'su-box-shortcodes', '', false, SU_PLUGIN_VERSION, 'all' ); // wp_register_style( 'su-media-shortcodes', '', false, SU_PLUGIN_VERSION, 'all' ); // wp_register_style( 'su-other-shortcodes', '', false, SU_PLUGIN_VERSION, 'all' ); // wp_register_style( 'su-galleries-shortcodes', '', false, SU_PLUGIN_VERSION, 'all' ); // wp_register_style( 'su-players-shortcodes', '', false, SU_PLUGIN_VERSION, 'all' ); // RTL stylesheets wp_register_style( 'su-rtl-shortcodes', plugins_url( 'includes/css/rtl-shortcodes.css', SU_PLUGIN_FILE ), false, SU_PLUGIN_VERSION, 'all' ); wp_register_style( 'su-rtl-admin', plugins_url( 'admin/css/rtl-admin.css', SU_PLUGIN_FILE ), false, SU_PLUGIN_VERSION, 'all' ); // Shortcodes scripts wp_register_script( 'su-shortcodes', plugins_url( 'includes/js/shortcodes/index.js', SU_PLUGIN_FILE ), array( 'jquery' ), SU_PLUGIN_VERSION, true ); wp_localize_script( 'su-shortcodes', 'SUShortcodesL10n', array( 'noPreview' => __( 'This shortcode doesn\'t work in live preview. Please insert it into editor and preview on the site.', 'shortcodes-ultimate' ), 'magnificPopup' => array( 'close' => __( 'Close (Esc)', 'shortcodes-ultimate' ), 'loading' => __( 'Loading...', 'shortcodes-ultimate' ), 'prev' => __( 'Previous (Left arrow key)', 'shortcodes-ultimate' ), 'next' => __( 'Next (Right arrow key)', 'shortcodes-ultimate' ), // translators: %1$s of %2$s represents image counter in lightbox, will be replaced with "1 of 5" 'counter' => sprintf( __( '%1$s of %2$s', 'shortcodes-ultimate' ), '%curr%', '%total%' ), 'error' => sprintf( // translators: %1$s and %2$s will be replace <a> and </a> tags __( 'Failed to load content. %1$sOpen link%2$s' ), '<a href="%url%" target="_blank"><u>', '</u></a>' ), ), ) ); // Hook to deregister assets or add custom do_action( 'su/assets/register' ); } /** * Enqueue assets */ public static function enqueue() { // Get assets query and plugin object $assets = self::assets(); // Enqueue stylesheets foreach ( $assets['css'] as $style ) wp_enqueue_style( $style ); // Enqueue scripts foreach ( $assets['js'] as $script ) wp_enqueue_script( $script ); // Hook to dequeue assets or add custom do_action( 'su/assets/enqueue', $assets ); } /** * Print assets without enqueuing */ public static function prnt() { // Prepare assets set $assets = self::assets(); // Enqueue stylesheets wp_print_styles( $assets['css'] ); // Enqueue scripts wp_print_scripts( $assets['js'] ); // Hook do_action( 'su/assets/print', $assets ); } /** * Print custom CSS */ public static function custom_css() { // Get custom CSS and apply filters to it $custom_css = (string) apply_filters( 'su/assets/custom_css', get_option( 'su_option_custom-css' ) ); $template = '%1$s<!-- %2$s - %3$s -->%1$s<style type="text/css">%1$s%5$s%1$s</style>%1$s<!-- %2$s - %4$s -->%1$s'; $template = apply_filters( 'su/assets/custom_css/template', $template ); if ( ! empty( $custom_css ) ) { $custom_css = str_replace( array( '%theme_url%', '%home_url%', '%plugin_url%' ), array( trailingslashit( get_stylesheet_directory_uri() ), trailingslashit( get_option( 'home' ) ), trailingslashit( plugins_url( '', SU_PLUGIN_FILE ) ), ), $custom_css ); printf( $template, PHP_EOL, 'Shortcodes Ultimate custom CSS', 'start', 'end', strip_tags( $custom_css ) ); } // Hook do_action( 'su/assets/custom_css/after' ); } /** * RTL support for shortcodes */ public static function rtl_shortcodes( $assets ) { // Check RTL if ( !is_rtl() ) return; // Add RTL stylesheets wp_print_styles( array( 'su-rtl-shortcodes' ) ); } /** * RTL support for admin */ public static function rtl_admin( $assets ) { // Check RTL if ( !is_rtl() ) return; // Add RTL stylesheets self::add( 'css', 'su-rtl-admin' ); } /** * Add asset to the query */ public static function add( $type, $handle ) { // Array with handles if ( is_array( $handle ) ) { foreach ( $handle as $h ) self::$assets[$type][$h] = $h; } // Single handle else self::$assets[$type][$handle] = $handle; } /** * Get queried assets */ public static function assets() { // Get assets query $assets = self::$assets; // Apply filters to assets set $assets['css'] = array_unique( ( array ) apply_filters( 'su/assets/css', ( array ) array_unique( $assets['css'] ) ) ); $assets['js'] = array_unique( ( array ) apply_filters( 'su/assets/js', ( array ) array_unique( $assets['js'] ) ) ); // Return set return $assets; } /** * Helper to get full URL of a skin file */ public static function skin_url( $file = '' ) { $skin = get_option( 'su_option_skin' ); $uploads = wp_upload_dir(); $uploads = $uploads['baseurl']; // Prepare url to skin directory $url = ( !$skin || $skin === 'default' ) ? plugins_url( 'assets/css/', SU_PLUGIN_FILE ) : $uploads . '/shortcodes-ultimate-skins/' . $skin; return trailingslashit( apply_filters( 'su/assets/skin', $url ) ) . $file; } } new Su_Assets; /** * Helper function to add asset to the query * * @param string $type Asset type (css|js) * @param mixed $handle Asset handle or array with handles */ function su_query_asset( $type, $handle ) { Su_Assets::add( $type, $handle ); } /** * Helper function to get current skin url * * @param string $file Asset file name. Example value: box-shortcodes.css */ function su_skin_url( $file ) { return Su_Assets::skin_url( $file ); } core/generator-views.php 0000644 00000077055 15252476777 0011372 0 ustar 00 <?php /** * Shortcode Generator */ class Su_Generator_Views { /** * Constructor */ function __construct() {} public static function text( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '' ) ); $return = '<input type="text" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" />'; return $return; } public static function textarea( $id, $field ) { $field = wp_parse_args( $field, array( 'rows' => 3, 'default' => '' ) ); $return = '<textarea name="' . $id . '" id="su-generator-attr-' . $id . '" rows="' . $field['rows'] . '" class="su-generator-attr">' . esc_textarea( $field['default'] ) . '</textarea>'; return $return; } public static function select( $id, $field ) { // Multiple selects $multiple = isset( $field['multiple'] ) && $field['multiple'] ? ' multiple' : ''; $return = '<select name="' . $id . '" id="su-generator-attr-' . $id . '" class="su-generator-attr"' . $multiple . '>'; // Create options foreach ( $field['values'] as $option_value => $option_title ) { // Is this option selected $selected = ( $field['default'] === $option_value ) ? ' selected="selected"' : ''; $is_pro = strpos($option_value, '_PRO-') === 0; $disabled = $is_pro ? ' disabled="disabled"' : ''; // Create option $return .= '<option value="' . $option_value . '"' . $selected . $disabled . '>' . $option_title . '</option>'; } $return .= '</select>'; return $return; } public static function radio( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '', 'layout' => 'vertical', 'values' => array(), ) ); $options = array(); foreach ( $field['values'] as $option_value => $option_label ) { $option_value = (string) $option_value; if ( is_array( $option_label ) ) { $option_label = isset( $option_label['label'] ) ? $option_label['label'] : $option_value; } $options[ $option_value ] = (string) $option_label; } if ( empty( $options ) ) { return ''; } $default = (string) $field['default']; if ( ! isset( $options[ $default ] ) ) { $default = (string) key( $options ); } $layout = sanitize_key( $field['layout'] ); if ( 'horizontal' !== $layout ) { $layout = 'vertical'; } $return = '<div class="su-generator-radio su-generator-radio-layout-' . esc_attr( $layout ) . '" role="radiogroup">'; $return .= '<input type="hidden" name="' . esc_attr( $id ) . '" value="' . esc_attr( $default ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-radio-value" />'; foreach ( $options as $option_value => $option_label ) { $option_id = sanitize_html_class( $id . '-' . $option_value ); if ( '' === $option_id ) { $option_id = md5( $id . '-' . $option_value ); } $is_pro = strpos( $option_value, '_PRO-' ) === 0; $disabled = $is_pro ? ' disabled="disabled"' : ''; $return .= '<label class="su-generator-radio-option" for="su-generator-radio-' . esc_attr( $option_id ) . '">'; $return .= '<input type="radio" name="' . esc_attr( $id . '_radio' ) . '" value="' . esc_attr( $option_value ) . '" id="su-generator-radio-' . esc_attr( $option_id ) . '" class="su-generator-radio-input"' . checked( $default, $option_value, false ) . $disabled . ' />'; $return .= '<span class="su-generator-radio-label">' . esc_html( $option_label ) . '</span>'; $return .= '</label>'; } $return .= '</div>'; return $return; } public static function date_picker( $id, $field ) { return self::picker_input( $id, $field, 'date', 'su-generator-date-picker' ); } public static function datepicker( $id, $field ) { return self::date_picker( $id, $field ); } public static function time_picker( $id, $field ) { return self::picker_input( $id, $field, 'time', 'su-generator-time-picker' ); } public static function timepicker( $id, $field ) { return self::time_picker( $id, $field ); } public static function image_radio( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '', 'values' => array(), ) ); $options = array(); foreach ( $field['values'] as $option_value => $option ) { $option_value = (string) $option_value; if ( is_array( $option ) ) { $label = isset( $option['label'] ) ? $option['label'] : $option_value; $image = isset( $option['image'] ) ? $option['image'] : ''; $alt = isset( $option['alt'] ) ? $option['alt'] : $label; } else { $label = (string) $option; $image = ''; $alt = $label; } $options[ $option_value ] = array( 'label' => $label, 'image' => $image, 'alt' => $alt, ); } if ( empty( $options ) ) { return ''; } $default = (string) $field['default']; if ( ! isset( $options[ $default ] ) ) { $default = (string) key( $options ); } $return = '<div class="su-generator-image-radio">'; $return .= '<input type="hidden" name="' . esc_attr( $id ) . '" value="' . esc_attr( $default ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-image-radio-value" />'; foreach ( $options as $option_value => $option ) { $option_id = sanitize_html_class( $id . '-' . $option_value ); if ( '' === $option_id ) { $option_id = md5( $id . '-' . $option_value ); } $return .= '<label class="su-generator-image-radio-option" for="su-generator-image-radio-' . esc_attr( $option_id ) . '">'; $return .= '<input type="radio" name="' . esc_attr( $id . '_image_radio' ) . '" value="' . esc_attr( $option_value ) . '" id="su-generator-image-radio-' . esc_attr( $option_id ) . '" class="su-generator-image-radio-input"' . checked( $default, $option_value, false ) . ' />'; $return .= '<span class="su-generator-image-radio-card">'; if ( '' !== $option['image'] ) { $return .= '<span class="su-generator-image-radio-image"><img src="' . esc_url( $option['image'] ) . '" alt="' . esc_attr( wp_strip_all_tags( $option['alt'] ) ) . '" /></span>'; } $return .= '<span class="su-generator-image-radio-label">' . esc_html( $option['label'] ) . '</span>'; $return .= '</span>'; $return .= '</label>'; } $return .= '</div>'; return $return; } public static function searchable_select( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '', 'values' => array(), 'multiple' => false, 'placeholder' => __( 'Search...', 'shortcodes-ultimate' ), 'empty' => __( 'No results found', 'shortcodes-ultimate' ), 'loading' => __( 'Loading...', 'shortcodes-ultimate' ), 'too_short' => '', 'taxonomy_field' => '', 'ajax_action' => '', 'ajax_min_length' => '', 'ajax_delay' => '', ) ); $default = is_array( $field['default'] ) ? implode( ',', $field['default'] ) : (string) $field['default']; $data = array( 'data-multiple="' . esc_attr( $field['multiple'] ? 'true' : 'false' ) . '"', 'data-placeholder="' . esc_attr( $field['placeholder'] ) . '"', 'data-empty="' . esc_attr( $field['empty'] ) . '"', 'data-loading="' . esc_attr( $field['loading'] ) . '"', ); if ( $field['taxonomy_field'] ) { $data[] = 'data-taxonomy-field="' . esc_attr( $field['taxonomy_field'] ) . '"'; } if ( $field['too_short'] ) { $data[] = 'data-too-short="' . esc_attr( $field['too_short'] ) . '"'; } if ( $field['ajax_action'] ) { $data[] = 'data-ajax-action="' . esc_attr( $field['ajax_action'] ) . '"'; } if ( '' !== $field['ajax_min_length'] ) { $data[] = 'data-ajax-min-length="' . esc_attr( $field['ajax_min_length'] ) . '"'; } if ( '' !== $field['ajax_delay'] ) { $data[] = 'data-ajax-delay="' . esc_attr( $field['ajax_delay'] ) . '"'; } $return = '<div class="su-generator-searchable-select" ' . implode( ' ', $data ) . '>'; $return .= '<input type="hidden" name="' . esc_attr( $id ) . '" value="' . esc_attr( $default ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-searchable-select-value" />'; $return .= '<div class="su-generator-searchable-select-control">'; $return .= '<span class="su-generator-searchable-select-tokens"></span>'; $return .= '<input type="search" class="su-generator-searchable-select-input" autocomplete="off" spellcheck="false" placeholder="' . esc_attr( $field['placeholder'] ) . '" />'; $return .= '</div>'; $return .= '<div class="su-generator-searchable-select-dropdown" role="listbox">'; if ( is_array( $field['values'] ) ) { foreach ( $field['values'] as $option_value => $option_title ) { $return .= '<button type="button" class="su-generator-searchable-select-option" data-value="' . esc_attr( $option_value ) . '" data-label="' . esc_attr( wp_strip_all_tags( $option_title ) ) . '" role="option">' . esc_html( $option_title ) . '</button>'; } } $return .= '<div class="su-generator-searchable-select-empty">' . esc_html( $field['empty'] ) . '</div>'; $return .= '</div>'; $return .= '</div>'; return $return; } public static function searchable_post_type( $id, $field ) { $types = get_post_types( array(), 'objects', 'or' ); $field['values'] = array( 'any' => __( 'Any post type', 'shortcodes-ultimate' ), ); foreach( $types as $type ) { $field['values'][$type->name] = $type->label; } if ( ! isset( $field['placeholder'] ) ) { $field['placeholder'] = __( 'Search post types', 'shortcodes-ultimate' ); } return self::searchable_select( $id, $field ); } public static function searchable_taxonomy( $id, $field ) { $taxonomies = get_taxonomies( array(), 'objects', 'or' ); $field['values'] = array( 'any' => __( 'Any taxonomy', 'shortcodes-ultimate' ), ); foreach( $taxonomies as $taxonomy ) { $field['values'][$taxonomy->name] = $taxonomy->label; } if ( ! isset( $field['placeholder'] ) ) { $field['placeholder'] = __( 'Search taxonomies', 'shortcodes-ultimate' ); } return self::searchable_select( $id, $field ); } public static function searchable_term( $id, $field ) { if ( empty( $field['values'] ) && ! empty( $field['taxonomy'] ) ) { $field['values'] = Su_Generator::get_terms( $field['taxonomy'] ); } if ( ! isset( $field['placeholder'] ) ) { $field['placeholder'] = __( 'Search terms', 'shortcodes-ultimate' ); } return self::searchable_select( $id, $field ); } public static function searchable_posts( $id, $field ) { $field = wp_parse_args( $field, array( 'multiple' => true, 'ajax_action' => 'su_generator_search_posts', 'ajax_min_length' => 2, 'ajax_delay' => 250, 'placeholder' => __( 'Search content', 'shortcodes-ultimate' ), 'empty' => __( 'No content found', 'shortcodes-ultimate' ), 'too_short' => __( 'Type at least 2 characters to search content', 'shortcodes-ultimate' ), ) ); return self::searchable_select( $id, $field ); } public static function searchable_users( $id, $field ) { $field = wp_parse_args( $field, array( 'multiple' => true, 'ajax_action' => 'su_generator_search_users', 'ajax_min_length' => 2, 'ajax_delay' => 250, 'placeholder' => __( 'Search users', 'shortcodes-ultimate' ), 'empty' => __( 'No users found', 'shortcodes-ultimate' ), 'too_short' => __( 'Type at least 2 characters to search users', 'shortcodes-ultimate' ), ) ); return self::searchable_select( $id, $field ); } public static function sortable_checkboxes( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '', 'values' => array(), ) ); $default = is_array( $field['default'] ) ? implode( ', ', $field['default'] ) : (string) $field['default']; $selected = array_filter( array_map( 'trim', explode( ',', $default ) ) ); $selected = array_values( array_intersect( $selected, array_keys( $field['values'] ) ) ); $values = array(); foreach ( $selected as $value ) { $values[ $value ] = $field['values'][ $value ]; } foreach ( $field['values'] as $value => $label ) { if ( ! isset( $values[ $value ] ) ) { $values[ $value ] = $label; } } $return = '<div class="su-generator-sortable-checkboxes">'; $return .= '<input type="hidden" name="' . esc_attr( $id ) . '" value="' . esc_attr( $default ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-sortable-checkboxes-value" />'; $return .= '<ul class="su-generator-sortable-checkboxes-list">'; foreach ( $values as $option_value => $option_label ) { $option_id = sanitize_html_class( $id . '-' . $option_value ); $checked = in_array( $option_value, $selected, true ) ? ' checked="checked"' : ''; $return .= '<li class="su-generator-sortable-checkboxes-item" data-value="' . esc_attr( $option_value ) . '">'; $return .= '<span class="su-generator-sortable-checkboxes-handle" aria-hidden="true"><i class="sui sui-bars"></i></span>'; $return .= '<label class="su-generator-sortable-checkboxes-label" for="su-generator-sortable-checkboxes-' . esc_attr( $option_id ) . '">'; $return .= '<input type="checkbox" id="su-generator-sortable-checkboxes-' . esc_attr( $option_id ) . '" class="su-generator-sortable-checkboxes-input" value="' . esc_attr( $option_value ) . '"' . $checked . ' />'; $return .= '<span class="su-generator-sortable-checkboxes-text">' . esc_html( $option_label ) . '</span>'; $return .= '</label>'; $return .= '</li>'; } $return .= '</ul>'; $return .= '</div>'; return $return; } public static function post_type( $id, $field ) { // Get post types $types = get_post_types( array(), 'objects', 'or' ); // Prepare empty array for values $field['values'] = array( 'any' => __( 'Any post type', 'shortcodes-ultimate' ), ); // Fill the array foreach( $types as $type ) { $field['values'][$type->name] = $type->label; } // Create select return self::select( $id, $field ); } public static function taxonomy( $id, $field ) { // Get taxonomies $taxonomies = get_taxonomies( array(), 'objects', 'or' ); // Prepare array for values $field['values'] = isset( $field['default'] ) && 'any' === $field['default'] ? array( 'any' => __( 'Any taxonomy', 'shortcodes-ultimate' ) ) : array(); // Fill the array foreach( $taxonomies as $taxonomy ) { $field['values'][$taxonomy->name] = $taxonomy->label; } // Create select return self::select( $id, $field ); } public static function term( $id, $field ) { // Get categories $field['values'] = Su_Generator::get_terms( 'category' ); // Create select return self::select( $id, $field ); } public static function bool( $id, $field ) { $value = ( 'yes' === $field['default'] ) ? 'yes' : 'no'; $checked = ( 'yes' === $value ) ? 'true' : 'false'; $return = '<button type="button" class="su-generator-switch su-generator-switch-' . esc_attr( $value ) . '" role="switch" aria-checked="' . esc_attr( $checked ) . '"><span class="su-generator-switch-track" aria-hidden="true"><span class="su-generator-switch-thumb"></span></span><span class="su-generator-switch-text su-generator-yes">' . __( 'Yes', 'shortcodes-ultimate' ) . '</span><span class="su-generator-switch-text su-generator-no">' . __( 'No', 'shortcodes-ultimate' ) . '</span></button><input type="hidden" name="' . esc_attr( $id ) . '" value="' . esc_attr( $value ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-switch-value" />'; return $return; } public static function upload( $id, $field ) { $return = '<input type="text" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" class="su-generator-attr su-generator-upload-value" /><div class="su-generator-field-actions"><a href="javascript:;" class="button su-generator-upload-button"><img src="' . admin_url( '/images/media-button.png' ) . '" alt="' . __( 'Open Media Library', 'shortcodes-ultimate' ) . '" />' . __( 'Open Media Library', 'shortcodes-ultimate' ) . '</a></div>'; return $return; } public static function icon( $id, $field ) { $return = '<input type="text" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" class="su-generator-attr su-generator-icon-picker-value" /><div class="su-generator-field-actions"><a href="javascript:;" class="button su-generator-upload-button su-generator-field-action"><img src="' . admin_url( '/images/media-button.png' ) . '" alt="' . __( 'Open Media Library', 'shortcodes-ultimate' ) . '" />' . __( 'Open Media Library', 'shortcodes-ultimate' ) . '</a> <a href="javascript:;" class="button su-generator-icon-picker-button su-generator-field-action"><img src="' . admin_url( '/images/media-button-other.gif' ) . '" alt="' . __( 'Icon picker', 'shortcodes-ultimate' ) . '" />' . __( 'Icon picker', 'shortcodes-ultimate' ) . '</a></div><div class="su-generator-icon-picker su-generator-clearfix"><input type="text" class="widefat" placeholder="' . __( 'Filter icons', 'shortcodes-ultimate' ) . '" /></div>'; return $return; } public static function color( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '', 'allow_transparent' => false, ) ); $allow_transparent = ! empty( $field['allow_transparent'] ); $is_transparent = 'transparent' === strtolower( trim( (string) $field['default'] ) ); $classes = array( 'su-generator-select-color' ); if ( $allow_transparent ) { $classes[] = 'su-generator-select-color-allow-transparent'; } $return = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">'; $return .= '<span class="su-generator-select-color-wheel"></span>'; $return .= '<span class="su-generator-select-color-control">'; $return .= '<input type="text" name="' . esc_attr( $id ) . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-select-color-value" />'; if ( $allow_transparent ) { $return .= '<label class="su-generator-select-color-transparent">'; $return .= '<input type="checkbox" class="su-generator-select-color-transparent-input" aria-controls="su-generator-attr-' . esc_attr( $id ) . '" ' . checked( $is_transparent, true, false ) . ' />'; $return .= '<span class="su-generator-select-color-transparent-label">' . esc_html__( 'Transparent', 'shortcodes-ultimate' ) . '</span>'; $return .= '</label>'; } $return .= '</span>'; $return .= '</span>'; return $return; } public static function number( $id, $field ) { $return = '<input type="number" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" min="' . $field['min'] . '" max="' . $field['max'] . '" step="' . $field['step'] . '" class="su-generator-attr" />'; return $return; } public static function slider( $id, $field ) { $return = '<div class="su-generator-range-picker su-generator-clearfix"><input type="number" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" min="' . $field['min'] . '" max="' . $field['max'] . '" step="' . $field['step'] . '" class="su-generator-attr" /></div>'; return $return; } public static function shadow( $id, $field ) { $defaults = ( $field['default'] === 'none' ) ? array ( '0', '0', '0', '#000000' ) : explode( ' ', str_replace( 'px', '', $field['default'] ) ); $return = '<div class="su-generator-shadow-picker"><span class="su-generator-shadow-picker-field"><input type="number" min="-1000" max="1000" step="1" value="' . $defaults[0] . '" class="su-generator-sp-hoff" /><small>' . __( 'Horizontal offset', 'shortcodes-ultimate' ) . ' (px)</small></span><span class="su-generator-shadow-picker-field"><input type="number" min="-1000" max="1000" step="1" value="' . $defaults[1] . '" class="su-generator-sp-voff" /><small>' . __( 'Vertical offset', 'shortcodes-ultimate' ) . ' (px)</small></span><span class="su-generator-shadow-picker-field"><input type="number" min="-1000" max="1000" step="1" value="' . $defaults[2] . '" class="su-generator-sp-blur" /><small>' . __( 'Blur', 'shortcodes-ultimate' ) . ' (px)</small></span><span class="su-generator-shadow-picker-field su-generator-shadow-picker-color"><span class="su-generator-shadow-picker-color-wheel"></span><input type="text" value="' . $defaults[3] . '" class="su-generator-shadow-picker-color-value" /><small>' . __( 'Color', 'shortcodes-ultimate' ) . '</small></span><input type="hidden" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" /></div>'; return $return; } public static function border( $id, $field ) { $defaults = ( $field['default'] === 'none' ) ? array ( '0', 'solid', '#000000' ) : explode( ' ', str_replace( 'px', '', $field['default'] ) ); $borders = su_html_dropdown( array( 'options' => su_get_config( 'borders' ), 'class' => 'su-generator-bp-style', 'selected' => $defaults[1] ) ); $return = '<div class="su-generator-border-picker"><span class="su-generator-border-picker-field"><input type="number" min="-1000" max="1000" step="1" value="' . $defaults[0] . '" class="su-generator-bp-width" /><small>' . __( 'Border width', 'shortcodes-ultimate' ) . ' (px)</small></span><span class="su-generator-border-picker-field">' . $borders . '<small>' . __( 'Border style', 'shortcodes-ultimate' ) . '</small></span><span class="su-generator-border-picker-field su-generator-border-picker-color"><span class="su-generator-border-picker-color-wheel"></span><input type="text" value="' . $defaults[2] . '" class="su-generator-border-picker-color-value" /><small>' . __( 'Border color', 'shortcodes-ultimate' ) . '</small></span><input type="hidden" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" /></div>'; return $return; } public static function border_new( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '1px solid #000000', ) ); $defaults = self::parse_border_new_value( $field['default'] ); $styles = su_get_config( 'borders', array( 'solid' => __( 'Solid', 'shortcodes-ultimate' ), 'dotted' => __( 'Dotted', 'shortcodes-ultimate' ), 'dashed' => __( 'Dashed', 'shortcodes-ultimate' ), 'double' => __( 'Double', 'shortcodes-ultimate' ), 'groove' => __( 'Groove', 'shortcodes-ultimate' ), 'ridge' => __( 'Ridge', 'shortcodes-ultimate' ), ) ); unset( $styles['none'] ); if ( empty( $styles ) ) { $styles = array( 'solid' => __( 'Solid', 'shortcodes-ultimate' ), 'dotted' => __( 'Dotted', 'shortcodes-ultimate' ), 'dashed' => __( 'Dashed', 'shortcodes-ultimate' ), 'double' => __( 'Double', 'shortcodes-ultimate' ), 'groove' => __( 'Groove', 'shortcodes-ultimate' ), 'ridge' => __( 'Ridge', 'shortcodes-ultimate' ), ); } if ( ! isset( $styles[ $defaults['style'] ] ) ) { $defaults['style'] = 'solid'; } $width_options = ''; $style_options = ''; $popover_id = 'su-generator-border-new-popover-' . sanitize_html_class( $id ); foreach ( range( 0, 15 ) as $width ) { $value = $width . 'px'; $width_options .= '<option value="' . esc_attr( $value ) . '"' . selected( $defaults['width'], $value, false ) . '>' . esc_html( $value ) . '</option>'; } foreach ( $styles as $style_value => $style_label ) { $style_options .= '<option value="' . esc_attr( $style_value ) . '"' . selected( $defaults['style'], $style_value, false ) . '>' . esc_html( $style_label ) . '</option>'; } $return = '<div class="su-generator-border-new">'; $return .= '<select class="su-generator-border-new-width" aria-label="' . esc_attr__( 'Border width', 'shortcodes-ultimate' ) . '">' . $width_options . '</select>'; $return .= '<select class="su-generator-border-new-style" aria-label="' . esc_attr__( 'Border style', 'shortcodes-ultimate' ) . '">' . $style_options . '</select>'; $return .= '<div class="su-generator-border-new-color">'; $return .= '<button type="button" class="button su-generator-border-new-color-button" aria-expanded="false" aria-controls="' . esc_attr( $popover_id ) . '">'; $return .= '<span class="su-generator-border-new-color-swatch"><span class="su-generator-border-new-color-swatch-color" style="background-color:' . esc_attr( $defaults['css_color'] ) . '"></span></span>'; $return .= '<span class="su-generator-border-new-color-label">' . esc_html( $defaults['label'] ) . '</span>'; $return .= '</button>'; $return .= '<div id="' . esc_attr( $popover_id ) . '" class="su-generator-border-new-popover" hidden>'; $return .= '<div class="su-generator-border-new-color-wheel"></div>'; $return .= '<label class="su-generator-border-new-color-field"><span>' . esc_html__( 'Color', 'shortcodes-ultimate' ) . '</span><input type="text" class="su-generator-border-new-color-value" value="' . esc_attr( $defaults['hex'] ) . '" /></label>'; $return .= '<label class="su-generator-border-new-alpha-field"><span>' . esc_html__( 'Opacity', 'shortcodes-ultimate' ) . '</span><input type="range" min="0" max="100" step="1" class="su-generator-border-new-alpha-range" value="' . esc_attr( $defaults['alpha'] ) . '" /><input type="number" min="0" max="100" step="1" class="su-generator-border-new-alpha-value" value="' . esc_attr( $defaults['alpha'] ) . '" /></label>'; $return .= '</div>'; $return .= '</div>'; $return .= '<input type="hidden" name="' . esc_attr( $id ) . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . esc_attr( $id ) . '" class="su-generator-attr su-generator-border-new-value" />'; $return .= '</div>'; return $return; } public static function image_source( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => 'none' ) ); if ( ! isset( $field['media_sources'] ) ) { $field['media_sources'] = array( 'media' => __( 'Media library', 'shortcodes-ultimate' ), 'posts: recent' => __( 'Recent posts', 'shortcodes-ultimate' ), 'taxonomy' => __( 'Taxonomy', 'shortcodes-ultimate' ), ); } $sources = su_html_dropdown( array( 'options' => $field['media_sources'], 'selected' => '0', 'none' => __( 'Select images source', 'shortcodes-ultimate' ) . '…', 'class' => 'su-generator-isp-sources' ) ); $categories = su_html_dropdown( array( 'options' => Su_Generator::get_terms( 'category' ), 'multiple' => true, 'size' => 10, 'class' => 'su-generator-isp-categories' ) ); $taxonomies = su_html_dropdown( array( 'options' => Su_Generator::get_taxonomies(), 'none' => __( 'Select taxonomy', 'shortcodes-ultimate' ) . '…', 'selected' => '0', 'class' => 'su-generator-isp-taxonomies' ) ); $terms = su_html_dropdown( array( 'class' => 'su-generator-isp-terms', 'multiple' => true, 'size' => 10, 'disabled' => true, 'style' => 'display:none' ) ); $return = '<div class="su-generator-isp">' . $sources . '<div class="su-generator-isp-source su-generator-isp-source-media"><div class="su-generator-clearfix"><a href="javascript:;" class="button button-primary su-generator-isp-add-media"><i class="sui sui-plus"></i> ' . __( 'Add images', 'shortcodes-ultimate' ) . '</a></div><div class="su-generator-isp-images su-generator-clearfix"><em class="description">' . __( 'Click the button above and select images.<br>You can select multimple images with Ctrl (Cmd) key', 'shortcodes-ultimate' ) . '</em></div></div><div class="su-generator-isp-source su-generator-isp-source-category"><em class="description">' . __( 'Select categories to retrieve posts from.<br>You can select multiple categories with Ctrl (Cmd) key', 'shortcodes-ultimate' ) . '</em>' . $categories . '</div><div class="su-generator-isp-source su-generator-isp-source-taxonomy"><em class="description">' . __( 'Select taxonomy and it\'s terms.<br>You can select multiple terms with Ctrl (Cmd) key', 'shortcodes-ultimate' ) . '</em>' . $taxonomies . $terms . '</div><input type="hidden" name="' . $id . '" value="' . $field['default'] . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" /></div>'; return $return; } public static function extra_css_class( $id, $field ) { $field = wp_parse_args( $field, array( 'default' => '' ) ); $return = '<input type="text" name="' . $id . '" value="' . esc_attr( $field['default'] ) . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" />'; return $return; } private static function picker_input( $id, $field, $type, $class ) { $field = wp_parse_args( $field, array( 'default' => '', 'max' => '', 'min' => '', 'placeholder' => '', 'step' => '', ) ); $attributes = array( 'type="' . esc_attr( $type ) . '"', 'name="' . esc_attr( $id ) . '"', 'value="' . esc_attr( $field['default'] ) . '"', 'id="su-generator-attr-' . esc_attr( $id ) . '"', 'class="su-generator-attr ' . esc_attr( $class ) . '"', ); foreach ( array( 'min', 'max', 'step', 'placeholder' ) as $attribute ) { if ( '' !== (string) $field[ $attribute ] ) { $attributes[] = $attribute . '="' . esc_attr( $field[ $attribute ] ) . '"'; } } return '<input ' . implode( ' ', $attributes ) . ' />'; } private static function parse_border_new_value( $value ) { $parsed = array( 'width' => '1px', 'style' => 'solid', 'hex' => '#000000', 'alpha' => 100, 'css_color' => '#000000', 'label' => '#000000', ); $value = trim( (string) $value ); if ( 'none' === strtolower( $value ) ) { $parsed['width'] = '0px'; $parsed['alpha'] = 0; } elseif ( preg_match( '/^(\d+(?:\.\d+)?)px\s+([a-z-]+)\s+(.+)$/i', $value, $matches ) ) { $width = intval( $matches[1] ); if ( $width >= 0 && $width <= 15 ) { $parsed['width'] = $width . 'px'; } $parsed['style'] = sanitize_key( $matches[2] ); $color = self::parse_border_new_color( $matches[3] ); $parsed['hex'] = $color['hex']; $parsed['alpha'] = $color['alpha']; } $parsed['css_color'] = self::format_border_new_color( $parsed['hex'], $parsed['alpha'] ); $parsed['label'] = $parsed['css_color']; return $parsed; } private static function parse_border_new_color( $value ) { $value = trim( (string) $value ); if ( 'transparent' === strtolower( $value ) ) { return array( 'hex' => '#000000', 'alpha' => 0, ); } if ( preg_match( '/^#?([a-f0-9]{3}|[a-f0-9]{6})$/i', $value, $matches ) ) { $hex = strtolower( $matches[1] ); if ( 3 === strlen( $hex ) ) { $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; } return array( 'hex' => '#' . $hex, 'alpha' => 100, ); } if ( preg_match( '/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*([0-9.]+)\s*)?\)$/i', $value, $matches ) ) { $red = max( 0, min( 255, intval( $matches[1] ) ) ); $green = max( 0, min( 255, intval( $matches[2] ) ) ); $blue = max( 0, min( 255, intval( $matches[3] ) ) ); $alpha = isset( $matches[4] ) && '' !== $matches[4] ? max( 0, min( 1, floatval( $matches[4] ) ) ) : 1; return array( 'hex' => sprintf( '#%02x%02x%02x', $red, $green, $blue ), 'alpha' => (int) round( $alpha * 100 ), ); } return array( 'hex' => '#000000', 'alpha' => 100, ); } private static function format_border_new_color( $hex, $alpha ) { $alpha = max( 0, min( 100, intval( $alpha ) ) ); if ( $alpha >= 100 ) { return $hex; } $hex = ltrim( $hex, '#' ); $red = hexdec( substr( $hex, 0, 2 ) ); $green = hexdec( substr( $hex, 2, 2 ) ); $blue = hexdec( substr( $hex, 4, 2 ) ); $value = rtrim( rtrim( sprintf( '%.2F', $alpha / 100 ), '0' ), '.' ); return sprintf( 'rgba(%d,%d,%d,%s)', $red, $green, $blue, $value ); } } icon-functions.php 0000644 00000016155 15252477153 0010236 0 ustar 00 <?php /** * SVG icons related functions and filters * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Add SVG definitions to the footer. */ function twentyseventeen_include_svg_icons() { // Define SVG sprite file. $svg_icons = get_parent_theme_file_path( '/assets/images/svg-icons.svg' ); // If it exists, include it. if ( file_exists( $svg_icons ) ) { require_once $svg_icons; } } add_action( 'wp_footer', 'twentyseventeen_include_svg_icons', 9999 ); /** * Return SVG markup. * * @param array $args { * Parameters needed to display an SVG. * * @type string $icon Required SVG icon filename. * @type string $title Optional SVG title. * @type string $desc Optional SVG description. * } * @return string SVG markup. */ function twentyseventeen_get_svg( $args = array() ) { // Make sure $args are an array. if ( empty( $args ) ) { return __( 'Please define default parameters in the form of an array.', 'twentyseventeen' ); } // Define an icon. if ( false === array_key_exists( 'icon', $args ) ) { return __( 'Please define an SVG icon filename.', 'twentyseventeen' ); } // Set defaults. $defaults = array( 'icon' => '', 'title' => '', 'desc' => '', 'fallback' => false, ); // Parse args. $args = wp_parse_args( $args, $defaults ); // Set aria hidden. $aria_hidden = ' aria-hidden="true"'; // Set ARIA. $aria_labelledby = ''; /* * Twenty Seventeen doesn't use the SVG title or description attributes; non-decorative icons are described with .screen-reader-text. * * However, child themes can use the title and description to add information to non-decorative SVG icons to improve accessibility. * * Example 1 with title: <?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ) ) ); ?> * * Example 2 with title and description: <?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ), 'desc' => __( 'This is the description', 'textdomain' ) ) ); ?> * * See https://www.paciellogroup.com/blog/2013/12/using-aria-enhance-svg-accessibility/. */ if ( $args['title'] ) { $aria_hidden = ''; $unique_id = twentyseventeen_unique_id(); $aria_labelledby = ' aria-labelledby="title-' . $unique_id . '"'; if ( $args['desc'] ) { $aria_labelledby = ' aria-labelledby="title-' . $unique_id . ' desc-' . $unique_id . '"'; } } // Begin SVG markup. $svg = '<svg class="icon icon-' . esc_attr( $args['icon'] ) . '"' . $aria_hidden . $aria_labelledby . ' role="img">'; // Display the title. if ( $args['title'] ) { $svg .= '<title id="title-' . $unique_id . '">' . esc_html( $args['title'] ) . '</title>'; // Display the desc only if the title is already set. if ( $args['desc'] ) { $svg .= '<desc id="desc-' . $unique_id . '">' . esc_html( $args['desc'] ) . '</desc>'; } } /* * Display the icon. * * The whitespace around `<use>` is intentional - it is a work around to a keyboard navigation bug in Safari 10. * * See https://core.trac.wordpress.org/ticket/38387. */ $svg .= ' <use href="#icon-' . esc_html( $args['icon'] ) . '" xlink:href="#icon-' . esc_html( $args['icon'] ) . '"></use> '; // Add some markup to use as a fallback for browsers that do not support SVGs. if ( $args['fallback'] ) { $svg .= '<span class="svg-fallback icon-' . esc_attr( $args['icon'] ) . '"></span>'; } $svg .= '</svg>'; return $svg; } /** * Display SVG icons in social links menu. * * @param string $item_output The menu item's starting HTML output. * @param WP_Post $item Menu item data object. * @param int $depth Depth of the menu. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @return string The menu item output with social icon. */ function twentyseventeen_nav_menu_social_icons( $item_output, $item, $depth, $args ) { // Get supported social icons. $social_icons = twentyseventeen_social_links_icons(); // Change SVG icon inside social links menu if there is supported URL. if ( 'social' === $args->theme_location ) { foreach ( $social_icons as $attr => $value ) { if ( false !== strpos( $item_output, $attr ) ) { $item_output = str_replace( $args->link_after, '</span>' . twentyseventeen_get_svg( array( 'icon' => esc_attr( $value ) ) ), $item_output ); } } } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'twentyseventeen_nav_menu_social_icons', 10, 4 ); /** * Add dropdown icon if menu item has children. * * @param string $title The menu item's title. * @param WP_Post $item The current menu item. * @param stdClass $args An object of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. * @return string The menu item's title with dropdown icon. */ function twentyseventeen_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) { if ( 'top' === $args->theme_location ) { foreach ( $item->classes as $value ) { if ( 'menu-item-has-children' === $value || 'page_item_has_children' === $value ) { $title = $title . twentyseventeen_get_svg( array( 'icon' => 'angle-down' ) ); } } } return $title; } add_filter( 'nav_menu_item_title', 'twentyseventeen_dropdown_icon_to_menu_link', 10, 4 ); /** * Returns an array of supported social links (URL and icon name). * * @return array Array of social links icons. */ function twentyseventeen_social_links_icons() { // Supported social links icons. $social_links_icons = array( 'behance.net' => 'behance', 'codepen.io' => 'codepen', 'deviantart.com' => 'deviantart', 'digg.com' => 'digg', 'docker.com' => 'dockerhub', 'dribbble.com' => 'dribbble', 'dropbox.com' => 'dropbox', 'facebook.com' => 'facebook', 'flickr.com' => 'flickr', 'foursquare.com' => 'foursquare', 'plus.google.com' => 'google-plus', 'github.com' => 'github', 'instagram.com' => 'instagram', 'linkedin.com' => 'linkedin', 'mailto:' => 'envelope-o', 'medium.com' => 'medium', 'pinterest.com' => 'pinterest-p', 'pscp.tv' => 'periscope', 'getpocket.com' => 'get-pocket', 'reddit.com' => 'reddit-alien', 'skype.com' => 'skype', 'skype:' => 'skype', 'slideshare.net' => 'slideshare', 'snapchat.com' => 'snapchat-ghost', 'soundcloud.com' => 'soundcloud', 'spotify.com' => 'spotify', 'stumbleupon.com' => 'stumbleupon', 't.me' => 'telegram', 'telegram.me' => 'telegram', 'tumblr.com' => 'tumblr', 'twitch.tv' => 'twitch', 'twitter.com' => 'twitter', 'vimeo.com' => 'vimeo', 'vine.co' => 'vine', 'vk.com' => 'vk', 'whatsapp.com' => 'whatsapp', 'wordpress.org' => 'wordpress', 'wordpress.com' => 'wordpress', 'yelp.com' => 'yelp', 'youtube.com' => 'youtube', ); /** * Filter Twenty Seventeen social links icons. * * @since Twenty Seventeen 1.0 * * @param array $social_links_icons Array of social links icons. */ return apply_filters( 'twentyseventeen_social_links_icons', $social_links_icons ); } template-tags.php 0000644 00000015672 15252477153 0010052 0 ustar 00 <?php /** * Custom template tags for this theme * * Eventually, some of the functionality here could be replaced by core features. * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ if ( ! function_exists( 'twentyseventeen_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function twentyseventeen_posted_on() { // Get the author name; wrap it in a link. $byline = sprintf( /* translators: %s: Post author. */ __( 'by %s', 'twentyseventeen' ), '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>' ); // Finally, let's write all of this to the page. echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>'; } endif; if ( ! function_exists( 'twentyseventeen_time_link' ) ) : /** * Gets a nicely formatted string for the published date. */ function twentyseventeen_time_link() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf( $time_string, get_the_date( DATE_W3C ), get_the_date(), get_the_modified_date( DATE_W3C ), get_the_modified_date() ); // Wrap the time string in a link, and preface it with 'Posted on'. return sprintf( /* translators: %s: Post date. */ __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ), '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' ); } endif; if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function twentyseventeen_entry_footer() { /* translators: Used between list items, there is a space after the comma. */ $separate_meta = __( ', ', 'twentyseventeen' ); // Get Categories for posts. $categories_list = get_the_category_list( $separate_meta ); // Get Tags for posts. $tags_list = get_the_tag_list( '', $separate_meta ); // We don't want to output .entry-footer if it will be empty, so make sure its not. if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { echo '<footer class="entry-footer">'; if ( 'post' === get_post_type() ) { if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) { echo '<span class="cat-tags-links">'; // Make sure there's more than one category before displaying. if ( $categories_list && twentyseventeen_categorized_blog() ) { echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>'; } if ( $tags_list && ! is_wp_error( $tags_list ) ) { echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>'; } echo '</span>'; } } twentyseventeen_edit_link(); echo '</footer> <!-- .entry-footer -->'; } } endif; if ( ! function_exists( 'twentyseventeen_edit_link' ) ) : /** * Returns an accessibility-friendly link to edit a post or page. * * This also gives us a little context about what exactly we're editing * (post or page?) so that users understand a bit more where they are in terms * of the template hierarchy and their content. Helpful when/if the single-page * layout with multiple posts/pages shown gets confusing. */ function twentyseventeen_edit_link() { edit_post_link( sprintf( /* translators: %s: Post title. */ __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), get_the_title() ), '<span class="edit-link">', '</span>' ); } endif; /** * Display a front page section. * * @param WP_Customize_Partial $partial Partial associated with a selective refresh request. * @param integer $id Front page section to display. */ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) { if ( is_a( $partial, 'WP_Customize_Partial' ) ) { // Find out the ID and set it up during a selective refresh. global $twentyseventeencounter; $id = str_replace( 'panel_', '', $partial->id ); $twentyseventeencounter = $id; } global $post; // Modify the global post object before setting up post data. if ( get_theme_mod( 'panel_' . $id ) ) { $post = get_post( get_theme_mod( 'panel_' . $id ) ); setup_postdata( $post ); set_query_var( 'panel', $id ); get_template_part( 'template-parts/page/content', 'front-page-panels' ); wp_reset_postdata(); } elseif ( is_customize_preview() ) { // The output placeholder anchor. printf( '<article class="panel-placeholder panel twentyseventeen-panel twentyseventeen-panel%1$s" id="panel%1$s">' . '<span class="twentyseventeen-panel-title">%2$s</span></article>', $id, /* translators: %s: The section ID. */ sprintf( __( 'Front Page Section %s Placeholder', 'twentyseventeen' ), $id ) ); } } /** * Returns true if a blog has more than 1 category. * * @return bool */ function twentyseventeen_categorized_blog() { $category_count = get_transient( 'twentyseventeen_categories' ); if ( false === $category_count ) { // Create an array of all the categories that are attached to posts. $categories = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $category_count = count( $categories ); set_transient( 'twentyseventeen_categories', $category_count ); } // Allow viewing case of 0 or 1 categories in post preview. if ( is_preview() ) { return true; } return $category_count > 1; } /** * Flush out the transients used in twentyseventeen_categorized_blog. */ function twentyseventeen_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'twentyseventeen_categories' ); } add_action( 'edit_category', 'twentyseventeen_category_transient_flusher' ); add_action( 'save_post', 'twentyseventeen_category_transient_flusher' ); if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * * Added for backward compatibility to support pre-5.2.0 WordPress versions. * * @since Twenty Seventeen 2.2 */ function wp_body_open() { /** * Triggered after the opening <body> tag. * * @since Twenty Seventeen 2.2 */ do_action( 'wp_body_open' ); } endif; customizer.php 0000644 00000015345 15252477153 0007504 0 ustar 00 <?php /** * Twenty Seventeen: Customizer * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function twentyseventeen_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'twentyseventeen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'twentyseventeen_customize_partial_blogdescription', ) ); /** * Custom colors. */ $wp_customize->add_setting( 'colorscheme', array( 'default' => 'light', 'transport' => 'postMessage', 'sanitize_callback' => 'twentyseventeen_sanitize_colorscheme', ) ); $wp_customize->add_setting( 'colorscheme_hue', array( 'default' => 250, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', // The hue is stored as a positive integer. ) ); $wp_customize->add_control( 'colorscheme', array( 'type' => 'radio', 'label' => __( 'Color Scheme', 'twentyseventeen' ), 'choices' => array( 'light' => __( 'Light', 'twentyseventeen' ), 'dark' => __( 'Dark', 'twentyseventeen' ), 'custom' => __( 'Custom', 'twentyseventeen' ), ), 'section' => 'colors', 'priority' => 5, ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'colorscheme_hue', array( 'mode' => 'hue', 'section' => 'colors', 'priority' => 6, ) ) ); /** * Theme options. */ $wp_customize->add_section( 'theme_options', array( 'title' => __( 'Theme Options', 'twentyseventeen' ), 'priority' => 130, // Before Additional CSS. ) ); $wp_customize->add_setting( 'page_layout', array( 'default' => 'two-column', 'sanitize_callback' => 'twentyseventeen_sanitize_page_layout', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'page_layout', array( 'label' => __( 'Page Layout', 'twentyseventeen' ), 'section' => 'theme_options', 'type' => 'radio', 'description' => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ), 'choices' => array( 'one-column' => __( 'One Column', 'twentyseventeen' ), 'two-column' => __( 'Two Column', 'twentyseventeen' ), ), 'active_callback' => 'twentyseventeen_is_view_with_layout_option', ) ); /** * Filter number of front page sections in Twenty Seventeen. * * @since Twenty Seventeen 1.0 * * @param int $num_sections Number of front page sections. */ $num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 ); // Create a setting and control for each of the sections available in the theme. for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { $wp_customize->add_setting( 'panel_' . $i, array( 'default' => false, 'sanitize_callback' => 'absint', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'panel_' . $i, array( /* translators: %d: The front page section number. */ 'label' => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ), 'description' => ( 1 !== $i ? '' : __( 'Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed.', 'twentyseventeen' ) ), 'section' => 'theme_options', 'type' => 'dropdown-pages', 'allow_addition' => true, 'active_callback' => 'twentyseventeen_is_static_front_page', ) ); $wp_customize->selective_refresh->add_partial( 'panel_' . $i, array( 'selector' => '#panel' . $i, 'render_callback' => 'twentyseventeen_front_page_section', 'container_inclusive' => true, ) ); } } add_action( 'customize_register', 'twentyseventeen_customize_register' ); /** * Sanitize the page layout options. * * @param string $input Page layout. */ function twentyseventeen_sanitize_page_layout( $input ) { $valid = array( 'one-column' => __( 'One Column', 'twentyseventeen' ), 'two-column' => __( 'Two Column', 'twentyseventeen' ), ); if ( array_key_exists( $input, $valid ) ) { return $input; } return ''; } /** * Sanitize the colorscheme. * * @param string $input Color scheme. */ function twentyseventeen_sanitize_colorscheme( $input ) { $valid = array( 'light', 'dark', 'custom' ); if ( in_array( $input, $valid, true ) ) { return $input; } return 'light'; } /** * Render the site title for the selective refresh partial. * * @since Twenty Seventeen 1.0 * * @see twentyseventeen_customize_register() * * @return void */ function twentyseventeen_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @since Twenty Seventeen 1.0 * * @see twentyseventeen_customize_register() * * @return void */ function twentyseventeen_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Return whether we're previewing the front page and it's a static page. */ function twentyseventeen_is_static_front_page() { return ( is_front_page() && ! is_home() ); } /** * Return whether we're on a view that supports a one or two column layout. */ function twentyseventeen_is_view_with_layout_option() { // This option is available on all pages. It's also available on archives when there isn't a sidebar. return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) ); } /** * Bind JS handlers to instantly live-preview changes. */ function twentyseventeen_customize_preview_js() { wp_enqueue_script( 'twentyseventeen-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview' ), '20161002', true ); } add_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' ); /** * Load dynamic logic for the customizer controls area. */ function twentyseventeen_panels_js() { wp_enqueue_script( 'twentyseventeen-customize-controls', get_theme_file_uri( '/assets/js/customize-controls.js' ), array(), '20161020', true ); } add_action( 'customize_controls_enqueue_scripts', 'twentyseventeen_panels_js' ); color-patterns.php 0000644 00000053773 15252477153 0010263 0 ustar 00 <?php /** * Twenty Seventeen: Color Patterns * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Generate the CSS for the current custom color scheme. */ function twentyseventeen_custom_colors_css() { $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) ); /** * Filter Twenty Seventeen default saturation level. * * @since Twenty Seventeen 1.0 * * @param int $saturation Color saturation level. */ $saturation = absint( apply_filters( 'twentyseventeen_custom_colors_saturation', 50 ) ); $reduced_saturation = ( .8 * $saturation ) . '%'; $saturation = $saturation . '%'; $css = ' /** * Twenty Seventeen: Color Patterns * * Colors are ordered from dark to light. */ .colors-custom a:hover, .colors-custom a:active, .colors-custom .entry-content a:focus, .colors-custom .entry-content a:hover, .colors-custom .entry-summary a:focus, .colors-custom .entry-summary a:hover, .colors-custom .comment-content a:focus, .colors-custom .comment-content a:hover, .colors-custom .widget a:focus, .colors-custom .widget a:hover, .colors-custom .site-footer .widget-area a:focus, .colors-custom .site-footer .widget-area a:hover, .colors-custom .posts-navigation a:focus, .colors-custom .posts-navigation a:hover, .colors-custom .comment-metadata a:focus, .colors-custom .comment-metadata a:hover, .colors-custom .comment-metadata a.comment-edit-link:focus, .colors-custom .comment-metadata a.comment-edit-link:hover, .colors-custom .comment-reply-link:focus, .colors-custom .comment-reply-link:hover, .colors-custom .widget_authors a:focus strong, .colors-custom .widget_authors a:hover strong, .colors-custom .entry-title a:focus, .colors-custom .entry-title a:hover, .colors-custom .entry-meta a:focus, .colors-custom .entry-meta a:hover, .colors-custom.blog .entry-meta a.post-edit-link:focus, .colors-custom.blog .entry-meta a.post-edit-link:hover, .colors-custom.archive .entry-meta a.post-edit-link:focus, .colors-custom.archive .entry-meta a.post-edit-link:hover, .colors-custom.search .entry-meta a.post-edit-link:focus, .colors-custom.search .entry-meta a.post-edit-link:hover, .colors-custom .page-links a:focus .page-number, .colors-custom .page-links a:hover .page-number, .colors-custom .entry-footer a:focus, .colors-custom .entry-footer a:hover, .colors-custom .entry-footer .cat-links a:focus, .colors-custom .entry-footer .cat-links a:hover, .colors-custom .entry-footer .tags-links a:focus, .colors-custom .entry-footer .tags-links a:hover, .colors-custom .post-navigation a:focus, .colors-custom .post-navigation a:hover, .colors-custom .pagination a:not(.prev):not(.next):focus, .colors-custom .pagination a:not(.prev):not(.next):hover, .colors-custom .comments-pagination a:not(.prev):not(.next):focus, .colors-custom .comments-pagination a:not(.prev):not(.next):hover, .colors-custom .logged-in-as a:focus, .colors-custom .logged-in-as a:hover, .colors-custom a:focus .nav-title, .colors-custom a:hover .nav-title, .colors-custom .edit-link a:focus, .colors-custom .edit-link a:hover, .colors-custom .site-info a:focus, .colors-custom .site-info a:hover, .colors-custom .widget .widget-title a:focus, .colors-custom .widget .widget-title a:hover, .colors-custom .widget ul li a:focus, .colors-custom .widget ul li a:hover { color: hsl( ' . $hue . ', ' . $saturation . ', 0% ); /* base: #000; */ } .colors-custom .entry-content a, .colors-custom .entry-summary a, .colors-custom .comment-content a, .colors-custom .widget a, .colors-custom .site-footer .widget-area a, .colors-custom .posts-navigation a, .colors-custom .widget_authors a strong { -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */ box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */ } .colors-custom button, .colors-custom input[type="button"], .colors-custom input[type="submit"], .colors-custom .entry-footer .edit-link a.post-edit-link { background-color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */ } .colors-custom input[type="text"]:focus, .colors-custom input[type="email"]:focus, .colors-custom input[type="url"]:focus, .colors-custom input[type="password"]:focus, .colors-custom input[type="search"]:focus, .colors-custom input[type="number"]:focus, .colors-custom input[type="tel"]:focus, .colors-custom input[type="range"]:focus, .colors-custom input[type="date"]:focus, .colors-custom input[type="month"]:focus, .colors-custom input[type="week"]:focus, .colors-custom input[type="time"]:focus, .colors-custom input[type="datetime"]:focus, .colors-custom .colors-custom input[type="datetime-local"]:focus, .colors-custom input[type="color"]:focus, .colors-custom textarea:focus, .colors-custom button.secondary, .colors-custom input[type="reset"], .colors-custom input[type="button"].secondary, .colors-custom input[type="reset"].secondary, .colors-custom input[type="submit"].secondary, .colors-custom a, .colors-custom .site-title, .colors-custom .site-title a, .colors-custom .navigation-top a, .colors-custom .dropdown-toggle, .colors-custom .menu-toggle, .colors-custom .page .panel-content .entry-title, .colors-custom .page-title, .colors-custom.page:not(.twentyseventeen-front-page) .entry-title, .colors-custom .page-links a .page-number, .colors-custom .comment-metadata a.comment-edit-link, .colors-custom .comment-reply-link .icon, .colors-custom h2.widget-title, .colors-custom mark, .colors-custom .post-navigation a:focus .icon, .colors-custom .post-navigation a:hover .icon, .colors-custom .site-content .site-content-light, .colors-custom .twentyseventeen-panel .recent-posts .entry-header .edit-link { color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */ } .colors-custom .entry-content a:focus, .colors-custom .entry-content a:hover, .colors-custom .entry-summary a:focus, .colors-custom .entry-summary a:hover, .colors-custom .comment-content a:focus, .colors-custom .comment-content a:hover, .colors-custom .widget a:focus, .colors-custom .widget a:hover, .colors-custom .site-footer .widget-area a:focus, .colors-custom .site-footer .widget-area a:hover, .colors-custom .posts-navigation a:focus, .colors-custom .posts-navigation a:hover, .colors-custom .comment-metadata a:focus, .colors-custom .comment-metadata a:hover, .colors-custom .comment-metadata a.comment-edit-link:focus, .colors-custom .comment-metadata a.comment-edit-link:hover, .colors-custom .comment-reply-link:focus, .colors-custom .comment-reply-link:hover, .colors-custom .widget_authors a:focus strong, .colors-custom .widget_authors a:hover strong, .colors-custom .entry-title a:focus, .colors-custom .entry-title a:hover, .colors-custom .entry-meta a:focus, .colors-custom .entry-meta a:hover, .colors-custom.blog .entry-meta a.post-edit-link:focus, .colors-custom.blog .entry-meta a.post-edit-link:hover, .colors-custom.archive .entry-meta a.post-edit-link:focus, .colors-custom.archive .entry-meta a.post-edit-link:hover, .colors-custom.search .entry-meta a.post-edit-link:focus, .colors-custom.search .entry-meta a.post-edit-link:hover, .colors-custom .page-links a:focus .page-number, .colors-custom .page-links a:hover .page-number, .colors-custom .entry-footer .cat-links a:focus, .colors-custom .entry-footer .cat-links a:hover, .colors-custom .entry-footer .tags-links a:focus, .colors-custom .entry-footer .tags-links a:hover, .colors-custom .post-navigation a:focus, .colors-custom .post-navigation a:hover, .colors-custom .pagination a:not(.prev):not(.next):focus, .colors-custom .pagination a:not(.prev):not(.next):hover, .colors-custom .comments-pagination a:not(.prev):not(.next):focus, .colors-custom .comments-pagination a:not(.prev):not(.next):hover, .colors-custom .logged-in-as a:focus, .colors-custom .logged-in-as a:hover, .colors-custom a:focus .nav-title, .colors-custom a:hover .nav-title, .colors-custom .edit-link a:focus, .colors-custom .edit-link a:hover, .colors-custom .site-info a:focus, .colors-custom .site-info a:hover, .colors-custom .widget .widget-title a:focus, .colors-custom .widget .widget-title a:hover, .colors-custom .widget ul li a:focus, .colors-custom .widget ul li a:hover { -webkit-box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ); box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ' , 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ); } body.colors-custom, .colors-custom button, .colors-custom input, .colors-custom select, .colors-custom textarea, .colors-custom h3, .colors-custom h4, .colors-custom h6, .colors-custom label, .colors-custom .entry-title a, .colors-custom.twentyseventeen-front-page .panel-content .recent-posts article, .colors-custom .entry-footer .cat-links a, .colors-custom .entry-footer .tags-links a, .colors-custom .format-quote blockquote, .colors-custom .nav-title, .colors-custom .comment-body, .colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album { color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */ } .colors-custom .social-navigation a:hover, .colors-custom .social-navigation a:focus { background: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */ } .colors-custom input[type="text"]:focus, .colors-custom input[type="email"]:focus, .colors-custom input[type="url"]:focus, .colors-custom input[type="password"]:focus, .colors-custom input[type="search"]:focus, .colors-custom input[type="number"]:focus, .colors-custom input[type="tel"]:focus, .colors-custom input[type="range"]:focus, .colors-custom input[type="date"]:focus, .colors-custom input[type="month"]:focus, .colors-custom input[type="week"]:focus, .colors-custom input[type="time"]:focus, .colors-custom input[type="datetime"]:focus, .colors-custom input[type="datetime-local"]:focus, .colors-custom input[type="color"]:focus, .colors-custom textarea:focus, .bypostauthor > .comment-body > .comment-meta > .comment-author .avatar { border-color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */ } .colors-custom h2, .colors-custom blockquote, .colors-custom input[type="text"], .colors-custom input[type="email"], .colors-custom input[type="url"], .colors-custom input[type="password"], .colors-custom input[type="search"], .colors-custom input[type="number"], .colors-custom input[type="tel"], .colors-custom input[type="range"], .colors-custom input[type="date"], .colors-custom input[type="month"], .colors-custom input[type="week"], .colors-custom input[type="time"], .colors-custom input[type="datetime"], .colors-custom input[type="datetime-local"], .colors-custom input[type="color"], .colors-custom textarea, .colors-custom .site-description, .colors-custom .entry-content blockquote.alignleft, .colors-custom .entry-content blockquote.alignright, .colors-custom .colors-custom .taxonomy-description, .colors-custom .site-info a, .colors-custom .wp-caption, .colors-custom .gallery-caption { color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */ } .colors-custom abbr, .colors-custom acronym { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */ } .colors-custom h5, .colors-custom .entry-meta, .colors-custom .entry-meta a, .colors-custom.blog .entry-meta a.post-edit-link, .colors-custom.archive .entry-meta a.post-edit-link, .colors-custom.search .entry-meta a.post-edit-link, .colors-custom .nav-subtitle, .colors-custom .comment-metadata, .colors-custom .comment-metadata a, .colors-custom .no-comments, .colors-custom .comment-awaiting-moderation, .colors-custom .page-numbers.current, .colors-custom .page-links .page-number, .colors-custom .navigation-top .current-menu-item > a, .colors-custom .navigation-top .current_page_item > a, .colors-custom .main-navigation a:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist { color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */ } .colors-custom :not( .mejs-button ) > button:hover, .colors-custom :not( .mejs-button ) > button:focus, .colors-custom input[type="button"]:hover, .colors-custom input[type="button"]:focus, .colors-custom input[type="submit"]:hover, .colors-custom input[type="submit"]:focus, .colors-custom .entry-footer .edit-link a.post-edit-link:hover, .colors-custom .entry-footer .edit-link a.post-edit-link:focus, .colors-custom .social-navigation a, .colors-custom .prev.page-numbers:focus, .colors-custom .prev.page-numbers:hover, .colors-custom .next.page-numbers:focus, .colors-custom .next.page-numbers:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus { background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */ } .colors-custom button.secondary:hover, .colors-custom button.secondary:focus, .colors-custom input[type="reset"]:hover, .colors-custom input[type="reset"]:focus, .colors-custom input[type="button"].secondary:hover, .colors-custom input[type="button"].secondary:focus, .colors-custom input[type="reset"].secondary:hover, .colors-custom input[type="reset"].secondary:focus, .colors-custom input[type="submit"].secondary:hover, .colors-custom input[type="submit"].secondary:focus, .colors-custom hr { background: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ } .colors-custom input[type="text"], .colors-custom input[type="email"], .colors-custom input[type="url"], .colors-custom input[type="password"], .colors-custom input[type="search"], .colors-custom input[type="number"], .colors-custom input[type="tel"], .colors-custom input[type="range"], .colors-custom input[type="date"], .colors-custom input[type="month"], .colors-custom input[type="week"], .colors-custom input[type="time"], .colors-custom input[type="datetime"], .colors-custom input[type="datetime-local"], .colors-custom input[type="color"], .colors-custom textarea, .colors-custom select, .colors-custom fieldset, .colors-custom .widget .tagcloud a:hover, .colors-custom .widget .tagcloud a:focus, .colors-custom .widget.widget_tag_cloud a:hover, .colors-custom .widget.widget_tag_cloud a:focus, .colors-custom .wp_widget_tag_cloud a:hover, .colors-custom .wp_widget_tag_cloud a:focus { border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ } .colors-custom thead th { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ } .colors-custom .entry-footer .cat-links .icon, .colors-custom .entry-footer .tags-links .icon { color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ } .colors-custom button.secondary, .colors-custom input[type="reset"], .colors-custom input[type="button"].secondary, .colors-custom input[type="reset"].secondary, .colors-custom input[type="submit"].secondary, .colors-custom .prev.page-numbers, .colors-custom .next.page-numbers { background-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ } .colors-custom .widget .tagcloud a, .colors-custom .widget.widget_tag_cloud a, .colors-custom .wp_widget_tag_cloud a { border-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ } .colors-custom.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child), .colors-custom .widget ul li { border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ } .colors-custom .widget ul li { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ } .colors-custom pre, .colors-custom mark, .colors-custom ins { background: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ } .colors-custom .navigation-top, .colors-custom .main-navigation > div > ul, .colors-custom .pagination, .colors-custom .comments-pagination, .colors-custom .entry-footer, .colors-custom .site-footer { border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ } .colors-custom .navigation-top, .colors-custom .main-navigation li, .colors-custom .entry-footer, .colors-custom .single-featured-image-header, .colors-custom .site-content .wp-playlist-light .wp-playlist-item, .colors-custom tr { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ } .colors-custom .site-content .wp-playlist-light { border-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ } .colors-custom .site-header, .colors-custom .single-featured-image-header { background-color: hsl( ' . $hue . ', ' . $saturation . ', 98% ); /* base: #fafafa; */ } .colors-custom button, .colors-custom input[type="button"], .colors-custom input[type="submit"], .colors-custom .entry-footer .edit-link a.post-edit-link, .colors-custom .social-navigation a, .colors-custom .site-content .wp-playlist-light a.wp-playlist-caption:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover a, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus a, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, .colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus, .colors-custom .prev.page-numbers:focus, .colors-custom .prev.page-numbers:hover, .colors-custom .next.page-numbers:focus, .colors-custom .next.page-numbers:hover, .colors-custom.has-header-image .site-title, .colors-custom.has-header-video .site-title, .colors-custom.has-header-image .site-title a, .colors-custom.has-header-video .site-title a, .colors-custom.has-header-image .site-description, .colors-custom.has-header-video .site-description { color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ } body.colors-custom, .colors-custom .navigation-top, .colors-custom .main-navigation ul { background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ } .colors-custom .widget ul li a, .colors-custom .site-footer .widget-area ul li a { -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */ box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */ } .colors-custom .menu-toggle, .colors-custom .menu-toggle:hover, .colors-custom .menu-toggle:focus, .colors-custom .menu .dropdown-toggle, .colors-custom .menu-scroll-down, .colors-custom .menu-scroll-down:hover, .colors-custom .menu-scroll-down:focus { background-color: transparent; } .colors-custom .widget .tagcloud a, .colors-custom .widget .tagcloud a:focus, .colors-custom .widget .tagcloud a:hover, .colors-custom .widget.widget_tag_cloud a, .colors-custom .widget.widget_tag_cloud a:focus, .colors-custom .widget.widget_tag_cloud a:hover, .colors-custom .wp_widget_tag_cloud a, .colors-custom .wp_widget_tag_cloud a:focus, .colors-custom .wp_widget_tag_cloud a:hover, .colors-custom .entry-footer .edit-link a.post-edit-link:focus, .colors-custom .entry-footer .edit-link a.post-edit-link:hover { -webkit-box-shadow: none !important; box-shadow: none !important; } /* Reset non-customizable hover styling for links */ .colors-custom .entry-content a:hover, .colors-custom .entry-content a:focus, .colors-custom .entry-summary a:hover, .colors-custom .entry-summary a:focus, .colors-custom .comment-content a:focus, .colors-custom .comment-content a:hover, .colors-custom .widget a:hover, .colors-custom .widget a:focus, .colors-custom .site-footer .widget-area a:hover, .colors-custom .site-footer .widget-area a:focus, .colors-custom .posts-navigation a:hover, .colors-custom .posts-navigation a:focus, .colors-custom .widget_authors a:hover strong, .colors-custom .widget_authors a:focus strong { -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); } .colors-custom .gallery-item a, .colors-custom .gallery-item a:hover, .colors-custom .gallery-item a:focus { -webkit-box-shadow: none; box-shadow: none; } @media screen and (min-width: 48em) { .colors-custom .nav-links .nav-previous .nav-title .icon, .colors-custom .nav-links .nav-next .nav-title .icon { color: hsl( ' . $hue . ', ' . $saturation . ', 20% ); /* base: #222; */ } .colors-custom .main-navigation li li:hover, .colors-custom .main-navigation li li.focus { background: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */ } .colors-custom .navigation-top .menu-scroll-down { color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */; } .colors-custom abbr[title] { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */; } .colors-custom .main-navigation ul ul { border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ } .colors-custom .main-navigation ul li.menu-item-has-children:before, .colors-custom .main-navigation ul li.page_item_has_children:before { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ } .colors-custom .main-navigation ul li.menu-item-has-children:after, .colors-custom .main-navigation ul li.page_item_has_children:after { border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ } .colors-custom .main-navigation li li.focus > a, .colors-custom .main-navigation li li:focus > a, .colors-custom .main-navigation li li:hover > a, .colors-custom .main-navigation li li a:hover, .colors-custom .main-navigation li li a:focus, .colors-custom .main-navigation li li.current_page_item a:hover, .colors-custom .main-navigation li li.current-menu-item a:hover, .colors-custom .main-navigation li li.current_page_item a:focus, .colors-custom .main-navigation li li.current-menu-item a:focus { color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ } }'; /** * Filters Twenty Seventeen custom colors CSS. * * @since Twenty Seventeen 1.0 * * @param string $css Base theme colors CSS. * @param int $hue The user's selected color hue. * @param string $saturation Filtered theme color saturation level. */ return apply_filters( 'twentyseventeen_custom_colors_css', $css, $hue, $saturation ); } helper-functions.php 0000644 00000007004 15252477153 0010556 0 ustar 00 <?php /** * Common theme functions * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.5 */ /** * Determines if post thumbnail can be displayed. */ function twentynineteen_can_show_post_thumbnail() { return apply_filters( 'twentynineteen_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() ); } /** * Returns true if image filters are enabled on the theme options. */ function twentynineteen_image_filters_enabled() { return 0 !== get_theme_mod( 'image_filter', 1 ); } /** * Returns the size for avatars used in the theme. */ function twentynineteen_get_avatar_size() { return 60; } /** * Returns true if comment is by author of the post. * * @see get_comment_class() */ function twentynineteen_is_comment_by_post_author( $comment = null ) { if ( is_object( $comment ) && $comment->user_id > 0 ) { $user = get_userdata( $comment->user_id ); $post = get_post( $comment->comment_post_ID ); if ( ! empty( $user ) && ! empty( $post ) ) { return $comment->user_id === $post->post_author; } } return false; } /** * Returns information about the current post's discussion, with cache support. */ function twentynineteen_get_discussion_data() { static $discussion, $post_id; $current_post_id = get_the_ID(); if ( $current_post_id === $post_id ) { return $discussion; /* If we have discussion information for post ID, return cached object */ } else { $post_id = $current_post_id; } $comments = get_comments( array( 'post_id' => $current_post_id, 'orderby' => 'comment_date_gmt', 'order' => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings » Discussion. */ 'status' => 'approve', 'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */ ) ); $authors = array(); foreach ( $comments as $comment ) { $authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email; } $authors = array_unique( $authors ); $discussion = (object) array( 'authors' => array_slice( $authors, 0, 6 ), /* Six unique authors commenting on the post. */ 'responses' => get_comments_number( $current_post_id ), /* Number of responses. */ ); return $discussion; } /** * Converts HSL to HEX colors. */ function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) { $h /= 360; $s /= 100; $l /= 100; $r = $l; $g = $l; $b = $l; $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s ); if ( $v > 0 ) { $m; $sv; $sextant; $fract; $vsf; $mid1; $mid2; $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)"; } back-compat.php 0000644 00000004744 15252477153 0007462 0 ustar 00 <?php /** * Twenty Seventeen back compat functionality * * Prevents Twenty Seventeen from running on WordPress versions prior to 4.7, * since this theme is not meant to be backward compatible beyond that and * relies on many newer functions and markup changes introduced in 4.7. * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Prevent switching to Twenty Seventeen on old versions of WordPress. * * Switches to the default theme. * * @since Twenty Seventeen 1.0 */ function twentyseventeen_switch_theme() { switch_theme( WP_DEFAULT_THEME ); unset( $_GET['activated'] ); add_action( 'admin_notices', 'twentyseventeen_upgrade_notice' ); } add_action( 'after_switch_theme', 'twentyseventeen_switch_theme' ); /** * Adds a message for unsuccessful theme switch. * * Prints an update nag after an unsuccessful attempt to switch to * Twenty Seventeen on WordPress versions prior to 4.7. * * @since Twenty Seventeen 1.0 * * @global string $wp_version WordPress version. */ function twentyseventeen_upgrade_notice() { /* translators: %s: The current WordPress version. */ $message = sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ); printf( '<div class="error"><p>%s</p></div>', $message ); } /** * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. * * @since Twenty Seventeen 1.0 * * @global string $wp_version WordPress version. */ function twentyseventeen_customize() { wp_die( /* translators: %s: The current WordPress version. */ sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ), '', array( 'back_link' => true, ) ); } add_action( 'load-customize.php', 'twentyseventeen_customize' ); /** * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. * * @since Twenty Seventeen 1.0 * * @global string $wp_version WordPress version. */ function twentyseventeen_preview() { if ( isset( $_GET['preview'] ) ) { /* translators: %s: The current WordPress version. */ wp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ) ); } } add_action( 'template_redirect', 'twentyseventeen_preview' ); template-functions.php 0000644 00000005022 15252477153 0011110 0 ustar 00 <?php /** * Additional features to allow styling of the templates * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function twentyseventeen_body_classes( $classes ) { // Add class of group-blog to blogs with more than 1 published author. if ( is_multi_author() ) { $classes[] = 'group-blog'; } // Add class of hfeed to non-singular pages. if ( ! is_singular() ) { $classes[] = 'hfeed'; } // Add class if we're viewing the Customizer for easier styling of theme options. if ( is_customize_preview() ) { $classes[] = 'twentyseventeen-customizer'; } // Add class on front page. if ( is_front_page() && 'posts' !== get_option( 'show_on_front' ) ) { $classes[] = 'twentyseventeen-front-page'; } // Add a class if there is a custom header. if ( has_header_image() ) { $classes[] = 'has-header-image'; } // Add class if sidebar is used. if ( is_active_sidebar( 'sidebar-1' ) && ! is_page() ) { $classes[] = 'has-sidebar'; } // Add class for one or two column page layouts. if ( is_page() || is_archive() ) { if ( 'one-column' === get_theme_mod( 'page_layout' ) ) { $classes[] = 'page-one-column'; } else { $classes[] = 'page-two-column'; } } // Add class if the site title and tagline is hidden. if ( 'blank' === get_header_textcolor() ) { $classes[] = 'title-tagline-hidden'; } // Get the colorscheme or the default if there isn't one. $colors = twentyseventeen_sanitize_colorscheme( get_theme_mod( 'colorscheme', 'light' ) ); $classes[] = 'colors-' . $colors; return $classes; } add_filter( 'body_class', 'twentyseventeen_body_classes' ); /** * Count our number of active panels. * * Primarily used to see if we have any panels active, duh. */ function twentyseventeen_panel_count() { $panel_count = 0; /** * Filter number of front page sections in Twenty Seventeen. * * @since Twenty Seventeen 1.0 * * @param int $num_sections Number of front page sections. */ $num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 ); // Create a setting and control for each of the sections available in the theme. for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { if ( get_theme_mod( 'panel_' . $i ) ) { $panel_count++; } } return $panel_count; } /** * Checks to see if we're on the front page or not. */ function twentyseventeen_is_frontpage() { return ( is_front_page() && ! is_home() ); } svg-icons.php 0000644 00000003473 15252503212 0007171 0 ustar 00 <?php /** * Twenty Twenty SVG Icon helper functions * * @package WordPress * @subpackage Twenty_Twenty * @since Twenty Twenty 1.0 */ if ( ! function_exists( 'twentytwenty_the_theme_svg' ) ) { /** * Output and Get Theme SVG. * Output and get the SVG markup for an icon in the TwentyTwenty_SVG_Icons class. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) { echo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg(). } } if ( ! function_exists( 'twentytwenty_get_theme_svg' ) ) { /** * Get information about the SVG icon. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function twentytwenty_get_theme_svg( $svg_name, $group = 'ui', $color = '' ) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( TwentyTwenty_SVG_Icons::get_svg( $svg_name, $group, $color ), array( 'svg' => array( 'class' => true, 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, 'aria-hidden' => true, 'role' => true, 'focusable' => true, ), 'path' => array( 'fill' => true, 'fill-rule' => true, 'd' => true, 'transform' => true, ), 'polygon' => array( 'fill' => true, 'fill-rule' => true, 'points' => true, 'transform' => true, 'focusable' => true, ), ) ); if ( ! $svg ) { return false; } return $svg; } } starter-content.php 0000644 00000020742 15252503212 0010413 0 ustar 00 <?php /** * Twenty Twenty-One Starter Content * * @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/ * * @package WordPress * @subpackage Twenty_Twenty_One * @since 1.0.0 */ /** * Function to return the array of starter content for the theme. * * Passes it through the `twentytwenty_starter_content` filter before returning. * * @since 1.0.0 * * @return array A filtered array of args for the starter_content. */ function twenty_twenty_one_get_starter_content() { // Define and register starter content to showcase the theme on new sites. $starter_content = array( // Specify the core-defined pages to create and add custom thumbnails to some of them. 'posts' => array( 'front' => array( 'post_type' => 'page', 'post_title' => esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ), 'post_content' => ' <!-- wp:heading {"align":"wide","fontSize":"gigantic","style":{"typography":{"lineHeight":"1.1"}}} --> <h2 class="alignwide has-text-align-wide has-gigantic-font-size" style="line-height:1.1">' . esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ) . '</h2> <!-- /wp:heading --> <!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns {"verticalAlignment":"center","align":"wide","className":"is-style-twentytwentyone-columns-overlap"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center is-style-twentytwentyone-columns-overlap"><!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"full","sizeSlug":"large"} --> <figure class="wp-block-image alignfull size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/roses-tremieres-hollyhocks-1884.jpg" alt="' . esc_attr__( '“Roses Tremieres” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure> <!-- /wp:image --> <!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:image {"align":"full","sizeSlug":"large","className":"is-style-twentytwentyone-image-frame"} --> <figure class="wp-block-image alignfull size-large is-style-twentytwentyone-image-frame"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/in-the-bois-de-boulogne.jpg" alt="' . esc_attr__( '“In the Bois de Boulogne” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure> <!-- /wp:image --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:image {"sizeSlug":"large","className":"alignfull size-full is-style-twentytwentyone-border"} --> <figure class="wp-block-image size-large alignfull size-full is-style-twentytwentyone-border"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/young-woman-in-mauve.jpg" alt="' . esc_attr__( '“Young Woman in Mauve” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns {"verticalAlignment":"top","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-top"><!-- wp:column {"verticalAlignment":"top"} --> <div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} --> <h3>' . esc_html_x( 'Add block patterns', 'Theme starter content', 'twentytwentyone' ) . '</h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . 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' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"top"} --> <div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} --> <h3>' . esc_html_x( 'Frame your images', 'Theme starter content', 'twentytwentyone' ) . '</h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . 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' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"top"} --> <div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} --> <h3>' . esc_html_x( 'Overlap columns', 'Theme starter content', 'twentytwentyone' ) . '</h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . 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' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:cover {"overlayColor":"green","contentPosition":"center center","align":"wide","className":"is-style-twentytwentyone-border"} --> <div class="wp-block-cover alignwide has-green-background-color has-background-dim is-style-twentytwentyone-border"><div class="wp-block-cover__inner-container"><!-- wp:spacer {"height":20} --> <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:paragraph {"fontSize":"huge"} --> <p class="has-huge-font-size">' . esc_html_x( 'Need help?', 'Theme starter content', 'twentytwentyone' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":75} --> <div style="height:75px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p><a href="https://wordpress.org/support/article/twenty-twenty-one/">' . esc_html_x( 'Read the Theme Documentation', 'Theme starter content', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p><a href="https://wordpress.org/support/theme/twentytwentyone/">' . esc_html_x( 'Check out the Support Forums', 'Theme starter content', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer {"height":20} --> <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div></div> <!-- /wp:cover -->', ), '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 1.0.0 * * @param array $starter_content Array of starter content. */ return apply_filters( 'twenty_twenty_one_starter_content', $starter_content ); } custom-css.php 0000644 00000002176 15252503212 0007360 0 ustar 00 <?php /** * Custom CSS * * @package WordPress * @subpackage Twenty_Twenty_One * @since 1.0.0 */ /** * Generate CSS. * * @since 1.0.0 * * @param string $selector The CSS selector. * @param string $style The CSS style. * @param string $value The CSS value. * @param string $prefix The CSS prefix. * @param string $suffix The CSS suffix. * @param bool $echo Echo the styles. * * @return string */ function twenty_twenty_one_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) { // Bail early if there is no $selector elements or properties and $value. if ( ! $value || ! $selector ) { return ''; } $css = sprintf( '%s { %s: %s; }', $selector, $style, $prefix . $value . $suffix ); if ( $echo ) { /** * Note to reviewers: $css contains auto-generated CSS. * It is included inside <style> 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 </style> and open a <script>. */ echo wp_strip_all_tags( $css ); // phpcs:ignore WordPress.Security.EscapeOutput } return $css; } patterns/page-about-media-left.php 0000644 00000005735 15252503364 0013165 0 ustar 00 <?php /** * About page with media on the left */ return array( 'title' => __( 'About page with media on the left', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:media-text {"align":"full","mediaType":"image","imageFill":true,"focalPoint":{"x":"0.63","y":"0.16"},"backgroundColor":"foreground","className":"alignfull is-image-fill has-background-color has-text-color has-background has-link-color"} --> <div class="wp-block-media-text alignfull is-stacked-on-mobile is-image-fill has-background-color has-text-color has-background has-link-color has-foreground-background-color has-background"><figure class="wp-block-media-text__media" style="background-image:url(' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg);background-position:63% 16%"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg" alt="' . esc_attr__( 'Image of a bird on a branch', 'twentytwentytwo' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-logo {"width":60} /--> <!-- wp:group {"style":{"spacing":{"padding":{"right":"min(8rem, 5vw)","top":"min(28rem, 28vw)"}}}} --> <div class="wp-block-group" style="padding-top:min(28rem, 28vw);padding-right:min(8rem, 5vw)"><!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} --> <h2 style="font-size:clamp(3rem, 6vw, 4.5rem);font-weight:300;line-height:1.115"><em>' . esc_html__( 'Doug', 'twentytwentytwo' ) . '<br>' . esc_html__( 'Stilton', 'twentytwentytwo' ) . '</em></h2> <!-- /wp:heading --> <!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} --> <p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Doug, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--background)","iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--foreground)"} --> <ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:group --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div></div> <!-- /wp:media-text -->', ); patterns/query-default.php 0000644 00000004425 15252503364 0011716 0 ustar 00 <?php /** * Default posts block pattern */ return array( 'title' => __( 'Default posts', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":""},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:group {"layout":{"inherit":true}} --> <div class="wp-block-group"><!-- wp:post-title {"isLink":true,"align":"wide","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /--> <!-- wp:post-featured-image {"isLink":true,"align":"wide","style":{"spacing":{"margin":{"top":"calc(1.75 * var(--wp--style--block-gap))"}}}} /--> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"650px"} --> <div class="wp-block-column" style="flex-basis:650px"><!-- wp:post-excerpt /--> <!-- wp:post-date {"isLink":true,"format":"F j, Y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:column --> <!-- wp:column {"width":""} --> <div class="wp-block-column"></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:separator {"align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide is-style-wide"/> <!-- /wp:separator --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:group --> <!-- /wp:post-template --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query -->', ); patterns/footer-navigation.php 0000644 00000002250 15252503364 0012554 0 ustar 00 <?php /** * Footer with navigation and citation */ return array( 'title' => __( 'Footer with navigation and citation', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:navigation --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --> <!-- wp:paragraph {"align":"right"} --> <p class="has-text-align-right">' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-layered-images-with-duotone.php 0000644 00000002764 15252503364 0016062 0 ustar 00 <?php /** * Layered images with duotone block pattern */ return array( 'title' => __( 'Layered images with duotone', 'twentytwentytwo' ), 'categories' => array( 'featured', 'gallery' ), 'content' => '<!-- wp:cover {"url":"' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg","dimRatio":0,"minHeight":666,"contentPosition":"center center","isDark":false,"align":"wide","style":{"spacing":{"padding":{"top":"1em","right":"1em","bottom":"1em","left":"1em"}},"color":{"duotone":["#000000","#FFFFFF"]}}} --> <div class="wp-block-cover alignwide is-light" style="padding-top:1em;padding-right:1em;padding-bottom:1em;padding-left:1em;min-height:666px"><span aria-hidden="true" class="has-background-dim-0 wp-block-cover__gradient-background has-background-dim"></span><img class="wp-block-cover__image-background" alt="' . esc_attr__( 'Painting of ducks in the water.', 'twentytwentytwo' ) . '" src="' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:image {"align":"center","width":384,"height":580,"sizeSlug":"large"} --> <div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-salmon.jpg" alt="' . esc_attr__( 'Illustration of a flying bird.', 'twentytwentytwo' ) . '" width="384" height="580"/></figure></div> <!-- /wp:image --></div></div> <!-- /wp:cover -->', ); patterns/general-image-with-caption.php 0000644 00000003106 15252503364 0014223 0 ustar 00 <?php /** * Image with caption block pattern */ return array( 'title' => __( 'Image with caption', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns', 'gallery' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"6rem","bottom":"6rem"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:6rem;padding-bottom:6rem"><!-- wp:media-text {"mediaId":202,"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-gray.jpg","mediaType":"image","verticalAlignment":"bottom","imageFill":false} --> <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-bottom"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-gray.jpg" alt="' . esc_attr__( 'Hummingbird illustration', 'twentytwentytwo' ) . '" class="wp-image-202 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph --> <p><strong>' . esc_html__( 'Hummingbird', 'twentytwentytwo' ) . '</strong></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>' . esc_html__( 'A beautiful bird featuring a surprising set of color feathers.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div></div> <!-- /wp:media-text --></div> <!-- /wp:group -->', ); patterns/header-title-navigation-social.php 0000644 00000003031 15252503364 0015073 0 ustar 00 <?php /** * Title, navigation, and social links header block pattern */ return array( 'title' => __( 'Title, navigation, and social links header', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only"} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"instagram"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--></ul> <!-- /wp:social-links --> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/footer-navigation-copyright.php 0000644 00000002327 15252503364 0014567 0 ustar 00 <?php /** * Footer with navigation and copyright */ return array( 'title' => __( 'Footer with navigation and copyright', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"center"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"16px"}}} --> <p class="has-text-align-center" style="font-size:16px">' . esc_html__( '© Site Title', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/header-large-dark.php 0000644 00000005367 15252503364 0012374 0 ustar 00 <?php /** * Large header with dark background block pattern */ return array( 'title' => __( 'Large header with dark background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"0px","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:0px;padding-bottom:var(--wp--custom--spacing--large, 8rem);"><!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:0px;padding-bottom:0px;"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:site-logo {"width":64} /--> <!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:group --> <!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(3.25rem, 8vw, 6.25rem)","lineHeight":"1.15"}}} --> <h2 class="alignwide" style="font-size:clamp(3.25rem, 8vw, 6.25rem);line-height:1.15">' . wp_kses_post( __( '<em>The Hatchery</em>: a blog about my adventures in bird watching', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:group --> <!-- wp:image {"align":"full","width":2400,"height":1020,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image alignfull size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-c.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2400" height="1020"/></figure> <!-- /wp:image --></div> <!-- /wp:group --><!-- wp:spacer {"height":66} --> <div style="height:66px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer -->', ); patterns/header-default.php 0000644 00000002401 15252503364 0011771 0 ustar 00 <?php /** * Default header block pattern */ return array( 'title' => __( 'Default header', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"> <!-- wp:site-logo {"width":64} /--> <!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/header-image-background-overlay.php 0000644 00000004514 15252503364 0015232 0 ustar 00 <?php /** * Header with image background and overlay block pattern */ return array( 'title' => __( 'Header with image background and overlay', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:cover {"url":"' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg","dimRatio":90,"overlayColor":"primary","focalPoint":{"x":"0.26","y":"0.34"},"minHeight":100,"minHeightUnit":"px","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}},"color":{"duotone":["#000000","#ffffff"]}}} --> <div class="wp-block-cover alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem);min-height:100px"><span aria-hidden="true" class="has-primary-background-color has-background-dim-90 wp-block-cover__gradient-background has-background-dim"></span><img class="wp-block-cover__image-background" alt="' . esc_attr__( 'Painting of ducks in the water.', 'twentytwentytwo' ) . '" src="' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg" style="object-position:26% 34%" data-object-fit="cover" data-object-position="26% 34%"/><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"textColor":"background","layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide has-background-color has-text-color has-link-color" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div></div> <!-- /wp:cover --></div> <!-- /wp:group -->', ); patterns/page-layout-image-and-text.php 0000644 00000005366 15252503364 0014165 0 ustar 00 <?php /** * Page layout with image and text. */ return array( 'title' => __( 'Page layout with image and text', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"2rem"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:2rem"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(4rem, 8vw, 7.5rem)","lineHeight":"1.15","fontWeight":"300"}}} --> <h2 class="alignwide" style="font-size:clamp(4rem, 8vw, 7.5rem);font-weight:300;line-height:1.15">' . wp_kses_post( __( '<em>Watching Birds </em><br><em>in the Garden</em>', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:group --> <!-- wp:image {"align":"full","width":2400,"height":1800,"style":{"color":{}}} --> <figure class="wp-block-image alignfull is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-b.png" alt="' . esc_attr_x( 'TBD', 'Short for to be determined', 'twentytwentytwo' ) . '" width="2400" height="1800"/></figure> <!-- /wp:image --> <!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"2rem","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:2rem;padding-bottom:var(--wp--custom--spacing--large, 8rem)"> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"verticalAlignment":"bottom","style":{"spacing":{"padding":{"bottom":"1em"}}}} --> <div class="wp-block-column is-vertically-aligned-bottom" style="padding-bottom:1em"><!-- wp:site-logo {"width":60} /--></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"bottom"} --> <div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'Oh hello. My name’s Angelo, and I operate this blog. I was born in Portland, but I currently live in upstate New York. You may recognize me from publications with names like <a href="#">Eagle Beagle</a> and <a href="#">Mourning Dive</a>. I write for a living.<br><br>I usually use this blog to catalog extensive lists of birds and other things that I find interesting. If you find an error with one of my lists, please keep it to yourself.<br><br>If that’s not your cup of tea, <a href="#">I definitely recommend this tea</a>. It’s my favorite.', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/query-irregular-grid.php 0000644 00000020546 15252503364 0013213 0 ustar 00 <?php /** * Irregular grid of posts block pattern */ return array( 'title' => __( 'Irregular grid of posts', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:group {"align":"wide"} --> <div class="wp-block-group alignwide"><!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"1","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":64} --> <div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"2","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":128} --> <div style="height:128px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"3","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"4","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":96} --> <div style="height:96px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"5","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":160} --> <div style="height:160px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"6","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"7","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":160} --> <div style="height:160px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:query {"query":{"offset":"8","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:spacer {"height":96} --> <div style="height:96px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/page-about-simple-dark.php 0000644 00000006417 15252503364 0013364 0 ustar 00 <?php /** * Simple dark about page */ return array( 'title' => __( 'Simple dark about page', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:cover {"overlayColor":"foreground","minHeight":100,"minHeightUnit":"vh","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"max(1.25rem, 8vw)","right":"max(1.25rem, 8vw)","bottom":"max(1.25rem, 8vw)","left":"max(1.25rem, 8vw)"}}}} --> <div class="wp-block-cover alignfull has-foreground-background-color has-background-dim" style="padding-top:max(1.25rem, 8vw);padding-right:max(1.25rem, 8vw);padding-bottom:max(1.25rem, 8vw);padding-left:max(1.25rem, 8vw);min-height:100vh"><div class="wp-block-cover__inner-container"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"},"overlayMenu":"always"} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"bottom","width":"45%","style":{"spacing":{"padding":{"top":"12rem"}}}} --> <div class="wp-block-column is-vertically-aligned-bottom" style="padding-top:12rem;flex-basis:45%"><!-- wp:site-logo {"width":60} /--> <!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} --> <h2 style="font-size:clamp(3rem, 6vw, 4.5rem);font-weight:300;line-height:1.115"><em>' . wp_kses_post( __( 'Jesús<br>Rodriguez', 'twentytwentytwo' ) ) . '</em></h2> <!-- /wp:heading --> <!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} --> <p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Jesús, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--foreground)","iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--background)"} --> <ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"4rem","left":"0rem"}}}} --> <div class="wp-block-column is-vertically-aligned-center" style="padding-top:0rem;padding-right:0rem;padding-bottom:4rem;padding-left:0rem"><!-- wp:separator {"color":"background","className":"is-style-wide"} --> <hr class="wp-block-separator has-text-color has-background has-background-background-color has-background-color is-style-wide"/> <!-- /wp:separator --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div></div> <!-- /wp:cover -->', ); patterns/hidden-bird.php 0000644 00000001242 15252503364 0011272 0 ustar 00 <?php /** * Bird image * * This pattern is used only to reference a dynamic image URL. * It does not appear in the inserter. */ return array( 'title' => __( 'Heading and bird image', 'twentytwentytwo' ), 'inserter' => false, 'content' => '<!-- wp:image {"align":"wide","width":2000,"height":474,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image alignwide size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-d.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2000" height="474"/></figure> <!-- /wp:image -->', ); patterns/hidden-404.php 0000644 00000001741 15252503364 0010665 0 ustar 00 <?php /** * 404 content. */ return array( 'title' => __( '404 content', 'twentytwentytwo' ), 'inserter' => false, 'content' => '<!-- wp:heading {"style":{"typography":{"fontSize":"clamp(4rem, 40vw, 20rem)","fontWeight":"200","lineHeight":"1"}},"className":"has-text-align-center"} --> <h2 class="has-text-align-center" style="font-size:clamp(4rem, 40vw, 20rem);font-weight:200;line-height:1">' . esc_html( _x( '404', 'Error code for a webpage that is not found.', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --> <!-- wp:paragraph {"align":"center"} --> <p class="has-text-align-center">' . esc_html__( 'This page could not be found. Maybe try a search?', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:search {"label":"' . esc_html_x( 'Search', 'label', 'twentytwentytwo' ) . '","showLabel":false,"width":50,"widthUnit":"%","buttonText":"' . esc_html__( 'Search', 'twentytwentytwo' ) . '","buttonUseIcon":true,"align":"center"} /-->', ); patterns/query-grid.php 0000644 00000002556 15252503364 0011222 0 ustar 00 <?php /** * Grid of posts block pattern */ return array( 'title' => __( 'Grid of posts', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":12},"displayLayout":{"type":"flex","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --> <!-- wp:separator {"align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide is-style-wide"/> <!-- /wp:separator --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query -->', ); patterns/header-text-only-with-tagline-black-background.php 0000644 00000003335 15252503364 0020100 0 ustar 00 <?php /** * Text-only header with tagline and black background block pattern */ return array( 'title' => __( 'Text-only header with tagline and background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|secondary"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"foreground","textColor":"secondary","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-secondary-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:group {"layout":{"type":"flex","justifyContent":"left"}} --> <div class="wp-block-group"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:site-tagline {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-about-media-right.php 0000644 00000005551 15252503364 0013344 0 ustar 00 <?php /** * About page with media on the right */ return array( 'title' => __( 'About page with media on the right', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:media-text {"align":"full","mediaPosition":"right","mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-black.jpg","mediaType":"image","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background"} --> <div class="wp-block-media-text alignfull has-media-on-the-right is-stacked-on-mobile has-background-color has-foreground-background-color has-text-color has-background has-link-color"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-black.jpg" alt="' . esc_attr__( 'An image of a bird flying', 'twentytwentytwo' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-logo {"width":60} /--> <!-- wp:group {"style":{"spacing":{"padding":{"right":"min(8rem, 5vw)","top":"min(20rem, 20vw)"}}}} --> <div class="wp-block-group" style="padding-top:min(20rem, 20vw);padding-right:min(8rem, 5vw)"><!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} --> <h2 style="font-size:clamp(3rem, 6vw, 4.5rem);font-weight:300;line-height:1.115"><em>' . wp_kses_post( __( 'Emery<br>Driscoll', 'twentytwentytwo' ) ) . '</em></h2> <!-- /wp:heading --> <!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} --> <p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Emery, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--foreground)","iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--background)"} --> <ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:group --></div> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:media-text -->', ); patterns/header-logo-navigation-social-black-background.php 0000644 00000003623 15252503364 0020110 0 ustar 00 <?php /** * Logo, navigation, and social links header with black background block pattern */ return array( 'title' => __( 'Logo, navigation, and social links header with background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-logo {"width":64} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--background)","className":"is-style-logos-only"} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"instagram"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--></ul> <!-- /wp:social-links --> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-sidebar-poster.php 0000644 00000006543 15252503364 0012767 0 ustar 00 <?php /** * Poster with right sidebar block pattern */ return array( 'title' => __( 'Poster with right sidebar', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":"5%"}}} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"70%"} --> <div class="wp-block-column" style="flex-basis:70%"> <!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4.5rem)"},"spacing":{"margin":{"bottom":"0px"}}}} --> <h1 class="alignwide" style="font-size:clamp(3rem, 6vw, 4.5rem);margin-bottom:0px">' . wp_kses_post( __( '<em>Flutter</em>, a collection of bird-related ephemera', 'twentytwentytwo' ) ) . '</h1> <!-- /wp:heading --></div> <!-- /wp:column --> <!-- wp:column {"width":""} --> <div class="wp-block-column"></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":"5%"}}} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"70%","style":{"spacing":{"padding":{"bottom":"32px"}}}} --> <div class="wp-block-column" style="padding-bottom:32px;flex-basis:70%"><!-- wp:image {"width":984,"height":1426,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg" alt="' . esc_attr__( 'Image of a bird on a branch', 'twentytwentytwo' ) . '" width="984" height="1426"/></figure> <!-- /wp:image --></div> <!-- /wp:column --> <!-- wp:column {"width":""} --> <div class="wp-block-column"><!-- wp:image {"width":100,"height":47,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-binoculars.png" alt="' . esc_attr__( 'An icon representing binoculars.', 'twentytwentytwo' ) . '" width="100" height="47"/></figure> <!-- /wp:image --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:heading {"level":3,"fontSize":"large"} --> <h3 class="has-large-font-size"><em>' . esc_html__( 'Date', 'twentytwentytwo' ) . '</em></h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . esc_html__( 'February, 12 2021', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:heading {"level":3,"fontSize":"large"} --> <h3 class="has-large-font-size"><em>' . esc_html__( 'Location', 'twentytwentytwo' ) . '</em></h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . wp_kses_post( __( 'The Grand Theater<br>154 Eastern Avenue<br>Maryland NY, 12345', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/header-logo-navigation-gray-background.php 0000644 00000002630 15252503364 0016523 0 ustar 00 <?php /** * Logo and navigation header with gray background */ return array( 'title' => __( 'Logo and navigation header with background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"tertiary","textColor":"foreground","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-foreground-color has-tertiary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-logo {"width":64} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-layout-two-columns.php 0000644 00000007667 15252503364 0013656 0 ustar 00 <?php /** * Page layout with two columns. */ return array( 'title' => __( 'Page layout with two columns', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem);"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(4rem, 15vw, 12.5rem)","lineHeight":"1","fontWeight":"200"}}} --> <h1 class="alignwide" style="font-size:clamp(4rem, 15vw, 12.5rem);font-weight:200;line-height:1">' . wp_kses_post( __( '<em>Goldfinch </em><br><em>& Sparrow</em>', 'twentytwentytwo' ) ) . '</h1> <!-- /wp:heading --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:group {"align":"wide","layout":{"inherit":false}} --> <div class="wp-block-group alignwide"><!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":"20%"} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:20%"><!-- wp:paragraph --> <p>' . esc_html__( 'WELCOME', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center","width":"80%"} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'Oh hello. My name’s Angelo, and I operate this blog. I was born in Portland, but I currently live in upstate New York. You may recognize me from publications with names like <a href="#">Eagle Beagle</a> and <a href="#">Mourning Dive</a>. I write for a living.<br><br>I usually use this blog to catalog extensive lists of birds and other things that I find interesting. If you find an error with one of my lists, please keep it to yourself.<br><br>If that’s not your cup of tea, <a href="#">I definitely recommend this tea</a>. It’s my favorite.', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> <p>' . esc_html__( 'POSTS', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:latest-posts /--></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/query-simple-blog.php 0000644 00000003534 15252503364 0012504 0 ustar 00 <?php /** * Simple blog posts block pattern */ return array( 'title' => __( 'Simple blog posts', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"perPage":10},"layout":{"inherit":true}} --> <div class="wp-block-query"><!-- wp:post-template --> <!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"1rem","bottom":"1rem"}},"typography":{"fontStyle":"normal","fontWeight":"300"},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /--> <!-- wp:post-featured-image {"isLink":true} /--> <!-- wp:post-excerpt /--> <!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:post-date {"format":"F j, Y","style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /--> <!-- wp:post-terms {"term":"category","fontSize":"small"} /--> <!-- wp:post-terms {"term":"post_tag","fontSize":"small"} /--></div> <!-- /wp:group --> <!-- wp:spacer {"height":128} --> <div style="height:128px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- /wp:post-template --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query -->', ); patterns/general-divider-dark.php 0000644 00000001614 15252503364 0013104 0 ustar 00 <?php /** * Divider with image and color (dark) block pattern */ return array( 'title' => __( 'Divider with image and color (dark)', 'twentytwentytwo' ), 'categories' => array( 'featured' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"1rem","right":"0px","bottom":"1rem","left":"0px"}}},"backgroundColor":"primary"} --> <div class="wp-block-group alignfull has-primary-background-color has-background" style="padding-top:1rem;padding-right:0px;padding-bottom:1rem;padding-left:0px"><!-- wp:image {"id":473,"width":3001,"height":246,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/divider-white.png" alt="" class="wp-image-473" width="3001" height="246"/></figure> <!-- /wp:image --></div> <!-- /wp:group -->', ); patterns/footer-social-copyright.php 0000644 00000003034 15252503364 0013676 0 ustar 00 <?php /** * Footer with social links and copyright */ return array( 'title' => __( 'Footer with social links and copyright', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","iconBackgroundColor":"background","iconBackgroundColorValue":"var(--wp--preset--color--background)","layout":{"type":"flex","justifyContent":"center"}} --> <ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"facebook"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"16px"}}} --> <p class="has-text-align-center" style="font-size:16px">' . esc_html__( '© Site Title', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-layout-image-text-and-video.php 0000644 00000007650 15252503364 0015267 0 ustar 00 <?php /** * Page layout with image, text and video. */ return array( 'title' => __( 'Page layout with image, text and video', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"backgroundColor":"primary","textColor":"background"} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"inherit":true}} --> <div class="wp-block-group"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} --> <h1 class="alignwide" style="font-size:clamp(3rem, 6vw, 4.5rem)">' . wp_kses_post( __( '<em>Warble</em>, a film about <br>hobbyist bird watchers.', 'twentytwentytwo' ) ) . '</h1> <!-- /wp:heading --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.33%"} --> <div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size">' . esc_html__( 'Screening', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . wp_kses_post( __( 'May 14th, 2022 @ 7:00PM<br>The Vintagé Theater,<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"secondary","textColor":"primary"} --> <div class="wp-block-button"><a class="wp-block-button__link has-primary-color has-secondary-background-color has-text-color has-background">' . esc_html__( 'Buy Tickets', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --> <!-- wp:column {"width":"66.66%"} --> <div class="wp-block-column" style="flex-basis:66.66%"></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group --> <!-- wp:image {"align":"full","width":2400,"height":1178,"style":{"color":{}}} --> <figure class="wp-block-image alignfull is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-a.png" alt="' . esc_attr__( 'An illustration of a bird in flight', 'twentytwentytwo' ) . '" width="2400" height="1178"/></figure> <!-- /wp:image --> <!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.33%"} --> <div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size">' . esc_html__( 'Extended Trailer', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . esc_html__( 'Oh hello. My name’s Angelo, and you’ve found your way to my blog. I write about a range of topics, but lately I’ve been sharing my hopes for next year.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"width":"66.66%"} --> <div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:video {"id":181} --> <figure class="wp-block-video"><video controls src="' . esc_url( get_template_directory_uri() ) . '/assets/videos/birds.mp4"></video></figure> <!-- /wp:video --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/header-stacked.php 0000644 00000002721 15252503364 0011770 0 ustar 00 <?php /** * Logo and navigation header block pattern */ return array( 'title' => __( 'Logo and navigation header', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:site-logo {"align":"center","width":128} /--> <!-- wp:spacer {"height":10} --> <div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-title {"textAlign":"center","style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /--> <!-- wp:spacer {"height":10} --> <div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"center"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-sidebar-blog-posts-right.php 0000644 00000012123 15252503364 0014646 0 ustar 00 <?php /** * Blog posts with right sidebar block pattern */ return array( 'title' => __( 'Blog posts with right sidebar', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"2rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:2rem;padding-left:0px"><!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:site-logo {"width":64} /--></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:group --> <!-- wp:spacer {"height":64} --> <div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"},"blockGap":"5%"},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}},"textColor":"foreground"} --> <div class="wp-block-columns alignwide has-foreground-color has-text-color has-link-color" style="margin-top:0px;margin-bottom:0px"><!-- wp:column {"width":"66.66%","style":{"spacing":{"padding":{"bottom":"6rem"}}}} --> <div class="wp-block-column" style="padding-bottom:6rem;flex-basis:66.66%"><!-- wp:query {"queryId":9,"query":{"perPage":"5","pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"displayLayout":{"type":"list"},"layout":{"inherit":true}} --> <div class="wp-block-query"><!-- wp:post-template --> <!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"0","bottom":"1rem"}},"typography":{"fontStyle":"normal","fontWeight":"300"},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}},"textColor":"foreground","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /--> <!-- wp:post-featured-image {"isLink":true} /--> <!-- wp:post-excerpt /--> <!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:post-date {"format":"F j, Y","style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /--> <!-- wp:post-terms {"term":"category","fontSize":"small"} /--> <!-- wp:post-terms {"term":"post_tag","fontSize":"small"} /--></div> <!-- /wp:group --> <!-- wp:spacer {"height":64} --> <div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- /wp:post-template --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query --></div> <!-- /wp:column --> <!-- wp:column {"width":"33.33%"} --> <div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:image {"width":768,"height":1160,"sizeSlug":"large","linkDestination":"none"} --> <figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-salmon.jpg" alt="' . esc_attr__( 'Illustration of a flying bird.', 'twentytwentytwo' ) . '" width="768" height="1160"/></figure> <!-- /wp:image --> <!-- wp:spacer {"height":4} --> <div style="height:4px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-title {"isLink":false,"style":{"typography":{"fontStyle":"normal","fontWeight":"300","lineHeight":"1.2"}},"fontSize":"large","fontFamily":"source-serif-pro"} /--> <!-- wp:site-tagline /--> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:heading {"level":4,"fontSize":"large"} --> <h4 class="has-large-font-size"><em>' . esc_html__( 'Categories', 'twentytwentytwo' ) . '</em></h4> <!-- /wp:heading --> <!-- wp:tag-cloud {"taxonomy":"category","showTagCounts":true} /--> <!-- wp:heading {"level":4,"fontSize":"large"} --> <h4 class="has-large-font-size"><em>' . esc_html__( 'Tags', 'twentytwentytwo' ) . '</em></h4> <!-- /wp:heading --> <!-- wp:tag-cloud {"showTagCounts":true} /--></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/header-image-background.php 0000644 00000004562 15252503364 0013556 0 ustar 00 <?php /** * Header with image background block pattern */ return array( 'title' => __( 'Header with image background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:cover {"url":"' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-c.jpg","dimRatio":0,"focalPoint":{"x":"0.58","y":"0.58"},"minHeight":400,"contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}},"color":{}}} --> <div class="wp-block-cover alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem);min-height:400px"><span aria-hidden="true" class="has-background-dim-0 wp-block-cover__gradient-background has-background-dim"></span><img class="wp-block-cover__image-background" alt="' . esc_attr__( 'Illustration of a flying bird', 'twentytwentytwo' ) . '" src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-c.jpg" style="object-position:58% 58%" data-object-fit="cover" data-object-position="58% 58%"/><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}},"textColor":"foreground","layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide has-foreground-color has-text-color has-link-color" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --> <!-- wp:spacer {"height":500} --> <div style="height:500px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div></div> <!-- /wp:cover --></div> <!-- /wp:group -->', ); patterns/footer-about-title-logo.php 0000644 00000003433 15252503364 0013610 0 ustar 00 <?php /** * Footer with text, title, and logo */ return array( 'title' => __( 'Footer with text, title, and logo', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"6rem"}}},"backgroundColor":"secondary","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-secondary-background-color has-background" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:6rem"><!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"33%"} --> <div class="wp-block-column" style="flex-basis:33%"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} --> <p style="text-transform:uppercase">' . esc_html__( 'About us', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:paragraph {"style":{"fontSize":"small"} --> <p class="has-small-font-size">' . esc_html__( 'We are a rogue collective of bird watchers. We’ve been known to sneak through fences, climb perimeter walls, and generally trespass in order to observe the rarest of birds.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":180} --> <div style="height:180px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-title {"level":0} /--></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"bottom"} --> <div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:site-logo {"align":"right","width":60} /--></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/header-centered-logo.php 0000644 00000003505 15252503364 0013102 0 ustar 00 <?php /** * Header with centered logo block pattern */ return array( 'title' => __( 'Header with centered logo', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem);"><!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /--></div> <!-- /wp:column --> <!-- wp:column {"width":"64px"} --> <div class="wp-block-column" style="flex-basis:64px"><!-- wp:site-logo {"width":64} /--></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/general-featured-posts.php 0000644 00000002162 15252503364 0013503 0 ustar 00 <?php /** * Featured posts block pattern */ return array( 'title' => __( 'Featured posts', 'twentytwentytwo' ), 'categories' => array( 'featured', 'query' ), 'content' => '<!-- wp:group {"align":"wide","layout":{"inherit":false}} --> <div class="wp-block-group alignwide"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} --> <p style="text-transform:uppercase">' . esc_html__( 'Latest posts', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"displayLayout":{"type":"flex","columns":3}} --> <div class="wp-block-query"><!-- wp:post-template --> <!-- wp:post-featured-image {"isLink":true,"width":"","height":"310px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --></div> <!-- /wp:group -->', ); patterns/header-with-tagline.php 0000644 00000003063 15252503364 0012746 0 ustar 00 <?php /** * Header with tagline block pattern */ return array( 'title' => __( 'Header with tagline', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:site-logo {"width":64} /--> <!-- wp:group --> <div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:group --></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/footer-dark.php 0000644 00000002645 15252503364 0011346 0 ustar 00 <?php /** * Dark footer with title and citation */ return array( 'title' => __( 'Dark footer with title and citation', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide"><!-- wp:site-title {"level":0} /--> <!-- wp:paragraph {"align":"right"} --> <p class="has-text-align-right">' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-list-events.php 0000644 00000017625 15252503364 0013025 0 ustar 00 <?php /** * List of events block pattern */ return array( 'title' => __( 'List of events', 'twentytwentytwo' ), 'categories' => array( 'featured', 'text' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"primary","textColor":"background"} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(3.25rem, 8vw, 6.25rem)","lineHeight":"1.15"},"spacing":{"margin":{"bottom":"2rem"}}}} --> <h2 class="alignwide" style="font-size:clamp(3.25rem, 8vw, 6.25rem);line-height:1.15;margin-bottom:2rem"><em>' . esc_html__( 'Speaker Series', 'twentytwentytwo' ) . '</em></h2> <!-- /wp:heading --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph --> <p>' . esc_html__( 'May 14th, 2022, 6 PM', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Jesús Rodriguez', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'The Vintagé Theater<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph --> <p>' . esc_html__( 'May 16th, 2022, 6 PM', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Doug Stilton', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'The Swell Theater<br>120 River Rd.<br>Rainfall, NH', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph --> <p>' . esc_html__( 'May 18th, 2022, 7 PM', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Amy Jensen', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'The Vintagé Theater<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph --> <p>' . esc_html__( 'May 20th, 2022, 6 PM', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Emery Driscoll', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'The Swell Theater<br>120 River Rd.<br>Rainfall, NH', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:group {"align":"wide"} --> <div class="wp-block-group alignwide"><!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--background)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"right"}} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:group --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-divider-light.php 0000644 00000001622 15252503364 0013271 0 ustar 00 <?php /** * Divider with image and color (light) block pattern */ return array( 'title' => __( 'Divider with image and color (light)', 'twentytwentytwo' ), 'categories' => array( 'featured' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"1rem","right":"0px","bottom":"1rem","left":"0px"}}},"backgroundColor":"secondary"} --> <div class="wp-block-group alignfull has-secondary-background-color has-background" style="padding-top:1rem;padding-right:0px;padding-bottom:1rem;padding-left:0px"><!-- wp:image {"id":473,"width":3001,"height":246,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/divider-black.png" alt="" class="wp-image-473" width="3001" height="246"/></figure> <!-- /wp:image --></div> <!-- /wp:group -->', ); patterns/page-sidebar-blog-posts.php 0000644 00000010704 15252503364 0013536 0 ustar 00 <?php /** * Blog posts with left sidebar block pattern */ return array( 'title' => __( 'Blog posts with left sidebar', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"},"blockGap":"5%"},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary"} --> <div class="wp-block-columns alignwide has-primary-color has-text-color has-link-color" style="margin-top:0px;margin-bottom:0px"><!-- wp:column {"width":"33.33%"} --> <div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:cover {"overlayColor":"secondary","minHeight":400,"isDark":false} --> <div class="wp-block-cover is-light" style="min-height:400px"><span aria-hidden="true" class="has-secondary-background-color has-background-dim-100 wp-block-cover__gradient-background has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:site-logo {"align":"center","width":60} /--></div></div> <!-- /wp:cover --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-tagline {"fontSize":"small"} /--> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:separator {"color":"foreground","className":"is-style-wide"} --> <hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:navigation {"orientation":"vertical"} --> <!-- wp:page-list /--> <!-- /wp:navigation --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:separator {"color":"foreground","className":"is-style-wide"} --> <hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/> <!-- /wp:separator --></div> <!-- /wp:column --> <!-- wp:column {"width":"66.66%"} --> <div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:query {"query":{"perPage":"5","pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"inherit":true}} --> <div class="wp-block-query"><!-- wp:post-template --> <!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"0","bottom":"1rem"}},"typography":{"fontStyle":"normal","fontWeight":"300"},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /--> <!-- wp:post-featured-image {"isLink":true} /--> <!-- wp:post-excerpt /--> <!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:post-date {"format":"F j, Y","style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /--> <!-- wp:post-terms {"term":"category","fontSize":"small"} /--> <!-- wp:post-terms {"term":"post_tag","fontSize":"small"} /--></div> <!-- /wp:group --> <!-- wp:spacer {"height":128} --> <div style="height:128px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- /wp:post-template --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/footer-query-title-citation.php 0000644 00000004200 15252503364 0014506 0 ustar 00 <?php /** * Footer with query, title, and citation */ return array( 'title' => __( 'Footer with query, title, and citation', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3},"align":"wide"} --> <div class="wp-block-query alignwide"><!-- wp:post-template --> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"isLink":true} /--> <!-- /wp:post-template --></div> <!-- /wp:query --> <!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /--> <!-- wp:group {"layout":{"type":"flex","justifyContent":"right"}} --> <div class="wp-block-group"> <!-- wp:paragraph --> <p>' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-video-header-details.php 0000644 00000005272 15252503364 0014522 0 ustar 00 <?php /** * Video with header and details block pattern */ return array( 'title' => __( 'Video with header and details', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}},"elements":{"link":{"color":{"text":"var:preset|color|secondary"}}}},"backgroundColor":"foreground","textColor":"secondary"} --> <div class="wp-block-group alignfull has-secondary-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} --> <h1 class="alignwide" id="warble-a-film-about-hobbyist-bird-watchers-1" style="font-size:clamp(3rem, 6vw, 4.5rem)">' . wp_kses_post( __( '<em>Warble</em>, a film about <br>hobbyist bird watchers.', 'twentytwentytwo' ) ) . '</h1> <!-- /wp:heading --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:video {"align":"wide"} --> <figure class="wp-block-video alignwide"><video controls src="' . esc_url( get_template_directory_uri() ) . '/assets/videos/birds.mp4"></video></figure> <!-- /wp:video --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"50%"} --> <div class="wp-block-column" style="flex-basis:50%"><!-- wp:paragraph --> <p><strong>' . esc_html__( 'Featuring', 'twentytwentytwo' ) . '</strong></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'Jesús Rodriguez<br>Doug Stilton<br>Emery Driscoll<br>Megan Perry<br>Rowan Price', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>' . wp_kses_post( __( 'Angelo Tso<br>Edward Stilton<br>Amy Jensen<br>Boston Bell<br>Shay Ford', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/header-title-and-button.php 0000644 00000002300 15252503364 0013535 0 ustar 00 <?php /** * Title and button header block pattern */ return array( 'title' => __( 'Title and button header', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"},"overlayMenu":"always"} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-wide-image-intro-buttons.php 0000644 00000004625 15252503364 0015401 0 ustar 00 <?php /** * Wide image with introduction and buttons block pattern */ return array( 'title' => __( 'Wide image with introduction and buttons', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns' ), 'content' => '<!-- wp:group {"align":"wide"} --> <div class="wp-block-group alignwide"><!-- wp:image {"width":2100,"height":994,"sizeSlug":"large"} --> <figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-a.jpg" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2100" height="994"/></figure> <!-- /wp:image --> <!-- wp:columns {"verticalAlignment":null} --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"bottom"} --> <div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:heading {"style":{"typography":{"fontSize":"clamp(3.25rem, 8vw, 6.25rem)","lineHeight":"1.15"}}} --> <h2 style="font-size:clamp(3.25rem, 8vw, 6.25rem);line-height:1.15"><em>' . wp_kses_post( __( 'Welcome to<br>the Aviary', 'twentytwentytwo' ) ) . '</em></h2> <!-- /wp:heading --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"bottom","style":{"spacing":{"padding":{"bottom":"6rem"}}}} --> <div class="wp-block-column is-vertically-aligned-bottom" style="padding-bottom:6rem"><!-- wp:paragraph --> <p>' . esc_html__( 'A film about hobbyist bird watchers, a catalog of different birds, paired with the noises they make. Each bird is listed by their scientific name so things seem more official.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":20} --> <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"className":"is-style-outline"} --> <div class="wp-block-button is-style-outline"><a class="wp-block-button__link">' . esc_html__( 'Learn More', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"className":"is-style-outline"} --> <div class="wp-block-button is-style-outline"><a class="wp-block-button__link">' . esc_html__( 'Buy Tickets', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/general-pricing-table.php 0000644 00000011754 15252503364 0013265 0 ustar 00 <?php /** * Pricing table block pattern */ return array( 'title' => __( 'Pricing table', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns', 'buttons' ), 'content' => '<!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --> <!-- wp:heading {"style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--gigantic, clamp(2.75rem, 6vw, 3.25rem))","lineHeight":"0.5"}}} --> <h2 id="1" style="font-size:var(--wp--custom--typography--font-size--gigantic, clamp(2.75rem, 6vw, 3.25rem));line-height:0.5">' . esc_html( _x( '1', 'First item in a numbered list.', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --> <!-- wp:heading {"level":3,"fontSize":"x-large"} --> <h3 class="has-x-large-font-size" id="pigeon"><em>' . esc_html__( 'Pigeon', 'twentytwentytwo' ) . '</em></h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . esc_html__( 'Help support our growing community by joining at the Pigeon level. Your support will help pay our writers, and you’ll get access to our exclusive newsletter.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground","width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( '$25', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --> <!-- wp:heading {"style":{"typography":{"fontSize":"clamp(2.75rem, 6vw, 3.25rem)","lineHeight":"0.5"}}} --> <h2 id="2" style="font-size:clamp(2.75rem, 6vw, 3.25rem);line-height:0.5">' . esc_html( _x( '2', 'Second item in a numbered list.', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --> <!-- wp:heading {"level":3,"fontSize":"x-large"} --> <h3 class="has-x-large-font-size" id="sparrow"><meta charset="utf-8"><em>' . esc_html__( 'Sparrow', 'twentytwentytwo' ) . '</em></h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . esc_html__( 'Join at the Sparrow level and become a member of our flock! You’ll receive our newsletter, plus a bird pin that you can wear with pride when you’re out in nature.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground","width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( '$75', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --> <!-- wp:heading {"style":{"typography":{"fontSize":"clamp(2.75rem, 6vw, 3.25rem)","lineHeight":"0.5"}}} --> <h2 id="3" style="font-size:clamp(2.75rem, 6vw, 3.25rem);line-height:0.5">' . esc_html( _x( '3', 'Third item in a numbered list.', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --> <!-- wp:heading {"level":3,"fontSize":"x-large"} --> <h3 class="has-x-large-font-size" id="falcon"><meta charset="utf-8"><em>' . esc_html__( 'Falcon', 'twentytwentytwo' ) . '</em></h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . esc_html__( 'Play a leading role for our community by joining at the Falcon level. This level earns you a seat on our board, where you can help plan future birdwatching expeditions.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground","width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( '$150', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:column --></div> <!-- /wp:columns -->', ); patterns/header-centered-logo-black-background.php 0000644 00000002463 15252503364 0016273 0 ustar 00 <?php /** * Header with centered logo and black background */ return array( 'title' => __( 'Header with centered logo and background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--small, 1.25rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background","layout":{"type":"flex","justifyContent":"center"}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:navigation-link {"isTopLevelLink":true} /--> <!-- wp:navigation-link {"isTopLevelLink":true} /--> <!-- wp:site-logo {"width":90} /--> <!-- wp:navigation-link {"isTopLevelLink":true} /--> <!-- wp:navigation-link {"isTopLevelLink":true} /--> <!-- /wp:navigation --></div> <!-- /wp:group -->', ); patterns/footer-default.php 0000644 00000002004 15252503364 0012036 0 ustar 00 <?php /** * Default footer */ return array( 'title' => __( 'Default footer', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /--> <!-- wp:paragraph {"align":"right"} --> <p class="has-text-align-right">' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-two-images-text.php 0000644 00000005275 15252503364 0013604 0 ustar 00 <?php /** * Two images with text block pattern */ return array( 'title' => __( 'Two images with text', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns', 'gallery' ), 'content' => '<!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"0rem","left":"0rem"}}}} --> <div class="wp-block-column" style="padding-top:0rem;padding-right:0rem;padding-bottom:0rem;padding-left:0rem"><!-- wp:image {"width":984,"height":1426,"sizeSlug":"large"} --> <figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg" alt="' . esc_attr__( 'Illustration of a bird sitting on a branch.', 'twentytwentytwo' ) . '" width="984" height="1426"/></figure> <!-- /wp:image --></div> <!-- /wp:column --> <!-- wp:column {"style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"0rem","left":"0rem"}}}} --> <div class="wp-block-column" style="padding-top:0rem;padding-right:0rem;padding-bottom:0rem;padding-left:0rem"><!-- wp:image {"width":984,"height":1426,"sizeSlug":"large"} --> <figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-green.jpg" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="984" height="1426"/></figure> <!-- /wp:image --> <!-- wp:spacer {"height":30} --> <div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size" id="screening">' . esc_html__( 'SCREENING', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . wp_kses_post( __( 'May 14th, 2022 @ 7:00PM<br>The Vintagé Theater,<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":8} --> <div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:spacer {"height":10} --> <div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground"} --> <div class="wp-block-button"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( 'Buy Tickets', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --></div> <!-- /wp:columns -->', ); patterns/header-text-only-salmon-background.php 0000644 00000002645 15252503364 0015726 0 ustar 00 <?php /** * Text-only header with salmon background block pattern */ return array( 'title' => __( 'Text-only header with background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"secondary","textColor":"foreground","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-foreground-color has-secondary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/query-text-grid.php 0000644 00000002456 15252503364 0012203 0 ustar 00 <?php /** * Text-based grid of posts block pattern */ return array( 'title' => __( 'Text-based grid of posts', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":12},"displayLayout":{"type":"flex","columns":3},"align":"wide","layout":{"inherit":true}} --> <div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} --> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --> <!-- wp:separator {"align":"wide","className":"is-style-wide"} --> <hr class="wp-block-separator alignwide is-style-wide"/> <!-- /wp:separator --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query -->', ); patterns/page-about-links-dark.php 0000644 00000007131 15252503364 0013205 0 ustar 00 <?php /** * About page links (dark) */ return array( 'title' => __( 'About page links (dark)', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages', 'buttons' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"10rem","bottom":"10rem"}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":false,"contentSize":"400px"}} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:10rem;padding-bottom:10rem;"><!-- wp:group --> <div class="wp-block-group"> <!-- wp:image {"width":100,"height":100,"sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} --> <figure class="wp-block-image size-full is-resized is-style-rounded"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-bird.jpg" alt="' . esc_attr__( 'Logo featuring a flying bird', 'twentytwentytwo' ) . '" width="100" height="100"/></figure> <!-- /wp:image --> <!-- wp:heading {"textAlign":"left","style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"}}} --> <h2 class="has-text-align-left" style="font-size:var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))">' . esc_html__( 'A trouble of hummingbirds', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:buttons {"contentJustification":"left"} --> <div class="wp-block-buttons is-content-justification-left"><!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Watch our videos', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on iTunes Podcasts', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on Spotify', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Support the show', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'About the hosts', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-large-list-names.php 0000644 00000004573 15252503364 0013712 0 ustar 00 <?php /** * Large list of names block pattern */ return array( 'title' => __( 'Large list of names', 'twentytwentytwo' ), 'categories' => array( 'featured', 'text' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"6rem","bottom":"6rem"}},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"backgroundColor":"tertiary","textColor":"primary","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-primary-color has-tertiary-background-color has-text-color has-background has-link-color" style="padding-top:6rem;padding-bottom:6rem"><!-- wp:group {"align":"wide"} --> <div class="wp-block-group alignwide"><!-- wp:image {"width":175,"height":82,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-binoculars.png" alt="' . esc_attr__( 'An icon representing binoculars.', 'twentytwentytwo' ) . '" width="175" height="82"/></figure> <!-- /wp:image --></div> <!-- /wp:group --> <!-- wp:group {"align":"wide"} --> <div class="wp-block-group alignwide"><!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:paragraph {"style":{"typography":{"fontWeight":"300"}},"fontSize":"x-large"} --> <p class="has-x-large-font-size" style="font-weight:300">' . esc_html__( 'Jesús Rodriguez, Doug Stilton, Emery Driscoll, Megan Perry, Rowan Price, Angelo Tso, Edward Stilton, Amy Jensen, Boston Bell, Shay Ford, Lee Cunningham, Evelynn Ray, Landen Reese, Ewan Hart, Jenna Chan, Phoenix Murray, Mel Saunders, Aldo Davidson, Zain Hall.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"primary","textColor":"background"} --> <div class="wp-block-button"><a class="wp-block-button__link has-background-color has-primary-background-color has-text-color has-background">' . esc_html__( 'Read more', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/query-large-titles.php 0000644 00000002517 15252503364 0012666 0 ustar 00 <?php /** * Large post titles block pattern */ return array( 'title' => __( 'Large post titles', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:query {"query":{"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"perPage":8},"align":"wide"} --> <div class="wp-block-query alignwide"><!-- wp:post-template --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"top","width":"4em"} --> <div class="wp-block-column is-vertically-aligned-top" style="flex-basis:4em"><!-- wp:post-date {"format":"M j","fontSize":"small"} /--></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center","width":""} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontSize":"clamp(2.75rem, 6vw, 3.25rem)"}}} /--></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --> <!-- /wp:post-template --></div> <!-- /wp:query -->', ); patterns/footer-title-tagline-social.php 0000644 00000003427 15252503364 0014436 0 ustar 00 <?php /** * Footer with title, tagline, and social links on a dark background */ return array( 'title' => __( 'Footer with title, tagline, and social links on a dark background', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:group --> <div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"textTransform":"uppercase"}}} /--> <!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:group --> <!-- wp:social-links {"iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--foreground)","layout":{"type":"flex","justifyContent":"right"}} --> <ul class="wp-block-social-links has-icon-background-color"><!-- wp:social-link {"url":"#","service":"facebook"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-about-solid-color.php 0000644 00000005340 15252503364 0013374 0 ustar 00 <?php /** * About page on solid color background */ return array( 'title' => __( 'About page on solid color background', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"1.25rem","right":"1.25rem","bottom":"1.25rem","left":"1.25rem"}}}} --> <div class="wp-block-group alignfull" style="padding-top:1.25rem;padding-right:1.25rem;padding-bottom:1.25rem;padding-left:1.25rem"><!-- wp:cover {"overlayColor":"secondary","minHeight":80,"minHeightUnit":"vh","isDark":false,"align":"full"} --> <div class="wp-block-cover alignfull is-light" style="min-height:80vh"><span aria-hidden="true" class="has-secondary-background-color has-background-dim-100 wp-block-cover__gradient-background has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:group {"layout":{"inherit":false,"contentSize":"400px"}} --> <div class="wp-block-group"><!-- wp:spacer {"height":64} --> <div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --><!-- wp:heading {"style":{"typography":{"lineHeight":"1","textTransform":"uppercase","fontSize":"clamp(2.75rem, 6vw, 3.25rem)"}}} --> <h2 id="edvard-smith" style="font-size:clamp(2.75rem, 6vw, 3.25rem);line-height:1;text-transform:uppercase">' . wp_kses_post( __( 'Edvard<br>Smith', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --> <!-- wp:spacer {"height":8} --> <div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:paragraph {"fontSize":"small"} --> <p class="has-small-font-size">' . esc_html__( 'Oh hello. My name’s Edvard, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show every Tuesday evening at 11PM EDT. Listen in sometime!', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":8} --> <div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only"} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --><!-- wp:spacer {"height":64} --> <div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --></div> <!-- /wp:group --></div></div> <!-- /wp:cover --></div> <!-- /wp:group -->', ); patterns/header-text-only-green-background.php 0000644 00000003116 15252503364 0015527 0 ustar 00 <?php /** * Text-only header with green background block pattern */ return array( 'title' => __( 'Text-only header with background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide"><!-- wp:group --> <div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> <!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/footer-logo.php 0000644 00000002035 15252503364 0011356 0 ustar 00 <?php /** * Default footer with logo */ return array( 'title' => __( 'Footer with logo and citation', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-logo {"width":60} /--> <!-- wp:paragraph {"align":"right"} --> <p class="has-text-align-right">' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/general-video-trailer.php 0000644 00000003227 15252503364 0013307 0 ustar 00 <?php /** * Video trailer block pattern */ return array( 'title' => __( 'Video trailer', 'twentytwentytwo' ), 'categories' => array( 'featured', 'columns' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}},"spacing":{"padding":{"top":"6rem","bottom":"4rem"}}},"backgroundColor":"secondary","textColor":"foreground","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-foreground-color has-secondary-background-color has-text-color has-background has-link-color" style="padding-top:6rem;padding-bottom:4rem"><!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.33%"} --> <div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:heading {"fontSize":"x-large"} --> <h2 class="has-x-large-font-size" id="extended-trailer">' . esc_html__( 'Extended Trailer', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p>' . esc_html__( 'A film about hobbyist bird watchers, a catalog of different birds, paired with the noises they make. Each bird is listed by their scientific name so things seem more official.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"width":"66.66%"} --> <div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:video --> <figure class="wp-block-video"><video controls src="' . esc_url( get_template_directory_uri() ) . '/assets/videos/birds.mp4"></video></figure> <!-- /wp:video --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/page-about-large-image-and-buttons.php 0000644 00000010461 15252503364 0015554 0 ustar 00 <?php /** * About page with large image and buttons */ return array( 'title' => __( 'About page with large image and buttons', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages', 'buttons' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:image {"align":"wide","width":2100,"height":1260,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image alignwide size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-b.jpg" alt="" width="2100" height="1260"/></figure> <!-- /wp:image --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Purchase my work', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Support my studio', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Take a class', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Read about me', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Learn about my process', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"width":100} --> <div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Join my mailing list', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--preset--color--primary)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"center"}} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"facebook"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:group -->', ); patterns/header-centered-title-navigation-social.php 0000644 00000004267 15252503364 0016676 0 ustar 00 <?php /** * Centered header with navigation, social links, and salmon background block pattern */ return array( 'title' => __( 'Centered header with navigation, social links, and background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|primary"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"secondary","textColor":"primary","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-primary-color has-secondary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem);"><!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"left"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:column --> <!-- wp:column {"width":""} --> <div class="wp-block-column"><!-- wp:site-title {"textAlign":"center","style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"700"}}} /--></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--custom--color--primary)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"right"}} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); patterns/footer-blog.php 0000644 00000005306 15252503364 0011345 0 ustar 00 <?php /** * Blog footer */ return array( 'title' => __( 'Blog footer', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} --> <p style="text-transform:uppercase">' . esc_html__( 'About us', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>' . esc_html__( 'We are a rogue collective of bird watchers. We’ve been known to sneak through fences, climb perimeter walls, and generally trespass in order to observe the rarest of birds.', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} --> <p style="text-transform:uppercase">' . esc_html__( 'Latest posts', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:latest-posts /--></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} --> <p style="text-transform:uppercase">' . esc_html__( 'Categories', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:categories /--></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:spacer {"height":50} --> <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /--> <!-- wp:paragraph {"align":"right"} --> <p class="has-text-align-right">' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/hidden-heading-and-bird.php 0000644 00000002620 15252503364 0013430 0 ustar 00 <?php /** * Heading and bird image * * This pattern is used only for translation * and to reference a dynamic image URL. It does * not appear in the inserter. */ return array( 'title' => __( 'Heading and bird image', 'twentytwentytwo' ), 'inserter' => false, 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:0px;padding-bottom:0px;"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--colossal, clamp(3.25rem, 8vw, 6.25rem))","lineHeight":"1.15"}}} --> <h2 class="alignwide" style="font-size:var(--wp--custom--typography--font-size--colossal, clamp(3.25rem, 8vw, 6.25rem));line-height:1.15">' . wp_kses_post( __( '<em>The Hatchery</em>: a blog about my adventures in bird watching', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:group --> <!-- wp:image {"align":"full","width":2400,"height":1020,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image alignfull size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-c.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2400" height="1020"/></figure> <!-- /wp:image -->', ); patterns/general-subscribe.php 0000644 00000002715 15252503364 0012523 0 ustar 00 <?php /** * Subscribe callout block pattern */ return array( 'title' => __( 'Subscribe callout', 'twentytwentytwo' ), 'categories' => array( 'featured', 'buttons' ), 'content' => '<!-- wp:columns {"verticalAlignment":"center","align":"wide"} --> <div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading --> <h2>' . wp_kses_post( __( 'Watch birds<br>from your inbox', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --> <!-- wp:buttons --> <div class="wp-block-buttons"><!-- wp:button {"fontSize":"medium"} --> <div class="wp-block-button has-custom-font-size has-medium-font-size"><a class="wp-block-button__link">' . esc_html__( 'Join our mailing list', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"2rem","bottom":"2rem"}}}} --> <div class="wp-block-column is-vertically-aligned-center" style="padding-top:2rem;padding-bottom:2rem"><!-- wp:separator {"color":"primary","className":"is-style-wide"} --> <hr class="wp-block-separator has-text-color has-background has-primary-background-color has-primary-color is-style-wide"/> <!-- /wp:separator --></div> <!-- /wp:column --></div> <!-- /wp:columns -->', ); patterns/header-logo-navigation-offset-tagline.php 0000644 00000003333 15252503364 0016354 0 ustar 00 <?php /** * Logo, navigation, and offset tagline Header block pattern */ return array( 'title' => __( 'Logo, navigation, and offset tagline Header', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","layout":{"inherit":true}} --> <div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)"}}}} --> <div class="wp-block-group alignwide" style="padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:site-logo {"width":64} /--> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> <!-- /wp:navigation --></div> <!-- /wp:group --> <!-- wp:columns {"isStackedOnMobile":false,"align":"wide"} --> <div class="wp-block-columns alignwide is-not-stacked-on-mobile"><!-- wp:column {"width":"64px"} --> <div class="wp-block-column" style="flex-basis:64px"></div> <!-- /wp:column --> <!-- wp:column {"width":"380px"} --> <div class="wp-block-column" style="flex-basis:380px"><!-- wp:site-tagline {"fontSize":"small"} /--></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/footer-query-images-title-citation.php 0000644 00000004444 15252503364 0015763 0 ustar 00 <?php /** * Footer with query, featured images, title, and citation */ return array( 'title' => __( 'Footer with query, featured images, title, and citation', 'twentytwentytwo' ), 'categories' => array( 'footer' ), 'blockTypes' => array( 'core/template-part/footer' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3},"align":"wide"} --> <div class="wp-block-query alignwide"><!-- wp:post-template --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /--> <!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /--> <!-- wp:post-excerpt /--> <!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /--> <!-- /wp:post-template --></div> <!-- /wp:query --> <!-- wp:spacer --> <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /--> <!-- wp:group {"layout":{"type":"flex","justifyContent":"right"}} --> <div class="wp-block-group"> <!-- wp:paragraph --> <p>' . sprintf( /* Translators: WordPress link. */ esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ), '<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>' ) . '</p> <!-- /wp:paragraph --></div> <!-- /wp:group --></div> <!-- /wp:group --></div> <!-- /wp:group -->', ); patterns/page-about-links.php 0000644 00000010344 15252503364 0012266 0 ustar 00 <?php /** * About page links */ return array( 'title' => __( 'About page links', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages', 'buttons' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"10rem","bottom":"10rem"}}},"layout":{"inherit":false,"contentSize":"400px"}} --> <div class="wp-block-group alignfull" style="padding-top:10rem;padding-bottom:10rem;"><!-- wp:image {"align":"center","width":100,"height":100,"sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} --> <div class="wp-block-image is-style-rounded"><figure class="aligncenter size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-bird.jpg" alt="' . esc_attr__( 'Logo featuring a flying bird', 'twentytwentytwo' ) . '" width="100" height="100"/></figure></div> <!-- /wp:image --> <!-- wp:group --> <div class="wp-block-group"> <!-- wp:heading {"textAlign":"center","style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"}}} --> <h2 class="has-text-align-center" style="font-size:var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))">' . esc_html__( 'Swoop', 'twentytwentytwo' ) . '</h2> <!-- /wp:heading --> <!-- wp:paragraph {"align":"center"} --> <p class="has-text-align-center">' . esc_html__( 'A podcast about birds', 'twentytwentytwo' ) . '</p> <!-- /wp:paragraph --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:buttons {"contentJustification":"left"} --> <div class="wp-block-buttons is-content-justification-left"><!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Watch our videos', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on iTunes Podcasts', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on Spotify', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Support the show', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --> <!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} --> <div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'About the hosts', 'twentytwentytwo' ) . '</a></div> <!-- /wp:button --></div> <!-- /wp:buttons --></div> <!-- /wp:group --> <!-- wp:spacer {"height":40} --> <div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--preset--color--primary)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"center"}} --> <ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /--> <!-- wp:social-link {"url":"#","service":"facebook"} /--> <!-- wp:social-link {"url":"#","service":"twitter"} /--> <!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> <!-- /wp:social-links --></div> <!-- /wp:group -->', ); patterns/query-image-grid.php 0000644 00000003573 15252503364 0012302 0 ustar 00 <?php /** * Grid of image posts block pattern */ return array( 'title' => __( 'Grid of image posts', 'twentytwentytwo' ), 'categories' => array( 'query' ), 'blockTypes' => array( 'core/query' ), 'content' => '<!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","inherit":false,"perPage":12},"displayLayout":{"type":"flex","columns":3},"layout":{"inherit":true}} --> <div class="wp-block-query"><!-- wp:post-template --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"200px"} /--> <!-- wp:columns {"isStackedOnMobile":false,"style":{"spacing":{"blockGap":"0.5rem"}}} --> <div class="wp-block-columns is-not-stacked-on-mobile"><!-- wp:column --> <div class="wp-block-column"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"400"},"spacing":{"margin":{"top":"0.2em"}}},"fontSize":"small","fontFamily":"system-font"} /--></div> <!-- /wp:column --> <!-- wp:column {"width":"4em"} --> <div class="wp-block-column" style="flex-basis:4em"><!-- wp:post-date {"textAlign":"right","format":"m.d.y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- /wp:post-template --> <!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator alignwide is-style-wide"/> <!-- /wp:separator --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query -->', ); patterns/header-small-dark.php 0000644 00000004501 15252503364 0012377 0 ustar 00 <?php /** * Small header with dark background block pattern */ return array( 'title' => __( 'Small header with dark background', 'twentytwentytwo' ), 'categories' => array( 'header' ), 'blockTypes' => array( 'core/template-part/header' ), 'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> <div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:0px;padding-bottom:0px;"><!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:0px;padding-bottom:0px;"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} --> <div class="wp-block-group"><!-- wp:site-logo {"width":64} /--> <!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> <!-- /wp:group --> <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} --> <!-- wp:page-list /--> <!-- /wp:navigation --></div> <!-- /wp:group --></div> <!-- /wp:group --> <!-- wp:image {"align":"wide","width":2000,"height":474,"sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image alignwide size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-d.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2000" height="474"/></figure> <!-- /wp:image --></div> <!-- /wp:group --> <!-- wp:spacer {"height":66} --> <div style="height:66px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer -->', ); patterns/page-sidebar-grid-posts.php 0000644 00000010137 15252503364 0013540 0 ustar 00 <?php /** * Grid of posts with left sidebar block pattern */ return array( 'title' => __( 'Grid of posts with left sidebar', 'twentytwentytwo' ), 'categories' => array( 'twentytwentytwo_pages' ), 'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}}} --> <div class="wp-block-columns alignwide" style="margin-top:0px;margin-bottom:0px"><!-- wp:column {"width":"30%"} --> <div class="wp-block-column" style="flex-basis:30%"><!-- wp:site-title {"isLink":false,"style":{"spacing":{"margin":{"top":"0px","bottom":"1rem"}},"typography":{"fontStyle":"italic","fontWeight":"300","lineHeight":"1.1"}},"fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))","fontFamily":"source-serif-pro"} /--> <!-- wp:site-tagline {"fontSize":"small"} /--> <!-- wp:spacer {"height":32} --> <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:separator {"color":"foreground","className":"is-style-wide"} --> <hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:navigation {"orientation":"vertical"} --> <!-- wp:page-list /--> <!-- /wp:navigation --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:separator {"color":"foreground","className":"is-style-wide"} --> <hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/> <!-- /wp:separator --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:spacer {"height":16} --> <div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer --> <!-- wp:site-logo {"width":60} /--></div> <!-- /wp:column --> <!-- wp:column {"width":"70%"} --> <div class="wp-block-column" style="flex-basis:70%"><!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","inherit":false,"perPage":12},"displayLayout":{"type":"flex","columns":3},"layout":{"inherit":true}} --> <div class="wp-block-query"><!-- wp:post-template --> <!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"200px"} /--> <!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between"}} --> <div class="wp-block-group"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small","fontFamily":"system-font"} /--> <!-- wp:post-date {"format":"m.d.y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> <!-- /wp:group --> <!-- /wp:post-template --> <!-- wp:separator {"className":"alignwide is-style-wide"} --> <hr class="wp-block-separator alignwide is-style-wide"/> <!-- /wp:separator --> <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} --> <!-- wp:query-pagination-previous {"fontSize":"small"} /--> <!-- wp:query-pagination-numbers /--> <!-- wp:query-pagination-next {"fontSize":"small"} /--> <!-- /wp:query-pagination --></div> <!-- /wp:query --></div> <!-- /wp:column --></div> <!-- /wp:columns --></div> <!-- /wp:group -->', ); block-patterns.php 0000644 00000046447 15252503364 0010231 0 ustar 00 <?php /** * Block Patterns * * @link https://developer.wordpress.org/reference/functions/register_block_pattern/ * @link https://developer.wordpress.org/reference/functions/register_block_pattern_category/ * * @package WordPress * @subpackage Twenty_Twenty_One * @since 1.0.0 */ /** * Register Block Pattern Category. */ if ( function_exists( 'register_block_pattern_category' ) ) { register_block_pattern_category( 'twentytwentyone', array( 'label' => esc_html__( 'Twenty Twenty-One', 'twentytwentyone' ) ) ); } /** * Register Block Patterns. */ if ( function_exists( 'register_block_pattern' ) ) { // Large Text. register_block_pattern( 'twentytwentyone/large-text', array( 'title' => esc_html__( 'Large text', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'content' => '<!-- wp:heading {"align":"wide","fontSize":"gigantic","style":{"typography":{"lineHeight":"1.1"}}} --><h2 class="alignwide has-text-align-wide has-gigantic-font-size" style="line-height:1.1">' . esc_html__( 'A new portfolio default theme for WordPress', 'twentytwentyone' ) . '</h2><!-- /wp:heading -->', ) ); // Links Area. register_block_pattern( 'twentytwentyone/links-area', array( 'title' => esc_html__( 'Links area', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1440, 'description' => esc_html_x( 'A huge text followed by social networks and email address links.', 'Block pattern description', 'twentytwentyone' ), 'content' => '<!-- wp:cover {"overlayColor":"green","contentPosition":"center center","align":"wide","className":"is-style-twentytwentyone-border"} --><div class="wp-block-cover alignwide has-green-background-color has-background-dim is-style-twentytwentyone-border"><div class="wp-block-cover__inner-container"><!-- wp:spacer {"height":20} --><div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div><!-- /wp:spacer --><!-- wp:paragraph {"fontSize":"huge"} --><p class="has-huge-font-size">' . wp_kses_post( __( 'Let’s Connect.', 'twentytwentyone' ) ) . '</p><!-- /wp:paragraph --><!-- wp:spacer {"height":75} --><div style="height:75px" aria-hidden="true" class="wp-block-spacer"></div><!-- /wp:spacer --><!-- wp:columns --><div class="wp-block-columns"><!-- wp:column --><div class="wp-block-column"><!-- wp:paragraph --><p><a href="#" data-type="URL">' . esc_html__( 'Twitter', 'twentytwentyone' ) . '</a> / <a href="#" data-type="URL">' . esc_html__( 'Instagram', 'twentytwentyone' ) . '</a> / <a href="#" data-type="URL">' . esc_html__( 'Dribbble', 'twentytwentyone' ) . '</a></p><!-- /wp:paragraph --></div><!-- /wp:column --><!-- wp:column --><div class="wp-block-column"><!-- wp:paragraph --><p><a href="#">' . esc_html__( 'example@example.com', 'twentytwentyone' ) . '</a></p><!-- /wp:paragraph --></div><!-- /wp:column --></div><!-- /wp:columns --><!-- wp:spacer {"height":20} --><div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div><!-- /wp:spacer --></div></div><!-- /wp:cover --><!-- wp:paragraph --><p></p><!-- /wp:paragraph -->', ) ); // 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' => '<!-- wp:media-text {"mediaId":1752,"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/playing-in-the-sand.jpg","mediaType":"image","className":"is-style-twentytwentyone-border"} --><div class="wp-block-media-text alignwide is-stacked-on-mobile is-style-twentytwentyone-border"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/playing-in-the-sand.jpg" alt="' . esc_attr__( '“Playing in the Sand” by Berthe Morisot', 'twentytwentyone' ) . '" class="wp-image-1752"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"align":"center"} --><h2 class="has-text-align-center">' . esc_html__( 'Playing in the Sand', 'twentytwentyone' ) . '</h2><!-- /wp:heading --><!-- wp:separator {"className":"is-style-dots"} --><hr class="wp-block-separator is-style-dots"/><!-- /wp:separator --><!-- wp:paragraph {"align":"center","fontSize":"small"} --><p class="has-text-align-center has-small-font-size">' . wp_kses_post( __( 'Berthe Morisot<br>(French, 1841-1895)', 'twentytwentyone' ) ) . '</p><!-- /wp:paragraph --></div></div><!-- /wp:media-text -->', ) ); // Overlapping Images. register_block_pattern( 'twentytwentyone/overlapping-images', array( 'title' => esc_html__( 'Overlapping images', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'viewportWidth' => 1024, 'description' => esc_html_x( 'Three images inside an overlapping columns block.', 'Block pattern description', 'twentytwentyone' ), 'content' => '<!-- wp:columns {"verticalAlignment":"center","align":"wide","className":"is-style-twentytwentyone-columns-overlap"} --><div class="wp-block-columns alignwide are-vertically-aligned-center is-style-twentytwentyone-columns-overlap"><!-- wp:column {"verticalAlignment":"center"} --><div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"full","sizeSlug":"full"} --><figure class="wp-block-image alignfull size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/roses-tremieres-hollyhocks-1884.jpg" alt="' . esc_attr__( '“Roses Tremieres” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure><!-- /wp:image --><!-- wp:spacer --><div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div><!-- /wp:spacer --><!-- wp:image {"align":"full","sizeSlug":"full"} --><figure class="wp-block-image alignfull size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/in-the-bois-de-boulogne.jpg" alt="' . esc_attr__( '“In the Bois de Boulogne” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure><!-- /wp:image --></div><!-- /wp:column --><!-- wp:column {"verticalAlignment":"center"} --><div class="wp-block-column is-vertically-aligned-center"><!-- wp:spacer --><div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div><!-- /wp:spacer --><!-- wp:image {"align":"full",sizeSlug":"full"} --><figure class="wp-block-image alignfull size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/young-woman-in-mauve.jpg" alt="' . esc_attr__( '“Young Woman in Mauve” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure><!-- /wp:image --></div><!-- /wp:column --></div><!-- /wp:columns -->', ) ); // 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' => '<!-- wp:media-text {"mediaId":1747,"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/Daffodils.jpg","mediaType":"image"} --><div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/Daffodils.jpg" alt="' . esc_attr__( '“Daffodils” by Berthe Morisot', 'twentytwentyone' ) . '" size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:image {"align":"center","width":400,"height":512,"sizeSlug":"large","className":"is-style-twentytwentyone-image-frame"} --><figure class="wp-block-image aligncenter size-large is-resized is-style-twentytwentyone-image-frame"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/self-portrait-1885.jpg" alt="' . esc_attr__( '“Self portrait” by Berthe Morisot', 'twentytwentyone' ) . '" width="400" height="512"/></figure><!-- /wp:image --></div></div><!-- /wp:media-text -->', ) ); // 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, 'description' => esc_html_x( 'An overlapping columns block with two images and a text description.', 'Block pattern description', 'twentytwentyone' ), 'content' => '<!-- wp:columns {"verticalAlignment":null,"align":"wide","className":"is-style-twentytwentyone-columns-overlap"} --> <div class="wp-block-columns alignwide is-style-twentytwentyone-columns-overlap"><!-- wp:column --> <div class="wp-block-column"><!-- wp:image {sizeSlug":"full"} --> <figure class="wp-block-image size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/the-garden-at-bougival-1884.jpg" alt="' . esc_attr__( '“The Garden at Bougival” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure> <!-- /wp:image --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"bottom"} --> <div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:group {"className":"is-style-twentytwentyone-border","backgroundColor":"green"} --> <div class="wp-block-group is-style-twentytwentyone-border has-green-background-color has-background"><div class="wp-block-group__inner-container"><!-- wp:paragraph {"fontSize":"extra-large","style":{"typography":{"lineHeight":"1.4"}}} --> <p class="has-extra-large-font-size" style="line-height:1.4">' . esc_html__( 'Beautiful gardens painted by Berthe Morisot in the late 1800s', 'twentytwentyone' ) . '</p> <!-- /wp:paragraph --></div></div> <!-- /wp:group --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:image {sizeSlug":"full"} --> <figure class="wp-block-image size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/villa-with-orange-trees-nice.jpg" alt="' . esc_attr__( '“Villa with Orange Trees, Nice” by Berthe Morisot', 'twentytwentyone' ) . '"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns -->', ) ); // 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' => '<!-- wp:separator {"className":"is-style-twentytwentyone-separator-thick"} --> <hr class="wp-block-separator is-style-twentytwentyone-separator-thick"/> <!-- /wp:separator --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":80} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:paragraph {"fontSize":"extra-large"} --> <p class="has-extra-large-font-size"><a href="#">' . esc_html__( 'Roses Tremieres', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"right","width":85,"height":67,"sizeSlug":"large"} --> <figure class="wp-block-image alignright size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/roses-tremieres-hollyhocks-1884.jpg" alt="' . esc_attr__( '“Roses Tremieres” by Berthe Morisot', 'twentytwentyone' ) . '" width="85" height="67"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-default"} --> <hr class="wp-block-separator is-style-default"/> <!-- /wp:separator --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":80} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:paragraph {"fontSize":"extra-large"} --> <p class="has-extra-large-font-size"><a href="#">' . esc_html__( 'Villa with Orange Trees, Nice', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"right","width":53,"height":67,"className":"alignright size-large is-resized"} --><figure class="wp-block-image is-resized alignright size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/villa-with-orange-trees-nice.jpg" alt="“Villa with Orange Trees, Nice” by Berthe Morisot" width="53" height="67"/></figure><!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-default"} --> <hr class="wp-block-separator is-style-default"/> <!-- /wp:separator --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":80} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:paragraph {"fontSize":"extra-large"} --> <p class="has-extra-large-font-size"><a href="#">' . esc_html__( 'In the Bois de Boulogne', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"right","width":81,"height":67,"sizeSlug":"large"} --> <figure class="wp-block-image alignright size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/in-the-bois-de-boulogne.jpg" alt="' . esc_attr__( '“In the Bois de Boulogne” by Berthe Morisot', 'twentytwentyone' ) . '" width="81" height="67"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-default"} --> <hr class="wp-block-separator is-style-default"/> <!-- /wp:separator --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":80} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:paragraph {"fontSize":"extra-large"} --> <p class="has-extra-large-font-size"><a href="#">' . esc_html__( 'The Garden at Bougival', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"right","width":85,"height":67,"sizeSlug":"large"} --> <figure class="wp-block-image alignright size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/the-garden-at-bougival-1884.jpg" alt="' . esc_attr__( '“The Garden at Bougival” by Berthe Morisot', 'twentytwentyone' ) . '" width="85" height="67"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-default"} --> <hr class="wp-block-separator is-style-default"/> <!-- /wp:separator --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":80} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:paragraph {"fontSize":"extra-large"} --> <p class="has-extra-large-font-size"><a href="#">' . esc_html__( 'Young Woman in Mauve', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"right","width":54,"height":67,"sizeSlug":"large"} --> <figure class="wp-block-image alignright size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/young-woman-in-mauve.jpg" alt="' . esc_attr__( '“Young Woman in Mauve” by Berthe Morisot', 'twentytwentyone' ) . '" width="54" height="67"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-default"} --> <hr class="wp-block-separator is-style-default"/> <!-- /wp:separator --> <!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":80} --> <div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:paragraph {"fontSize":"extra-large"} --> <p class="has-extra-large-font-size"><a href="#">' . esc_html__( 'Reading', 'twentytwentyone' ) . '</a></p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"center"} --> <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"right","width":84,"height":67,"sizeSlug":"large"} --> <figure class="wp-block-image alignright size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/Reading.jpg" alt="' . esc_attr__( '“Reading” by Berthe Morisot', 'twentytwentyone' ) . '" width="84" height="67"/></figure> <!-- /wp:image --></div> <!-- /wp:column --></div> <!-- /wp:columns --> <!-- wp:separator {"className":"is-style-twentytwentyone-separator-thick"} --> <hr class="wp-block-separator is-style-twentytwentyone-separator-thick"/> <!-- /wp:separator -->', ) ); register_block_pattern( 'twentytwentyone/contact-information', array( 'title' => esc_html__( 'Contact information', 'twentytwentyone' ), 'categories' => array( 'twentytwentyone' ), 'description' => esc_html_x( 'A block with 3 columns that display contact information and social media links.', 'Block pattern description', 'twentytwentyone' ), 'content' => '<!-- wp:columns {"align":"wide"} --><div class="wp-block-columns alignwide"><!-- wp:column --><div class="wp-block-column"><!-- wp:paragraph --><p><a href="mailto:#">' . esc_html_x( 'example@example.com', 'Block pattern sample content', 'twentytwentyone' ) . '<br></a>' . esc_html_x( '123-456-7890', 'Block pattern sample content', 'twentytwentyone' ) . '</p><!-- /wp:paragraph --></div><!-- /wp:column --><!-- wp:column --><div class="wp-block-column"><!-- wp:paragraph {"align":"center"} --><p class="has-text-align-center">' . esc_html_x( '123 Main Street', 'Block pattern sample content', 'twentytwentyone' ) . '<br>' . esc_html_x( 'Cambridge, MA, 02139', 'Block pattern sample content', 'twentytwentyone' ) . '</p><!-- /wp:paragraph --></div><!-- /wp:column --><!-- wp:column {"verticalAlignment":"center"} --><div class="wp-block-column is-vertically-aligned-center"><!-- wp:social-links {"align":"right","className":"is-style-twentytwentyone-social-icons-color"} --><ul class="wp-block-social-links alignright is-style-twentytwentyone-social-icons-color"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /--><!-- wp:social-link {"url":"https://www.facebook.com/WordPress/","service":"facebook"} /--><!-- wp:social-link {"url":"https://twitter.com/WordPress","service":"twitter"} /--><!-- wp:social-link {"url":"https://www.youtube.com/wordpress","service":"youtube"} /--></ul><!-- /wp:social-links --></div><!-- /wp:column --></div><!-- /wp:columns -->', ) ); } menu-functions.php 0000644 00000006712 15252503401 0010232 0 ustar 00 <?php /** * Functions and filters related to the menus. * * Makes the default WordPress navigation use an HTML structure similar * to the Navigation block. * * @link https://make.wordpress.org/themes/2020/07/06/printing-navigation-block-html-from-a-legacy-menu-in-themes/ * * @package WordPress * @subpackage Twenty_Twenty_One * @since 1.0.0 */ /** * Add a button to top-level menu items that has sub-menus. * An icon is added using CSS depending on the value of aria-expanded. * * @since 1.0.0 * * @param string $output Nav menu item start element. * @param object $item Nav menu item. * @param int $depth Depth. * @param object $args Nav menu args. * * @return string Nav menu item start element. */ function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) { if ( 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) { // Add toggle button. $output .= '<button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)">'; $output .= '<span class="icon-plus">' . twenty_twenty_one_get_icon_svg( 'ui', 'plus', 18 ) . '</span>'; $output .= '<span class="icon-minus">' . twenty_twenty_one_get_icon_svg( 'ui', 'minus', 18 ) . '</span>'; $output .= '<span class="screen-reader-text">' . esc_html__( 'Open menu', 'twentytwentyone' ) . '</span>'; $output .= '</button>'; } return $output; } add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_add_sub_menu_toggle', 10, 4 ); /** * Detects the social network from a URL and returns the SVG code for its icon. * * @since 1.0.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. * * @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 1.0.0 * * @param stdClass $args An object of wp_nav_menu() arguments. * @param WP_Post $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * * @return stdClass */ function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) { $args->link_after = ''; if ( 0 === $depth && isset( $item->description ) && $item->description ) { // The extra <span> element is here for styling purposes: Allows the description to not be underlined on hover. $args->link_after = '<p class="menu-item-description"><span>' . $item->description . '</span></p>'; } return $args; } add_filter( 'nav_menu_item_args', 'twenty_twenty_one_add_menu_description_args', 10, 3 ); block-styles.php 0000644 00000004551 15252503401 0007672 0 ustar 00 <?php /** * Block Styles * * @link https://developer.wordpress.org/reference/functions/register_block_style/ * * @package WordPress * @subpackage Twenty_Twenty_One * @since 1.0.0 */ if ( function_exists( 'register_block_style' ) ) { /** * Register block styles. * * @since 1.0.0 * * @return void */ function twenty_twenty_one_register_block_styles() { // Columns: Overlap. register_block_style( 'core/columns', array( 'name' => 'twentytwentyone-columns-overlap', 'label' => esc_html__( 'Overlap', 'twentytwentyone' ), ) ); // Cover: Borders. register_block_style( 'core/cover', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Group: Borders. register_block_style( 'core/group', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Image: Borders. register_block_style( 'core/image', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Image: Frame. register_block_style( 'core/image', array( 'name' => 'twentytwentyone-image-frame', 'label' => esc_html__( 'Frame', 'twentytwentyone' ), ) ); // Latest Posts: Dividers. register_block_style( 'core/latest-posts', array( 'name' => 'twentytwentyone-latest-posts-dividers', 'label' => esc_html__( 'Dividers', 'twentytwentyone' ), ) ); // Latest Posts: Borders. register_block_style( 'core/latest-posts', array( 'name' => 'twentytwentyone-latest-posts-borders', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Media & Text: Borders. register_block_style( 'core/media-text', array( 'name' => 'twentytwentyone-border', 'label' => esc_html__( 'Borders', 'twentytwentyone' ), ) ); // Separator: Thick. register_block_style( 'core/separator', array( 'name' => 'twentytwentyone-separator-thick', 'label' => esc_html__( 'Thick', 'twentytwentyone' ), ) ); // Social icons: Dark gray color. register_block_style( 'core/social-links', array( 'name' => 'twentytwentyone-social-icons-color', 'label' => esc_html__( 'Dark gray', 'twentytwentyone' ), ) ); } add_action( 'init', 'twenty_twenty_one_register_block_styles' ); } custom-header.php 0000644 00000010510 15252503644 0010020 0 ustar 00 <?php /** * Custom header implementation * * @link https://codex.wordpress.org/Custom_Headers * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Set up the WordPress core custom header feature. * * @uses twentyseventeen_header_style() */ function twentyseventeen_custom_header_setup() { add_theme_support( 'custom-header', /** * Filter Twenty Seventeen custom-header support arguments. * * @since Twenty Seventeen 1.0 * * @param array $args { * An array of custom-header support arguments. * * @type string $default-image Default image of the header. * @type int $width Width in pixels of the custom header image. Default 954. * @type int $height Height in pixels of the custom header image. Default 1300. * @type string $flex-height Flex support for height of header. * @type string $video Video support for header. * @type string $wp-head-callback Callback function used to styles the header image and text * displayed on the blog. * } */ apply_filters( 'twentyseventeen_custom_header_args', array( 'default-image' => get_parent_theme_file_uri( '/assets/images/header.jpg' ), 'width' => 2000, 'height' => 1200, 'flex-height' => true, 'video' => true, 'wp-head-callback' => 'twentyseventeen_header_style', ) ) ); register_default_headers( array( 'default-image' => array( 'url' => '%s/assets/images/header.jpg', 'thumbnail_url' => '%s/assets/images/header.jpg', 'description' => __( 'Default Header Image', 'twentyseventeen' ), ), ) ); } add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' ); if ( ! function_exists( 'twentyseventeen_header_style' ) ) : /** * Styles the header image and text displayed on the blog. * * @see twentyseventeen_custom_header_setup(). */ function twentyseventeen_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style id="twentyseventeen-custom-header-styles" type="text/css"> <?php // Has the text been hidden? if ( 'blank' === $header_text_color ) : ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that. else : ?> .site-title a, .colors-dark .site-title a, .colors-custom .site-title a, body.has-header-image .site-title a, body.has-header-video .site-title a, body.has-header-image.colors-dark .site-title a, body.has-header-video.colors-dark .site-title a, body.has-header-image.colors-custom .site-title a, body.has-header-video.colors-custom .site-title a, .site-description, .colors-dark .site-description, .colors-custom .site-description, body.has-header-image .site-description, body.has-header-video .site-description, body.has-header-image.colors-dark .site-description, body.has-header-video.colors-dark .site-description, body.has-header-image.colors-custom .site-description, body.has-header-video.colors-custom .site-description { color: #<?php echo esc_attr( $header_text_color ); ?>; } <?php endif; ?> </style> <?php } endif; // End of twentyseventeen_header_style(). /** * Customize video play/pause button in the custom header. * * @param array $settings Video settings. * @return array The filtered video settings. */ function twentyseventeen_video_controls( $settings ) { $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) ); return $settings; } add_filter( 'header_video_settings', 'twentyseventeen_video_controls' );
dvadf
dvadf
| ver. 1.4 |
Github
|
.
| PHP 8.2.33 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings