Skip to content

Commit

Permalink
2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
webmandesign committed Apr 10, 2019
1 parent ce8e883 commit 1dafef4
Show file tree
Hide file tree
Showing 30 changed files with 681 additions and 795 deletions.
2 changes: 1 addition & 1 deletion assets/css/custom-styles-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mark, .highlight { -webkit-box-shadow: 0.38em 0 0 #00855b, -0.38em 0 0 #00855b;

@media only screen and (max-width: 41.9375em) { .pagination a { background-color: #00855b; color: #ffffff; background-color: var(--color_accent); color: var(--color_accent_text); } }

/* FILE: main/custom-styles/__typography-editor.scss */
/* FILE: main/custom-styles/__editor-typography.scss */
.mce-content-body { line-height: 1.62; }

.mce-content-body h1, .mce-content-body .h1 { line-height: 1.19; }
Expand Down
24 changes: 15 additions & 9 deletions assets/js/scripts-navigation-accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 2.0.0
* @version 2.3.0
* @version 2.4.0
*/


Expand Down Expand Up @@ -73,22 +73,28 @@
*/

$siteNavigation
.on( 'touchstart click', '.menu-item-has-children > a .expander', function( e ) {
.on( 'touchstart', '.menu-item-has-children > a', function( e ) {

// Helper variables

var
$this = $( this ).parent().parent(); // Get the LI element
el = $( this ).parent( 'li' );


// Processing

e.preventDefault();

$this
.toggleClass( 'focus' )
.siblings()
.removeClass( 'focus' );
/**
* First touch does not trigger the link, only opens the submenu.
* Second touch does trigger the link.
*/
if ( ! el.hasClass( 'focus' ) ) {
e.preventDefault();

el
.toggleClass( 'focus' )
.siblings( '.focus' )
.removeClass( 'focus' );
}

} );

Expand Down
2 changes: 1 addition & 1 deletion assets/scss/custom-styles-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// @copyright WebMan Design, Oliver Juhas
//
// @since 2.0.0
// @version 2.3.0
// @version 2.4.0
//


Expand Down
2 changes: 1 addition & 1 deletion assets/scss/main/custom-styles/__editor-typography.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* FILE: main/custom-styles/__typography-editor.scss */
/* FILE: main/custom-styles/__editor-typography.scss */

//
// Custom visual editor typography
Expand Down
50 changes: 50 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
# Modern Changelog

## 2.4.0

* **Update**: Navigation accessibility and touch screen functionality
* **Update**: Improving intro image accessibility
* **Update**: Custom typography info in theme options
* **Update**: Improving accessibility skip links
* **Update**: Excerpts display
* **Update**: Info about demo required plugins
* **Update**: Demo content
* **Update**: Welcome page and notice
* **Update**: Improving CSS variables functionality for browsers with no support
* **Update**: Donation links
* **Update**: Improving code
* **Update**: Localization
* **Fix**: CSS variables background image code escaping
* **Fix**: Gallery post format slideshow not working with Gutenberg editor

### Files changed:

changelog.md
footer.php
header.php
readme.txt
style.css
assets/js/scripts-navigation-accessibility.js
assets/scss/custom-styles-editor.scss
includes/custom-header/class-intro.php
includes/customize/class-customize.php
includes/frontend/class-header.php
includes/frontend/class-menu.php
includes/frontend/class-post-media.php
includes/frontend/class-post-summary.php
includes/plugins/one-click-demo-import/class-one-click-demo-import.php
includes/plugins/one-click-demo-import/demo-content-modern.xml
includes/post-formats/class-post-formats.php
includes/welcome/class-welcome.php
languages/modern.pot
library/includes/classes/class-core.php
library/includes/classes/class-css-variables.php
template-parts/admin/notice-welcome.php
template-parts/admin/welcome-footer.php
template-parts/admin/welcome-header.php
template-parts/admin/welcome-promo.php
template-parts/component/link-more.php
template-parts/content/content.php
template-parts/header/links-skip.php
template-parts/meta/entry-meta-element-comments.php
template-parts/meta/entry-meta-element-date.php


## 2.3.1

* **Update**: Removing obsolete files (related to v2.0.0 upgrade notices)
Expand Down
44 changes: 11 additions & 33 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,26 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 1.0.0
* @version 2.0.0
* @version 2.4.0
*/





/**
* Content
*/

do_action( 'tha_content_bottom' );

do_action( 'tha_content_after' );



/**
* Footer
*/

if ( ! apply_filters( 'wmhook_modern_disable_footer', false ) ) {
do_action( 'tha_content_bottom' );
do_action( 'tha_content_after' );

do_action( 'tha_footer_before' );

do_action( 'tha_footer_top' );

do_action( 'tha_footer_bottom' );

do_action( 'tha_footer_after' );

}



/**
* Body and WordPress footer
*/
if ( ! apply_filters( 'wmhook_modern_disable_footer', false ) ) {
do_action( 'tha_footer_before' );
do_action( 'tha_footer_top' );
do_action( 'tha_footer_bottom' );
do_action( 'tha_footer_after' );
}

do_action( 'tha_body_bottom' );
do_action( 'tha_body_bottom' );

wp_footer();
wp_footer();

?>

Expand Down
59 changes: 14 additions & 45 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 1.0.0
* @version 2.0.0
* @version 2.4.0
*/





/**
* HTML
*/

do_action( 'tha_html_before' );
do_action( 'tha_html_before' );

?>

Expand All @@ -30,15 +26,10 @@

<?php

/**
* HTML head
*/

do_action( 'tha_head_top' );

do_action( 'tha_head_bottom' );
do_action( 'tha_head_top' );
do_action( 'tha_head_bottom' );

wp_head();
wp_head();

?>

Expand All @@ -49,36 +40,14 @@

<?php

/**
* Body
*/

do_action( 'tha_body_top' );



/**
* Header
*/

if ( ! apply_filters( 'wmhook_modern_disable_header', false ) ) {

do_action( 'tha_header_before' );

do_action( 'tha_header_top' );

do_action( 'tha_header_bottom' );

do_action( 'tha_header_after' );

}



/**
* Content
*/
do_action( 'tha_body_top' );

do_action( 'tha_content_before' );
if ( ! apply_filters( 'wmhook_modern_disable_header', false ) ) {
do_action( 'tha_header_before' );
do_action( 'tha_header_top' );
do_action( 'tha_header_bottom' );
do_action( 'tha_header_after' );
}

do_action( 'tha_content_top' );
do_action( 'tha_content_before' );
do_action( 'tha_content_top' );
67 changes: 59 additions & 8 deletions includes/custom-header/class-intro.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 2.0.0
* @version 2.0.2
* @version 2.4.0
*
* Contents:
*
* 0) Init
* 10) Setup
* 20) Output
* 30) Conditions
* 40) Assets
* 50) Slideshow
* 0) Init
* 10) Setup
* 20) Output
* 30) Conditions
* 40) Assets
* 50) Slideshow
* 100) Helpers
*/
class Modern_Intro {

Expand All @@ -37,7 +38,7 @@ class Modern_Intro {
* @uses `wmhook_modern_title_primary_disable` global hook to disable `#primary` section H1
*
* @since 2.0.0
* @version 2.0.0
* @version 2.4.0
*/
private function __construct() {

Expand Down Expand Up @@ -65,6 +66,8 @@ private function __construct() {

add_filter( 'theme_mod_' . 'header_image', __CLASS__ . '::image', 15 ); // Has to be priority 15 for correct customizer previews.

add_filter( 'get_header_image_tag', __CLASS__ . '::image_alt_text', 10, 3 );

} // /__construct


Expand Down Expand Up @@ -467,6 +470,54 @@ public static function get_slides_count() {



/**
* 100) Helpers
*/

/**
* Custom header image alt text fix.
*
* However, this does not always work. If the image URL is overridden
* with `self::image()` above, the attachment ID is different, thus
* the alt text could not be applied. This has to be fixed in WP core
* or completely redone in theme with custom code...
*
* @link https://core.trac.wordpress.org/ticket/46124
* @todo Remove with WordPress 5.2?
*
* @since 2.4.0
* @version 2.4.0
*/
public static function image_alt_text( $html, $header, $attr ) {

// Processing

if ( isset( $header->attachment_id ) ) {
$image_alt = get_post_meta( $header->attachment_id, '_wp_attachment_image_alt', true );
if (
! empty( $image_alt )
&& wp_get_attachment_url( $header->attachment_id ) === $attr['src']
) {
$attr['alt'] = $image_alt;
$html = '<img';
foreach ( $attr as $name => $value ) {
$html .= ' ' . $name . '="' . esc_attr( $value ) . '"';
}
$html .= ' />';
}
}


// Output

return $html;

} // /image_alt_text





} // /Modern_Intro

add_action( 'after_setup_theme', 'Modern_Intro::init' );
Loading

0 comments on commit 1dafef4

Please sign in to comment.