diff --git a/assets/css/editor-style-rtl.css b/assets/css/editor-style-rtl.css index 4362cbd..5498fa1 100644 --- a/assets/css/editor-style-rtl.css +++ b/assets/css/editor-style-rtl.css @@ -1,5 +1,2 @@ /* FILE: editor-style-rtl.scss */ -/*[*/ -@import url("main-rtl.css"); -/*]*/ body { direction: rtl; unicode-bidi: embed; } diff --git a/assets/css/editor-style.css b/assets/css/editor-style.css index d064cc9..fb9b4b9 100644 --- a/assets/css/editor-style.css +++ b/assets/css/editor-style.css @@ -1,4 +1 @@ /* FILE: editor-style.scss */ -/*[*/ -@import url("main.css"); -/*]*/ diff --git a/assets/css/main-rtl.css b/assets/css/main-rtl.css index 0cd00aa..536b484 100644 --- a/assets/css/main-rtl.css +++ b/assets/css/main-rtl.css @@ -246,7 +246,7 @@ th, td { padding: 0.62em 1em; border-width: 1px; border-style: solid; vertical-a th, tfoot td { text-align: right; border-width: 2px; } /* FILE: starter/base/__classes.scss */ -.screen-reader-text, .comments-title .add-comment-link, .comments-link .comments-title, .hide-widget-title-accessibly .widget-title, .hide-widget-title-accessibly .widgettitle, .site-title-hidden .site-branding-text, .main-navigation-container .hide > a, .main-navigation-container .hide-link > a, .menu-toggle-skip-link-container, .posts .format-link .entry-header, .posts .format-quote .entry-header, .posts .type-jetpack-testimonial .entry-header, .posts .format-status .entry-header, .tags-links .entry-meta-description { position: absolute !important; width: 1px; height: 1px; line-height: 1px; word-wrap: normal !important; -webkit-clip-path: inset(50%); clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); overflow: hidden; } +.screen-reader-text, .comments-title .add-comment-link, .comments-link .comments-title, .hide-widget-title-accessibly .widget-title, .hide-widget-title-accessibly .widgettitle, .site-title-hidden .site-branding-text, .main-navigation-container .hide > a, .main-navigation-container .hide-link > a, .menu-toggle-skip-link-container, .posts .format-link .entry-header, .posts .format-quote .entry-header, .posts .type-jetpack-testimonial .entry-header, .posts .format-status .entry-header, .tags-links .entry-meta-description, .date-hidden.comment-hidden.categories-hidden:not(.group-blog) .entry-meta-top, .date-hidden.comment-hidden.categories-hidden.author-hidden.group-blog .entry-meta-top, .single.tags-hidden .site-main .entry-meta-bottom, .date-hidden.comment-hidden:not(.group-blog) .posts .entry-meta-bottom, .date-hidden.comment-hidden.author-hidden.group-blog .posts .entry-meta-bottom { position: absolute !important; width: 1px; height: 1px; line-height: 1px; word-wrap: normal !important; -webkit-clip-path: inset(50%); clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); overflow: hidden; } .main-navigation-container .hide > a:focus, .main-navigation-container .hide-link > a:focus { position: static !important; height: auto; width: auto; line-height: inherit; word-wrap: break-word !important; -webkit-clip-path: none; clip-path: none; clip: auto; overflow: visible; } @@ -327,7 +327,7 @@ blockquote cite, code, pre, small, .small, .font-size-s, .wp-caption-text, #canc .weight-300, blockquote, .search-results .page-title, .author .intro-title span, .post-table-of-contents .is-passed a, .posts .format-image .entry-content, .posts .format-link .entry-content, .front-page-section-title, .comments-title span { font-weight: 300; } -blockquote cite, .weight-400, #cancel-comment-reply-link, .comments-title .add-comment-link, .button:disabled, button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled, .main-navigation-container .button > a:disabled, .entry-title small, .page-title small, .post-table-of-contents .is-current a, .entry-author .author-title { font-weight: 400; } +blockquote cite, .weight-400, #cancel-comment-reply-link, .comments-title .add-comment-link, .button:disabled, button:disabled, input:disabled[type="button"], input:disabled[type="reset"], input:disabled[type="submit"], .main-navigation-container .button > a:disabled, .entry-title small, .page-title small, .post-table-of-contents .is-current a, .entry-author .author-title { font-weight: 400; } .weight-500 { font-weight: 500; } @@ -477,8 +477,6 @@ input[disabled] { cursor: default; opacity: .66; } .comment-form label { display: block; } -.comment-form [type="checkbox"] + label, .comment-form [type="radio"] + label { display: inline-block; } - .comment-form-author input, .comment-form-email input, .comment-form-url input, .comment-form-comment textarea { width: 100%; } .comment-form-url { clear: both; } @@ -653,7 +651,7 @@ form[role="search"] input[type="search"], form[role="search"] .search-field, .fo .widget_recent_entries .post-date { display: block; } -.widget .tagcloud a { float: right; position: relative; display: inline-block; width: auto; padding: 0.19rem 0.62rem; margin: 2px 2px 0; margin-right: 0; white-space: nowrap; background-color: transparent; color: inherit; border-width: 1px; border-style: solid; z-index: 0; -webkit-transition: background .3s, color .3s, border .3s; -o-transition: background .3s, color .3s, border .3s; transition: background .3s, color .3s, border .3s; } +.widget .tagcloud a { float: right; position: relative; display: inline-block; width: auto; padding: 0.19rem 0.62rem; margin: 2px 2px 0; margin-right: 0; white-space: nowrap; background-color: transparent; color: inherit; border-width: 1px; border-style: solid; z-index: 0; -webkit-transition: background .3s, color .3s, border .3s; -o-transition: background .3s, color .3s, border .3s; transition: background .3s, color .3s, border .3s; } .widget .tagcloud a:hover, .widget .tagcloud a:active, .widget .tagcloud a:focus { text-decoration: none; } @@ -734,16 +732,6 @@ div.sharedaddy .sd-social .sd-button .share-count { background: inherit; color: .tiled-gallery-item { overflow: hidden; } -.video-player, .videopress-placeholder, .videopress-placeholder img { width: 100% !important; height: auto !important; } - -.is-singular .video-player object, .is-singular .videopress-placeholder { position: absolute; width: 100%; height: 100%; left: 0; right: 0; top: 0; } - -.video-player object { width: 100%; } - -.is-singular .video-player { position: relative; height: 0 !important; padding: 0 0 56.25%; /* 16:9 ratio only */ } - -.videopress-placeholder .play-button + div { display: none; } - .jetpack_subscription_widget form { margin-bottom: 0; } .jetpack_subscription_widget #subscribe-email { float: right; width: 62%; padding-left: 0.62em; margin-bottom: 0; } @@ -1253,9 +1241,9 @@ form .button, form button, form input[type="button"], form input[type="reset"], div[class*="hover-color-"] .button, div[class*="hover-color-"] button, div[class*="hover-color-"] input[type="button"], div[class*="hover-color-"] input[type="reset"], div[class*="hover-color-"] input[type="submit"], div[class*="hover-color-"] .main-navigation-container .button > a, .main-navigation-container div[class*="hover-color-"] .button > a { -webkit-transition: none; -o-transition: none; transition: none; } -.button:hover, button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, .main-navigation-container .button > a:hover, .button:active, button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active, .main-navigation-container .button > a:active, .button:focus, button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus, .main-navigation-container .button > a:focus { text-decoration: none; border-color: currentColor; } +.button:hover, button:hover, input:hover[type="button"], input:hover[type="reset"], input:hover[type="submit"], .main-navigation-container .button > a:hover, .button:active, button:active, input:active[type="button"], input:active[type="reset"], input:active[type="submit"], .main-navigation-container .button > a:active, .button:focus, button:focus, input:focus[type="button"], input:focus[type="reset"], input:focus[type="submit"], .main-navigation-container .button > a:focus { text-decoration: none; border-color: currentColor; } -.button:disabled, button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled, .main-navigation-container .button > a:disabled { -webkit-box-shadow: none; box-shadow: none; opacity: .5; cursor: not-allowed; } +.button:disabled, button:disabled, input:disabled[type="button"], input:disabled[type="reset"], input:disabled[type="submit"], .main-navigation-container .button > a:disabled { -webkit-box-shadow: none; box-shadow: none; opacity: .5; cursor: not-allowed; } /* FILE: main/forms/__search.scss */ .site form[role="search"]::before, .site .search-form::before { content: '\f400'; position: absolute; width: 1.62em; height: 100%; left: 0; top: 0; line-height: 1.62; text-align: center; font-size: 1.62em; z-index: 1; } @@ -1451,7 +1439,7 @@ body:not(.home) .intro-media img { width: calc( 100% + 20px); max-width: none; m @media only screen and (max-width: 54.9375em) { .intro-media, .intro-media .slick-slide { overflow: hidden; } .site .intro-media img { position: relative; width: auto; height: 110%; height: 110vh; max-width: none; max-height: none; left: 50%; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); } - body:not(.home) .intro-media img { -webkit-transform: scaleX(-1) translateX(50%); -ms-transform: scaleX(-1) translateX(50%); transform: scaleX(-1) translateX(50%); } } + body:not(.home) .intro-media img { width: auto; -webkit-transform: scaleX(-1) translateX(50%); -ms-transform: scaleX(-1) translateX(50%); transform: scaleX(-1) translateX(50%); } } .intro-title { padding: 8% 0; margin: 0; line-height: 1.19; font-weight: 700; border-top: 2px solid; font-size: 2.281rem; } @@ -1805,14 +1793,16 @@ blockquote.alignleft::before { float: left; margin-left: 0; margin-right: .09em; .posts .entry-summary:not(.has-more-tag) { font-size: 1em; line-height: inherit; } /* FILE: main/content/__post-format-gallery.scss */ -.format-gallery .entry-media-gallery-image:not(.slick-slide):not(:first-child) { display: none; } +.format-gallery .entry-media-gallery-images:not(.slick-slider) { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; } + +.format-gallery .entry-media-gallery-images:not(.slick-slider) .entry-media-gallery-image { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 50%; } /* FILE: main/content/__post-format-image.scss */ .format-image .entry-media { position: relative; } .format-image .entry-media::before { content: '\f102'; position: absolute; width: 2em; height: 2em; right: -0.38em; top: -0.38em; line-height: 2em; text-align: center; } -.format-image .entry-header { margin-bottom: 0.62em; } +.posts .format-image .entry-header { margin-bottom: 0.62em; } @media only screen and (min-width: 42em) { .posts .format-image .entry-content { font-size: 1.19em; } } @@ -2147,6 +2137,8 @@ div.sharedaddy { margin: 2.6244rem auto 0; } @media only screen and (min-width: 42em) { .entry-author .author-bio { clear: both; } } +.entry-author .author-link { display: block; margin-top: 1em; } + .jetpack-featured-images-archive-disabled .posts .post-thumbnail { display: none; } .jetpack-featured-images-page-disabled.page .content-area .post-thumbnail { display: none; } diff --git a/assets/css/main.css b/assets/css/main.css index da84e0d..9285e07 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -244,7 +244,7 @@ th, td { padding: 0.62em 1em; border-width: 1px; border-style: solid; vertical-a th, tfoot td { text-align: left; border-width: 2px; } /* FILE: starter/base/__classes.scss */ -.screen-reader-text, .comments-title .add-comment-link, .comments-link .comments-title, .hide-widget-title-accessibly .widget-title, .hide-widget-title-accessibly .widgettitle, .site-title-hidden .site-branding-text, .main-navigation-container .hide > a, .main-navigation-container .hide-link > a, .menu-toggle-skip-link-container, .posts .format-link .entry-header, .posts .format-quote .entry-header, .posts .type-jetpack-testimonial .entry-header, .posts .format-status .entry-header, .tags-links .entry-meta-description { position: absolute !important; width: 1px; height: 1px; line-height: 1px; word-wrap: normal !important; -webkit-clip-path: inset(50%); clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); overflow: hidden; } +.screen-reader-text, .comments-title .add-comment-link, .comments-link .comments-title, .hide-widget-title-accessibly .widget-title, .hide-widget-title-accessibly .widgettitle, .site-title-hidden .site-branding-text, .main-navigation-container .hide > a, .main-navigation-container .hide-link > a, .menu-toggle-skip-link-container, .posts .format-link .entry-header, .posts .format-quote .entry-header, .posts .type-jetpack-testimonial .entry-header, .posts .format-status .entry-header, .tags-links .entry-meta-description, .date-hidden.comment-hidden.categories-hidden:not(.group-blog) .entry-meta-top, .date-hidden.comment-hidden.categories-hidden.author-hidden.group-blog .entry-meta-top, .single.tags-hidden .site-main .entry-meta-bottom, .date-hidden.comment-hidden:not(.group-blog) .posts .entry-meta-bottom, .date-hidden.comment-hidden.author-hidden.group-blog .posts .entry-meta-bottom { position: absolute !important; width: 1px; height: 1px; line-height: 1px; word-wrap: normal !important; -webkit-clip-path: inset(50%); clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); overflow: hidden; } .main-navigation-container .hide > a:focus, .main-navigation-container .hide-link > a:focus { position: static !important; height: auto; width: auto; line-height: inherit; word-wrap: break-word !important; -webkit-clip-path: none; clip-path: none; clip: auto; overflow: visible; } @@ -325,7 +325,7 @@ blockquote cite, code, pre, small, .small, .font-size-s, .wp-caption-text, #canc .weight-300, blockquote, .search-results .page-title, .author .intro-title span, .post-table-of-contents .is-passed a, .posts .format-image .entry-content, .posts .format-link .entry-content, .front-page-section-title, .comments-title span { font-weight: 300; } -blockquote cite, .weight-400, #cancel-comment-reply-link, .comments-title .add-comment-link, .button:disabled, button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled, .main-navigation-container .button > a:disabled, .entry-title small, .page-title small, .post-table-of-contents .is-current a, .entry-author .author-title { font-weight: 400; } +blockquote cite, .weight-400, #cancel-comment-reply-link, .comments-title .add-comment-link, .button:disabled, button:disabled, input:disabled[type="button"], input:disabled[type="reset"], input:disabled[type="submit"], .main-navigation-container .button > a:disabled, .entry-title small, .page-title small, .post-table-of-contents .is-current a, .entry-author .author-title { font-weight: 400; } .weight-500 { font-weight: 500; } @@ -475,8 +475,6 @@ input[disabled] { cursor: default; opacity: .66; } .comment-form label { display: block; } -.comment-form [type="checkbox"] + label, .comment-form [type="radio"] + label { display: inline-block; } - .comment-form-author input, .comment-form-email input, .comment-form-url input, .comment-form-comment textarea { width: 100%; } .comment-form-url { clear: both; } @@ -651,7 +649,7 @@ form[role="search"] input[type="search"], form[role="search"] .search-field, .fo .widget_recent_entries .post-date { display: block; } -.widget .tagcloud a { float: left; position: relative; display: inline-block; width: auto; padding: 0.19rem 0.62rem; margin: 2px 2px 0; margin-left: 0; white-space: nowrap; background-color: transparent; color: inherit; border-width: 1px; border-style: solid; z-index: 0; -webkit-transition: background .3s, color .3s, border .3s; -o-transition: background .3s, color .3s, border .3s; transition: background .3s, color .3s, border .3s; } +.widget .tagcloud a { float: left; position: relative; display: inline-block; width: auto; padding: 0.19rem 0.62rem; margin: 2px 2px 0; margin-left: 0; white-space: nowrap; background-color: transparent; color: inherit; border-width: 1px; border-style: solid; z-index: 0; -webkit-transition: background .3s, color .3s, border .3s; -o-transition: background .3s, color .3s, border .3s; transition: background .3s, color .3s, border .3s; } .widget .tagcloud a:hover, .widget .tagcloud a:active, .widget .tagcloud a:focus { text-decoration: none; } @@ -732,16 +730,6 @@ div.sharedaddy .sd-social .sd-button .share-count { background: inherit; color: .tiled-gallery-item { overflow: hidden; } -.video-player, .videopress-placeholder, .videopress-placeholder img { width: 100% !important; height: auto !important; } - -.is-singular .video-player object, .is-singular .videopress-placeholder { position: absolute; width: 100%; height: 100%; left: 0; right: 0; top: 0; } - -.video-player object { width: 100%; } - -.is-singular .video-player { position: relative; height: 0 !important; padding: 0 0 56.25%; /* 16:9 ratio only */ } - -.videopress-placeholder .play-button + div { display: none; } - .jetpack_subscription_widget form { margin-bottom: 0; } .jetpack_subscription_widget #subscribe-email { float: left; width: 62%; padding-right: 0.62em; margin-bottom: 0; } @@ -1251,9 +1239,9 @@ form .button, form button, form input[type="button"], form input[type="reset"], div[class*="hover-color-"] .button, div[class*="hover-color-"] button, div[class*="hover-color-"] input[type="button"], div[class*="hover-color-"] input[type="reset"], div[class*="hover-color-"] input[type="submit"], div[class*="hover-color-"] .main-navigation-container .button > a, .main-navigation-container div[class*="hover-color-"] .button > a { -webkit-transition: none; -o-transition: none; transition: none; } -.button:hover, button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, .main-navigation-container .button > a:hover, .button:active, button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active, .main-navigation-container .button > a:active, .button:focus, button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus, .main-navigation-container .button > a:focus { text-decoration: none; border-color: currentColor; } +.button:hover, button:hover, input:hover[type="button"], input:hover[type="reset"], input:hover[type="submit"], .main-navigation-container .button > a:hover, .button:active, button:active, input:active[type="button"], input:active[type="reset"], input:active[type="submit"], .main-navigation-container .button > a:active, .button:focus, button:focus, input:focus[type="button"], input:focus[type="reset"], input:focus[type="submit"], .main-navigation-container .button > a:focus { text-decoration: none; border-color: currentColor; } -.button:disabled, button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled, .main-navigation-container .button > a:disabled { -webkit-box-shadow: none; box-shadow: none; opacity: .5; cursor: not-allowed; } +.button:disabled, button:disabled, input:disabled[type="button"], input:disabled[type="reset"], input:disabled[type="submit"], .main-navigation-container .button > a:disabled { -webkit-box-shadow: none; box-shadow: none; opacity: .5; cursor: not-allowed; } /* FILE: main/forms/__search.scss */ .site form[role="search"]::before, .site .search-form::before { content: '\f400'; position: absolute; width: 1.62em; height: 100%; right: 0; top: 0; line-height: 1.62; text-align: center; font-size: 1.62em; z-index: 1; } @@ -1449,7 +1437,7 @@ body:not(.home) .intro-media img { width: calc( 100% + 20px); max-width: none; m @media only screen and (max-width: 54.9375em) { .intro-media, .intro-media .slick-slide { overflow: hidden; } .site .intro-media img { position: relative; width: auto; height: 110%; height: 110vh; max-width: none; max-height: none; left: 50%; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); } - body:not(.home) .intro-media img { -webkit-transform: scaleX(-1) translateX(50%); -ms-transform: scaleX(-1) translateX(50%); transform: scaleX(-1) translateX(50%); } } + body:not(.home) .intro-media img { width: auto; -webkit-transform: scaleX(-1) translateX(50%); -ms-transform: scaleX(-1) translateX(50%); transform: scaleX(-1) translateX(50%); } } .intro-title { padding: 8% 0; margin: 0; line-height: 1.19; font-weight: 700; border-top: 2px solid; font-size: 2.281rem; } @@ -1803,14 +1791,16 @@ blockquote.alignleft::before { float: right; margin-right: 0; margin-left: .09em .posts .entry-summary:not(.has-more-tag) { font-size: 1em; line-height: inherit; } /* FILE: main/content/__post-format-gallery.scss */ -.format-gallery .entry-media-gallery-image:not(.slick-slide):not(:first-child) { display: none; } +.format-gallery .entry-media-gallery-images:not(.slick-slider) { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; } + +.format-gallery .entry-media-gallery-images:not(.slick-slider) .entry-media-gallery-image { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 50%; } /* FILE: main/content/__post-format-image.scss */ .format-image .entry-media { position: relative; } .format-image .entry-media::before { content: '\f102'; position: absolute; width: 2em; height: 2em; left: -0.38em; top: -0.38em; line-height: 2em; text-align: center; } -.format-image .entry-header { margin-bottom: 0.62em; } +.posts .format-image .entry-header { margin-bottom: 0.62em; } @media only screen and (min-width: 42em) { .posts .format-image .entry-content { font-size: 1.19em; } } @@ -2145,6 +2135,8 @@ div.sharedaddy { margin: 2.6244rem auto 0; } @media only screen and (min-width: 42em) { .entry-author .author-bio { clear: both; } } +.entry-author .author-link { display: block; margin-top: 1em; } + .jetpack-featured-images-archive-disabled .posts .post-thumbnail { display: none; } .jetpack-featured-images-page-disabled.page .content-area .post-thumbnail { display: none; } diff --git a/assets/js/scripts-global.js b/assets/js/scripts-global.js index 005c585..a3c070c 100644 --- a/assets/js/scripts-global.js +++ b/assets/js/scripts-global.js @@ -5,7 +5,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 1.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -61,13 +61,20 @@ // Processing - e.preventDefault(); - + // Scroll the page to top. $( 'html, body' ) .animate( { scrollTop : 0 }, 600 ); + // Reset focus on top of the page. + $( 'body' ) + .attr( 'tabindex', 0 ) + .focus(); + + // Do not alter URL in browser. + return false; + } ); } diff --git a/assets/js/scripts-masonry.js b/assets/js/scripts-masonry.js index e3ea19a..81686a3 100644 --- a/assets/js/scripts-masonry.js +++ b/assets/js/scripts-masonry.js @@ -1,19 +1,19 @@ /** * Masonry layouts * + * @requires jQuery + * * @package Modern * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ - - - - ( function( $ ) { + 'use strict'; + if ( $().masonry ) { @@ -137,6 +137,57 @@ + /** + * Masonry posts + */ + if ( $( document.body ).hasClass( 'has-posts-layout-masonry' ) ) { + + var + $postsList = $( '.posts' ); + + $postsList + .imagesLoaded( function() { + + // Processing + + $postsList + .masonry( { + itemSelector : '.entry', + percentPosition : true, + isOriginLeft : ( 'rtl' !== $( 'html' ).attr( 'dir' ) ) + } ); + + } ); + + + + /** + * Jetpack Infinite Scroll posts loading + * + * @subpackage Jetpack + */ + + $( document.body ) + .on( 'post-load', function() { + + // Processing + + $postsList + .imagesLoaded( function() { + + // Processing + + $postsList + .masonry( 'reload' ); + + } ); + + } ); + + } + + + } // /masonry diff --git a/assets/js/scripts-slick.js b/assets/js/scripts-slick.js index 4afe7a0..19b088c 100644 --- a/assets/js/scripts-slick.js +++ b/assets/js/scripts-slick.js @@ -5,15 +5,13 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ - - - - ( function( $ ) { + 'use strict'; + if ( $().slick ) { @@ -34,6 +32,7 @@ /** * Gallery post format slideshow */ + if ( ! $( document.body ).hasClass( 'has-posts-layout-masonry' ) ) { var $slickContainerPostFormatGallery = '.format-gallery .entry-media-gallery-images', @@ -82,6 +81,8 @@ } ); + } + /** diff --git a/assets/scss/editor-style-rtl.scss b/assets/scss/editor-style-rtl.scss index 6d46495..c6a4f72 100644 --- a/assets/scss/editor-style-rtl.scss +++ b/assets/scss/editor-style-rtl.scss @@ -3,24 +3,14 @@ // // Visual Editor core stylesheet (RTL) // +// @see Modern_Assets::editor_stylesheets() +// // @package Modern // @copyright WebMan Design, Oliver Juhas // - - -// These will be ignored when editor stylesheet is generated - - /*[*/ - @import url( 'main-rtl.css' ); - /*]*/ - - // Don't forget to load `custom-styles-editor.css` file additionally into Visual editor! - - - // RTL style overrides body { diff --git a/assets/scss/editor-style.scss b/assets/scss/editor-style.scss index f09798b..ec8994e 100644 --- a/assets/scss/editor-style.scss +++ b/assets/scss/editor-style.scss @@ -3,21 +3,11 @@ // // Visual Editor core stylesheet // +// @see Modern_Assets::editor_stylesheets() +// // @package Modern // @copyright WebMan Design, Oliver Juhas // // @since 2.0.0 -// @version 2.0.0 +// @version 2.2.0 // - - - - - -// These will be ignored when editor stylesheet is generated - - /*[*/ - @import url( 'main.css' ); - /*]*/ - - // Don't forget to load `custom-styles-editor.css` file additionally into Visual editor! diff --git a/assets/scss/main.scss b/assets/scss/main.scss index 605df91..fbd79fd 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -7,7 +7,7 @@ // @copyright WebMan Design, Oliver Juhas // // @since 2.0.0 -// @version 2.1.0 +// @version 2.2.0 // diff --git a/assets/scss/main/content/__post-format-gallery.scss b/assets/scss/main/content/__post-format-gallery.scss index 0377c6c..062a5db 100644 --- a/assets/scss/main/content/__post-format-gallery.scss +++ b/assets/scss/main/content/__post-format-gallery.scss @@ -10,10 +10,13 @@ .format-gallery { - .entry-media-gallery-image { + .entry-media-gallery-images:not(.slick-slider) { + display: flex; + flex-wrap: wrap; - &:not(.slick-slide):not(:first-child) { - display: none; + .entry-media-gallery-image { + flex: 1; + min-width: 50%; } } diff --git a/assets/scss/main/content/__post-format-image.scss b/assets/scss/main/content/__post-format-image.scss index aff24b0..aa841ab 100644 --- a/assets/scss/main/content/__post-format-image.scss +++ b/assets/scss/main/content/__post-format-image.scss @@ -31,7 +31,7 @@ } - &-header { + .posts &-header { margin-bottom: $golden_major +em; } diff --git a/assets/scss/main/header/__intro.scss b/assets/scss/main/header/__intro.scss index 64aaa00..b41aeb1 100644 --- a/assets/scss/main/header/__intro.scss +++ b/assets/scss/main/header/__intro.scss @@ -89,6 +89,7 @@ } body:not(.home) & img { + width: auto; transform: scaleX( -1 ) translateX( 50% ); } diff --git a/assets/scss/main/plugins/__jetpack.scss b/assets/scss/main/plugins/__jetpack.scss index a0449f4..50d5d3c 100644 --- a/assets/scss/main/plugins/__jetpack.scss +++ b/assets/scss/main/plugins/__jetpack.scss @@ -165,6 +165,11 @@ } + &-link { + display: block; + margin-top: 1em; + } + } } @@ -243,6 +248,42 @@ + // Post meta + + .entry-meta { + + &-top { + + .date-hidden.comment-hidden.categories-hidden:not(.group-blog) & { + @extend %screen_reader_hiding; + } + + .date-hidden.comment-hidden.categories-hidden.author-hidden.group-blog & { + @extend %screen_reader_hiding; + } + + } + + &-bottom { + + .single.tags-hidden .site-main & { + @extend %screen_reader_hiding; + } + + .date-hidden.comment-hidden:not(.group-blog) .posts & { + @extend %screen_reader_hiding; + } + + .date-hidden.comment-hidden.author-hidden.group-blog .posts & { + @extend %screen_reader_hiding; + } + + } + + } + + + // Custom post types // Portfolio diff --git a/assets/scss/starter/_starter.scss b/assets/scss/starter/_starter.scss index b006cb1..4463bff 100644 --- a/assets/scss/starter/_starter.scss +++ b/assets/scss/starter/_starter.scss @@ -47,7 +47,7 @@ // @copyright WebMan Design, Oliver Juhas // @license GPL-3.0, http://www.gnu.org/licenses/gpl-3.0.html // -// @version 4.0.1 +// @version 4.0.2 // diff --git a/assets/scss/starter/content/forms/__comments.scss b/assets/scss/starter/content/forms/__comments.scss index aa9ec87..347d507 100644 --- a/assets/scss/starter/content/forms/__comments.scss +++ b/assets/scss/starter/content/forms/__comments.scss @@ -43,11 +43,6 @@ display: block; } - [type="checkbox"] + label, - [type="radio"] + label { - display: inline-block; - } - } .comment-form-author input, diff --git a/assets/scss/starter/content/plugins/__jetpack.scss b/assets/scss/starter/content/plugins/__jetpack.scss index 302dd48..3e2b1a6 100644 --- a/assets/scss/starter/content/plugins/__jetpack.scss +++ b/assets/scss/starter/content/plugins/__jetpack.scss @@ -325,71 +325,6 @@ -// VideoPress -@if ( index( $supported_jetpack_modules, 'videopress' ) ) { - - %videopress { - width: 100% !important; - height: auto !important; - } - - %videopress_object { - position: absolute; - width: 100%; - height: 100%; - left: 0; - right: 0; - top: 0; - } - - .video-player { - @extend %videopress; - - object { - width: 100%; - } - - .is-singular & { - position: relative; - height: 0 !important; - padding: 0 0 56.25%; /* 16:9 ratio only */ - } - - .is-singular & { - - object { - @extend %videopress_object; - } - - } - - } - - .videopress-placeholder { - @extend %videopress; - - img { - @extend %videopress; - } - - .play-button { - - + div { - display: none; - } - - } - - .is-singular & { - @extend %videopress_object; - } - - } - -} - - - // Widgets @if ( index( $supported_jetpack_modules, 'widgets' ) ) { diff --git a/assets/scss/starter/setup/_variables.scss b/assets/scss/starter/setup/_variables.scss index 664d2fb..030e861 100644 --- a/assets/scss/starter/setup/_variables.scss +++ b/assets/scss/starter/setup/_variables.scss @@ -152,6 +152,5 @@ 'responsive-videos', 'sharing', 'tiled-gallery', - 'videopress', 'widgets', ) !default; diff --git a/changelog.md b/changelog.md index b02ee98..b0a2139 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,52 @@ # Modern Changelog +## 2.2.0 + +* **Add**: Masonry posts layout option +* **Update**: Library 2.7.0 +* **Update**: CSS Starter 4.0.2 +* **Update**: Removing archive title options in favor of plugin +* **Update**: Improving NS Featured Posts plugin compatibility +* **Update**: Improving post meta display +* **Update**: Improving stylesheets loading +* **Update**: Localization +* **Fix**: All Envato Theme Check plugin test requirements +* **Fix**: Jetpack Author Bio display +* **Fix**: Intro image width on mobile devices +* **Fix**: "Back to top" button accessibility + +### Files changed: + + changelog.md + style.css + assets/js/scripts-global.js + assets/js/scripts-masonry.js + assets/js/scripts-slick.js + assets/scss/editor-style.scss + assets/scss/main.scss + assets/scss/starter/*.* + includes/customize/class-customize-styles.php + includes/customize/class-customize.php + includes/frontend/class-assets.php + includes/frontend/class-header.php + includes/frontend/class-loop.php + includes/frontend/class-menu.php + includes/frontend/class-post.php + includes/plugins/jetpack/class-jetpack-content-options.php + includes/plugins/jetpack/class-jetpack-custom-post-types.php + includes/plugins/jetpack/class-jetpack-setup.php + includes/plugins/ns-featured-posts/class-ns-featured-posts.php + includes/welcome/welcome.php + languages/modern.pot + library/*.* + template-parts/footer/site-info.php + template-parts/intro/intro-content.php + template-parts/loop/loop-front-blog.php + template-parts/loop/loop-front-portfolio.php + template-parts/loop/loop-front-testimonials.php + template-parts/menu/menu-primary.php + + ## 2.1.0 * **Add**: Adding intro background color option description diff --git a/includes/customize/class-customize-styles.php b/includes/customize/class-customize-styles.php index 7d77930..1717391 100644 --- a/includes/customize/class-customize-styles.php +++ b/includes/customize/class-customize-styles.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -213,11 +213,10 @@ public static function get_css_raw( $css = '', $scope = '' ) { /** * Enqueue HTML head inline styles * - * @uses `wmhook_modern_inline_styles_handle` global hook * @uses `wmhook_modern_esc_css` global hook * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function inline_styles() { @@ -245,7 +244,7 @@ public static function inline_styles() { if ( ! empty( $output ) ) { wp_add_inline_style( - (string) apply_filters( 'wmhook_modern_inline_styles_handle', 'modern-stylesheet-global' ), + 'modern', (string) apply_filters( 'wmhook_modern_esc_css', $output ) ); @@ -330,7 +329,7 @@ public static function get_editor_custom_stylesheet() { * and processing in oppose to custom CSS variables. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * @param string $scope */ @@ -341,8 +340,8 @@ public static function get_custom_styles_array( $scope = '' ) { $output = array(); $helper = apply_filters( 'wmhook_modern_customize_styles_get_custom_styles_array_helper', array( - 'layout_width_content' => get_theme_mod( 'layout_width_content', 1200 ), - 'typography_size_html' => get_theme_mod( 'typography_size_html', 16 ), + 'layout_width_content' => 1200, + 'typography_size_html' => 16, ), $scope ); diff --git a/includes/customize/class-customize.php b/includes/customize/class-customize.php index 41a38c1..70aebb8 100644 --- a/includes/customize/class-customize.php +++ b/includes/customize/class-customize.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.1.0 + * @version 2.2.0 * * Contents: * @@ -106,7 +106,7 @@ public static function init() { * Modify native WordPress options and setup partial refresh * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * @param object $wp_customize WP customizer object. */ @@ -148,12 +148,6 @@ public static function setup( $wp_customize ) { // Option pointers only - // Archive page title prefix - - $wp_customize->selective_refresh->add_partial( 'archive_title_prefix', array( - 'selector' => '.archive .page-title', - ) ); - // Posts columns $wp_customize->selective_refresh->add_partial( 'layout_posts_columns', array( @@ -258,7 +252,7 @@ public static function option_pointer_texts_intro( $title ) { * Set theme options array * * @since 2.0.0 - * @version 2.1.0 + * @version 2.2.0 * * @param array $options */ @@ -721,6 +715,18 @@ public static function options( $options = array() ) { ), 300 . 'layout' . 100 => array( + 'type' => 'radio', + 'id' => 'layout_posts', + 'label' => esc_html__( 'Posts list style', 'modern' ), + 'description' => esc_html__( 'Sets how posts, portfolio projects and testimonials are listed.', 'modern' ), + 'default' => 'equal-height', + 'choices' => array( + 'equal-height' => esc_html__( 'Equal row height list', 'modern' ), + 'masonry' => esc_html__( 'Masonry list', 'modern' ), + ), + ), + + 300 . 'layout' . 110 => array( 'type' => 'range', 'id' => 'layout_posts_columns', 'label' => esc_html__( 'Posts list columns', 'modern' ), @@ -1010,21 +1016,6 @@ public static function options( $options = array() ) { 'default' => true, ), - 950 . 'others' . 120 => array( - 'type' => 'multicheckbox', - 'id' => 'archive_title_prefix', - 'label' => esc_html__( 'Archive page title prefix', 'modern' ), - 'default' => array( 'category', 'tag', 'author' ), - 'choices' => array( - 'category' => esc_html__( 'Display "Category:" prefix', 'modern' ), - 'tag' => esc_html__( 'Display "Tag:" prefix', 'modern' ), - 'author' => esc_html__( 'Display "Author:" prefix', 'modern' ), - 'post-type' => esc_html__( 'Display "Archives:" prefix', 'modern' ), - 'taxonomy' => esc_html__( 'Display "Taxonomy:" prefix', 'modern' ), - ), - // No need for `preview_js` as we really need to refresh the page to apply changes. - ), - ); @@ -1168,13 +1159,13 @@ public static function partial_blogdescription() { * Render the site info in the footer for the selective refresh partial * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function partial_texts_site_info() { // Helper variables - $site_info_text = trim( get_theme_mod( 'texts_site_info' ) ); + $site_info_text = trim( Modern_Library_Customize::get_theme_mod( 'texts_site_info' ) ); // Output diff --git a/includes/frontend/class-assets.php b/includes/frontend/class-assets.php index c8a2893..9e5aec4 100644 --- a/includes/frontend/class-assets.php +++ b/includes/frontend/class-assets.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -34,7 +34,7 @@ class Modern_Assets { * Constructor * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ private function __construct() { @@ -44,10 +44,12 @@ private function __construct() { // Actions + add_action( 'wp_enqueue_scripts', __CLASS__ . '::register_inline_styles', 0 ); add_action( 'wp_enqueue_scripts', __CLASS__ . '::register_styles' ); add_action( 'wp_enqueue_scripts', __CLASS__ . '::register_scripts' ); add_action( 'wp_enqueue_scripts', __CLASS__ . '::enqueue_styles', 100 ); + add_action( 'wp_enqueue_scripts', __CLASS__ . '::enqueue_inline_styles', 105 ); add_action( 'wp_enqueue_scripts', __CLASS__ . '::enqueue_theme_stylesheet', 110 ); add_action( 'wp_enqueue_scripts', __CLASS__ . '::enqueue_scripts', 100 ); @@ -107,43 +109,18 @@ public static function init() { * Registering theme styles * * @since 1.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function register_styles() { // Helper variables - $stylesheet_global_version = ''; - - if ( current_theme_supports( 'stylesheet-generator' ) ) { - - $wp_upload_dir = wp_upload_dir(); - $theme_upload_dir = trailingslashit( $wp_upload_dir['basedir'] . get_theme_mod( '__path_theme_generated_files' ) ); - $dev_prefix = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? ( 'dev-' ) : ( '' ); - $stylesheet_global_version = get_theme_mod( '__stylesheet_timestamp' ); - - $stylesheets = array( - 'global' => ( ! file_exists( $theme_upload_dir . 'modern-styles.css' ) ) ? ( get_theme_file_uri( 'fallback.css' ) ) : ( str_replace( 'modern-styles', $dev_prefix . 'modern-styles', get_theme_mod( '__url_css' ) ) ), - ); - - } else { - - $stylesheets = array( - 'global' => get_theme_file_uri( 'assets/css/main.css' ), - ); - - } - - if ( empty( $stylesheet_global_version ) ) { - $stylesheet_global_version = MODERN_THEME_VERSION; - } - $register_assets = array( - 'modern-google-fonts' => array( self::google_fonts_url() ), - 'modern-stylesheet-global' => array( 'src' => Modern_Library::fix_ssl_urls( $stylesheets['global'] ), 'ver' => $stylesheet_global_version ), + 'modern-google-fonts' => array( 'src' => self::google_fonts_url() ), + 'modern-stylesheet-global' => array( 'src' => get_theme_file_uri( 'assets/css/main.css' ) ), ); - $register_assets = (array) apply_filters( 'wmhook_modern_assets_register_styles', $register_assets, $stylesheets ); + $register_assets = (array) apply_filters( 'wmhook_modern_assets_register_styles', $register_assets ); // Processing @@ -216,7 +193,7 @@ public static function register_scripts() { * Frontend styles enqueue * * @since 1.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function enqueue_styles() { @@ -227,27 +204,6 @@ public static function enqueue_styles() { // Processing - // SASS debugging - enqueue default (fallback) stylesheet - - if ( - defined( 'MODERN_DEBUG_SASS' ) - && MODERN_DEBUG_SASS - && current_theme_supports( 'stylesheet-generator' ) - ) { - - // We must deregister first to register again with the new URL. - wp_deregister_style( 'modern-stylesheet-global' ); - - wp_register_style( - 'modern-stylesheet-global', - get_theme_file_uri( 'fallback.css' ), - false, - esc_attr( trim( MODERN_THEME_VERSION ) ), - 'screen' - ); - - } - // Google Fonts if ( self::google_fonts_url() ) { @@ -282,7 +238,7 @@ public static function enqueue_styles() { * Frontend scripts enqueue * * @since 1.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function enqueue_scripts() { @@ -317,14 +273,20 @@ public static function enqueue_scripts() { if ( ! apply_filters( 'wmhook_modern_disable_header', false ) ) { $enqueue_assets[20] = 'modern-scripts-nav-a11y'; - if ( get_theme_mod( 'navigation_mobile', true ) ) { + if ( Modern_Library_Customize::get_theme_mod( 'navigation_mobile' ) ) { $enqueue_assets[25] = 'modern-scripts-nav-mobile'; } } // Masonry - if ( in_array( 'has-masonry-footer', $body_classes ) ) { + if ( + in_array( 'has-masonry-footer', $body_classes ) + || ( + in_array( 'has-posts-layout-masonry', $body_classes ) + && ( ! is_singular() || is_page_template( 'page-template/_front.php' ) ) + ) + ) { $enqueue_assets[40] = 'modern-scripts-masonry'; } @@ -336,6 +298,7 @@ public static function enqueue_scripts() { // For gallery post format slideshow || ( in_array( 'gallery', $supported_post_formats ) + && ! in_array( 'has-posts-layout-masonry', $body_classes ) && ( is_home() || is_archive() @@ -406,6 +369,43 @@ public static function enqueue_theme_stylesheet() { + /** + * Placeholder for adding inline styles: register. + * + * This should be loaded after all of the theme stylesheets are enqueued, + * and before the child theme stylesheet is enqueued. + * Use the `modern` handle in `wp_add_inline_style`. + * Early registration is required! + * + * @since 2.2.0 + * @version 2.2.0 + */ + public static function register_inline_styles() { + + // Processing + + wp_register_style( 'modern', '' ); + + } // /register_inline_styles + + + + /** + * Placeholder for adding inline styles: enqueue. + * + * @since 2.2.0 + * @version 2.2.0 + */ + public static function enqueue_inline_styles() { + + // Processing + + wp_enqueue_style( 'modern' ); + + } // /enqueue_inline_styles + + + /** * Customizer preview assets enqueue * @@ -627,7 +627,7 @@ public static function google_fonts_url( $fonts = array() ) { * Editor stylesheets array * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function editor_stylesheets() { @@ -649,54 +649,35 @@ public static function editor_stylesheets() { // Editor stylesheet - if ( current_theme_supports( 'stylesheet-generator' ) ) { - - $wp_upload_dir = wp_upload_dir(); - $theme_upload_dir = trailingslashit( $wp_upload_dir['basedir'] . get_theme_mod( '__path_theme_generated_files' ) ); - - if ( file_exists( $theme_upload_dir . 'modern-styles' . $stylesheet_suffix . '.css' ) ) { - - $dev_prefix = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? ( 'dev-' ) : ( '' ); - - $visual_editor_stylesheets[10] = esc_url_raw( add_query_arg( - 'ver', - get_theme_mod( '__stylesheet_timestamp' ), - Modern_Library::fix_ssl_urls( str_replace( - 'modern-styles', - $dev_prefix . 'modern-styles', - get_theme_mod( '__url_css' . $stylesheet_suffix ) - ) ) - ) ); - - } - - } + $visual_editor_stylesheets[10] = esc_url_raw( add_query_arg( + 'ver', + MODERN_THEME_VERSION, + get_theme_file_uri( 'assets/css/main' . str_replace( + '-editor', + '', + $stylesheet_suffix + ) . '.css' ) + ) ); + + $visual_editor_stylesheets[15] = esc_url_raw( add_query_arg( + 'ver', + MODERN_THEME_VERSION, + get_theme_file_uri( 'assets/css/editor-style' . str_replace( + '-editor', + '', + $stylesheet_suffix + ) . '.css' ) + ) ); /** - * If we don't have generated editor stylesheet enqueued yet, load a fallback stylesheets. - * - * In Modern_Customize_Styles::editor_stylesheet() the fallback custom styles stylesheet + * In Modern_Customize_Styles::editor_stylesheet() this fallback custom styles stylesheet * will be overridden if the theme does not support `stylesheet-generator`. */ - if ( ! isset( $visual_editor_stylesheets[10] ) ) { - - $visual_editor_stylesheets[10] = esc_url_raw( add_query_arg( - 'ver', - MODERN_THEME_VERSION, - get_theme_file_uri( 'assets/css/editor-style' . str_replace( - '-editor', - '', - $stylesheet_suffix - ) . '.css' ) - ) ); - - $visual_editor_stylesheets[20] = esc_url_raw( add_query_arg( - 'ver', - MODERN_THEME_VERSION, - get_theme_file_uri( 'assets/css/custom-styles-editor.css' ) - ) ); - - } + $visual_editor_stylesheets[20] = esc_url_raw( add_query_arg( + 'ver', + MODERN_THEME_VERSION, + get_theme_file_uri( 'assets/css/custom-styles-editor.css' ) + ) ); // Filter and order diff --git a/includes/frontend/class-header.php b/includes/frontend/class-header.php index 851e463..e414f70 100644 --- a/includes/frontend/class-header.php +++ b/includes/frontend/class-header.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.1.0 + * @version 2.2.0 * * Contents: * @@ -154,14 +154,14 @@ public static function head_pingback() { * @see https://wordpress.org/plugins/chrome-theme-color-changer * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function head_chrome_color() { // Output if ( ! class_exists( 'Chrome_Theme_Color_Changer' ) ) { - echo ''; + echo ''; } } // /head_chrome_color @@ -338,7 +338,7 @@ public static function site_branding() { * HTML Body classes * * @since 1.0.0 - * @version 2.1.0 + * @version 2.2.0 * * @param array $classes */ @@ -373,7 +373,7 @@ public static function body_class( $classes = array() ) { // Is mobile navigation enabled? - if ( get_theme_mod( 'navigation_mobile', true ) ) { + if ( Modern_Library_Customize::get_theme_mod( 'navigation_mobile' ) ) { $classes[] = 'has-navigation-mobile'; } @@ -454,7 +454,9 @@ public static function body_class( $classes = array() ) { // Posts layout - $classes[] = 'posts-layout-columns-' . absint( get_theme_mod( 'layout_posts_columns', 3 ) ); + $classes[] = 'posts-layout-columns-' . absint( Modern_Library_Customize::get_theme_mod( 'layout_posts_columns' ) ); + + $classes[] = sanitize_title( 'has-posts-layout-' . Modern_Library_Customize::get_theme_mod( 'layout_posts' ) ); // Enable intro slideshow? diff --git a/includes/frontend/class-loop.php b/includes/frontend/class-loop.php index b3efa93..75e7567 100644 --- a/includes/frontend/class-loop.php +++ b/includes/frontend/class-loop.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -34,7 +34,7 @@ class Modern_Loop { * Constructor * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ private function __construct() { @@ -52,8 +52,6 @@ private function __construct() { // Filters - add_filter( 'get_the_archive_title', __CLASS__ . '::archive_title' ); - add_filter( 'get_the_archive_description', __CLASS__ . '::archive_author_description' ); add_filter( 'navigation_markup_template', __CLASS__ . '::pagination_comments', 10, 2 ); @@ -268,60 +266,6 @@ public static function search_form() { * 30) Archives */ - /** - * Archive page title - * - * @since 2.0.0 - * @version 2.0.0 - * - * @param string $title - */ - public static function archive_title( $title = '' ) { - - // Helper variables - - $use_prefix = get_theme_mod( 'archive_title_prefix', array( 'category', 'tag', 'author' ) ); - $use_prefix = ( ! is_array( $use_prefix ) ) ? ( explode( ',', $use_prefix ) ) : ( $use_prefix ); - - $remove_prefix = array_diff( array( - 'author', - 'category', - 'post-type', - 'tag', - 'taxonomy', - ), (array) $use_prefix ); - - - // Requirements check - - if ( empty( $remove_prefix ) ) { - return $title; - } - - - // Processing - - if ( in_array( 'category', $remove_prefix ) && is_category() ) { - $title = single_cat_title( '', false ); - } elseif ( in_array( 'tag', $remove_prefix ) && is_tag() ) { - $title = single_tag_title( '', false ); - } elseif ( in_array( 'author', $remove_prefix ) && is_author() ) { - $title = '' . get_the_author() . ''; - } elseif ( in_array( 'post-type', $remove_prefix ) && is_post_type_archive() ) { - $title = post_type_archive_title( '', false ); - } elseif ( in_array( 'taxonomy', $remove_prefix ) && is_tax() ) { - $title = single_term_title( '', false ); - } - - - // Output - - return $title; - - } // /archive_title - - - /** * Author archive description * diff --git a/includes/frontend/class-menu.php b/includes/frontend/class-menu.php index ccb37d6..b5b7d88 100644 --- a/includes/frontend/class-menu.php +++ b/includes/frontend/class-menu.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.2 + * @version 2.2.0 * * Contents: * @@ -206,13 +206,13 @@ public static function primary_menu_args( $mobile_nav = true, $fallback = false * Primary navigation fallback * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function primary_fallback() { // Helper variables - $output = wp_page_menu( array( 'echo' => false ) + (array) self::primary_menu_args( get_theme_mod( 'navigation_mobile', true ), 'fallback' ) ); + $output = wp_page_menu( array( 'echo' => false ) + (array) self::primary_menu_args( Modern_Library_Customize::get_theme_mod( 'navigation_mobile' ), 'fallback' ) ); // Output diff --git a/includes/frontend/class-post.php b/includes/frontend/class-post.php index 6d5737e..6fc755c 100644 --- a/includes/frontend/class-post.php +++ b/includes/frontend/class-post.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -446,11 +446,10 @@ public static function navigation() { /** * Post navigation styles * - * @uses `wmhook_modern_inline_styles_handle` global hook * @uses `wmhook_modern_esc_css` global hook * * @since 1.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function navigation_styles() { @@ -500,7 +499,7 @@ public static function navigation_styles() { if ( ! empty( $output ) ) { wp_add_inline_style( - (string) apply_filters( 'wmhook_modern_inline_styles_handle', 'modern-stylesheet-global' ), + 'modern', (string) apply_filters( 'wmhook_modern_esc_css', $output, 'Modern_Post::navigation_styles' ) ); @@ -551,18 +550,18 @@ public static function entry_content_container() { * fine with customizer options. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function template_front_display_blog() { // Helper variables - $location = explode( '|', (string) get_theme_mod( 'layout_location_front_blog', 'tha_content_before|20' ) ); + $location = explode( '|', (string) Modern_Library_Customize::get_theme_mod( 'layout_location_front_blog' ) ); if ( ! isset( $location[1] ) ) { $location[1] = 10; } - if ( 1 > intval( get_theme_mod( 'layout_posts_per_page_front_blog', 6 ) ) ) { + if ( 1 > intval( Modern_Library_Customize::get_theme_mod( 'layout_posts_per_page_front_blog' ) ) ) { $location[0] = false; } diff --git a/includes/plugins/jetpack/class-jetpack-content-options.php b/includes/plugins/jetpack/class-jetpack-content-options.php index ebf8ba2..bb3e80e 100644 --- a/includes/plugins/jetpack/class-jetpack-content-options.php +++ b/includes/plugins/jetpack/class-jetpack-content-options.php @@ -8,7 +8,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -33,10 +33,8 @@ class Modern_Jetpack_Content_Options { /** * Constructor * - * @uses `wmhook_modern_inline_styles_handle` global hook - * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ private function __construct() { @@ -54,7 +52,7 @@ private function __construct() { $content_options = array( 'author-bio' => true, 'post-details' => array( - 'stylesheet' => (string) apply_filters( 'wmhook_modern_inline_styles_handle', 'modern-stylesheet-global' ), + 'stylesheet' => 'modern', 'categories' => '.cat-links', 'comment' => '.comments-link', 'date' => '.posted-on', @@ -152,7 +150,7 @@ public static function author_bio() { * Get author bio HTML * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * @param boolean $remove_default_paragraph */ @@ -177,7 +175,10 @@ public static function get_author_bio( $remove_default_paragraph = true ) { '

', '

', ), - '', + array( + '
', + '
', + ), $output ); } diff --git a/includes/plugins/jetpack/class-jetpack-custom-post-types.php b/includes/plugins/jetpack/class-jetpack-custom-post-types.php index b2a1363..4c2880a 100644 --- a/includes/plugins/jetpack/class-jetpack-custom-post-types.php +++ b/includes/plugins/jetpack/class-jetpack-custom-post-types.php @@ -8,7 +8,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.2 + * @version 2.2.0 * * Contents: * @@ -190,18 +190,18 @@ public static function portfolio_taxonomy( $context = '' ) { * fine with customizer options. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function template_front_display_portfolio() { // Helper variables - $location = explode( '|', (string) get_theme_mod( 'layout_location_front_portfolio', 'tha_content_before|10' ) ); + $location = explode( '|', (string) Modern_Library_Customize::get_theme_mod( 'layout_location_front_portfolio' ) ); if ( ! isset( $location[1] ) ) { $location[1] = 10; } - if ( 1 > intval( get_theme_mod( 'layout_posts_per_page_front_portfolio', 6 ) ) ) { + if ( 1 > intval( Modern_Library_Customize::get_theme_mod( 'layout_posts_per_page_front_portfolio' ) ) ) { $location[0] = false; } @@ -325,18 +325,18 @@ public static function content_type_testimonials( $content_type = '' ) { * fine with customizer options. * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ public static function template_front_display_testimonials() { // Helper variables - $location = explode( '|', (string) get_theme_mod( 'layout_location_front_testimonials', 'tha_content_after|10' ) ); + $location = explode( '|', (string) Modern_Library_Customize::get_theme_mod( 'layout_location_front_testimonials' ) ); if ( ! isset( $location[1] ) ) { $location[1] = 10; } - if ( 1 > intval( get_theme_mod( 'layout_posts_per_page_front_testimonials', 3 ) ) ) { + if ( 1 > intval( Modern_Library_Customize::get_theme_mod( 'layout_posts_per_page_front_testimonials' ) ) ) { $location[0] = false; } diff --git a/includes/plugins/jetpack/class-jetpack-customize.php b/includes/plugins/jetpack/class-jetpack-customize.php index 7366772..91b44d9 100644 --- a/includes/plugins/jetpack/class-jetpack-customize.php +++ b/includes/plugins/jetpack/class-jetpack-customize.php @@ -30,8 +30,6 @@ class Modern_Jetpack_Customize { /** * Constructor * - * @uses `wmhook_modern_inline_styles_handle` global hook - * * @since 2.0.0 * @version 2.0.0 */ diff --git a/includes/plugins/jetpack/class-jetpack-setup.php b/includes/plugins/jetpack/class-jetpack-setup.php index d1d2472..af032e0 100644 --- a/includes/plugins/jetpack/class-jetpack-setup.php +++ b/includes/plugins/jetpack/class-jetpack-setup.php @@ -8,13 +8,12 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * * 0) Init - * 10) Assets - * 20) Sharing + * 10) Sharing */ class Modern_Jetpack_Setup { @@ -34,7 +33,7 @@ class Modern_Jetpack_Setup { * Constructor * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ private function __construct() { @@ -66,10 +65,6 @@ private function __construct() { // Hooks - // Actions - - add_action( 'wp_enqueue_scripts', __CLASS__ . '::assets', 100 ); - // Filters if ( is_callable( 'Modern_Content::headings_level_up' ) ) { @@ -110,33 +105,7 @@ public static function init() { /** - * 10) Assets - */ - - /** - * Assets - * - * @since 2.0.0 - * @version 2.0.0 - */ - public static function assets() { - - // Processing - - // Styles - - // Deregister Genericons as we've got them in the theme - - wp_deregister_style( 'genericons' ); - - } // /assets - - - - - - /** - * 20) Sharing + * 10) Sharing */ /** diff --git a/includes/plugins/ns-featured-posts/class-ns-featured-posts.php b/includes/plugins/ns-featured-posts/class-ns-featured-posts.php index 0813d27..9177c86 100644 --- a/includes/plugins/ns-featured-posts/class-ns-featured-posts.php +++ b/includes/plugins/ns-featured-posts/class-ns-featured-posts.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -33,7 +33,7 @@ class Modern_NS_Featured_Posts { * Constructor * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ private function __construct() { @@ -56,7 +56,7 @@ private function __construct() { // Filters - add_filter( 'wmhook_modern_intro_get_slides', __CLASS__ . '::get_posts', 100 ); // After Jetpack featured content to override it. + add_filter( 'wmhook_modern_intro_get_slides', __CLASS__ . '::get_posts', 20 ); // After Jetpack featured content to override it. add_filter( 'post_class', __CLASS__ . '::post_class', 100 ); diff --git a/includes/welcome/welcome.php b/includes/welcome/welcome.php index 1172fe1..ec96759 100644 --- a/includes/welcome/welcome.php +++ b/includes/welcome/welcome.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 * * Contents: * @@ -24,7 +24,7 @@ if ( ! is_admin() - || ! get_theme_mod( 'admin_welcome_page', true ) + || ! Modern_Library_Customize::get_theme_mod( 'admin_welcome_page' ) ) { return; } diff --git a/languages/modern.pot b/languages/modern.pot index 865450e..cf1d3e9 100644 --- a/languages/modern.pot +++ b/languages/modern.pot @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Modern\n" "Report-Msgid-Bugs-To: https://www.webmandesign.eu/reference/#links-support\n" -"POT-Creation-Date: 2018-06-18 15:22+0200\n" +"POT-Creation-Date: 2018-09-26 18:07+0200\n" "PO-Revision-Date: 2015-04-15 10:00+0100\n" "Last-Translator: WebMan - Oliver Juhas \n" "Language-Team: \n" @@ -11,7 +11,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.8\n" +"X-Generator: Poedit 2.1.1\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" @@ -53,160 +53,160 @@ msgstr "" msgid "Header image %d" msgstr "" -#: includes/customize/class-customize.php:297 +#: includes/customize/class-customize.php:291 msgid "Logo image" msgstr "" -#: includes/customize/class-customize.php:298 +#: includes/customize/class-customize.php:292 msgid "Please, do not forget to set the logo max height." msgstr "" -#: includes/customize/class-customize.php:298 +#: includes/customize/class-customize.php:292 msgid "" "To make your logo image ready for high DPI screens, please upload twice as " "big image." msgstr "" -#: includes/customize/class-customize.php:306 +#: includes/customize/class-customize.php:300 msgid "Max logo image height (px)" msgstr "" -#: includes/customize/class-customize.php:327 -#: includes/customize/class-customize.php:358 -#: includes/customize/class-customize.php:400 -#: includes/customize/class-customize.php:488 -#: includes/customize/class-customize.php:549 -#: includes/customize/class-customize.php:631 -#: includes/customize/class-customize.php:720 -#: includes/customize/class-customize.php:784 -#: includes/customize/class-customize.php:821 -#: includes/customize/class-customize.php:993 +#: includes/customize/class-customize.php:321 +#: includes/customize/class-customize.php:352 +#: includes/customize/class-customize.php:394 +#: includes/customize/class-customize.php:482 +#: includes/customize/class-customize.php:543 +#: includes/customize/class-customize.php:625 +#: includes/customize/class-customize.php:714 +#: includes/customize/class-customize.php:790 +#: includes/customize/class-customize.php:827 +#: includes/customize/class-customize.php:999 msgctxt "Customizer panel title." msgid "Theme Options" msgstr "" -#: includes/customize/class-customize.php:328 +#: includes/customize/class-customize.php:322 msgid "Theme Credits" msgstr "" -#: includes/customize/class-customize.php:331 +#: includes/customize/class-customize.php:325 #, php-format msgctxt "1: linked theme name, 2: theme author name." msgid "%1$s is a WordPress theme developed by %2$s." msgstr "" -#: includes/customize/class-customize.php:338 +#: includes/customize/class-customize.php:332 #, php-format msgctxt "%s: theme author link." msgid "You can obtain other professional WordPress themes at %s." msgstr "" -#: includes/customize/class-customize.php:343 +#: includes/customize/class-customize.php:337 msgid "Thank you for using a theme by WebMan Design!" msgstr "" -#: includes/customize/class-customize.php:357 -#: includes/customize/class-customize.php:399 -#: includes/customize/class-customize.php:487 -#: includes/customize/class-customize.php:548 -#: includes/customize/class-customize.php:630 +#: includes/customize/class-customize.php:351 +#: includes/customize/class-customize.php:393 +#: includes/customize/class-customize.php:481 +#: includes/customize/class-customize.php:542 +#: includes/customize/class-customize.php:624 #, php-format msgctxt "%s = section name. Customizer section title." msgid "Colors: %s" msgstr "" -#: includes/customize/class-customize.php:357 +#: includes/customize/class-customize.php:351 msgctxt "Customizer color section title" msgid "Accents" msgstr "" -#: includes/customize/class-customize.php:369 +#: includes/customize/class-customize.php:363 msgid "These colors affect links, buttons and other elements." msgstr "" -#: includes/customize/class-customize.php:374 +#: includes/customize/class-customize.php:368 msgid "Primary accent color" msgstr "" -#: includes/customize/class-customize.php:380 +#: includes/customize/class-customize.php:374 msgid "Accent color" msgstr "" -#: includes/customize/class-customize.php:386 +#: includes/customize/class-customize.php:380 msgid "Accent text color" msgstr "" -#: includes/customize/class-customize.php:387 +#: includes/customize/class-customize.php:381 msgid "Color of text on accent color background." msgstr "" -#: includes/customize/class-customize.php:399 +#: includes/customize/class-customize.php:393 msgctxt "Customizer color section title" msgid "Header" msgstr "" -#: includes/customize/class-customize.php:411 +#: includes/customize/class-customize.php:405 msgid "Header" msgstr "" -#: includes/customize/class-customize.php:417 -#: includes/customize/class-customize.php:506 -#: includes/customize/class-customize.php:567 -#: includes/customize/class-customize.php:649 +#: includes/customize/class-customize.php:411 +#: includes/customize/class-customize.php:500 +#: includes/customize/class-customize.php:561 +#: includes/customize/class-customize.php:643 msgid "Background color" msgstr "" -#: includes/customize/class-customize.php:418 +#: includes/customize/class-customize.php:412 msgid "This color is also used to style a mobile device browser address bar." msgstr "" -#: includes/customize/class-customize.php:418 +#: includes/customize/class-customize.php:412 msgid "You can further customize it with a dedicated plugin." msgstr "" -#: includes/customize/class-customize.php:443 -#: includes/customize/class-customize.php:522 -#: includes/customize/class-customize.php:582 -#: includes/customize/class-customize.php:670 +#: includes/customize/class-customize.php:437 +#: includes/customize/class-customize.php:516 +#: includes/customize/class-customize.php:576 +#: includes/customize/class-customize.php:664 msgid "Text color" msgstr "" -#: includes/customize/class-customize.php:444 +#: includes/customize/class-customize.php:438 msgid "This color affects navigation menu only." msgstr "" -#: includes/customize/class-customize.php:444 +#: includes/customize/class-customize.php:438 msgid "" "If you want to set a different header logo and social icons color, please " "see Colors: Intro options." msgstr "" -#: includes/customize/class-customize.php:487 +#: includes/customize/class-customize.php:481 msgctxt "Customizer color section title" msgid "Intro" msgstr "" -#: includes/customize/class-customize.php:499 +#: includes/customize/class-customize.php:493 msgid "Intro" msgstr "" -#: includes/customize/class-customize.php:500 +#: includes/customize/class-customize.php:494 msgid "" "This is a specially styled, main, dominant intro section (with optional " "slideshow) on front page, or site background image section on other pages." msgstr "" -#: includes/customize/class-customize.php:500 +#: includes/customize/class-customize.php:494 msgid "" "The text color below also controls other text color on the website - see " "below." msgstr "" -#: includes/customize/class-customize.php:507 +#: includes/customize/class-customize.php:501 msgid "This also controls the intro image overlay color." msgstr "" -#: includes/customize/class-customize.php:523 +#: includes/customize/class-customize.php:517 msgid "" "This color is also applied on main site container, and thus on all elements " "outside the actual post or page content area (the elements that are " @@ -214,152 +214,167 @@ msgid "" "logo and social icons)." msgstr "" -#: includes/customize/class-customize.php:548 +#: includes/customize/class-customize.php:542 msgctxt "Customizer color section title" msgid "Content" msgstr "" -#: includes/customize/class-customize.php:560 +#: includes/customize/class-customize.php:554 msgid "Content" msgstr "" -#: includes/customize/class-customize.php:561 +#: includes/customize/class-customize.php:555 msgid "" "These are colors for actual post or page content area (both in single post/" "page display and in posts lists)." msgstr "" -#: includes/customize/class-customize.php:603 -#: includes/customize/class-customize.php:691 +#: includes/customize/class-customize.php:597 +#: includes/customize/class-customize.php:685 msgid "Headings color" msgstr "" -#: includes/customize/class-customize.php:630 +#: includes/customize/class-customize.php:624 msgctxt "Customizer color section title" msgid "Footer" msgstr "" -#: includes/customize/class-customize.php:642 +#: includes/customize/class-customize.php:636 msgid "Footer" msgstr "" -#: includes/customize/class-customize.php:643 +#: includes/customize/class-customize.php:637 msgid "" "The main footer widgets area is displayed only if it contains some widgets." msgstr "" -#: includes/customize/class-customize.php:719 +#: includes/customize/class-customize.php:713 msgctxt "Customizer section title." msgid "Layout" msgstr "" -#: includes/customize/class-customize.php:726 +#: includes/customize/class-customize.php:720 +msgid "Posts list style" +msgstr "" + +#: includes/customize/class-customize.php:721 +msgid "Sets how posts, portfolio projects and testimonials are listed." +msgstr "" + +#: includes/customize/class-customize.php:724 +msgid "Equal row height list" +msgstr "" + +#: includes/customize/class-customize.php:725 +msgid "Masonry list" +msgstr "" + +#: includes/customize/class-customize.php:732 msgid "Posts list columns" msgstr "" -#: includes/customize/class-customize.php:727 +#: includes/customize/class-customize.php:733 msgid "Number of columns displayed in list of posts." msgstr "" -#: includes/customize/class-customize.php:729 +#: includes/customize/class-customize.php:735 msgid "" "Please note that sidebar affects the columns count if it is displayed on the " "page with list of posts." msgstr "" -#: includes/customize/class-customize.php:731 +#: includes/customize/class-customize.php:737 msgid "" "You may also need to rise the thumbnail image size if you set this to 2 " "columns (see Settings → Media)." msgstr "" -#: includes/customize/class-customize.php:747 -#: includes/plugins/jetpack/class-jetpack-customize.php:137 -#: includes/plugins/jetpack/class-jetpack-customize.php:169 +#: includes/customize/class-customize.php:753 +#: includes/plugins/jetpack/class-jetpack-customize.php:135 +#: includes/plugins/jetpack/class-jetpack-customize.php:167 msgid "Front page:" msgstr "" -#: includes/customize/class-customize.php:748 +#: includes/customize/class-customize.php:754 msgid "Blog section" msgstr "" -#: includes/customize/class-customize.php:751 +#: includes/customize/class-customize.php:757 msgid "Options for setting up blog posts section on \"Front page\" template." msgstr "" -#: includes/customize/class-customize.php:758 -#: includes/plugins/jetpack/class-jetpack-customize.php:143 -#: includes/plugins/jetpack/class-jetpack-customize.php:175 +#: includes/customize/class-customize.php:764 +#: includes/plugins/jetpack/class-jetpack-customize.php:141 +#: includes/plugins/jetpack/class-jetpack-customize.php:173 msgid "Display location" msgstr "" -#: includes/customize/class-customize.php:766 -#: includes/plugins/jetpack/class-jetpack-customize.php:151 -#: includes/plugins/jetpack/class-jetpack-customize.php:183 +#: includes/customize/class-customize.php:772 +#: includes/plugins/jetpack/class-jetpack-customize.php:149 +#: includes/plugins/jetpack/class-jetpack-customize.php:181 msgid "Posts count" msgstr "" -#: includes/customize/class-customize.php:783 +#: includes/customize/class-customize.php:789 msgctxt "Customizer section title." msgid "Texts" msgstr "" -#: includes/customize/class-customize.php:790 +#: includes/customize/class-customize.php:796 msgid "Default blog intro text" msgstr "" -#: includes/customize/class-customize.php:791 +#: includes/customize/class-customize.php:797 msgid "" "This text will be displayed in intro section of your website front page only " "if latest posts are displayed there." msgstr "" -#: includes/customize/class-customize.php:792 -#: template-parts/intro/intro-content.php:41 +#: includes/customize/class-customize.php:798 msgid "Welcome to our site!" msgstr "" -#: includes/customize/class-customize.php:803 +#: includes/customize/class-customize.php:809 msgid "Footer credits (copyright)" msgstr "" -#: includes/customize/class-customize.php:804 +#: includes/customize/class-customize.php:810 #, php-format msgid "Set %s to disable this area." msgstr "" -#: includes/customize/class-customize.php:804 +#: includes/customize/class-customize.php:810 msgid "Leaving the field empty will fall back to default theme setting." msgstr "" -#: includes/customize/class-customize.php:804 +#: includes/customize/class-customize.php:810 #, php-format msgid "You can use %s to display dynamic, always current year." msgstr "" -#: includes/customize/class-customize.php:820 +#: includes/customize/class-customize.php:826 msgctxt "Customizer section title." msgid "Typography" msgstr "" -#: includes/customize/class-customize.php:827 +#: includes/customize/class-customize.php:833 msgid "Basic font size in px" msgstr "" -#: includes/customize/class-customize.php:828 +#: includes/customize/class-customize.php:834 msgid "" "All other font sizes are calculated automatically from this basic font size." msgstr "" -#: includes/customize/class-customize.php:852 +#: includes/customize/class-customize.php:858 msgid "Use custom fonts" msgstr "" -#: includes/customize/class-customize.php:859 +#: includes/customize/class-customize.php:865 msgid "Custom fonts setup" msgstr "" -#: includes/customize/class-customize.php:862 +#: includes/customize/class-customize.php:868 #, php-format msgctxt "" "%s: linked examples of web fonts libraries such as Google Fonts or Adobe " @@ -369,7 +384,7 @@ msgid "" "Instead, please use any font service (such as %s) plugin you like." msgstr "" -#: includes/customize/class-customize.php:866 +#: includes/customize/class-customize.php:872 msgid "" "You can set your fonts plugin according to information provided below, or " "insert your custom font names (a value of \"font-family\" CSS property) " @@ -377,121 +392,97 @@ msgid "" "fonts on the website)." msgstr "" -#: includes/customize/class-customize.php:874 +#: includes/customize/class-customize.php:880 msgid "General text font" msgstr "" -#: includes/customize/class-customize.php:886 +#: includes/customize/class-customize.php:892 #: includes/setup/class-setup.php:683 msgid "Headings font" msgstr "" -#: includes/customize/class-customize.php:898 +#: includes/customize/class-customize.php:904 #: includes/setup/class-setup.php:689 msgid "Logo font" msgstr "" -#: includes/customize/class-customize.php:909 +#: includes/customize/class-customize.php:915 msgid "Info: CSS selectors" msgstr "" -#: includes/customize/class-customize.php:911 +#: includes/customize/class-customize.php:917 msgid "" "Here you can find CSS selectors list associated with each font group in the " "theme. You can use these in your custom font plugin settings." msgstr "" -#: includes/customize/class-customize.php:915 +#: includes/customize/class-customize.php:921 msgid "General text font CSS selectors:" msgstr "" -#: includes/customize/class-customize.php:925 +#: includes/customize/class-customize.php:931 msgid "Headings font CSS selectors:" msgstr "" -#: includes/customize/class-customize.php:942 +#: includes/customize/class-customize.php:948 msgid "Logo font CSS selectors:" msgstr "" -#: includes/customize/class-customize.php:992 +#: includes/customize/class-customize.php:998 msgctxt "Customizer section title." msgid "Others" msgstr "" -#: includes/customize/class-customize.php:999 +#: includes/customize/class-customize.php:1005 msgid "Show \"Welcome\" page" msgstr "" -#: includes/customize/class-customize.php:1000 +#: includes/customize/class-customize.php:1006 msgid "Under \"Appearance\" WordPress dashboard menu." msgstr "" -#: includes/customize/class-customize.php:1008 +#: includes/customize/class-customize.php:1014 msgid "Enable mobile navigation" msgstr "" -#: includes/customize/class-customize.php:1009 +#: includes/customize/class-customize.php:1015 msgid "" "If your website navigation is very simple and you do not want to use the " "mobile navigation functionality, you can disable it here." msgstr "" -#: includes/customize/class-customize.php:1016 -msgid "Archive page title prefix" -msgstr "" - -#: includes/customize/class-customize.php:1019 -msgid "Display \"Category:\" prefix" -msgstr "" - -#: includes/customize/class-customize.php:1020 -msgid "Display \"Tag:\" prefix" -msgstr "" - -#: includes/customize/class-customize.php:1021 -msgid "Display \"Author:\" prefix" -msgstr "" - -#: includes/customize/class-customize.php:1022 -msgid "Display \"Archives:\" prefix" -msgstr "" - -#: includes/customize/class-customize.php:1023 -msgid "Display \"Taxonomy:\" prefix" -msgstr "" - -#: includes/customize/class-customize.php:1183 +#: includes/customize/class-customize.php:1174 msgid "" "Please set your website credits text or the theme default one will be " "displayed." msgstr "" -#: includes/customize/class-customize.php:1234 +#: includes/customize/class-customize.php:1225 msgid "Do not display" msgstr "" -#: includes/customize/class-customize.php:1236 -#: includes/customize/class-customize.php:1237 -#: includes/customize/class-customize.php:1238 +#: includes/customize/class-customize.php:1227 +#: includes/customize/class-customize.php:1228 +#: includes/customize/class-customize.php:1229 #, php-format msgctxt "%d: Position priority number." msgid "Above page content, position %d" msgstr "" -#: includes/customize/class-customize.php:1240 -#: includes/customize/class-customize.php:1241 -#: includes/customize/class-customize.php:1242 +#: includes/customize/class-customize.php:1231 +#: includes/customize/class-customize.php:1232 +#: includes/customize/class-customize.php:1233 #, php-format msgctxt "%d: Position priority number." msgid "Below page content, position %d" msgstr "" -#: includes/frontend/class-assets.php:352 +#: includes/frontend/class-assets.php:315 msgctxt "Slideshow slide." msgid "Previous" msgstr "" -#: includes/frontend/class-assets.php:353 +#: includes/frontend/class-assets.php:316 msgctxt "Slideshow slide." msgid "Next" msgstr "" @@ -504,22 +495,22 @@ msgstr "" msgid "Skip to footer" msgstr "" -#: includes/frontend/class-loop.php:116 includes/frontend/class-loop.php:189 +#: includes/frontend/class-loop.php:114 includes/frontend/class-loop.php:187 msgctxt "Pagination text (visible): previous." msgid "«" msgstr "" -#: includes/frontend/class-loop.php:117 includes/frontend/class-loop.php:190 +#: includes/frontend/class-loop.php:115 includes/frontend/class-loop.php:188 msgctxt "Pagination text (hidden): previous." msgid "Previous page" msgstr "" -#: includes/frontend/class-loop.php:118 includes/frontend/class-loop.php:191 +#: includes/frontend/class-loop.php:116 includes/frontend/class-loop.php:189 msgctxt "Pagination text (hidden): next." msgid "Next page" msgstr "" -#: includes/frontend/class-loop.php:119 includes/frontend/class-loop.php:192 +#: includes/frontend/class-loop.php:117 includes/frontend/class-loop.php:190 msgctxt "Pagination text (visible): next." msgid "»" msgstr "" @@ -647,19 +638,19 @@ msgid "" "needs." msgstr "" -#: includes/plugins/jetpack/class-jetpack-customize.php:137 +#: includes/plugins/jetpack/class-jetpack-customize.php:135 msgid "Portfolio section" msgstr "" -#: includes/plugins/jetpack/class-jetpack-customize.php:137 +#: includes/plugins/jetpack/class-jetpack-customize.php:135 msgid "Options for setting up portfolio section on \"Front page\" template." msgstr "" -#: includes/plugins/jetpack/class-jetpack-customize.php:169 +#: includes/plugins/jetpack/class-jetpack-customize.php:167 msgid "Testimonials section" msgstr "" -#: includes/plugins/jetpack/class-jetpack-customize.php:169 +#: includes/plugins/jetpack/class-jetpack-customize.php:167 msgid "Options for setting up testimonials section on \"Front page\" template." msgstr "" @@ -959,149 +950,134 @@ msgstr "" msgid "Welcome" msgstr "" -#: library/includes/classes/class-core.php:177 +#: library/includes/classes/class-core.php:157 #, php-format msgctxt "%s: post title." msgid "\"%s\" table of contents" msgstr "" -#: library/includes/classes/class-core.php:215 +#: library/includes/classes/class-core.php:196 #, php-format msgid "Page %s" msgstr "" -#: library/includes/classes/class-core.php:307 +#: library/includes/classes/class-core.php:289 #, php-format msgctxt "Paginated content title suffix, %s: page number." msgid "(page %s)" msgstr "" -#: library/includes/classes/class-core.php:527 +#: library/includes/classes/class-core.php:450 msgid "Skip to main content" msgstr "" -#: library/includes/classes/class-customize-control-html.php:32 +#: library/includes/classes/class-customize-control-html.php:34 msgid "Please set the `content` parameter for the HTML control." msgstr "" -#: library/includes/classes/class-customize-control-multiselect.php:115 +#: library/includes/classes/class-customize-control-multiselect.php:117 msgid "Press CTRL key for multiple selection." msgstr "" -#: library/includes/classes/class-customize-styles.php:211 -msgid "" -"ERROR: Wasn't able to create a theme CSS folder! Contact the theme support." -msgstr "" - -#: library/includes/classes/class-customize-styles.php:754 -msgid "" -"The theme writes a files to your server. You do not appear to have your FTP " -"credentials set up in \"wp-config.php\" file." -msgstr "" - -#: library/includes/classes/class-customize-styles.php:754 -msgid "Please set your FTP credentials first." -msgstr "" - -#: library/includes/classes/class-visual-editor.php:219 +#: library/includes/classes/class-visual-editor.php:185 msgid "Text styles" msgstr "" -#: library/includes/classes/class-visual-editor.php:223 +#: library/includes/classes/class-visual-editor.php:189 msgid "Dropcap text" msgstr "" -#: library/includes/classes/class-visual-editor.php:229 +#: library/includes/classes/class-visual-editor.php:195 msgid "Uppercase heading or paragraph" msgstr "" -#: library/includes/classes/class-visual-editor.php:235 +#: library/includes/classes/class-visual-editor.php:201 msgid "Highlighted (marked) text" msgstr "" -#: library/includes/classes/class-visual-editor.php:241 +#: library/includes/classes/class-visual-editor.php:207 msgid "Small text" msgstr "" -#: library/includes/classes/class-visual-editor.php:246 +#: library/includes/classes/class-visual-editor.php:212 msgid "Superscript" msgstr "" -#: library/includes/classes/class-visual-editor.php:252 +#: library/includes/classes/class-visual-editor.php:218 msgid "Subscript" msgstr "" -#: library/includes/classes/class-visual-editor.php:258 -#: library/includes/classes/class-visual-editor.php:264 -#: library/includes/classes/class-visual-editor.php:270 +#: library/includes/classes/class-visual-editor.php:224 +#: library/includes/classes/class-visual-editor.php:230 +#: library/includes/classes/class-visual-editor.php:236 #, php-format msgctxt "%d = HTML heading size number." msgid "Heading %d text style" msgstr "" -#: library/includes/classes/class-visual-editor.php:281 +#: library/includes/classes/class-visual-editor.php:247 msgid "Text sizes" msgstr "" -#: library/includes/classes/class-visual-editor.php:285 -#: library/includes/classes/class-visual-editor.php:291 -#: library/includes/classes/class-visual-editor.php:297 -#: library/includes/classes/class-visual-editor.php:303 +#: library/includes/classes/class-visual-editor.php:251 +#: library/includes/classes/class-visual-editor.php:257 +#: library/includes/classes/class-visual-editor.php:263 +#: library/includes/classes/class-visual-editor.php:269 #, php-format msgctxt "%d: Display text size number." msgid "Display %d" msgstr "" -#: library/includes/classes/class-visual-editor.php:314 +#: library/includes/classes/class-visual-editor.php:280 msgctxt "Visual editor blockquote formats group title." msgid "Quotes" msgstr "" -#: library/includes/classes/class-visual-editor.php:318 +#: library/includes/classes/class-visual-editor.php:284 msgid "Blockquote" msgstr "" -#: library/includes/classes/class-visual-editor.php:324 +#: library/includes/classes/class-visual-editor.php:290 msgid "Pullquote - align left" msgstr "" -#: library/includes/classes/class-visual-editor.php:331 +#: library/includes/classes/class-visual-editor.php:297 msgid "Pullquote - align right" msgstr "" -#: library/includes/classes/class-visual-editor.php:338 +#: library/includes/classes/class-visual-editor.php:304 msgctxt "" "Visual editor format label for HTML CITE tag used to set the blockquote " "source." msgid "Cite" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:346 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:348 msgid "Install Required Plugins" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:347 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:349 msgid "Install Plugins" msgstr "" #. translators: %s: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:349 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:351 #, php-format msgid "Installing Plugin: %s" msgstr "" #. translators: %s: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:351 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:353 #, php-format msgid "Updating Plugin: %s" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:352 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:354 msgid "Something went wrong with the plugin API." msgstr "" #. translators: 1: plugin name(s). -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:355 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:357 #, php-format msgid "This theme requires the following plugin: %1$s." msgid_plural "This theme requires the following plugins: %1$s." @@ -1109,7 +1085,7 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: plugin name(s). -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:361 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:363 #, php-format msgid "This theme recommends the following plugin: %1$s." msgid_plural "This theme recommends the following plugins: %1$s." @@ -1117,7 +1093,7 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: plugin name(s). -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:367 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:369 #, php-format msgid "" "The following plugin needs to be updated to its latest version to ensure " @@ -1129,7 +1105,7 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: plugin name(s). -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:373 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:375 #, php-format msgid "There is an update available for: %1$s." msgid_plural "There are updates available for the following plugins: %1$s." @@ -1137,7 +1113,7 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: plugin name(s). -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:379 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:381 #, php-format msgid "The following required plugin is currently inactive: %1$s." msgid_plural "The following required plugins are currently inactive: %1$s." @@ -1145,62 +1121,62 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: plugin name(s). -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:385 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:387 #, php-format msgid "The following recommended plugin is currently inactive: %1$s." msgid_plural "The following recommended plugins are currently inactive: %1$s." msgstr[0] "" msgstr[1] "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:390 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:392 msgid "Begin installing plugin" msgid_plural "Begin installing plugins" msgstr[0] "" msgstr[1] "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:395 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:397 msgid "Begin updating plugin" msgid_plural "Begin updating plugins" msgstr[0] "" msgstr[1] "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:400 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:402 msgid "Begin activating plugin" msgid_plural "Begin activating plugins" msgstr[0] "" msgstr[1] "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:404 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:406 msgid "Return to Required Plugins Installer" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:405 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:846 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2552 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3599 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:407 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:848 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2554 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3601 msgid "Return to the Dashboard" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:406 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3178 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:408 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3180 msgid "Plugin activated successfully." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:407 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2971 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:409 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2973 msgid "The following plugin was activated successfully:" msgid_plural "The following plugins were activated successfully:" msgstr[0] "" msgstr[1] "" #. translators: 1: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:409 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:411 #, php-format msgid "No action taken. Plugin %1$s was already active." msgstr "" #. translators: 1: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:411 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:413 #, php-format msgid "" "Plugin not activated. A higher version of %s is needed for this theme. " @@ -1208,117 +1184,117 @@ msgid "" msgstr "" #. translators: 1: dashboard link. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:413 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:415 #, php-format msgid "All plugins installed and activated successfully. %1$s" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:414 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:416 msgid "Dismiss this notice" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:415 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:417 msgid "" "There are one or more required or recommended plugins to install, update or " "activate." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:416 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:418 msgid "Please contact the administrator of this site for help." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:541 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:543 msgid "This plugin needs to be updated to be compatible with your theme." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:542 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:544 msgid "Update Required" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:953 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:955 msgid "" "The remote plugin package does not contain a folder with the desired slug " "and renaming did not work." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:953 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:956 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:955 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:958 msgid "" "Please contact the plugin provider and ask them to package their plugin " "according to the WordPress guidelines." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:956 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:958 msgid "" "The remote plugin package consists of more than one file, but the files are " "not packaged in a folder." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:1140 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2967 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:1142 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2969 msgctxt "plugin A *and* plugin B" msgid "and" msgstr "" #. translators: %s: version number -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2001 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2003 #, php-format msgid "TGMPA v%s" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2292 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2294 msgid "Required" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2295 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2297 msgid "Recommended" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2311 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2313 msgid "WordPress Repository" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2314 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2316 msgid "External Source" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2317 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2319 msgid "Pre-Packaged" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2334 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2336 msgid "Not Installed" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2338 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2340 msgid "Installed But Not Activated" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2340 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2342 msgid "Active" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2346 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2348 msgid "Required Update not Available" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2349 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2351 msgid "Requires Update" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2352 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2354 msgid "Update recommended" msgstr "" #. translators: 1: install status, 2: update status -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2361 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2363 #, php-format msgctxt "Install/Update Status" msgid "%1$s, %2$s" msgstr "" #. translators: 1: number of plugins. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2407 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2409 #, php-format msgctxt "plugins" msgid "All (%s)" @@ -1327,7 +1303,7 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: number of plugins. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2411 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2413 #, php-format msgid "To Install (%s)" msgid_plural "To Install (%s)" @@ -1335,7 +1311,7 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: number of plugins. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2415 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2417 #, php-format msgid "Update Available (%s)" msgid_plural "Update Available (%s)" @@ -1343,202 +1319,202 @@ msgstr[0] "" msgstr[1] "" #. translators: 1: number of plugins. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2419 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2421 #, php-format msgid "To Activate (%s)" msgid_plural "To Activate (%s)" msgstr[0] "" msgstr[1] "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2501 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2503 msgctxt "as in: \"version nr unknown\"" msgid "unknown" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2509 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2511 msgid "Installed version:" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2517 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2519 msgid "Minimum required version:" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2529 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2531 msgid "Available version:" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2552 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2554 msgid "No plugins to install, update or activate." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2566 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2568 msgid "Plugin" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2567 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2569 msgid "Source" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2568 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2570 msgid "Type" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2572 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2574 msgid "Version" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2573 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2575 msgid "Status" msgstr "" #. translators: %2$s: plugin name in screen reader markup -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2622 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2624 #, php-format msgid "Install %2$s" msgstr "" #. translators: %2$s: plugin name in screen reader markup -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2627 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2629 #, php-format msgid "Update %2$s" msgstr "" #. translators: %2$s: plugin name in screen reader markup -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2633 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2635 #, php-format msgid "Activate %2$s" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2703 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2705 msgid "Upgrade message from the plugin author:" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2736 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2738 msgid "Install" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2742 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2744 msgid "Update" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2745 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2747 msgid "Activate" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2776 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2778 msgid "No plugins were selected to be installed. No action taken." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2778 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2780 msgid "No plugins were selected to be updated. No action taken." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2819 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2821 msgid "No plugins are available to be installed at this time." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2821 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2823 msgid "No plugins are available to be updated at this time." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2927 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2929 msgid "No plugins were selected to be activated. No action taken." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2953 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:2955 msgid "No plugins are available to be activated at this time." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3177 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3179 msgid "Plugin activation failed." msgstr "" #. translators: 1: plugin name, 2: action number 3: total number of actions. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3517 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3519 #, php-format msgid "Updating Plugin %1$s (%2$d/%3$d)" msgstr "" #. translators: 1: plugin name, 2: error message. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3520 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3522 #, php-format msgid "An error occurred while installing %1$s: %2$s." msgstr "" #. translators: 1: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3522 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3524 #, php-format msgid "The installation of %1$s failed." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3526 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3528 msgid "" "The installation and activation process is starting. This process may take a " "while on some hosts, so please be patient." msgstr "" #. translators: 1: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3528 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3530 #, php-format msgid "%1$s installed and activated successfully." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3528 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3536 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3530 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3538 msgid "Show Details" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3528 -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3536 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3530 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3538 msgid "Hide Details" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3529 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3531 msgid "All installations and activations have been completed." msgstr "" #. translators: 1: plugin name, 2: action number 3: total number of actions. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3531 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3533 #, php-format msgid "Installing and Activating Plugin %1$s (%2$d/%3$d)" msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3534 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3536 msgid "" "The installation process is starting. This process may take a while on some " "hosts, so please be patient." msgstr "" #. translators: 1: plugin name. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3536 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3538 #, php-format msgid "%1$s installed successfully." msgstr "" -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3537 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3539 msgid "All installations have been completed." msgstr "" #. translators: 1: plugin name, 2: action number 3: total number of actions. -#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3539 +#: library/includes/vendor/tgmpa/class-tgm-plugin-activation.php:3541 #, php-format msgid "Installing Plugin %1$s (%2$d/%3$d)" msgstr "" -#: library/includes/vendor/use-child-theme/class-use-child-theme.php:135 +#: library/includes/vendor/use-child-theme/class-use-child-theme.php:150 #, php-format msgid "Please use a %s child theme to make changes!" msgstr "" -#: library/includes/vendor/use-child-theme/class-use-child-theme.php:136 +#: library/includes/vendor/use-child-theme/class-use-child-theme.php:151 msgid "Create and activate now »" msgstr "" -#: library/includes/vendor/use-child-theme/class-use-child-theme.php:193 +#: library/includes/vendor/use-child-theme/class-use-child-theme.php:217 msgid "All done! You are using a child theme now! Please refresh the page." msgstr "" -#: library/includes/vendor/use-child-theme/class-use-child-theme.php:216 +#: library/includes/vendor/use-child-theme/class-use-child-theme.php:247 msgid "Error: theme folder not writable!" msgstr "" diff --git a/library/changelog.md b/library/changelog.md index 5fdeaa0..c8a719b 100644 --- a/library/changelog.md +++ b/library/changelog.md @@ -1,5 +1,69 @@ # WebMan WordPress Theme Framework Changelog +## 2.7.0 + +* **Add**: Theme options/mods wrapper with automatic default value fallback +* **Add**: Support for customizer options `validation_callback` +* **Update**: Improving customizer options setup +* **Update**: Using `error_log` where appropriate +* **Update**: Improving security +* **Update**: Using `PHP_EOL` +* **Update**: Improving and fixing `$pre` filters +* **Update**: Removing `get_theme_file_uri()` shim function (WP4.7+) +* **Update**: Removing custom TinyMCE editor page template class (WP4.7+) +* **Update**: Adding variable type where applicable +* **Update**: Removing obsolete WordPress min version requirement in favor of 2 major versions backwards compatibility +* **Update**: Simplifying assets versioning +* **Update**: Improving customizer options functionality +* **Update**: Improving PHP DocBlock and adding @subpackages info +* **Update**: Improving custom styles output functionality +* **Update**: Removing obsolete functionality +* **Update**: Improving code formatting +* **Update**: WebMan Design Use Child Theme 1.3.0 + +### Files changed: + + changelog.md + init.php + includes/classes/class-admin.php + includes/classes/class-core.php + includes/classes/class-customize-control-hidden.php + includes/classes/class-customize-control-html.php + includes/classes/class-customize-control-multiselect.php + includes/classes/class-customize-control-radio-matrix.php + includes/classes/class-customize-control-select.php + includes/classes/class-customize-styles.php + includes/classes/class-customize.php + includes/classes/class-sanitize.php + includes/classes/class-visual-editor.php + includes/vendor/tgmpa/class-tgm-plugin-activation.php + includes/vendor/use-child-theme/class-use-child-theme.php + js/customize-control-multicheckbox.js + js/customize-control-radio-matrix.js + js/customize-controls.js + scss/customize.scss + scss/welcome.scss + scss/styles/_customize.scss + scss/styles/_welcome.scss + + +## 2.6.1 + +* **Update**: Removing obsolete code comments +* **Fix**: Stylesheet generator functionality + +### Files changed: + + changelog.md + init.php + includes/classes/class-core.php + includes/classes/class-customize-control-radio-matrix.php + includes/classes/class-customize-control-select.php + includes/classes/class-customize-styles.php + includes/classes/class-customize.php + includes/classes/class-sanitize.php + + ## 2.6.0 * **Add**: Customizer range control hover color diff --git a/library/includes/classes/class-admin.php b/library/includes/classes/class-admin.php index fccdd8f..2ae0e41 100644 --- a/library/includes/classes/class-admin.php +++ b/library/includes/classes/class-admin.php @@ -2,11 +2,13 @@ /** * Admin class * - * @package WebMan WordPress Theme Framework * @subpackage Admin * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.0.2 + * @version 2.7.0 * * Contents: * @@ -46,10 +48,6 @@ private function __construct() { add_action( 'admin_enqueue_scripts', __CLASS__ . '::assets', 998 ); - // Admin notices - - add_action( 'admin_notices', __CLASS__ . '::message', 998 ); - } // /__construct @@ -87,7 +85,7 @@ public static function init() { * Admin assets * * @since 1.0.0 - * @version 2.0.2 + * @version 2.7.0 */ public static function assets() { @@ -97,14 +95,14 @@ public static function assets() { // Styles - $register_styles = apply_filters( 'wmhook_modern_library_admin_assets_register_styles', array( - 'modern-welcome' => array( get_theme_file_uri( MODERN_LIBRARY_DIR . 'css/welcome.css' ) ), - ) ); + $register_styles = array_filter( (array) apply_filters( 'wmhook_modern_library_admin_assets_register_styles', array( + 'modern-welcome' => array( get_theme_file_uri( MODERN_LIBRARY_DIR . 'css/welcome.css' ) ), + ) ) ); foreach ( $register_styles as $handle => $atts ) { - $src = ( isset( $atts['src'] ) ) ? ( $atts['src'] ) : ( $atts[0] ); - $deps = ( isset( $atts['deps'] ) ) ? ( $atts['deps'] ) : ( false ); - $ver = ( isset( $atts['ver'] ) ) ? ( $atts['ver'] ) : ( esc_attr( MODERN_THEME_VERSION ) ); + $src = ( isset( $atts['src'] ) ) ? ( $atts['src'] ) : ( $atts[0] ); + $deps = ( isset( $atts['deps'] ) ) ? ( $atts['deps'] ) : ( false ); + $ver = ( isset( $atts['ver'] ) ) ? ( $atts['ver'] ) : ( MODERN_THEME_VERSION ); $media = ( isset( $atts['media'] ) ) ? ( $atts['media'] ) : ( 'screen' ); wp_register_style( $handle, $src, $deps, $ver, $media ); @@ -120,109 +118,6 @@ public static function assets() { - /** - * 20) Messages - */ - - /** - * WordPress admin notification messages - * - * Displays the message stored in `modern_admin_notice` transient cache - * once or multiple times, than deletes the message cache. - * - * Transient structure: - * - * @example - * - * set_transient( - * 'modern_admin_notice', - * array( - * $text, - * $class, - * $capability, - * $number_of_displays - * ) - * ); - * - * @since 1.0.0 - * @version 2.0.0 - */ - public static function message() { - - // Pre - - $pre = apply_filters( 'wmhook_modern_library_admin_message_pre', false ); - - if ( false !== $pre ) { - echo $pre; - return; - } - - - // Requirements check - - if ( ! is_admin() ) { - return; - } - - - // Helper variables - - $output = ''; - - $class = 'updated'; - $repeat = 0; - $capability = apply_filters( 'wmhook_modern_library_admin_message_capability', 'edit_theme_options' ); - $message = get_transient( 'modern_admin_notice' ); - - - // Requirements check - - if ( empty( $message ) ) { - return; - } - - - // Processing - - if ( ! is_array( $message ) ) { - $message = array( $message, $class, $capability, $repeat ); - } - if ( ! isset( $message[1] ) || empty( $message[1] ) ) { - $message[1] = $class; - } - if ( ! isset( $message[2] ) || empty( $message[2] ) ) { - $message[2] = $capability; - } - if ( ! isset( $message[3] ) ) { - $message[3] = $repeat; - } - - if ( $message[0] && current_user_can( $message[2] ) ) { - $output .= '

' . $message[0] . '

'; - delete_transient( 'modern_admin_notice' ); - } - - // Delete the transient cache after specific number of displays - - if ( 1 < intval( $message[3] ) ) { - $message[3] = intval( $message[3] ) - 1; - set_transient( 'modern_admin_notice', $message, ( 60 * 60 * 48 ) ); - } - - - // Output - - if ( $output ) { - echo $output; - } - - } // /message - - - - - } // /Modern_Library_Admin add_action( 'admin_init', 'Modern_Library_Admin::init' ); diff --git a/library/includes/classes/class-core.php b/library/includes/classes/class-core.php index 0b20d7f..4e11904 100644 --- a/library/includes/classes/class-core.php +++ b/library/includes/classes/class-core.php @@ -2,18 +2,19 @@ /** * Core class * - * @package WebMan WordPress Theme Framework * @subpackage Core * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * Contents: * * 0) Init * 10) Theme upgrade action * 20) Post/page - * 30) Path functions * 100) Helpers */ final class Modern_Library { @@ -34,7 +35,7 @@ final class Modern_Library { * Constructor * * @since 1.0.0 - * @version 2.4.2 + * @version 2.7.0 */ private function __construct() { @@ -44,29 +45,16 @@ private function __construct() { // Actions - // Theme upgrade action - - add_action( 'init', __CLASS__ . '::theme_upgrade' ); - - // Flushing transients - - add_action( 'edit_category', __CLASS__ . '::all_categories_transient_flusher' ); - - add_action( 'save_post', __CLASS__ . '::all_categories_transient_flusher' ); + add_action( 'init', __CLASS__ . '::theme_upgrade' ); - // Contextual help - - add_action( 'contextual_help', __CLASS__ . '::contextual_help', 10, 3 ); + add_action( 'edit_category', __CLASS__ . '::all_categories_transient_flusher' ); + add_action( 'save_post', __CLASS__ . '::all_categories_transient_flusher' ); // Filters - // Widgets improvements - - add_filter( 'show_recent_comments_widget_style', '__return_false' ); + add_filter( 'show_recent_comments_widget_style', '__return_false' ); - // Table of contents - - add_filter( 'the_content', __CLASS__ . '::add_table_of_contents' ); + add_filter( 'the_content', __CLASS__ . '::add_table_of_contents' ); } // /__construct @@ -146,21 +134,12 @@ public static function theme_upgrade() { * Appends the output at the top and bottom of post content. * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * @param string $content */ public static function add_table_of_contents( $content = '' ) { - // Pre - - $pre = apply_filters( 'wmhook_modern_library_add_table_of_contents_pre', false, $content ); - - if ( false !== $pre ) { - return $pre; - } - - // Helper variables global $page, $numpages, $multipage, $post; @@ -174,15 +153,17 @@ public static function add_table_of_contents( $content = '' ) { return $content; } - $title_text = apply_filters( 'wmhook_modern_library_add_table_of_contents_title_text', sprintf( esc_html_x( '"%s" table of contents', '%s: post title.', 'modern' ), the_title_attribute( 'echo=0' ) ) ); - $title = apply_filters( 'wmhook_modern_library_add_table_of_contents_title', '

' . $title_text . '

' ); + $title_text = (string) apply_filters( 'wmhook_modern_library_add_table_of_contents_title_text', sprintf( + esc_html_x( '"%s" table of contents', '%s: post title.', 'modern' ), + the_title_attribute( 'echo=0' ) + ) ); - $args = apply_filters( 'wmhook_modern_library_add_table_of_contents_args', array( - 'disable_first' => true, // First part to have a title of the post (part title won't be parsed)? - 'links' => array(), // The output HTML links - 'post_content' => ( isset( $post->post_content ) ) ? ( $post->post_content ) : ( '' ), // Get the whole post content - 'tag' => 'h2', // HTML heading tag to parse as a post part title - ) ); + $args = (array) apply_filters( 'wmhook_modern_library_add_table_of_contents_args', array( + 'disable_first' => true, // First part to have a title of the post (part title won't be parsed)? + 'links' => array(), // The output HTML links + 'post_content' => ( isset( $post->post_content ) ) ? ( $post->post_content ) : ( '' ), // Get the whole post content + 'tag' => 'h2', // HTML heading tag to parse as a post part title + ) ); // Post part counter @@ -233,21 +214,20 @@ public static function add_table_of_contents( $content = '' ) { $args['links'][$i] = (string) apply_filters( 'wmhook_modern_library_add_table_of_contents_part', '' . _wp_link_page( $i ) . $part_title . '', $i, $part_title, $class, $args ); - } // /foreach + } // Add table of contents into the post/page content $args['links'] = implode( '', $args['links'] ); - $links = apply_filters( 'wmhook_modern_library_add_table_of_contents_links', array( - // Display table of contents before the post content only in first post part - 'before' => ( 1 === $page ) ? ( '
' . $title . '
    ' . $args['links'] . '
' ) : ( '' ), - // Display table of cotnnets after the post cotnent on each post part - 'after' => '
' . $title . '
    ' . $args['links'] . '
', - ), $args ); + $links = (array) apply_filters( 'wmhook_modern_library_add_table_of_contents_links', array( + 'before' => ( 1 === $page ) ? ( '' ) : ( '' ), + 'after' => '', + ), $args ); $content = $links['before'] . $content . $links['after']; + // Output return $content; @@ -259,6 +239,8 @@ public static function add_table_of_contents( $content = '' ) { /** * Get the paginated heading suffix * + * @subpackage Pagination + * * @since 1.0.0 * @version 2.6.0 * @@ -319,11 +301,13 @@ public static function get_the_paginated_suffix( $tag = '', $singular_only = fal /** * Display the paginated heading suffix * + * @subpackage Pagination + * * @since 1.0.0 * @version 1.0.0 * - * @param string $tag Wrapper tag - * @param string $singular_only Display only on singular posts of specific type + * @param string $tag Wrapper tag. + * @param string $singular_only Display only on singular posts of specific type. */ public static function the_paginated_suffix( $tag = '', $singular_only = false ) { @@ -346,7 +330,7 @@ public static function the_paginated_suffix( $tag = '', $singular_only = false ) * Checks for tag in post content * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * @param mixed $post */ @@ -354,9 +338,9 @@ public static function has_more_tag( $post = null ) { // Pre - $pre = apply_filters( 'wmhook_modern_library_has_more_tag_pre', false, $post ); + $pre = apply_filters( 'wmhook_modern_library_has_more_tag_pre', null, $post ); - if ( false !== $pre ) { + if ( null !== $pre ) { return $pre; } @@ -372,17 +356,14 @@ public static function has_more_tag( $post = null ) { // Requirements check - if ( - ! is_object( $post ) - || ! isset( $post->post_content ) - ) { + if ( ! isset( $post->post_content ) ) { return; } // Output - return strpos( $post->post_content, '' ); + return (bool) strpos( $post->post_content, '' ); } // /has_more_tag @@ -390,55 +371,6 @@ public static function has_more_tag( $post = null ) { - /** - * 30) Path functions - */ - - /** - * Outputs URL to the specific file - * - * This function looks for the file in the child theme first. - * If the file is not located in child theme, output the URL from parent theme. - * - * Matching the WordPress 4.7+ native `get_theme_file_uri()` function. - * - * @todo Remove with WordPress 4.9 - * - * @since 1.0.0 - * @version 2.0.2 - * - * @param string $file Optional. File to search for in the stylesheet directory. - * - * @return string Actual URL to the file - */ - public static function get_theme_file_uri( $file = '' ) { - - // Helper variables - - $file = ltrim( $file, '/' ); - - - // Processing - - if ( empty( $file ) ) { - $url = get_stylesheet_directory_uri(); - } elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { - $url = get_stylesheet_directory_uri() . '/' . $file; - } else { - $url = get_template_directory_uri() . '/' . $file; - } - - - // Output - - return apply_filters( 'theme_file_uri', $url, $file ); - - } // /get_theme_file_uri - - - - - /** * 100) Helpers */ @@ -477,21 +409,12 @@ static public function fix_ssl_urls( $content ) { * unlike WordPress native strip_shortcodes() function. * * @since 1.0.0 - * @version 2.0.0 + * @version 2.7.0 * * @param string $content */ public static function remove_shortcodes( $content ) { - // Pre - - $pre = apply_filters( 'wmhook_modern_library_remove_shortcodes_pre', false, $content ); - - if ( false !== $pre ) { - return $pre; - } - - // Output return preg_replace( '|\[(.+?)\]|s', '', $content ); @@ -536,96 +459,19 @@ public static function link_skip_to( $id = 'content', $text = '', $class = '' ) - /** - * Contextual help text - * - * Hook onto `wmhook_modern_library_contextual_help_texts_array` to add help texts. - * - * @example - * - * $texts_array = array( - * $screen_id => array( - * array( - * 'tab-id' => 'TAB_ID_1', - * 'tab-title' => 'TAB_TITLE_1', - * 'tab-content' => 'TAB_CONTENT_1', - * ), - * array( - * 'tab-id' => 'TAB_ID_2', - * 'tab-title' => 'TAB_TITLE_2', - * 'tab-content' => 'TAB_CONTENT_2', - * ) - * ) - * ); - * - * @since 1.0.0 - * @version 2.6.0 - * - * @param string $contextual_help Help text that appears on the screen. - * @param string $screen_id Screen ID. - * @param WP_Screen $screen Current WP_Screen instance. - */ - public static function contextual_help( $contextual_help, $screen_id, $screen ) { - - // Pre - - $pre = apply_filters( 'wmhook_modern_library_contextual_help_pre', false, $contextual_help, $screen_id, $screen ); - - if ( false !== $pre ) { - return $pre; - } - - - // Helper variables - - $texts_array = array_filter( (array) apply_filters( 'wmhook_modern_library_contextual_help_texts_array', array() ) ); - - - // Requirements check - - if ( empty( $texts_array ) ) { - return; - } - - - // Processing - - if ( - isset( $texts_array[ $screen_id ] ) - && is_array( $texts_array[ $screen_id ] ) - ) { - - $help_tabs = $texts_array[ $screen_id ]; - - foreach ( $help_tabs as $tab ) { - - $screen->add_help_tab( array( - 'id' => $tab['tab-id'], - 'title' => $tab['tab-title'], - 'content' => $tab['tab-content'] - ) ); - - } // /foreach - - } - - } // /contextual_help - - - /** * Returns true if a blog has more than 1 category * * @since 1.0.0 - * @version 2.0.0 + * @version 2.7.0 */ public static function is_categorized_blog() { // Pre - $pre = apply_filters( 'wmhook_modern_library_is_categorized_blog_pre', false ); + $pre = apply_filters( 'wmhook_modern_library_is_categorized_blog_pre', null ); - if ( false !== $pre ) { + if ( null !== $pre ) { return $pre; } @@ -634,17 +480,13 @@ public static function is_categorized_blog() { if ( false === ( $all_cats = get_transient( 'modern_all_categories' ) ) ) { - // Create an array of all the categories that are attached to posts - - $all_cats = get_categories( array( - 'fields' => 'ids', - 'hide_empty' => 1, - 'number' => 2, // We only need to know if there is more than one category - ) ); - - // Count the number of categories that are attached to the posts + $all_cats = get_categories( array( + 'fields' => 'ids', + 'hide_empty' => true, + 'number' => 2, // We only need to know if there is more than one category. + ) ); - $all_cats = count( $all_cats ); + $all_cats = count( $all_cats ); set_transient( 'modern_all_categories', $all_cats ); @@ -654,17 +496,9 @@ public static function is_categorized_blog() { // Output if ( $all_cats > 1 ) { - - // This blog has more than 1 category - - return true; - + return true; } else { - - // This blog has only 1 category - - return false; - + return false; } } // /is_categorized_blog @@ -688,9 +522,7 @@ public static function all_categories_transient_flusher() { // Processing - // Like, beat it. Dig? - - delete_transient( 'modern_all_categories' ); + delete_transient( 'modern_all_categories' ); } // /all_categories_transient_flusher @@ -701,25 +533,3 @@ public static function all_categories_transient_flusher() { } // /Modern_Library add_action( 'after_setup_theme', 'Modern_Library::init', -50 ); - - - - - -/** - * Helper `get_theme_file_uri()` function declaration for WordPress 4.7- - * - * @todo Remove with WordPress 4.9 - * - * @since 2.0.2 - * @version 2.0.2 - */ -if ( ! function_exists( 'get_theme_file_uri' ) ) { - function get_theme_file_uri( $file = '' ) { - - // Output - - return Modern_Library::get_theme_file_uri( $file ); - - } -} // /get_theme_file_uri diff --git a/library/includes/classes/class-customize-control-hidden.php b/library/includes/classes/class-customize-control-hidden.php index 23c102c..e461f65 100644 --- a/library/includes/classes/class-customize-control-hidden.php +++ b/library/includes/classes/class-customize-control-hidden.php @@ -4,11 +4,13 @@ * * Customizer hidden input field. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 1.9.0 + * @version 2.7.0 */ class Modern_Customize_Control_Hidden extends WP_Customize_Control { diff --git a/library/includes/classes/class-customize-control-html.php b/library/includes/classes/class-customize-control-html.php index 87a3ceb..857bd6e 100644 --- a/library/includes/classes/class-customize-control-html.php +++ b/library/includes/classes/class-customize-control-html.php @@ -4,11 +4,13 @@ * * Customizer custom HTML. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 1.9.0 + * @version 2.7.0 */ class Modern_Customize_Control_HTML extends WP_Customize_Control { diff --git a/library/includes/classes/class-customize-control-multiselect.php b/library/includes/classes/class-customize-control-multiselect.php index 70d9175..5ba8a38 100644 --- a/library/includes/classes/class-customize-control-multiselect.php +++ b/library/includes/classes/class-customize-control-multiselect.php @@ -4,11 +4,13 @@ * * Customizer multi select field. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 */ class Modern_Customize_Control_Multiselect extends WP_Customize_Control { @@ -21,12 +23,12 @@ public function enqueue() { if ( 'multicheckbox' === $this->type ) { wp_enqueue_script( - 'modern-customize-control-multicheckbox', - get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/customize-control-multicheckbox.js' ), - array( 'customize-controls' ), - esc_attr( MODERN_THEME_VERSION ), - true - ); + 'modern-customize-control-multicheckbox', + get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/customize-control-multicheckbox.js' ), + array( 'customize-controls' ), + MODERN_THEME_VERSION, + true + ); } @@ -106,7 +108,7 @@ public function render_content_select() { label; ?> description ) : ?>description; ?> - link(); ?>> choices as $value => $label ) : ?> diff --git a/library/includes/classes/class-customize-control-radio-matrix.php b/library/includes/classes/class-customize-control-radio-matrix.php index 1ba0b29..04bc264 100644 --- a/library/includes/classes/class-customize-control-radio-matrix.php +++ b/library/includes/classes/class-customize-control-radio-matrix.php @@ -4,11 +4,13 @@ * * Customizer matrix radio fields. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.1.0 + * @version 2.7.0 */ class Modern_Customize_Control_Radio_Matrix extends WP_Customize_Control { @@ -25,12 +27,12 @@ public function enqueue() { // Scripts wp_enqueue_script( - 'modern-customize-control-radio-matrix', - get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/customize-control-radio-matrix.js' ), - array( 'customize-controls' ), - esc_attr( MODERN_THEME_VERSION ), - true - ); + 'modern-customize-control-radio-matrix', + get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/customize-control-radio-matrix.js' ), + array( 'customize-controls' ), + MODERN_THEME_VERSION, + true + ); } // /enqueue @@ -73,7 +75,7 @@ public function render_content() { diff --git a/library/includes/classes/class-customize-control-select.php b/library/includes/classes/class-customize-control-select.php index 636b502..ddac475 100644 --- a/library/includes/classes/class-customize-control-select.php +++ b/library/includes/classes/class-customize-control-select.php @@ -4,11 +4,13 @@ * * Customizer select field (with optgroups). * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.1.0 + * @version 2.7.0 */ class Modern_Customize_Control_Select extends WP_Customize_Control { @@ -28,7 +30,7 @@ public function render_content() { label; ?> description ) : ?>description; ?> - link(); ?>> choices as $value => $name ) { @@ -41,7 +43,7 @@ public function render_content() { echo ''; } - } // /foreach + } ?> diff --git a/library/includes/classes/class-customize-styles.php b/library/includes/classes/class-customize-styles.php index a69adba..7a9b7a4 100644 --- a/library/includes/classes/class-customize-styles.php +++ b/library/includes/classes/class-customize-styles.php @@ -6,11 +6,14 @@ * @uses `wmhook_modern_custom_styles` global hook * @uses `wmhook_modern_custom_styles_alphas` global hook * - * @package WebMan WordPress Theme Framework * @subpackage Customize + * @subpackage Stylesheet Generator + * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas * * @since 1.8.0 - * @version 2.6.0 + * @version 2.7.0 * * Contents: * @@ -132,8 +135,10 @@ public static function init() { /** * Generate main CSS file * + * @subpackage Customize Options + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * @param string $scope */ @@ -141,10 +146,16 @@ public static function generate_main_css( $scope = '' ) { // Pre - $scope = '-' . trim( (string) apply_filters( 'wmhook_modern_library_generate_main_css_scope', $scope ), ' -' ); - $pre = apply_filters( 'wmhook_modern_library_generate_main_css_pre', ! self::$supports_generator, $scope ); + $scope = trim( (string) apply_filters( 'wmhook_modern_library_generate_main_css_scope', $scope ), ' -' ); - if ( false !== $pre ) { + if ( ! empty( $scope ) ) { + $scope = '-' . $scope; + } + + $pre = ( self::$supports_generator ) ? ( null ) : ( false ); + $pre = apply_filters( 'wmhook_modern_library_generate_main_css_pre', $pre, $scope ); + + if ( null !== $pre ) { return $pre; } @@ -153,8 +164,7 @@ public static function generate_main_css( $scope = '' ) { $output = $output_min = ''; - $filesystem = self::get_filesystem(); - + $filesystem = self::get_filesystem(); $required_file = MODERN_PATH . 'assets/css-generate/generate-css' . $scope . '.php'; @@ -176,7 +186,7 @@ public static function generate_main_css( $scope = '' ) { ob_start(); require_once $required_file; - $output = apply_filters( 'wmhook_modern_library_generate_main_css_output', trim( ob_get_clean() ), $scope ); + $output = (string) apply_filters( 'wmhook_modern_library_generate_main_css_output', trim( ob_get_clean() ), $scope ); // Requirements check @@ -186,7 +196,7 @@ public static function generate_main_css( $scope = '' ) { // Minify output if set - $output_min = apply_filters( 'wmhook_modern_library_generate_main_css_output_min', $output, $scope ); + $output_min = (string) apply_filters( 'wmhook_modern_library_generate_main_css_output_min', $output, $scope ); // Create the theme CSS folder @@ -205,16 +215,11 @@ public static function generate_main_css( $scope = '' ) { * and exit the method returning `false`. */ - set_transient( - 'modern_admin_notice', - array( - '' . esc_html__( "ERROR: Wasn't able to create a theme CSS folder! Contact the theme support.", 'modern' ) . '', - 'notice-error', - 'edit_theme_options', - 2 - ), - ( 60 * 60 * 48 ) - ); + error_log( + __METHOD__ . ': ' + . 'ERROR: ' + . 'Theme "' . get_template() . '" was not able to create "' . $theme_css_dir . '" directory.' + ); remove_theme_mod( '__url_css' . $scope ); remove_theme_mod( '__path_theme_generated_files' . $scope ); @@ -225,12 +230,12 @@ public static function generate_main_css( $scope = '' ) { // Create the theme CSS files - $file_name = apply_filters( 'wmhook_modern_library_generate_main_css_file_name', 'modern-styles' . $scope, $scope ); + $file_name = (string) apply_filters( 'wmhook_modern_library_generate_main_css_file_name', 'modern-styles' . $scope, $scope ); - $global_css_path = apply_filters( 'wmhook_modern_library_generate_main_css_global_css_path', trailingslashit( $theme_css_dir ) . $file_name . '.css', $scope, $file_name, $theme_css_dir ); - $global_css_path_dev = apply_filters( 'wmhook_modern_library_generate_main_css_global_css_path_dev', trailingslashit( $theme_css_dir ) . 'dev-' . $file_name . '.css', $scope, $file_name, $theme_css_dir ); + $global_css_path = (string) apply_filters( 'wmhook_modern_library_generate_main_css_global_css_path', trailingslashit( $theme_css_dir ) . $file_name . '.css', $scope, $file_name, $theme_css_dir ); + $global_css_path_dev = (string) apply_filters( 'wmhook_modern_library_generate_main_css_global_css_path_dev', trailingslashit( $theme_css_dir ) . 'dev-' . $file_name . '.css', $scope, $file_name, $theme_css_dir ); - $global_css_url = apply_filters( 'wmhook_modern_library_generate_main_css_global_css_url', trailingslashit( $theme_css_url ) . $file_name . '.css', $scope, $file_name, $theme_css_url ); + $global_css_url = (string) apply_filters( 'wmhook_modern_library_generate_main_css_global_css_url', trailingslashit( $theme_css_url ) . $file_name . '.css', $scope, $file_name, $theme_css_url ); if ( $output @@ -334,6 +339,8 @@ public static function generate_main_css_all() { /** * Saves stylesheet regeneration timestamp into theme options * + * @subpackage Customize Options + * * @since 2.3.0 * @version 2.3.0 */ @@ -369,8 +376,10 @@ public static function stylesheet_timestamp() { * @uses `wmhook_modern_custom_styles` global hook * @uses `wmhook_modern_custom_styles_alphas` global hook * + * @subpackage Customize Options + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * @param string $css CSS string with variables to replace. * @param string $scope Optional CSS scope (such as 'editor' for generating editor styles). @@ -382,7 +391,7 @@ public static function custom_styles( $css = '', $scope = '' ) { $pre = apply_filters( 'wmhook_modern_library_custom_styles_pre', false, $css, $scope ); if ( false !== $pre ) { - return $pre; + return ( is_string( $pre ) ) ? ( $pre ) : ( $css ); } @@ -457,31 +466,9 @@ public static function custom_styles( $css = '', $scope = '' ) { continue; } - // If we have an ID, get the default value if set - - if ( isset( $option['default'] ) && 'image' !== $option['type'] ) { - $value = $option['default']; - } + // Get modified option value or fall back to default - // Get the option value saved in database and apply it when exists - - $mod = get_theme_mod( $option_id ); - - /** - * As this is producing CSS output, we allow checking - * for an empty or zero value with checkbox and range controls. - * Checkbox can be used in conditional comments in CSS for example (see below). - * Also image control can have a value of `false` in which case the - * option default value is used. If the image control is of empty string - * the `none` is set as value. - */ - if ( - $mod - || is_numeric( $mod ) - || in_array( $option['type'], array( 'checkbox', 'image' ) ) - ) { - $value = $mod; - } + $value = Modern_Library_Customize::get_theme_mod( $option_id, $option ); // Make sure the color value contains '#' @@ -504,8 +491,6 @@ public static function custom_styles( $css = '', $scope = '' ) { if ( ! empty( $value ) ) { $value = "url('" . esc_url( $value ) . "')"; - } elseif ( false === $value ) { - $value = "url('" . esc_url( $option['default'] ) . "')"; } else { $value = 'none'; } @@ -515,34 +500,27 @@ public static function custom_styles( $css = '', $scope = '' ) { // CSS output if ( isset( $option['css_output'] ) ) { - switch ( $option['css_output'] ) { + case 'comma_list': case 'comma_list_quoted': - - if ( is_array( $value ) ) { - - if ( 'comma_list_quoted' == $option['css_output'] ) { - $value = "'" . implode( "', '", $value ) . "'"; - } else { - $value = implode( ', ', $value ); - } - + if ( is_array( $value ) ) { + if ( 'comma_list_quoted' == $option['css_output'] ) { + $value = "'" . implode( "', '", $value ) . "'"; + } else { + $value = implode( ', ', $value ); } - - $value .= ','; - + } + $value .= ','; break; default: - - if ( is_callable( $option['css_output'] ) ) { - $value = call_user_func( $option['css_output'], $value, $option ); - } - + if ( is_callable( $option['css_output'] ) ) { + $value = call_user_func( $option['css_output'], $value, $option ); + } break; - } // /switch + } } // Value filtering @@ -566,7 +544,7 @@ public static function custom_styles( $css = '', $scope = '' ) { if ( 'color' === $option['type'] && ! empty( $rgba_alphas ) ) { foreach ( $rgba_alphas as $alpha ) { $replacements[ '[[' . $css_option_id . '(' . absint( $alpha ) . ')]]' ] = self::color_hex_to_rgba( $value, absint( $alpha ) ); - } // /foreach + } } // Option related conditional CSS comment @@ -587,7 +565,7 @@ public static function custom_styles( $css = '', $scope = '' ) { } - } // /foreach + } // Add WordPress Custom Background and Header support @@ -599,7 +577,7 @@ public static function custom_styles( $css = '', $scope = '' ) { if ( ! empty( $rgba_alphas ) ) { foreach ( $rgba_alphas as $alpha ) { $replacements[ '[[background_color(' . absint( $alpha ) . ')]]' ] = self::color_hex_to_rgba( $value, absint( $alpha ) ); - } // /foreach + } } } @@ -619,7 +597,7 @@ public static function custom_styles( $css = '', $scope = '' ) { if ( ! empty( $rgba_alphas ) ) { foreach ( $rgba_alphas as $alpha ) { $replacements[ '[[header_textcolor(' . absint( $alpha ) . ')]]' ] = self::color_hex_to_rgba( $value, absint( $alpha ) ); - } // /foreach + } } } @@ -655,8 +633,8 @@ public static function custom_styles( $css = '', $scope = '' ) { $cache = (array) get_transient( self::$cache_key ); - $cache['debug'][ $scope ] = apply_filters( 'wmhook_modern_library_custom_styles_output_cache_debug', $output, $scope ); - $cache[ $scope ] = apply_filters( 'wmhook_modern_library_custom_styles_output_cache', $output, $scope ); + $cache['debug'][ $scope ] = (string) apply_filters( 'wmhook_modern_library_custom_styles_output_cache_debug', $output, $scope ); + $cache[ $scope ] = (string) apply_filters( 'wmhook_modern_library_custom_styles_output_cache', $output, $scope ); $cache['__replacements'] = (array) $replacements; set_transient( self::$cache_key, $cache ); @@ -715,7 +693,7 @@ public static function custom_styles_cache_flush() { * @see http://wordpress.findincity.net/view/63538464303732726692954/using-wpfilesystem-in-plugins-to-store-customizer-settings * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 */ public static function get_filesystem() { @@ -746,17 +724,13 @@ public static function get_filesystem() { && ! defined( 'FTP_USER' ) ) { - // If we don't have filesystem access, display an admin notice - - set_transient( - 'modern_admin_notice', - array( - esc_html__( 'The theme writes a files to your server. You do not appear to have your FTP credentials set up in "wp-config.php" file.', 'modern' ) . ' ' . esc_html__( 'Please set your FTP credentials first.', 'modern' ) . '', - 'notice-error', - 'edit_theme_options' - ), - ( 60 * 60 * 24 ) - ); + error_log( + __METHOD__ . ': ' + . 'ERROR: ' + . 'Theme "' . get_template() . '" could not get access to your server to write files to WordPress uploads directory.' + . ' ' + . 'Please try to set up FTP credentials in your "wp-confix.php" file (https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants) to fix the issue.' + ); return false; @@ -788,7 +762,7 @@ public static function get_filesystem() { * CSS minifier * * @since 1.0.0 - * @version 2.0.0 + * @version 2.7.0 * * @param string $css Code to minimize */ @@ -799,7 +773,7 @@ public static function minify_css( $css ) { $pre = apply_filters( 'wmhook_modern_library_minify_css_pre', false, $css ); if ( false !== $pre ) { - return $pre; + return ( is_string( $pre ) ) ? ( $pre ) : ( $css ); } @@ -818,7 +792,7 @@ public static function minify_css( $css ) { // Remove tabs, spaces, line breaks, etc. - $css = str_replace( array( "\r\n", "\r", "\n", "\t" ), '', $css ); + $css = str_replace( array( PHP_EOL, "\t" ), '', $css ); $css = str_replace( array( ' ', ' ', ' ', ' ' ), ' ', $css ); $css = str_replace( array( ' { ', ': ', '; }' ), array( '{', ':', '}' ), $css ); diff --git a/library/includes/classes/class-customize.php b/library/includes/classes/class-customize.php index 9805e4e..feab315 100644 --- a/library/includes/classes/class-customize.php +++ b/library/includes/classes/class-customize.php @@ -4,17 +4,20 @@ * * @uses `wmhook_modern_theme_options` global hook * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * Contents: * * 0) Init * 10) Assets * 20) Customizer core + * 30) Getters */ final class Modern_Library_Customize { @@ -28,6 +31,10 @@ final class Modern_Library_Customize { private static $instance; + public static $mods = false; + + public static $theme_options_setup = false; + /** @@ -89,7 +96,7 @@ public static function init() { * Customizer controls assets * * @since 1.0.0 - * @version 2.2.6 + * @version 2.7.0 */ public static function assets() { @@ -98,12 +105,12 @@ public static function assets() { // Styles wp_enqueue_style( - 'modern-customize-controls', - get_theme_file_uri( MODERN_LIBRARY_DIR . 'css/customize.css' ), - false, - esc_attr( MODERN_THEME_VERSION ), - 'screen' - ); + 'modern-customize-controls', + get_theme_file_uri( MODERN_LIBRARY_DIR . 'css/customize.css' ), + false, + MODERN_THEME_VERSION, + 'screen' + ); // RTL setup @@ -112,12 +119,12 @@ public static function assets() { // Scripts wp_enqueue_script( - 'modern-customize-controls', - get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/customize-controls.js' ), - array( 'customize-controls' ), - esc_attr( MODERN_THEME_VERSION ), - true - ); + 'modern-customize-controls', + get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/customize-controls.js' ), + array( 'customize-controls' ), + MODERN_THEME_VERSION, + true + ); } // /assets @@ -152,34 +159,34 @@ public static function assets() { * * 'css' => array( * - * // Sets the whole value to the `css-property-name` of the `selector` + * // Sets the whole value to the `css-property-name` of the `selector` * - * 'selector' => array( - * 'background-color',... - * ), + * 'selector' => array( + * 'background-color',... + * ), * - * // Sets the `css-property-name` of the `selector` with specific settings + * // Sets the `css-property-name` of the `selector` with specific settings * - * 'selector' => array( - * array( - * 'property' => 'text-shadow', - * 'prefix' => '0 1px 1px rgba(', - * 'suffix' => ', .5)', - * 'process_callback' => 'hexToRgb', - * 'custom' => '0 0 0 1em [[value]] ), 0 0 0 2em transparent, 0 0 0 3em [[value]]', - * ),... - * ), + * 'selector' => array( + * array( + * 'property' => 'text-shadow', + * 'prefix' => '0 1px 1px rgba(', + * 'suffix' => ', .5)', + * 'process_callback' => 'hexToRgb', + * 'custom' => '0 0 0 1em [[value]] ), 0 0 0 2em transparent, 0 0 0 3em [[value]]', + * ),... + * ), * - * // Replaces "@" in `selector` for `selector-replace-value` (such as "@ h2, @ h3" to ".footer h2, .footer h3") + * // Replaces "@" in `selector` for `selector-replace-value` (such as "@ h2, @ h3" to ".footer h2, .footer h3") * - * 'selector' => array( - * 'selector_replace' => 'selector-replace-value', - * 'selector_before' => '@media only screen and (min-width: 80em) {', - * 'selector_after' => '}', - * 'background-color',... - * ), + * 'selector' => array( + * 'selector_replace' => 'selector-replace-value', + * 'selector_before' => '@media only screen and (min-width: 80em) {', + * 'selector_after' => '}', + * 'background-color',... + * ), * - * ), + * ), * * // And/or setting custom JavaScript: * @@ -189,8 +196,10 @@ public static function assets() { * * @uses `wmhook_modern_theme_options` global hook * + * @subpackage Customize Options + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 */ public static function preview_scripts() { @@ -199,13 +208,13 @@ public static function preview_scripts() { $pre = apply_filters( 'wmhook_modern_library_customize_preview_scripts_pre', false ); if ( false !== $pre ) { - return $pre; + return (string) $pre; } // Helper variables - $theme_options = apply_filters( 'wmhook_modern_theme_options', array() ); + $theme_options = (array) apply_filters( 'wmhook_modern_theme_options', array() ); ksort( $theme_options ); @@ -215,25 +224,22 @@ public static function preview_scripts() { // Processing if ( is_array( $theme_options ) && ! empty( $theme_options ) ) { - foreach ( $theme_options as $theme_option ) { - if ( isset( $theme_option['preview_js'] ) && is_array( $theme_option['preview_js'] ) ) { - $output_single = "wp.customize(" . "\r\n"; - $output_single .= "\t" . "'" . $theme_option['id'] . "'," . "\r\n"; - $output_single .= "\t" . "function( value ) {" . "\r\n"; - $output_single .= "\t\t" . 'value.bind( function( to ) {' . "\r\n"; + $output_single = "wp.customize(" . PHP_EOL; + $output_single .= "\t" . "'" . $theme_option['id'] . "'," . PHP_EOL; + $output_single .= "\t" . "function( value ) {" . PHP_EOL; + $output_single .= "\t\t" . 'value.bind( function( to ) {' . PHP_EOL; // CSS if ( isset( $theme_option['preview_js']['css'] ) ) { - $output_single .= "\t\t\t" . "var newCss = '';" . "\r\n\r\n"; - $output_single .= "\t\t\t" . "if ( jQuery( '#jscss-" . $theme_option['id'] . "' ).length ) { jQuery( '#jscss-" . $theme_option['id'] . "' ).remove() }" . "\r\n\r\n"; + $output_single .= "\t\t\t" . "var newCss = '';" . PHP_EOL.PHP_EOL; + $output_single .= "\t\t\t" . "if ( jQuery( '#jscss-" . $theme_option['id'] . "' ).length ) { jQuery( '#jscss-" . $theme_option['id'] . "' ).remove() }" . PHP_EOL.PHP_EOL; foreach ( $theme_option['preview_js']['css'] as $selector => $properties ) { - if ( is_array( $properties ) ) { $output_single_css = $selector_before = $selector_after = ''; @@ -272,12 +278,12 @@ public static function preview_scripts() { } $property = wp_parse_args( (array) $property, array( - 'custom' => '', - 'prefix' => '', - 'process_callback' => '', - 'property' => '', - 'suffix' => '', - ) ); + 'custom' => '', + 'prefix' => '', + 'process_callback' => '', + 'property' => '', + 'suffix' => '', + ) ); $value = ( empty( $property['process_callback'] ) ) ? ( 'to' ) : ( trim( $property['process_callback'] ) . '( to )' ); @@ -287,42 +293,39 @@ public static function preview_scripts() { $output_single_css .= $property['property'] . ": " . str_replace( '[[value]]', "' + " . $value . " + '", $property['custom'] ) . "; "; } - } // /foreach + } - $output_single .= "\t\t\t" . "newCss += '" . $selector_before . $selector . " { " . $output_single_css . "}" . $selector_after . " ';" . "\r\n"; + $output_single .= "\t\t\t" . "newCss += '" . $selector_before . $selector . " { " . $output_single_css . "}" . $selector_after . " ';" . PHP_EOL; } + } - } // /foreach - - $output_single .= "\r\n\t\t\t" . "jQuery( document ).find( 'head' ).append( jQuery( '' ) );" . "\r\n"; + $output_single .= PHP_EOL . "\t\t\t" . "jQuery( document ).find( 'head' ).append( jQuery( '' ) );" . PHP_EOL; } // Custom JS if ( isset( $theme_option['preview_js']['custom'] ) ) { - $output_single .= "\t\t" . $theme_option['preview_js']['custom'] . "\r\n"; + $output_single .= "\t\t" . $theme_option['preview_js']['custom'] . PHP_EOL; } - $output_single .= "\t\t" . '} );' . "\r\n"; - $output_single .= "\t" . '}'. "\r\n"; - $output_single .= ');'. "\r\n"; - $output_single = apply_filters( 'wmhook_modern_library_customize_preview_scripts_option_' . $theme_option['id'], $output_single ); + $output_single .= "\t\t" . '} );' . PHP_EOL; + $output_single .= "\t" . '}'. PHP_EOL; + $output_single .= ');'. PHP_EOL; + $output_single = (string) apply_filters( 'wmhook_modern_library_customize_preview_scripts_option_' . $theme_option['id'], $output_single ); $output .= $output_single; } - - } // /foreach - + } } // Output if ( $output = trim( $output ) ) { - echo apply_filters( 'wmhook_modern_library_customize_preview_scripts_output', '' . "\r\n" . '' ); + echo (string) apply_filters( 'wmhook_modern_library_customize_preview_scripts_output', '' . PHP_EOL . '' ); } } // /preview_scripts @@ -340,8 +343,10 @@ public static function preview_scripts() { * * @uses `wmhook_modern_theme_options` global hook * + * @subpackage Customize Options + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * @param object $wp_customize WP customizer object. */ @@ -356,9 +361,9 @@ public static function customize( $wp_customize ) { // Pre - $pre = apply_filters( 'wmhook_modern_library_customize_pre', false, $wp_customize ); + $pre = apply_filters( 'wmhook_modern_library_customize_pre', null, $wp_customize ); - if ( false !== $pre ) { + if ( null !== $pre ) { return $pre; } @@ -369,25 +374,25 @@ public static function customize( $wp_customize ) { ksort( $theme_options ); - $allowed_option_types = apply_filters( 'wmhook_modern_library_customize_allowed_option_types', array( - 'checkbox', - 'color', - 'email', - 'hidden', - 'html', - 'image', - 'multicheckbox', - 'multiselect', - 'password', - 'radio', - 'radiomatrix', - 'range', - 'section', - 'select', - 'text', - 'textarea', - 'url', - ) ); + $allowed_option_types = (array) apply_filters( 'wmhook_modern_library_customize_allowed_option_types', array( + 'checkbox', + 'color', + 'email', + 'hidden', + 'html', + 'image', + 'multicheckbox', + 'multiselect', + 'password', + 'radio', + 'radiomatrix', + 'range', + 'section', + 'select', + 'text', + 'textarea', + 'url', + ) ); // To make sure our customizer sections start after WordPress default ones @@ -448,10 +453,11 @@ public static function customize( $wp_customize ) { // Generate customizer options - if ( is_array( $theme_options ) && ! empty( $theme_options ) ) { - + if ( + is_array( $theme_options ) + && ! empty( $theme_options ) + ) { foreach ( $theme_options as $theme_option ) { - if ( is_array( $theme_option ) && isset( $theme_option['type'] ) @@ -474,6 +480,18 @@ public static function customize( $wp_customize ) { $description = $theme_option['description']; } + if ( isset( $theme_option['sanitize_callback'] ) ) { + $sanitize_callback = $theme_option['sanitize_callback']; + } else { + $sanitize_callback = ''; + } + + if ( isset( $theme_option['validate_callback'] ) ) { + $validate_callback = $theme_option['validate_callback']; + } else { + $validate_callback = ''; + } + $transport = ( isset( $theme_option['preview_js'] ) ) ? ( 'postMessage' ) : ( 'refresh' ); @@ -495,35 +513,28 @@ public static function customize( $wp_customize ) { $panel_type = 'theme-options'; if ( is_array( $theme_option['in_panel'] ) ) { - $panel_title = isset( $theme_option['in_panel']['title'] ) ? ( $theme_option['in_panel']['title'] ) : ( '—' ); $panel_id = isset( $theme_option['in_panel']['id'] ) ? ( $theme_option['in_panel']['id'] ) : ( $panel_type ); $panel_type = isset( $theme_option['in_panel']['type'] ) ? ( $theme_option['in_panel']['type'] ) : ( $panel_type ); - } else { - $panel_title = $theme_option['in_panel']; $panel_id = $panel_type; - } - $panel_type = apply_filters( 'wmhook_modern_library_customize_panel_type', $panel_type, $theme_option, $theme_options ); - $panel_id = apply_filters( 'wmhook_modern_library_customize_panel_id', $panel_id, $theme_option, $theme_options ); + $panel_type = (string) apply_filters( 'wmhook_modern_library_customize_panel_type', $panel_type, $theme_option, $theme_options ); + $panel_id = (string) apply_filters( 'wmhook_modern_library_customize_panel_id', $panel_id, $theme_option, $theme_options ); if ( $customizer_panel !== $panel_id ) { - $wp_customize->add_panel( - $panel_id, - array( - 'title' => esc_html( $panel_title ), - 'description' => ( isset( $theme_option['in_panel-description'] ) ) ? ( $theme_option['in_panel-description'] ) : ( '' ), // Hidden at the top of the panel - 'priority' => $priority, - 'type' => $panel_type, // Sets also the panel class - ) - ); - + $panel_id, + array( + 'title' => esc_html( $panel_title ), + 'description' => ( isset( $theme_option['in_panel-description'] ) ) ? ( $theme_option['in_panel-description'] ) : ( '' ), // Hidden at the top of the panel + 'priority' => $priority, + 'type' => $panel_type, // Sets also the panel class + ) + ); $customizer_panel = $panel_id; - } } @@ -540,14 +551,14 @@ public static function customize( $wp_customize ) { } $customizer_section = array( - 'id' => $option_id, - 'setup' => array( - 'title' => $theme_option['create_section'], // Section title - 'description' => ( isset( $theme_option['create_section-description'] ) ) ? ( $theme_option['create_section-description'] ) : ( '' ), // Displayed at the top of section - 'priority' => $priority, - 'type' => 'theme-options', // Sets also the section class - ) - ); + 'id' => $option_id, + 'setup' => array( + 'title' => $theme_option['create_section'], // Section title + 'description' => ( isset( $theme_option['create_section-description'] ) ) ? ( $theme_option['create_section-description'] ) : ( '' ), // Displayed at the top of section + 'priority' => $priority, + 'type' => 'theme-options', // Sets also the section class + ) + ); if ( ! isset( $theme_option['in_panel'] ) ) { $customizer_panel = ''; @@ -556,9 +567,9 @@ public static function customize( $wp_customize ) { } $wp_customize->add_section( - $customizer_section['id'], - $customizer_section['setup'] - ); + $customizer_section['id'], + $customizer_section['setup'] + ); $customizer_section = $customizer_section['id']; @@ -570,14 +581,14 @@ public static function customize( $wp_customize ) { * Generic settings */ $generic = array( - 'label' => ( isset( $theme_option['label'] ) ) ? ( $theme_option['label'] ) : ( '' ), - 'description' => $description, - 'section' => ( isset( $theme_option['section'] ) ) ? ( $theme_option['section'] ) : ( $customizer_section ), - 'priority' => ( isset( $theme_option['priority'] ) ) ? ( $theme_option['priority'] ) : ( $priority ), - 'type' => $theme_option['type'], - 'active_callback' => ( isset( $theme_option['active_callback'] ) ) ? ( $theme_option['active_callback'] ) : ( null ), - 'input_attrs' => ( isset( $theme_option['input_attrs'] ) ) ? ( $theme_option['input_attrs'] ) : ( array() ), - ); + 'label' => ( isset( $theme_option['label'] ) ) ? ( $theme_option['label'] ) : ( '' ), + 'description' => $description, + 'section' => ( isset( $theme_option['section'] ) ) ? ( $theme_option['section'] ) : ( $customizer_section ), + 'priority' => ( isset( $theme_option['priority'] ) ) ? ( $theme_option['priority'] ) : ( $priority ), + 'type' => $theme_option['type'], + 'active_callback' => ( isset( $theme_option['active_callback'] ) ) ? ( $theme_option['active_callback'] ) : ( '' ), + 'input_attrs' => ( isset( $theme_option['input_attrs'] ) ) ? ( $theme_option['input_attrs'] ) : ( array() ), + ); @@ -586,393 +597,429 @@ public static function customize( $wp_customize ) { */ switch ( $theme_option['type'] ) { - /** - * Checkbox, radio - */ case 'checkbox': case 'radio': - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( 'checkbox' === $theme_option['type'] ) ? ( 'Modern_Library_Sanitize::checkbox' ) : ( 'Modern_Library_Sanitize::select' ), - 'sanitize_js_callback' => ( 'checkbox' === $theme_option['type'] ) ? ( 'Modern_Library_Sanitize::checkbox' ) : ( 'Modern_Library_Sanitize::select' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( 'checkbox' === $theme_option['type'] ) ? ( 'Modern_Library_Sanitize::checkbox' ) : ( 'Modern_Library_Sanitize::select' ), + 'sanitize_js_callback' => ( 'checkbox' === $theme_option['type'] ) ? ( 'Modern_Library_Sanitize::checkbox' ) : ( 'Modern_Library_Sanitize::select' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( - $option_id, - array_merge( $generic, array( - 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), - ) ) - ); - - break; + $option_id, + array_merge( $generic, array( + 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), + ) ) + ); + break; - /** - * Checkboxex, multiselect - */ case 'multicheckbox': case 'multiselect': - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'Modern_Library_Sanitize::multi_array' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'Modern_Library_Sanitize::multi_array' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'Modern_Library_Sanitize::multi_array' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'Modern_Library_Sanitize::multi_array' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new Modern_Customize_Control_Multiselect( - $wp_customize, - $option_id, - array_merge( $generic, array( - 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), - ) ) - ) ); - - break; - - /** - * Color - */ - case 'color': + $wp_customize, + $option_id, + array_merge( $generic, array( + 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), + ) ) + ) ); + break; + case 'color': $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => trim( $default, '#' ), - 'transport' => $transport, - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => trim( $default, '#' ), + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new WP_Customize_Color_Control( - $wp_customize, - $option_id, - $generic - ) ); + $wp_customize, + $option_id, + $generic + ) ); + break; - break; - - /** - * Email - */ case 'email': - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => 'sanitize_email', - 'sanitize_js_callback' => 'sanitize_email', - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_email', + 'sanitize_js_callback' => 'sanitize_email', + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( - $option_id, - $generic - ); - - break; + $option_id, + $generic + ); + break; - /** - * Hidden - */ case 'hidden': - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_attr' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_attr' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_attr' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_attr' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new Modern_Customize_Control_Hidden( - $wp_customize, - $option_id, - array( - 'label' => 'HIDDEN FIELD', - 'section' => $customizer_section, - 'priority' => $priority, - ) - ) ); - - break; - - /** - * HTML - */ - case 'html': + $wp_customize, + $option_id, + array( + 'label' => 'HIDDEN FIELD', + 'section' => $customizer_section, + 'priority' => $priority, + ) + ) ); + break; + case 'html': if ( empty( $option_id ) ) { $option_id = 'custom-title-' . $priority; } - $wp_customize->add_setting( - $option_id, - array( - 'sanitize_callback' => 'wp_kses_post', - 'sanitize_js_callback' => 'wp_filter_post_kses', - ) - ); - + $option_id, + array( + 'sanitize_callback' => 'wp_kses_post', + 'sanitize_js_callback' => 'wp_filter_post_kses', + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new Modern_Customize_Control_HTML( - $wp_customize, - $option_id, - array( - 'label' => ( isset( $theme_option['label'] ) ) ? ( $theme_option['label'] ) : ( '' ), - 'description' => $description, - 'content' => $theme_option['content'], - 'section' => ( isset( $theme_option['section'] ) ) ? ( $theme_option['section'] ) : ( $customizer_section ), - 'priority' => ( isset( $theme_option['priority'] ) ) ? ( $theme_option['priority'] ) : ( $priority ), - 'active_callback' => ( isset( $theme_option['active_callback'] ) ) ? ( $theme_option['active_callback'] ) : ( null ), - ) - ) ); - - break; - - /** - * Image - */ - case 'image': + $wp_customize, + $option_id, + array_merge( $generic, array( + 'content' => $theme_option['content'], + ) ) + ) ); + break; + case 'image': $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_url_raw' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_url_raw' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_url_raw' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_url_raw' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new WP_Customize_Image_Control( - $wp_customize, - $option_id, - array_merge( $generic, array( - 'context' => $option_id, - ) ) - ) ); - - break; - - /** - * Range - */ - case 'range': + $wp_customize, + $option_id, + array_merge( $generic, array( + 'context' => $option_id, + ) ) + ) ); + break; + case 'range': $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'absint' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'absint' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'absint' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'absint' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( - $option_id, - array_merge( $generic, array( - 'input_attrs' => array( - 'min' => $theme_option['min'], - 'max' => $theme_option['max'], - 'step' => $theme_option['step'], - 'data-multiply' => ( isset( $theme_option['multiplier'] ) ) ? ( $theme_option['multiplier'] ) : ( 1 ), - 'data-prefix' => ( isset( $theme_option['prefix'] ) ) ? ( $theme_option['prefix'] ) : ( '' ), - 'data-suffix' => ( isset( $theme_option['suffix'] ) ) ? ( $theme_option['suffix'] ) : ( '' ), - 'data-decimals' => ( isset( $theme_option['decimal_places'] ) ) ? ( absint( $theme_option['decimal_places'] ) ) : ( 0 ), - ), - ) ) - ); - - break; - - /** - * Password - */ - case 'password': + $option_id, + array_merge( $generic, array( + 'input_attrs' => array( + 'min' => $theme_option['min'], + 'max' => $theme_option['max'], + 'step' => $theme_option['step'], + 'data-multiply' => ( isset( $theme_option['multiplier'] ) ) ? ( $theme_option['multiplier'] ) : ( 1 ), + 'data-prefix' => ( isset( $theme_option['prefix'] ) ) ? ( $theme_option['prefix'] ) : ( '' ), + 'data-suffix' => ( isset( $theme_option['suffix'] ) ) ? ( $theme_option['suffix'] ) : ( '' ), + 'data-decimals' => ( isset( $theme_option['decimal_places'] ) ) ? ( absint( $theme_option['decimal_places'] ) ) : ( 0 ), + ), + ) ) + ); + break; + case 'password': $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_attr' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_attr' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_attr' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_attr' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( - $option_id, - $generic - ); - - break; + $option_id, + $generic + ); + break; - /** - * Radio matrix - */ case 'radiomatrix': - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_attr' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_attr' ), - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_attr' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_attr' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new Modern_Customize_Control_Radio_Matrix( - $wp_customize, - $option_id, - array_merge( $generic, array( - 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), - 'class' => ( isset( $theme_option['class'] ) ) ? ( $theme_option['class'] ) : ( '' ), - ) ) - ) ); - - break; - - /** - * Select (with optgroups) - */ - case 'select': + $wp_customize, + $option_id, + array_merge( $generic, array( + 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), + 'class' => ( isset( $theme_option['class'] ) ) ? ( $theme_option['class'] ) : ( '' ), + ) ) + ) ); + break; + case 'select': + // Supporting optgroups too. $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => 'Modern_Library_Sanitize::select', - 'sanitize_js_callback' => 'Modern_Library_Sanitize::select', - ) - ); - + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => 'Modern_Library_Sanitize::select', + 'sanitize_js_callback' => 'Modern_Library_Sanitize::select', + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( new Modern_Customize_Control_Select( - $wp_customize, - $option_id, - array_merge( $generic, array( - 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), - ) ) - ) ); - - break; - - /** - * Text - */ + $wp_customize, + $option_id, + array_merge( $generic, array( + 'choices' => ( isset( $theme_option['choices'] ) ) ? ( $theme_option['choices'] ) : ( '' ), + ) ) + ) ); + break; + case 'text': + $wp_customize->add_setting( + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_textarea' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_textarea' ), + 'validate_callback' => $validate_callback, + ) + ); + $wp_customize->add_control( + $option_id, + $generic + ); + break; + case 'textarea': $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_textarea' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_textarea' ), - ) - ); + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_textarea' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_textarea' ), + 'validate_callback' => $validate_callback, + ) + ); + $wp_customize->add_control( + $option_id, + $generic + ); + break; + case 'url': + $wp_customize->add_setting( + $option_id, + array( + 'type' => $type, + 'default' => $default, + 'transport' => $transport, + 'sanitize_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_url' ), + 'sanitize_js_callback' => ( $sanitize_callback ) ? ( $sanitize_callback ) : ( 'esc_url' ), + 'validate_callback' => $validate_callback, + ) + ); $wp_customize->add_control( - $option_id, - $generic - ); + $option_id, + $generic + ); + break; - break; + default: + break; - /** - * Textarea - */ - case 'textarea': + } - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_textarea' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_textarea' ), - ) - ); + } + } + } - $wp_customize->add_control( - $option_id, - $generic - ); + // Assets needed for customizer preview - break; + if ( $wp_customize->is_preview() ) { + add_action( 'wp_footer', __CLASS__ . '::preview_scripts', 99 ); + } - /** - * URL - */ - case 'url': + } // /customize - $wp_customize->add_setting( - $option_id, - array( - 'type' => $type, - 'default' => $default, - 'transport' => $transport, - 'sanitize_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_url' ), - 'sanitize_js_callback' => ( isset( $theme_option['validate'] ) ) ? ( $theme_option['validate'] ) : ( 'esc_url' ), - ) - ); - $wp_customize->add_control( - $option_id, - $generic - ); - break; - /** - * Default - */ - default: - break; - } // /switch + /** + * 30) Getters + */ + + /** + * Get theme mod or fall back to default automatically + * + * @uses `wmhook_modern_theme_options` global hook + * @link https://developer.wordpress.org/reference/functions/get_theme_mod/ + * + * @subpackage Customize Options + * + * @since 2.7.0 + * @version 2.7.0 + * + * @param string $name + * @param array $theme_option_setup + */ + public static function get_theme_mod( $name, $theme_option_setup = array() ) { + + // Pre - } // /if suitable option array + $pre = apply_filters( 'wmhook_modern_library_customize_get_theme_mod_pre', null, $name, $theme_option_setup ); - } // /foreach + if ( null !== $pre ) { + return $pre; + } - } // /if skin options are non-empty array - // Assets needed for customizer preview + // Helper variables - if ( $wp_customize->is_preview() ) { + $output = false; - add_action( 'wp_footer', __CLASS__ . '::preview_scripts', 99 ); + if ( false === self::$mods ) { + // Cache theme mods + self::$mods = get_theme_mods(); + } + + + // Processing + + if ( isset( self::$mods[ $name ] ) ) { + + /** + * Theme option has been modified, + * so we don't need the default value. + */ + $output = self::$mods[ $name ]; + + } else { + + /** + * We haven't found a modified theme option, + * so we need its default value. + */ + if ( empty( $theme_option_setup ) ) { + + /** + * We don't have single theme option passed, + * get all theme options setup. + */ + if ( false === self::$theme_options_setup ) { + // Cache theme options setup + self::$theme_options_setup = (array) apply_filters( 'wmhook_modern_theme_options', array() ); + } + + foreach ( self::$theme_options_setup as $option ) { + if ( + isset( $option['default'] ) + && isset( $option['id'] ) + && $name === $option['id'] + ) { + $output = $option['default']; + $theme_option_setup = $option; + break; + } + } + + } else { + + /** + * We have single theme option passed, + * get the default value from it. + */ + if ( + isset( $theme_option_setup['default'] ) + && isset( $theme_option_setup['id'] ) + && $name === $theme_option_setup['id'] + ) { + $output = $theme_option_setup['default']; + } } - } // /customize + /** + * @see https://developer.wordpress.org/reference/functions/get_theme_mod/ + */ + if ( is_string( $output ) ) { + $output = sprintf( + $output, + get_template_directory_uri(), + get_stylesheet_directory_uri() + ); + } + + } + + + // Output + + return apply_filters( 'theme_mod_' . $name, $output, $theme_option_setup ); + + } // /get_theme_mod diff --git a/library/includes/classes/class-sanitize.php b/library/includes/classes/class-sanitize.php index 1630ff0..4e81442 100644 --- a/library/includes/classes/class-sanitize.php +++ b/library/includes/classes/class-sanitize.php @@ -4,11 +4,13 @@ * * @link https://github.com/WPTRT/code-examples/blob/master/customizer/sanitization-callbacks.php * - * @package WebMan WordPress Theme Framework * @subpackage Core * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 2.5.0 - * @version 2.5.6 + * @version 2.7.0 * * Contents: * @@ -90,7 +92,7 @@ public static function select( $value, $choices = array(), $default = '' ) { * Returns an array of values. * * @since 2.5.0 - * @version 2.5.4 + * @version 2.6.1 * * @param mixed $value * @param array $choices @@ -132,7 +134,7 @@ public static function multi_array( $value, $choices = array() ) { $value[ $key ] = esc_attr( $single_value ); - } // /foreach + } // Output diff --git a/library/includes/classes/class-visual-editor.php b/library/includes/classes/class-visual-editor.php index 753ee9c..89eebc2 100644 --- a/library/includes/classes/class-visual-editor.php +++ b/library/includes/classes/class-visual-editor.php @@ -5,11 +5,13 @@ * This is a helper class and does not load automatically with the library. * Load it directly from within your theme's `functions.php` file. * - * @package WebMan WordPress Theme Framework * @subpackage Visual Editor * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * Contents: * @@ -36,7 +38,7 @@ final class Modern_Library_Visual_Editor { * Constructor * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 */ private function __construct() { @@ -44,14 +46,6 @@ private function __construct() { // Hooks - // Actions - - // Editor body class on page template change - - if ( is_admin() ) { - add_action( 'admin_enqueue_scripts', __CLASS__ . '::scripts_post_edit', 1000 ); - } - // Filters // Editor body class @@ -62,8 +56,7 @@ private function __construct() { // Editor addons - add_filter( 'mce_buttons', __CLASS__ . '::add_buttons_row1' ); - + add_filter( 'mce_buttons', __CLASS__ . '::add_buttons_row1' ); add_filter( 'mce_buttons_2', __CLASS__ . '::add_buttons_row2' ); add_filter( 'tiny_mce_before_init', __CLASS__ . '::style_formats' ); @@ -107,21 +100,12 @@ public static function init() { * First row. * * @since 1.0.0 - * @version 2.0.0 + * @version 2.7.0 * * @param array $buttons */ public static function add_buttons_row1( $buttons ) { - // Pre - - $pre = apply_filters( 'wmhook_modern_library_editor_add_buttons_row1_pre', false, $buttons ); - - if ( false !== $pre ) { - return $pre; - } - - // Processing // Inserting buttons after "more" button @@ -149,21 +133,12 @@ public static function add_buttons_row1( $buttons ) { * Second row. * * @since 1.0.0 - * @version 2.0.0 + * @version 2.7.0 * * @param array $buttons */ public static function add_buttons_row2( $buttons ) { - // Pre - - $pre = apply_filters( 'wmhook_modern_library_editor_add_buttons_row2_pre', false, $buttons ); - - if ( false !== $pre ) { - return $pre; - } - - // Processing // Inserting buttons at the beginning of the row @@ -192,21 +167,12 @@ public static function add_buttons_row2( $buttons ) { * @link http://www.tinymce.com/wiki.php/Configuration:style_formats * * @since 1.0.0 - * @version 2.6.0 + * @version 2.7.0 * * @param array $init */ public static function style_formats( $init ) { - // Pre - - $pre = apply_filters( 'wmhook_modern_library_editor_style_formats_pre', false, $init ); - - if ( false !== $pre ) { - return $pre; - } - - // Processing // Add custom formats @@ -392,7 +358,7 @@ public static function style_formats( $init ) { * Adding editor HTML body classes * * @since 1.7.2 - * @version 2.0.1 + * @version 2.7.0 * * @param array $init */ @@ -422,17 +388,6 @@ public static function body_class( $init ) { $class[] = 'entry-content'; - // Page template class - - if ( version_compare( $wp_version, '4.7', '<' ) ) { - - if ( $page_template = get_page_template_slug( $post ) ) { - $page_template = str_replace( '.', '-', basename( $page_template, '.php' ) ); - $class[] = 'page-template-' . sanitize_html_class( $page_template ); - } - - } - // Adding custom classes $init['body_class'] = $init['body_class'] . ' ' . implode( ' ', $class ); @@ -446,49 +401,6 @@ public static function body_class( $init ) { - /** - * Adding scripts to post edit screen - * - * @since 1.7.2 - * @version 2.6.0 - * - * @param string $hook_suffix - */ - public static function scripts_post_edit( $hook_suffix = '' ) { - - // Helper variables - - global $wp_version; - - $current_screen = get_current_screen(); - - - // Requirements check - - if ( - version_compare( $wp_version, '4.7', '>=' ) - || ( isset( $current_screen->base ) && 'post' != $current_screen->base ) - ) { - return; - } - - - // Processing - - // Scripts - - wp_enqueue_script( - 'modern-post-edit', - get_theme_file_uri( MODERN_LIBRARY_DIR . 'js/post.js' ), - array( 'jquery' ), - esc_attr( MODERN_THEME_VERSION ), - true - ); - - } // /scripts_post_edit - - - } // /Modern_Library_Visual_Editor diff --git a/library/includes/vendor/tgmpa/class-tgm-plugin-activation.php b/library/includes/vendor/tgmpa/class-tgm-plugin-activation.php index baa621f..361956e 100644 --- a/library/includes/vendor/tgmpa/class-tgm-plugin-activation.php +++ b/library/includes/vendor/tgmpa/class-tgm-plugin-activation.php @@ -7,11 +7,13 @@ * Modification: * - Changed localization text domain * - * @package WebMan WordPress Theme Framework * @subpackage Plugins * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.4.4 + * @version 2.7.0 */ diff --git a/library/includes/vendor/use-child-theme/class-use-child-theme.php b/library/includes/vendor/use-child-theme/class-use-child-theme.php index 44d1729..d87318a 100644 --- a/library/includes/vendor/use-child-theme/class-use-child-theme.php +++ b/library/includes/vendor/use-child-theme/class-use-child-theme.php @@ -2,11 +2,13 @@ /** * WebMan Design Use Child Theme * - * @package WebMan WordPress Theme Framework - * @subpackage Plugins + * @subpackage Child Theme + * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas * * @since 1.6.2 - * @version 2.2.6 + * @version 2.7.0 */ @@ -19,10 +21,9 @@ * @link https://github.com/webmandesign/use-child-theme * @link https://github.com/FacetWP/use-child-theme * - * This is a fork of Use Child Theme by FacetWP modified for use - * in WebMan WordPress Theme Framework. - * - * This does not work in WordPress multisite installation due to theme + * This is a fork of Use Child Theme by FacetWP (version 0.4) + * modified for use in WebMan WordPress Theme Framework. + * Does not work in WordPress multisite installation due to theme * file editor not being available in single site dashboard. * * Modifications: @@ -35,15 +36,7 @@ * Used development variables/prefixes: * - text_domain * - * @version 1.2.1 - */ - - - -/** - * Use Child Theme - * A drop-in to make it easy to use WordPress child themes - * @version 0.4 + * @version 1.3.0 */ defined( 'ABSPATH' ) or exit; @@ -63,6 +56,9 @@ class Use_Child_Theme { + /** + * @version 1.0.0 + */ function __construct() { add_action( 'admin_init', array( $this, 'admin_init' ) ); @@ -71,6 +67,9 @@ function __construct() { + /** + * @version 1.3.0 + */ function admin_init() { // Exit if unauthorized @@ -96,13 +95,16 @@ function admin_init() { } add_action( 'wp_ajax_uct_activate', array( $this, 'activate_child_theme' ) ); - add_action( 'wp_ajax_uct_dismiss', array( $this, 'dismiss_notice' ) ); - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); + add_action( 'wp_ajax_uct_dismiss', array( $this, 'dismiss_notice' ) ); + add_action( 'admin_notices', array( $this, 'admin_notices' ) ); } // /admin_init + /** + * @version 1.3.0 + */ function admin_notices() { // Show only on specific admin page(s) (default: Appearance > Editor) @@ -115,19 +117,32 @@ function admin_notices() { ?>
@@ -143,6 +158,9 @@ function admin_notices() { + /** + * @version 1.0.0 + */ function dismiss_notice() { set_transient( 'uct_dismiss_notice', 'yes', apply_filters( 'uct_dismiss_timeout', 86400 ) ); @@ -152,10 +170,13 @@ function dismiss_notice() { + /** + * @version 1.3.0 + */ function has_child_theme() { - $themes = wp_get_themes(); - $folder_name = $this->theme->get_stylesheet(); + $themes = wp_get_themes(); + $folder_name = $this->theme->get_stylesheet(); $this->child_slug = $folder_name . '-child'; foreach ( $themes as $theme ) { @@ -171,6 +192,9 @@ function has_child_theme() { + /** + * @version 1.0.0 + */ function activate_child_theme() { $parent_slug = $this->theme->get_stylesheet(); @@ -196,13 +220,18 @@ function activate_child_theme() { + /** + * @version 1.3.0 + */ function create_child_theme() { $parent_dir = $this->theme->get_stylesheet_directory(); - $child_dir = $parent_dir . '-child'; + $child_dir = $parent_dir . '-child'; if ( wp_mkdir_p( $child_dir ) ) { + $creds = request_filesystem_credentials( admin_url() ); + WP_Filesystem( $creds ); // we already have direct access global $wp_filesystem; @@ -212,24 +241,32 @@ function create_child_theme() { if ( false !== ( $img = $this->theme->get_screenshot( 'relative' ) ) ) { $wp_filesystem->copy( "$parent_dir/$img", "$child_dir/$img" ); } + } else { + wp_die( esc_html__( 'Error: theme folder not writable!', 'modern' ) ); + } } // /create_child_theme + /** + * @version 1.3.0 + */ function style_css() { - $output = '/**' . "\r\n"; - $output .= ' * Theme Name: ' . $this->theme->get( 'Name' ) . ' Child' . "\r\n"; - $output .= ' * Template: ' . $this->theme->get_stylesheet() . "\r\n"; - $output .= ' * Version: 1.0.0' . "\r\n"; - $output .= ' * Description: This is a child theme of ' . $this->theme->get( 'Name' ) . "\r\n"; - $output .= ' */' . "\r\n"; - $output .= "\r\n"; - $output .= '/* Put your custom CSS styles below... */' . "\r\n"; + $output = '/*!' . PHP_EOL; + $output .= 'Theme Name: ' . $this->theme->get( 'Name' ) . ' Child' . PHP_EOL; + $output .= 'Template: ' . $this->theme->get_stylesheet() . PHP_EOL; + $output .= 'Version: 1.0.0' . PHP_EOL; + $output .= 'Description: This is a child theme of ' . $this->theme->get( 'Name' ) . PHP_EOL; + $output .= 'License: GNU General Public License v3' . PHP_EOL; + $output .= 'License URI: http://www.gnu.org/licenses/gpl-3.0.html' . PHP_EOL; + $output .= '*/' . PHP_EOL; + $output .= PHP_EOL; + $output .= '/* Put your custom CSS styles here... */' . PHP_EOL; return apply_filters( 'uct_style_css', $output ); @@ -237,27 +274,52 @@ function style_css() { + /** + * @version 1.3.0 + */ function functions_php() { - $output = 'theme->get( 'Name' ) . ' Child' . "\r\n"; - $output .= ' */' . "\r\n"; - $output .= "\r\n"; - $output .= '/**' . "\r\n"; - $output .= ' * Enqueue parent theme stylesheet the right way' . "\r\n"; - $output .= ' */' . "\r\n"; - $output .= 'function child_theme_enqueue_parent_styles() {' . "\r\n"; - $output .= "\t" . "if ( current_theme_supports( 'child-theme-stylesheet' ) ) { return; }" . "\r\n"; - $output .= "\t" . "wp_enqueue_style( 'parent-theme-styles', get_template_directory_uri() . '/style.css' );" . "\r\n"; - $output .= "\t" . "wp_enqueue_style( 'child-theme-styles', get_stylesheet_uri() );" . "\r\n"; - $output .= '}' . "\r\n"; - $output .= "\r\n"; - $output .= "add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_parent_styles', 1000 );\r\n"; - $output .= "\r\n"; - $output .= '/* Put your custom PHP code below... */' . "\r\n"; + $function_prefix = str_replace( '-', '_', $this->child_slug ); + + $output = 'theme->get( 'Name' ) . ' Child' . PHP_EOL; + $output .= ' *' . PHP_EOL; + $output .= ' * @version 1.0.0' . PHP_EOL; + $output .= ' */' . PHP_EOL; + + $output .= PHP_EOL.PHP_EOL.PHP_EOL.PHP_EOL.PHP_EOL; + + $output .= '/**' . PHP_EOL; + $output .= ' * Enqueue parent theme stylesheet' . PHP_EOL; + $output .= ' *' . PHP_EOL; + $output .= ' * This runs only if parent theme does not claim support for' . PHP_EOL; + $output .= ' * `child-theme-stylesheet`, and so we need to enqueue this' . PHP_EOL; + $output .= ' * child theme `style.css` file ourselves.' . PHP_EOL; + $output .= ' *' . PHP_EOL; + $output .= ' * If parent theme supports `child-theme-stylesheet`, it enqueues' . PHP_EOL; + $output .= ' * this child theme `style.css` file automatically.' . PHP_EOL; + $output .= ' *' . PHP_EOL; + $output .= ' * @version 1.0.0' . PHP_EOL; + $output .= ' */' . PHP_EOL; + $output .= 'function ' . $function_prefix . '_parent_theme_style() {' . PHP_EOL; + $output .= "\t" . "if ( ! current_theme_supports( 'child-theme-stylesheet' ) ) {" . PHP_EOL; + $output .= "\t\t" . "wp_enqueue_style( '" . $function_prefix . "-parent-style', get_template_directory_uri() . '/style.css' );" . PHP_EOL; + $output .= "\t\t" . "wp_enqueue_style( '" . $function_prefix . "-child-style', get_stylesheet_uri() );" . PHP_EOL; + $output .= "\t" . "}" . PHP_EOL; + $output .= '} // /' . $function_prefix . '_parent_theme_style' . PHP_EOL; + $output .= PHP_EOL; + $output .= "add_action( 'wp_enqueue_scripts', '" . $function_prefix . "_parent_theme_style', 1000 );" . PHP_EOL; + + $output .= PHP_EOL.PHP_EOL.PHP_EOL.PHP_EOL.PHP_EOL; + + $output .= '/**' . PHP_EOL; + $output .= ' * Put your custom PHP code below...' . PHP_EOL; + $output .= ' */' . PHP_EOL; + + $output .= PHP_EOL; return apply_filters( 'uct_functions_php', $output ); diff --git a/library/init.php b/library/init.php index c7d0adb..6a0626b 100644 --- a/library/init.php +++ b/library/init.php @@ -6,22 +6,13 @@ * setup related options and can not be edited via customizer. * This way we prevent creating additional options in the database. * - * @copyright WebMan Design, Oliver Juhas - * @license GPL-3.0, http://www.gnu.org/licenses/gpl-3.0.html - * * @link https://github.com/webmandesign/webman-theme-framework * @link http://www.webmandesign.eu * - * @package WebMan WordPress Theme Framework - * @subpackage Core - * - * @version 2.6.0 - * - * Used global hooks: - * - * @uses wmhook_modern_theme_options - * @uses wmhook_modern_esc_css - * @uses wmhook_modern_custom_styles + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * @license GPL-3.0, http://www.gnu.org/licenses/gpl-3.0.html + * @version 2.7.0 * * Used development prefixes: * @@ -106,7 +97,7 @@ // Plugins suggestions if ( - apply_filters( 'wmhook_modern_plugins_suggestion_enabled', true ) + (bool) apply_filters( 'wmhook_modern_plugins_suggestion_enabled', true ) && locate_template( 'includes/tgmpa/plugins.php' ) ) { require MODERN_LIBRARY . 'includes/vendor/tgmpa/class-tgm-plugin-activation.php'; @@ -115,7 +106,7 @@ // Child theme generator - if ( apply_filters( 'wmhook_modern_child_theme_generator_enabled', false ) ) { + if ( (bool) apply_filters( 'wmhook_modern_child_theme_generator_enabled', false ) ) { require MODERN_LIBRARY . 'includes/vendor/use-child-theme/class-use-child-theme.php'; } diff --git a/library/js/customize-control-multicheckbox.js b/library/js/customize-control-multicheckbox.js index b3bbb74..473ef24 100644 --- a/library/js/customize-control-multicheckbox.js +++ b/library/js/customize-control-multicheckbox.js @@ -3,11 +3,13 @@ * * Customizer multiple checkboxes. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 2.1.0 - * @version 2.2.0 + * @version 2.7.0 */ ( function( exports, $ ) { $( wp.customize ).on( 'ready', function() { diff --git a/library/js/customize-control-radio-matrix.js b/library/js/customize-control-radio-matrix.js index f2aa343..f5136a0 100644 --- a/library/js/customize-control-radio-matrix.js +++ b/library/js/customize-control-radio-matrix.js @@ -3,11 +3,13 @@ * * Customizer matrix radio fields. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 1.0.0 - * @version 2.2.0 + * @version 2.7.0 */ ( function( exports, $ ) { $( wp.customize ).on( 'ready', function() { diff --git a/library/js/customize-controls.js b/library/js/customize-controls.js index b81647d..d6cc10a 100644 --- a/library/js/customize-controls.js +++ b/library/js/customize-controls.js @@ -6,11 +6,13 @@ * we conditionally hide corresponding "_attachment", "_position", * "_repeat", "_size" and also "_opacity" controls. * - * @package WebMan WordPress Theme Framework * @subpackage Customize * + * @package WebMan WordPress Theme Framework + * @copyright WebMan Design, Oliver Juhas + * * @since 2.2.0 - * @version 2.2.3 + * @version 2.7.0 */ ( function( exports, $ ) { $( wp.customize ).on( 'ready', function() { @@ -95,32 +97,38 @@ $.each( backgroundImages, function( i, settingId ) { wp.customize( settingId, function( value ) { - var - selectors = [ - '[id$="' + settingId + '_attachment"]', - '[id$="' + settingId + '_opacity"]', - '[id$="' + settingId + '_position"]', - '[id$="' + settingId + '_repeat"]', - '[id$="' + settingId + '_size"]', - ]; - - if ( ! _wpCustomizeSettings.settings[ settingId ].value ) { - $( selectors.join() ) - .hide(); - } + // Helper variables + + var + selectors = [ + '[id$="' + settingId + '_attachment"]', + '[id$="' + settingId + '_opacity"]', + '[id$="' + settingId + '_position"]', + '[id$="' + settingId + '_repeat"]', + '[id$="' + settingId + '_size"]', + ]; + + + // Processing + + if ( ! _wpCustomizeSettings.settings[ settingId ].value ) { + $( selectors.join() ) + .hide(); + } + + value + .bind( function( to ) { - value - .bind( function( to ) { + if ( ! to ) { + $( selectors.join() ) + .hide(); + } else { + $( selectors.join() ) + .show(); + } - if ( ! to ) { - $( selectors.join() ) - .hide(); - } else { - $( selectors.join() ) - .show(); - } + } ); - } ); } ); } ); diff --git a/library/js/post.js b/library/js/post.js deleted file mode 100644 index 2116896..0000000 --- a/library/js/post.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Post edit scripts - * - * @see wp-admin/js/post.js - * - * @package WebMan WordPress Theme Framework - * @subpackage Visual Editor - * - * @since 1.7.2 - * @version 2.0.1 - */ - - - - - -jQuery( document ).ready( function( $ ) { - - - - - - /** - * Adding page template class on TinyMCE editor HTML body - * - * @since 1.7.2 - * @version 2.0.1 - */ - if ( typeof tinymce !== 'undefined' ) { - - $( '#page_template' ) - .on( 'change.set-editor-class', function() { - - // Helper variables - - var - editor, - body, - pageTemplate = $( this ).val() || ''; - - pageTemplate = pageTemplate.substr( pageTemplate.lastIndexOf( '/' ) + 1, pageTemplate.length ) - .replace( /\.php$/, '' ) - .replace( /\./g, '-' ); - - - // Processing - - if ( pageTemplate && ( editor = tinymce.get( 'content' ) ) ) { - body = editor.getBody(); - body.className = body.className.replace( /\bpage-template-[^ ]+/, '' ); - editor.dom.addClass( body, 'page-template-' + pageTemplate ); - $( document ).trigger( 'editor-classchange' ); - } - - } ); - - } - - - - - -} ); diff --git a/library/readme.md b/library/readme.md index 8e418b3..5495109 100644 --- a/library/readme.md +++ b/library/readme.md @@ -5,8 +5,6 @@ This framework, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned with others. -*Requires at least WordPress 4.4.* - For more info please visit https://github.com/webmandesign/webman-theme-framework *(C) Copyright WebMan Design, Oliver Juhas* diff --git a/library/scss/customize-rtl.scss b/library/scss/customize-rtl.scss index 85cfc56..1fdee32 100644 --- a/library/scss/customize-rtl.scss +++ b/library/scss/customize-rtl.scss @@ -3,9 +3,11 @@ // // Customize RTL styles // -// @package WebMan WordPress Theme Framework // @subpackage Customize // +// @package WebMan WordPress Theme Framework +// @copyright WebMan Design, Oliver Juhas +// diff --git a/library/scss/customize.scss b/library/scss/customize.scss index 127e32e..b8c7174 100644 --- a/library/scss/customize.scss +++ b/library/scss/customize.scss @@ -3,11 +3,13 @@ // // Customize styles // -// @package WebMan WordPress Theme Framework // @subpackage Customize // +// @package WebMan WordPress Theme Framework +// @copyright WebMan Design, Oliver Juhas +// // @since 1.5.0 -// @version 1.5.0 +// @version 2.7.0 // diff --git a/library/scss/styles/_customize.scss b/library/scss/styles/_customize.scss index b1a4f95..f72203b 100644 --- a/library/scss/styles/_customize.scss +++ b/library/scss/styles/_customize.scss @@ -3,11 +3,13 @@ // // Customize styles // -// @package WebMan WordPress Theme Framework // @subpackage Customize // +// @package WebMan WordPress Theme Framework +// @copyright WebMan Design, Oliver Juhas +// // @since 1.5.0 -// @version 2.6.0 +// @version 2.7.0 // diff --git a/library/scss/styles/_welcome.scss b/library/scss/styles/_welcome.scss index 78f29ea..03442fb 100644 --- a/library/scss/styles/_welcome.scss +++ b/library/scss/styles/_welcome.scss @@ -3,11 +3,13 @@ // // Welcome page styles // -// @package WebMan WordPress Theme Framework -// @subpackage Welcome page +// @subpackage Welcome +// @subpackage Admin +// +// @package WebMan WordPress Theme Framework // // @since 1.5.0 -// @version 2.5.5 +// @version 2.7.0 // diff --git a/library/scss/welcome-rtl.scss b/library/scss/welcome-rtl.scss index 9956256..c1d5d97 100644 --- a/library/scss/welcome-rtl.scss +++ b/library/scss/welcome-rtl.scss @@ -3,8 +3,10 @@ // // Welcome page RTL styles // -// @package WebMan WordPress Theme Framework -// @subpackage Welcome page +// @subpackage Welcome +// @subpackage Admin +// +// @package WebMan WordPress Theme Framework // diff --git a/library/scss/welcome.scss b/library/scss/welcome.scss index 6c20c28..ea31586 100644 --- a/library/scss/welcome.scss +++ b/library/scss/welcome.scss @@ -3,11 +3,13 @@ // // Welcome page styles // -// @package WebMan WordPress Theme Framework -// @subpackage Welcome page +// @subpackage Welcome +// @subpackage Admin +// +// @package WebMan WordPress Theme Framework // // @since 1.5.0 -// @version 1.5.0 +// @version 2.7.0 // diff --git a/style.css b/style.css index 95efbd6..1f73ca1 100644 --- a/style.css +++ b/style.css @@ -3,7 +3,7 @@ Theme Name: Modern Theme URI: https://www.webmandesign.eu/portfolio/modern-wordpress-theme/ Author: WebMan Design Author URI: https://www.webmandesign.eu/ -Version: 2.1.0 +Version: 2.2.0 Text Domain: modern Domain Path: /languages License: GNU General Public License v3 diff --git a/template-parts/footer/site-info.php b/template-parts/footer/site-info.php index 339e727..d4a67bb 100644 --- a/template-parts/footer/site-info.php +++ b/template-parts/footer/site-info.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.1.0 + * @version 2.2.0 */ @@ -15,7 +15,7 @@ // Helper variables - $site_info_text = trim( (string) get_theme_mod( 'texts_site_info' ) ); + $site_info_text = trim( (string) Modern_Library_Customize::get_theme_mod( 'texts_site_info' ) ); // Requirements check diff --git a/template-parts/intro/intro-content.php b/template-parts/intro/intro-content.php index ba162cf..9f22acf 100644 --- a/template-parts/intro/intro-content.php +++ b/template-parts/intro/intro-content.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ @@ -38,7 +38,7 @@ // Customizer option text... $title = trim( // This is already sanitized in database. - get_theme_mod( 'texts_intro', esc_html__( 'Welcome to our site!', 'modern' ) ) + Modern_Library_Customize::get_theme_mod( 'texts_intro' ) ); // ...or site tagline diff --git a/template-parts/loop/loop-front-blog.php b/template-parts/loop/loop-front-blog.php index d44859c..1cda9dc 100644 --- a/template-parts/loop/loop-front-blog.php +++ b/template-parts/loop/loop-front-blog.php @@ -9,7 +9,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ @@ -34,7 +34,7 @@ $query = new WP_Query( (array) apply_filters( 'wmhook_modern_loop_query', array( 'post_type' => $post_type, - 'posts_per_page' => absint( get_theme_mod( 'layout_posts_per_page_front_blog', 6 ) ), + 'posts_per_page' => absint( Modern_Library_Customize::get_theme_mod( 'layout_posts_per_page_front_blog' ) ), 'paged' => 1, 'no_found_rows' => true, 'ignore_sticky_posts' => true, diff --git a/template-parts/loop/loop-front-portfolio.php b/template-parts/loop/loop-front-portfolio.php index 223bc57..3ca146b 100644 --- a/template-parts/loop/loop-front-portfolio.php +++ b/template-parts/loop/loop-front-portfolio.php @@ -9,7 +9,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ @@ -34,7 +34,7 @@ $query = new WP_Query( (array) apply_filters( 'wmhook_modern_loop_query', array( 'post_type' => $post_type, - 'posts_per_page' => absint( get_theme_mod( 'layout_posts_per_page_front_portfolio', 6 ) ), + 'posts_per_page' => absint( Modern_Library_Customize::get_theme_mod( 'layout_posts_per_page_front_portfolio' ) ), 'paged' => 1, 'no_found_rows' => true, 'ignore_sticky_posts' => true, diff --git a/template-parts/loop/loop-front-testimonials.php b/template-parts/loop/loop-front-testimonials.php index 556d551..521a606 100644 --- a/template-parts/loop/loop-front-testimonials.php +++ b/template-parts/loop/loop-front-testimonials.php @@ -9,7 +9,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ @@ -34,7 +34,7 @@ $query = new WP_Query( (array) apply_filters( 'wmhook_modern_loop_query', array( 'post_type' => $post_type, - 'posts_per_page' => absint( get_theme_mod( 'layout_posts_per_page_front_testimonials', 3 ) ), + 'posts_per_page' => absint( Modern_Library_Customize::get_theme_mod( 'layout_posts_per_page_front_testimonials' ) ), 'paged' => 1, 'no_found_rows' => true, 'ignore_sticky_posts' => true, diff --git a/template-parts/menu/menu-primary.php b/template-parts/menu/menu-primary.php index a02d435..5ee436b 100644 --- a/template-parts/menu/menu-primary.php +++ b/template-parts/menu/menu-primary.php @@ -10,7 +10,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 2.0.0 - * @version 2.0.0 + * @version 2.2.0 */ @@ -19,7 +19,7 @@ // Helper variables - $is_mobile_nav_enabled = get_theme_mod( 'navigation_mobile', true ); + $is_mobile_nav_enabled = Modern_Library_Customize::get_theme_mod( 'navigation_mobile' ); ?>