Skip to content

Commit

Permalink
Merge pull request #103 from tomusborne/release/2.4
Browse files Browse the repository at this point in the history
Release/2.4
  • Loading branch information
tomusborne authored Nov 20, 2019
2 parents e3baba6 + d5952e3 commit 7f9a266
Show file tree
Hide file tree
Showing 30 changed files with 505 additions and 251 deletions.
18 changes: 17 additions & 1 deletion content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,23 @@
if ( generate_show_title() ) : ?>

<header class="entry-header">
<?php the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' ); ?>
<?php
/**
* generate_before_page_title hook.
*
* @since 2.4
*/
do_action( 'generate_before_page_title' );

the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );

/**
* generate_after_page_title hook.
*
* @since 2.4
*/
do_action( 'generate_after_page_title' );
?>
</header><!-- .entry-header -->

<?php endif;
Expand Down
2 changes: 1 addition & 1 deletion css/all.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions css/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ button.menu-toggle:focus {
padding-left: 3px;
}

.menu-toggle .gp-icon + .mobile-menu {
padding-left: 9px;
}

.menu-toggle .mobile-menu:empty {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion css/mobile.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 25 additions & 24 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

// Set our theme version.
define( 'GENERATE_VERSION', '2.3.2' );
define( 'GENERATE_VERSION', '2.4.0' );

if ( ! function_exists( 'generate_setup' ) ) {
add_action( 'after_setup_theme', 'generate_setup' );
Expand All @@ -34,7 +34,6 @@ function generate_setup() {
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'align-wide' );
add_theme_support( 'editor-color-palette', array() );
add_theme_support( 'responsive-embeds' );

add_theme_support( 'custom-logo', array(
Expand Down Expand Up @@ -66,32 +65,34 @@ function generate_setup() {
/**
* Get all necessary theme files
*/
require get_template_directory() . '/inc/theme-functions.php';
require get_template_directory() . '/inc/defaults.php';
require get_template_directory() . '/inc/class-css.php';
require get_template_directory() . '/inc/css-output.php';
require get_template_directory() . '/inc/general.php';
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/markup.php';
require get_template_directory() . '/inc/typography.php';
require get_template_directory() . '/inc/plugin-compat.php';
require get_template_directory() . '/inc/block-editor.php';
require get_template_directory() . '/inc/migrate.php';
require get_template_directory() . '/inc/deprecated.php';
$theme_dir = get_template_directory();

require $theme_dir . '/inc/theme-functions.php';
require $theme_dir . '/inc/defaults.php';
require $theme_dir . '/inc/class-css.php';
require $theme_dir . '/inc/css-output.php';
require $theme_dir . '/inc/general.php';
require $theme_dir . '/inc/customizer.php';
require $theme_dir . '/inc/markup.php';
require $theme_dir . '/inc/typography.php';
require $theme_dir . '/inc/plugin-compat.php';
require $theme_dir . '/inc/block-editor.php';
require $theme_dir . '/inc/migrate.php';
require $theme_dir . '/inc/deprecated.php';

if ( is_admin() ) {
require get_template_directory() . '/inc/meta-box.php';
require get_template_directory() . '/inc/dashboard.php';
require $theme_dir . '/inc/meta-box.php';
require $theme_dir . '/inc/dashboard.php';
}

/**
* Load our theme structure
*/
require get_template_directory() . '/inc/structure/archives.php';
require get_template_directory() . '/inc/structure/comments.php';
require get_template_directory() . '/inc/structure/featured-images.php';
require get_template_directory() . '/inc/structure/footer.php';
require get_template_directory() . '/inc/structure/header.php';
require get_template_directory() . '/inc/structure/navigation.php';
require get_template_directory() . '/inc/structure/post-meta.php';
require get_template_directory() . '/inc/structure/sidebars.php';
require $theme_dir . '/inc/structure/archives.php';
require $theme_dir . '/inc/structure/comments.php';
require $theme_dir . '/inc/structure/featured-images.php';
require $theme_dir . '/inc/structure/footer.php';
require $theme_dir . '/inc/structure/header.php';
require $theme_dir . '/inc/structure/navigation.php';
require $theme_dir . '/inc/structure/post-meta.php';
require $theme_dir . '/inc/structure/sidebars.php';
8 changes: 8 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
?>

<div id="page" class="hfeed site grid-container container grid-parent">
<?php
/**
* generate_inside_site_container hook.
*
* @since 2.4
*/
do_action( 'generate_inside_site_container' );
?>
<div id="content" class="site-content">
<?php
/**
Expand Down
23 changes: 23 additions & 0 deletions inc/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ function generate_do_inline_block_editor_css() {
$css->set_selector( '.edit-post-visual-editor .editor-block-list__block[data-align=wide]' );
$css->add_property( 'max-width', absint( $content_width ), false, 'px' );

if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
$css->set_selector( '.wp-block-group__inner-container' );
$css->add_property( 'max-width', absint( $content_width ), false, 'px' );
$css->add_property( 'margin-left', 'auto' );
$css->add_property( 'margin-right', 'auto' );
$css->add_property( 'padding', generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ) );
}

$css->set_selector( '.wp-block-button__link:not(.has-background)' );
$css->add_property( 'color', esc_attr( $color_settings['form_button_text_color'] ) );
$css->add_property( 'background-color', esc_attr( $color_settings['form_button_background_color'] ) );
Expand Down Expand Up @@ -230,6 +238,7 @@ function generate_do_inline_block_editor_css() {
$css->add_property( 'font-weight', esc_attr( $font_settings['heading_1_weight'] ) );
$css->add_property( 'text-transform', esc_attr( $font_settings['heading_1_transform'] ) );
$css->add_property( 'font-size', absint( $font_settings['heading_1_font_size'] ), false, 'px' );
$css->add_property( 'line-height', floatval( $font_settings['heading_1_line_height'] ), false, 'em' );

if ( $color_settings['h1_color'] ) {
$css->add_property( 'color', esc_attr( $color_settings['h1_color'] ) );
Expand All @@ -249,6 +258,7 @@ function generate_do_inline_block_editor_css() {
$css->add_property( 'font-weight', esc_attr( $font_settings['heading_2_weight'] ) );
$css->add_property( 'text-transform', esc_attr( $font_settings['heading_2_transform'] ) );
$css->add_property( 'font-size', absint( $font_settings['heading_2_font_size'] ), false, 'px' );
$css->add_property( 'line-height', floatval( $font_settings['heading_2_line_height'] ), false, 'em' );

if ( $color_settings['h2_color'] ) {
$css->add_property( 'color', esc_attr( $color_settings['h2_color'] ) );
Expand All @@ -263,6 +273,7 @@ function generate_do_inline_block_editor_css() {
$css->add_property( 'font-weight', esc_attr( $font_settings['heading_3_weight'] ) );
$css->add_property( 'text-transform', esc_attr( $font_settings['heading_3_transform'] ) );
$css->add_property( 'font-size', absint( $font_settings['heading_3_font_size'] ), false, 'px' );
$css->add_property( 'line-height', floatval( $font_settings['heading_3_line_height'] ), false, 'em' );

if ( $color_settings['h3_color'] ) {
$css->add_property( 'color', esc_attr( $color_settings['h3_color'] ) );
Expand All @@ -283,6 +294,10 @@ function generate_do_inline_block_editor_css() {
$css->add_property( 'font-size', 'inherit' );
}

if ( '' !== $font_settings['heading_4_line_height'] ) {
$css->add_property( 'line-height', floatval( $font_settings['heading_4_line_height'] ), false, 'em' );
}

if ( $color_settings['h4_color'] ) {
$css->add_property( 'color', esc_attr( $color_settings['h4_color'] ) );
} elseif ( $color_settings['content_text_color'] ) {
Expand All @@ -302,6 +317,10 @@ function generate_do_inline_block_editor_css() {
$css->add_property( 'font-size', 'inherit' );
}

if ( '' !== $font_settings['heading_5_line_height'] ) {
$css->add_property( 'line-height', floatval( $font_settings['heading_5_line_height'] ), false, 'em' );
}

if ( $color_settings['h5_color'] ) {
$css->add_property( 'color', esc_attr( $color_settings['h5_color'] ) );
} elseif ( $color_settings['content_text_color'] ) {
Expand All @@ -321,6 +340,10 @@ function generate_do_inline_block_editor_css() {
$css->add_property( 'font-size', 'inherit' );
}

if ( '' !== $font_settings['heading_6_line_height'] ) {
$css->add_property( 'line-height', floatval( $font_settings['heading_6_line_height'] ), false, 'em' );
}

if ( $color_settings['h6_color'] ) {
$css->add_property( 'color', esc_attr( $color_settings['h6_color'] ) );
} elseif ( $color_settings['content_text_color'] ) {
Expand Down
Loading

0 comments on commit 7f9a266

Please sign in to comment.