' . __( 'Pages:', 'generatepress' ),
'after' => '
',
)
);
?>
<# if ( 'undefined' !== typeof ( data.weight ) ) { #>
<# } #>
<# if ( 'undefined' !== typeof ( data.transform ) ) { #>
<# } #>
esc_html( 'normal' ),
'bold' => esc_html( 'bold' ),
'100' => esc_html( '100' ),
'200' => esc_html( '200' ),
'300' => esc_html( '300' ),
'400' => esc_html( '400' ),
'500' => esc_html( '500' ),
'600' => esc_html( '600' ),
'700' => esc_html( '700' ),
'800' => esc_html( '800' ),
'900' => esc_html( '900' ),
);
}
/**
* Build text transform choices.
*/
public function get_font_transform_choices() {
return array(
'none' => esc_html( 'none' ),
'capitalize' => esc_html( 'capitalize' ),
'uppercase' => esc_html( 'uppercase' ),
'lowercase' => esc_html( 'lowercase' ),
);
}
}
}
inc/customizer/controls/class-deprecated.php 0000644 00000021302 15220145167 0015301 0 ustar 00 wp_create_nonce( 'gp_customize_nonce' ) ) );
}
/**
* Send variables to json.
*/
public function to_json() {
parent::to_json();
$number_of_fonts = apply_filters( 'generate_number_of_fonts', 200 );
$this->json['link'] = $this->get_link();
$this->json['value'] = $this->value();
$this->json['default_fonts_title'] = __( 'Default fonts', 'generatepress' );
$this->json['google_fonts_title'] = __( 'Google fonts', 'generatepress' );
$this->json['description'] = __( 'Font family', 'generatepress' );
$this->json['google_fonts'] = apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts( $number_of_fonts ) );
$this->json['default_fonts'] = generate_typography_default_fonts();
}
/**
* Render content.
*/
public function content_template() {
?>
choices as $name => $choice ) {
$this->choices[ $name ] = $choice;
}
$this->json['choices'] = $this->choices;
$this->json['link'] = $this->get_link();
$this->json['value'] = $this->value();
}
/**
* Render content.
*/
public function content_template() {
?>
<# if ( ! data.choices )
return;
#>
json['link'] = $this->get_link();
$this->json['value'] = $this->value();
$this->json['id'] = $this->id;
}
/**
* Render content.
*/
public function content_template() {
?>
json['choices'] = $this->choices;
}
/**
* Empty JS template.
*
* @access public
* @since 1.0.0
* @return void
*/
public function content_template() {}
}
inc/customizer/controls/class-upsell-control.php 0000644 00000002760 15220145167 0016172 0 ustar 00 json['url'] = esc_url( $this->url );
}
/**
* Render content.
*/
public function content_template() {
?>
{{{ data.description }}}
{{ data.label }} json['choices'] = $this->choices; } /** * Empty JS template. * * @access public * @since 1.0.0 * @return void */ public function content_template() {} /** * Empty PHP template. * * @access public * @since 1.0.0 * @return void */ public function render_content() { $html_attributes = array( 'class' => 'generate-customize-control-wrapper', 'id' => $this->id, 'data-wrapper-type' => $this->choices['type'], ); if ( ! empty( $this->choices['class'] ) ) { $html_attributes['class'] .= ' ' . $this->choices['class']; } $attributes_string = ''; foreach ( $html_attributes as $attribute => $value ) { $attributes_string .= $attribute . '="' . esc_attr( $value ) . '" '; } $this->toggleIdScript(); ?>>
choices['items'] as $wrapper ) {
?>
choices['toggleId'] ) ) :
?>
json['choices'] = $this->choices;
}
/**
* Empty JS template.
*
* @access public
* @since 1.0.0
* @return void
*/
public function content_template() {}
/**
* Empty PHP template.
*
* @access public
* @since 1.0.0
* @return void
*/
public function render_content() {}
}
inc/customizer/controls/class-upsell-section.php 0000644 00000003771 15220145167 0016161 0 ustar 00 pro_text;
$json['pro_url'] = esc_url( $this->pro_url );
$json['id'] = $this->id;
return $json;
}
/**
* Render content.
*/
protected function render_template() {
?>
{{ data.pro_text }}
' ), 'after_title' => apply_filters( 'generate_end_widget_title', '
' ), ) ); } } } if ( ! function_exists( 'generate_smart_content_width' ) ) { add_action( 'wp', 'generate_smart_content_width' ); /** * Set the $content_width depending on layout of current page * Hook into "wp" so we have the correct layout setting from generate_get_layout() * Hooking into "after_setup_theme" doesn't get the correct layout setting */ function generate_smart_content_width() { global $content_width; $container_width = generate_get_option( 'container_width' ); $right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' ); $left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' ); $layout = generate_get_layout(); if ( 'left-sidebar' === $layout ) { $content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 ); } elseif ( 'right-sidebar' === $layout ) { $content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 ); } elseif ( 'no-sidebar' === $layout ) { $content_width = $container_width; } else { $content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 ); } } } if ( ! function_exists( 'generate_page_menu_args' ) ) { add_filter( 'wp_page_menu_args', 'generate_page_menu_args' ); /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. * * @since 0.1 * * @param array $args The existing menu args. * @return array Menu args. */ function generate_page_menu_args( $args ) { $args['show_home'] = true; return $args; } } if ( ! function_exists( 'generate_disable_title' ) ) { add_filter( 'generate_show_title', 'generate_disable_title' ); /** * Remove our title if set. * * @since 1.3.18 * * @param bool $title Whether the title is displayed or not. * @return bool Whether to display the content title. */ function generate_disable_title( $title ) { if ( is_singular() ) { $disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true ); if ( $disable_title ) { $title = false; } } return $title; } } if ( ! function_exists( 'generate_resource_hints' ) ) { add_filter( 'wp_resource_hints', 'generate_resource_hints', 10, 2 ); /** * Add resource hints to our Google fonts call. * * @since 1.3.42 * * @param array $urls URLs to print for resource hints. * @param string $relation_type The relation type the URLs are printed. * @return array $urls URLs to print for resource hints. */ function generate_resource_hints( $urls, $relation_type ) { $handle = generate_is_using_dynamic_typography() ? 'generate-google-fonts' : 'generate-fonts'; $hint_type = apply_filters( 'generate_google_font_resource_hint_type', 'preconnect' ); $has_crossorigin_support = version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ); if ( wp_style_is( $handle, 'queue' ) ) { if ( $relation_type === $hint_type ) { if ( $has_crossorigin_support && 'preconnect' === $hint_type ) { $urls[] = array( 'href' => 'https://fonts.gstatic.com', 'crossorigin', ); $urls[] = array( 'href' => 'https://fonts.googleapis.com', 'crossorigin', ); } else { $urls[] = 'https://fonts.gstatic.com'; $urls[] = 'https://fonts.googleapis.com'; } } if ( 'dns-prefetch' !== $hint_type ) { $googleapis_index = array_search( 'fonts.googleapis.com', $urls ); if ( false !== $googleapis_index ) { unset( $urls[ $googleapis_index ] ); } } } return $urls; } } if ( ! function_exists( 'generate_remove_caption_padding' ) ) { add_filter( 'img_caption_shortcode_width', 'generate_remove_caption_padding' ); /** * Remove WordPress's default padding on images with captions * * @param int $width Default WP .wp-caption width (image width + 10px). * @return int Updated width to remove 10px padding. */ function generate_remove_caption_padding( $width ) { return $width - 10; } } if ( ! function_exists( 'generate_enhanced_image_navigation' ) ) { add_filter( 'attachment_link', 'generate_enhanced_image_navigation', 10, 2 ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages. * * @param string $url The input URL. * @param int $id The ID of the post. */ function generate_enhanced_image_navigation( $url, $id ) { if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) { return $url; } $image = get_post( $id ); // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Intentially loose. if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) { $url .= '#main'; } return $url; } } if ( ! function_exists( 'generate_categorized_blog' ) ) { /** * Determine whether blog/site has more than one category. * * @since 1.2.5 * * @return bool True of there is more than one category, false otherwise. */ function generate_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'generate_categories' ) ) ) { // phpcs:ignore // Create an array of all the categories that are attached to posts. $all_the_cool_cats = 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. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'generate_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so twentyfifteen_categorized_blog should return true. return true; } else { // This blog has only 1 category so twentyfifteen_categorized_blog should return false. return false; } } } if ( ! function_exists( 'generate_category_transient_flusher' ) ) { add_action( 'edit_category', 'generate_category_transient_flusher' ); add_action( 'save_post', 'generate_category_transient_flusher' ); /** * Flush out the transients used in {@see generate_categorized_blog()}. * * @since 1.2.5 */ function generate_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'generate_categories' ); } } if ( ! function_exists( 'generate_get_default_color_palettes' ) ) { /** * Set up our colors for the color picker palettes and filter them so you can change them. * * @since 1.3.42 */ function generate_get_default_color_palettes() { $palettes = array( '#000000', '#FFFFFF', '#F1C40F', '#E74C3C', '#1ABC9C', '#1e72bd', '#8E44AD', '#00CC77', ); return apply_filters( 'generate_default_color_palettes', $palettes ); } } add_filter( 'generate_fontawesome_essentials', 'generate_set_font_awesome_essentials' ); /** * Check to see if we should include the full Font Awesome library or not. * * @since 2.0 * * @param bool $essentials The existing value. * @return bool */ function generate_set_font_awesome_essentials( $essentials ) { if ( generate_get_option( 'font_awesome_essentials' ) ) { return true; } return $essentials; } add_filter( 'generate_dynamic_css_skip_cache', 'generate_skip_dynamic_css_cache' ); /** * Skips caching of the dynamic CSS if set to false. * * @since 2.0 * * @param bool $cache The existing value. * @return bool */ function generate_skip_dynamic_css_cache( $cache ) { if ( ! generate_get_option( 'dynamic_css_cache' ) ) { return true; } return $cache; } add_filter( 'wp_headers', 'generate_set_wp_headers' ); /** * Set any necessary headers. * * @param array $headers The existing headers. * * @since 2.3 */ function generate_set_wp_headers( $headers ) { $headers['X-UA-Compatible'] = 'IE=edge'; return $headers; } add_filter( 'generate_after_element_class_attribute', 'generate_set_microdata_markup', 10, 2 ); /** * Adds microdata to elements. * * @since 3.0.0 * @param string $output The existing output after the class attribute. * @param string $context What element we're targeting. */ function generate_set_microdata_markup( $output, $context ) { if ( 'left_sidebar' === $context || 'right_sidebar' === $context ) { $context = 'sidebar'; } if ( 'footer' === $context ) { return $output; } if ( 'site-info' === $context ) { $context = 'footer'; } $microdata = generate_get_microdata( $context ); if ( $microdata ) { return $microdata; } return $output; } add_action( 'wp_footer', 'generate_do_a11y_scripts' ); /** * Enqueue scripts in the footer. * * @since 3.1.0 */ function generate_do_a11y_scripts() { if ( apply_filters( 'generate_print_a11y_script', true ) && function_exists( 'wp_print_inline_script_tag' ) ) { wp_print_inline_script_tag( '!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var e=document.body;e.addEventListener("pointerdown",(function(){e.classList.add("using-mouse")}),{passive:!0}),e.addEventListener("keydown",(function(){e.classList.remove("using-mouse")}),{passive:!0})}}();', array( 'id' => 'generate-a11y', ) ); } } inc/class-rest.php 0000644 00000005130 15220145167 0010110 0 ustar 00 namespace . $this->version; register_rest_route( $namespace, '/reset/', array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'reset' ), 'permission_callback' => array( $this, 'update_settings_permission' ), ) ); } /** * Get edit options permissions. * * @return bool */ public function update_settings_permission() { return current_user_can( 'manage_options' ); } /** * Reset settings. * * @param WP_REST_Request $request request object. * * @return mixed */ public function reset( WP_REST_Request $request ) { delete_option( 'generate_settings' ); delete_option( 'generate_dynamic_css_output' ); delete_option( 'generate_dynamic_css_cached_version' ); return $this->success( __( 'Settings reset.', 'generatepress' ) ); } /** * Success rest. * * @param mixed $response response data. * @return mixed */ public function success( $response ) { return new WP_REST_Response( array( 'success' => true, 'response' => $response, ), 200 ); } /** * Failed rest. * * @param mixed $response response data. * @return mixed */ public function failed( $response ) { return new WP_REST_Response( array( 'success' => false, 'response' => $response, ), 200 ); } /** * Error rest. * * @param mixed $code error code. * @param mixed $response response data. * @return mixed */ public function error( $code, $response ) { return new WP_REST_Response( array( 'error' => true, 'success' => false, 'error_code' => $code, 'response' => $response, ), 401 ); } } GeneratePress_Rest::get_instance(); inc/theme-functions.php 0000644 00000066224 15220145167 0011153 0 ustar 00 post_content, '' ) ); $format = ( false !== get_post_format() ) ? get_post_format() : 'standard'; $show_excerpt = ( 'excerpt' === generate_get_option( 'post_content' ) ) ? true : false; $show_excerpt = ( 'standard' !== $format ) ? false : $show_excerpt; $show_excerpt = ( $more_tag ) ? false : $show_excerpt; $show_excerpt = ( is_search() ) ? true : $show_excerpt; return apply_filters( 'generate_show_excerpt', $show_excerpt ); } } if ( ! function_exists( 'generate_show_title' ) ) { /** * Check to see if we should show our page/post title or not. * * @since 1.3.18 * * @return bool Whether to show the content title. */ function generate_show_title() { return apply_filters( 'generate_show_title', true ); } } /** * Check whether we should display the entry header or not. * * @since 3.0.0 */ function generate_show_entry_header() { $show_entry_header = true; $show_title = generate_show_title(); $has_before_entry_title = has_action( 'generate_before_entry_title' ); $has_after_entry_title = has_action( 'generate_after_entry_title' ); if ( is_page() ) { $has_before_entry_title = has_action( 'generate_before_page_title' ); $has_after_entry_title = has_action( 'generate_after_page_title' ); } if ( ! $show_title && ! $has_before_entry_title && ! $has_after_entry_title ) { $show_entry_header = false; } return apply_filters( 'generate_show_entry_header', $show_entry_header ); } if ( ! function_exists( 'generate_get_premium_url' ) ) { /** * Generate a URL to our premium add-ons. * Allows the use of a referral ID and campaign. * * @since 1.3.42 * * @param string $url URL to premium page. * @param bool $trailing_slash Whether we want to include a trailing slash. * @return string The URL to generatepress.com. */ function generate_get_premium_url( $url = 'https://generatepress.com/premium', $trailing_slash = true ) { if ( $trailing_slash ) { $url = trailingslashit( $url ); } $args = apply_filters( 'generate_premium_url_args', array( 'ref' => null, 'campaign' => null, ) ); if ( isset( $args['ref'] ) ) { $url = add_query_arg( 'ref', absint( $args['ref'] ), $url ); } if ( isset( $args['campaign'] ) ) { $url = add_query_arg( 'campaign', sanitize_text_field( $args['campaign'] ), $url ); } return esc_url( $url ); } } if ( ! function_exists( 'generate_padding_css' ) ) { /** * Shorten our padding/margin values into shorthand form. * * @since 0.1 * * @param int $top Top spacing. * @param int $right Right spacing. * @param int $bottom Bottom spacing. * @param int $left Left spacing. * @return string Element spacing values. */ function generate_padding_css( $top, $right, $bottom, $left ) { $padding_top = ( isset( $top ) && '' !== $top ) ? absint( $top ) . 'px ' : '0px '; $padding_right = ( isset( $right ) && '' !== $right ) ? absint( $right ) . 'px ' : '0px '; $padding_bottom = ( isset( $bottom ) && '' !== $bottom ) ? absint( $bottom ) . 'px ' : '0px '; $padding_left = ( isset( $left ) && '' !== $left ) ? absint( $left ) . 'px' : '0px'; if ( ( absint( $padding_top ) === absint( $padding_right ) ) && ( absint( $padding_right ) === absint( $padding_bottom ) ) && ( absint( $padding_bottom ) === absint( $padding_left ) ) ) { return $padding_left; } return $padding_top . $padding_right . $padding_bottom . $padding_left; } } if ( ! function_exists( 'generate_get_link_url' ) ) { /** * Return the post URL. * * Falls back to the post permalink if no URL is found in the post. * * @since 1.2.5 * * @see get_url_in_content() * @return string The Link format URL. */ function generate_get_link_url() { $has_url = get_url_in_content( get_the_content() ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Core filter name. return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } } if ( ! function_exists( 'generate_get_navigation_location' ) ) { /** * Get the location of the navigation and filter it. * * @since 1.3.41 * * @return string The primary menu location. */ function generate_get_navigation_location() { return apply_filters( 'generate_navigation_location', generate_get_option( 'nav_position_setting' ) ); } } /** * Check if the logo and site branding are active. * * @since 2.3 */ function generate_has_logo_site_branding() { $has_site_title = ! generate_get_option( 'hide_title' ) && get_bloginfo( 'title' ); $has_site_tagline = ! generate_get_option( 'hide_tagline' ) && get_bloginfo( 'description' ); if ( get_theme_mod( 'custom_logo' ) && ( $has_site_title || $has_site_tagline ) ) { return true; } return false; } /** * Create SVG icons. * * @since 2.3 * * @param string $icon The icon to get. * @param bool $replace Whether we're replacing an icon on action (click). */ function generate_get_svg_icon( $icon, $replace = false ) { if ( 'svg' !== generate_get_option( 'icons' ) ) { return; } $output = ''; if ( 'menu-bars' === $icon ) { $output = ''; } if ( 'close' === $icon ) { $output = ''; } if ( 'search' === $icon ) { $output = ''; } if ( 'categories' === $icon ) { $output = ''; } if ( 'tags' === $icon ) { $output = ''; } if ( 'comments' === $icon ) { $output = ''; } if ( 'arrow' === $icon ) { $output = ''; } if ( 'arrow-right' === $icon ) { $output = ''; } if ( 'arrow-left' === $icon ) { $output = ''; } if ( 'arrow-up' === $icon ) { $output = ''; } $output = apply_filters( 'generate_svg_icon_element', $output, $icon ); if ( $replace ) { $output .= ''; } $classes = array( 'gp-icon', 'icon-' . $icon, ); $output = sprintf( '%2$s', implode( ' ', $classes ), $output ); return apply_filters( 'generate_svg_icon', $output, $icon ); } /** * Out our icon HTML. * * @since 2.3 * * @param string $icon The icon to print. * @param bool $replace Whether to include the close icon to be shown using JS. */ function generate_do_svg_icon( $icon, $replace = false ) { echo generate_get_svg_icon( $icon, $replace ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in function. } /** * Get our media queries. * * @since 2.4 * * @param string $name Name of the media query. * @return string The full media query. */ function generate_get_media_query( $name ) { $desktop = apply_filters( 'generate_desktop_media_query', '(min-width:1025px)' ); $tablet_only = apply_filters( 'generate_tablet_media_query', '(min-width: 769px) and (max-width: 1024px)' ); $mobile = apply_filters( 'generate_mobile_media_query', '(max-width:768px)' ); $mobile_menu = apply_filters( 'generate_mobile_menu_media_query', $mobile ); $queries = apply_filters( 'generate_media_queries', array( 'desktop' => $desktop, 'tablet_only' => $tablet_only, 'tablet' => '(max-width: 1024px)', 'mobile' => $mobile, 'mobile-menu' => $mobile_menu, ) ); return $queries[ $name ]; } /** * Display HTML classes for an element. * * @since 2.2 * * @param string $context The element we're targeting. * @param string|array $class One or more classes to add to the class list. */ function generate_do_element_classes( $context, $class = '' ) { $after = apply_filters( 'generate_after_element_class_attribute', '', $context ); if ( $after ) { $after = ' ' . $after; } echo 'class="' . join( ' ', generate_get_element_classes( $context, $class ) ) . '"' . $after; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in function. } /** * Retrieve HTML classes for an element. * * @since 2.2 * * @param string $context The element we're targeting. * @param string|array $class One or more classes to add to the class list. * @return array Array of classes. */ function generate_get_element_classes( $context, $class = '' ) { $classes = array(); if ( ! empty( $class ) ) { if ( ! is_array( $class ) ) { $class = preg_split( '#\s+#', $class ); } $classes = array_merge( $classes, $class ); } $classes = array_map( 'esc_attr', $classes ); return apply_filters( "generate_{$context}_class", $classes, $class ); } /** * Get the kind of schema we're using. * * @since 3.0.0 */ function generate_get_schema_type() { return apply_filters( 'generate_schema_type', 'microdata' ); } /** * Get any necessary microdata. * * @since 2.2 * * @param string $context The element to target. * @return string Our final attribute to add to the element. */ function generate_get_microdata( $context ) { $data = false; if ( 'microdata' !== generate_get_schema_type() ) { return false; } if ( 'body' === $context ) { $type = 'WebPage'; if ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) { $type = 'Blog'; } if ( is_search() ) { $type = 'SearchResultsPage'; } $type = apply_filters( 'generate_body_itemtype', $type ); $data = sprintf( 'itemtype="https://schema.org/%s" itemscope', esc_html( $type ) ); } if ( 'header' === $context ) { $data = 'itemtype="https://schema.org/WPHeader" itemscope'; } if ( 'navigation' === $context ) { $data = 'itemtype="https://schema.org/SiteNavigationElement" itemscope'; } if ( 'article' === $context ) { $type = apply_filters( 'generate_article_itemtype', 'CreativeWork' ); $data = sprintf( 'itemtype="https://schema.org/%s" itemscope', esc_html( $type ) ); } if ( 'post-author' === $context ) { $data = 'itemprop="author" itemtype="https://schema.org/Person" itemscope'; } if ( 'comment-body' === $context ) { $data = 'itemtype="https://schema.org/Comment" itemscope'; } if ( 'comment-author' === $context ) { $data = 'itemprop="author" itemtype="https://schema.org/Person" itemscope'; } if ( 'sidebar' === $context ) { $data = 'itemtype="https://schema.org/WPSideBar" itemscope'; } if ( 'footer' === $context ) { $data = 'itemtype="https://schema.org/WPFooter" itemscope'; } if ( $data ) { return apply_filters( "generate_{$context}_microdata", $data ); } } /** * Output our microdata for an element. * * @since 2.2 * * @param string $context The element to target. */ function generate_do_microdata( $context ) { echo generate_get_microdata( $context ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in function. } /** * Whether to print hAtom output or not. * * @since 3.0.0 */ function generate_is_using_hatom() { return apply_filters( 'generate_is_using_hatom', true ); } /** * Check whether we're using the Flexbox structure. * * @since 3.0.0 */ function generate_is_using_flexbox() { // No flexbox for old versions of GPP. if ( defined( 'GP_PREMIUM_VERSION' ) && version_compare( GP_PREMIUM_VERSION, '1.11.0-alpha.1', '<' ) ) { return false; } return 'flexbox' === generate_get_option( 'structure' ); } /** * Check if we have any menu bar items. * * @since 3.0.0 */ function generate_has_menu_bar_items() { return has_action( 'generate_menu_bar_items' ); } /** * Check if we should include the default template part. * * @since 3.0.0 * @param string $template The template to get. */ function generate_do_template_part( $template ) { /** * generate_before_do_template_part hook. * * @since 3.0.0 * @param string $template The template. */ do_action( 'generate_before_do_template_part', $template ); if ( apply_filters( 'generate_do_template_part', true, $template ) ) { if ( 'archive' === $template || 'index' === $template ) { get_template_part( 'content', get_post_format() ); } elseif ( 'none' === $template ) { get_template_part( 'no-results' ); } else { get_template_part( 'content', $template ); } } /** * generate_after_do_template_parts hook. * * @since 3.0.0 * @param string $template The template. */ do_action( 'generate_after_do_template_part', $template ); } /** * Check if we should use inline mobile navigation. * * @since 3.0.0 */ function generate_has_inline_mobile_toggle() { $has_inline_mobile_toggle = generate_is_using_flexbox() && ( 'nav-float-right' === generate_get_navigation_location() || 'nav-float-left' === generate_get_navigation_location() ); return apply_filters( 'generate_has_inline_mobile_toggle', $has_inline_mobile_toggle ); } /** * Build our the_title() parameters. * * @since 3.0.0 */ function generate_get_the_title_parameters() { $params = array( 'before' => sprintf( '', 'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : '' ), 'after' => '
', ); if ( ! is_singular() ) { $params = array( 'before' => sprintf( '', esc_url( get_permalink() ), 'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : '' ), 'after' => '
', ); } if ( 'link' === get_post_format() ) { $params = array( 'before' => sprintf( '', esc_url( generate_get_link_url() ), 'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : '' ), 'after' => '
', ); } return apply_filters( 'generate_get_the_title_parameters', $params ); } /** * Check whether we should display the default loop or not. * * @since 3.0.0 */ function generate_has_default_loop() { return apply_filters( 'generate_has_default_loop', true ); } /** * Detemine whether to output site branding container. * * @since 3.0.0 */ function generate_needs_site_branding_container() { $container = false; if ( generate_has_logo_site_branding() ) { if ( generate_is_using_flexbox() || generate_get_option( 'inline_logo_site_branding' ) ) { $container = true; } } return $container; } /** * Merge array of attributes with defaults, and apply contextual filter on array. * * The contextual filter is of the form `generate_attr_{context}`. * * @since 3.1.0 * * @param string $context The context, to build filter name. * @param array $attributes Optional. Extra attributes to merge with defaults. * @param array $settings Optional. Custom data to pass to filter. * @return array Merged and filtered attributes. */ function generate_parse_attr( $context, $attributes = array(), $settings = array() ) { // Initialize an empty class attribute so it's easier to append to in filters. if ( ! isset( $attributes['class'] ) ) { $attributes['class'] = ''; } // We used to have a class-only system. If it's in use, add the classes. $classes = generate_get_element_classes( $context ); if ( $classes ) { $attributes['class'] .= join( ' ', $classes ); } // Contextual filter. return apply_filters( 'generate_parse_attr', $attributes, $context, $settings ); } /** * Build list of attributes into a string and apply contextual filter on string. * * The contextual filter is of the form `generate_attr_{context}_output`. * * @since 3.1.0 * * @param string $context The context, to build filter name. * @param array $attributes Optional. Extra attributes to merge with defaults. * @param array $settings Optional. Custom data to pass to filter. * @return string String of HTML attributes and values. */ function generate_get_attr( $context, $attributes = array(), $settings = array() ) { $attributes = generate_parse_attr( $context, $attributes, $settings ); $output = ''; // Cycle through attributes, build tag attribute string. foreach ( $attributes as $key => $value ) { if ( ! $value ) { continue; } // Remove any whitespace at the start or end of our classes. if ( 'class' === $key ) { $value = trim( $value ); } if ( true === $value ) { $output .= esc_html( $key ) . ' '; } else { $output .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) ); } } // Before this function existed we had the below to add attributes after the class attribute. $after = apply_filters( 'generate_after_element_class_attribute', '', $context ); if ( $after ) { $after = ' ' . $after; } $output .= $after; $output = apply_filters( 'generate_get_attr_output', $output, $attributes, $context, $settings ); return trim( $output ); } /** * Output our string of HTML attributes. * * @since 3.1.0 * * @param string $context The context, to build filter name. * @param array $attributes Optional. Extra attributes to merge with defaults. * @param array $settings Optional. Custom data to pass to filter. */ function generate_do_attr( $context, $attributes = array(), $settings = array() ) { echo generate_get_attr( $context, $attributes, $settings ); // phpcs:ignore -- Escaping done in function. } /** * Build our editor color palette based on our global colors. * * @since 3.1.0 */ function generate_get_editor_color_palette() { $global_colors = generate_get_option( 'global_colors' ); $editor_palette = array(); $static_colors = false; if ( apply_filters( 'generate_color_palette_use_static_colors', false ) ) { $static_colors = true; } if ( ! empty( $global_colors ) ) { foreach ( (array) $global_colors as $key => $data ) { $editor_palette[] = array( 'name' => $data['name'], 'slug' => $data['slug'], 'color' => $static_colors ? $data['color'] : 'var(--' . $data['slug'] . ')', ); } } return $editor_palette; } /** * Get our global colors. * * @since 3.1.0 */ function generate_get_global_colors() { $global_colors = generate_get_option( 'global_colors' ); $colors = array(); if ( ! empty( $global_colors ) ) { foreach ( (array) $global_colors as $key => $data ) { $colors[] = array( 'slug' => $data['slug'], 'color' => $data['color'], ); } } return $colors; } /** * Get our system default font. * * @since 3.1.0 */ function generate_get_system_default_font() { return apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ); } /** * Check to see if we have a GP menu active. * This is primarily used to know whether we need to enqueue menu.js or not. * * @since 3.1.0 */ function generate_has_active_menu() { $has_active_menu = true; if ( ! generate_get_navigation_location() ) { $has_active_menu = false; } return apply_filters( 'generate_has_active_menu', $has_active_menu ); } /** * Check to see if we're using dynamic typography. * * @since 3.1.0 */ function generate_is_using_dynamic_typography() { return generate_get_option( 'use_dynamic_typography' ); } /** * Add inline script. * * @param string $handle The script handle to attach the inline script to. * @param array $data The data to be passed to the script. * @param string $var The JavaScript variable name to assign the data to. * @param string $position The position to add the inline script. */ function generate_add_inline_script( $handle, $data, $var, $position = 'before' ) { if ( ! empty( $data ) ) { $json_data = wp_json_encode( $data ); $inline_script = "var $var = $json_data;"; wp_add_inline_script( $handle, $inline_script, $position ); } } comments.php 0000644 00000007035 15220145167 0007112 0 ustar 00>
>
>
>
>
>
>
>
>
>
searchform.php 0000644 00000002633 15220145170 0007407 0 ustar 00
content-404.php 0000644 00000002754 15220145170 0007241 0 ustar 00
>
footer-min.php 0000644 00000000441 15220145170 0007330 0 ustar 00
single.php 0000644 00000001602 15220145170 0006532 0 ustar 00
>
>
no-results.php 0000644 00000003244 15220145170 0007370 0 ustar 00
>
page.php 0000644 00000002110 15220145170 0006160 0 ustar 00
>
>
content-link.php 0000644 00000004202 15220145170 0007655 0 ustar 00
>
>
screenshot.png 0000644 00000212022 15220145170 0007423 0 ustar 00 PNG
IHDR 8 PLTE
r!+"m#p"o %!lRР@«kFJPP7~Y"(5I!VWX)$'Y679]^bW;'fzV%sfgj*Dg`/02FDB.y9' nor5Rv9=BгljJ!1FbQy#?vx{ħ1ԷLf Fk>]gB))=WտxxQ5E5(H*˭tŚ]mj^q/UhN6_?WMEujĸsRbvkZLug]õڢGUfÕpnKvc=M IDATx읁Kǻ/XzƻZ`ҖF$,\P@lIć5D(M$Q|3O{-l$j]d|L6 t , @X , @X a , @X a a nHX: KgINw `XE_Ew :RX#zH]'bQ +c!z i2h!W!( %,WDa2DF᧖F NVgA"gEc # tYgubQC :FXC"*E6F :EXLKbԃnfa-L2+
IxfIvx^8w8lwaՄily "Ҽ3]+,m_X XR[`Y,>{2H$-^/̡it|?w'kZi=p{f5njLQ߃]68lkCsvHJ~mq+Z9b~JV㇛ghKPN]_M=
,`A[
ӊhZ^SSSK>%\Vg'ԿfY[j~em[W^6|qKafv綰MaYߘ|߰ai&0V
+<\>{JJp97=/}fHm胔S]/>яcڳ5KώhEڣ[1zIJ0&c~մEI2pgUwϵښr#Fzau0xQ N3S!||A{ŚfXg^__IO[{ywhs=j4ɒ*ȩ?6
>
'
>
%s',
apply_filters( 'generate_404_text', __( 'It looks like nothing was found at this location. Maybe try searching?', 'generatepress' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is allowed in filter here.
);
get_search_form();
?>
>
>
>
'
' . __( 'Pages:', 'generatepress' ),
'after' => '
',
)
);
?>
Get started here.', 'generatepress' ), esc_url( admin_url( 'post-new.php' ) ) ); ?>
>
>
>
>
>
content.php 0000644 00000004206 15220145170 0006726 0 ustar 00
>
>
'
' . __( 'Pages:', 'generatepress' ),
'after' => '
',
)
);
?>
>
>
'
' . __( 'Pages:', 'generatepress' ),
'after' => '
',
)
);
?>
'generate_comment', ) ); ?>
1 && get_option( 'page_comments' ) ) : ?>