From 79d72f694f9032957dc4e7201c9207fe4853f9d1 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 8 Apr 2022 04:07:22 -0500 Subject: [PATCH] v1.3.6 changes --- CHANGELOG.md | 12 ++++++++++++ build | 2 +- njk/assets/lib/cmb2-metaboxes.php | 12 +++--------- njk/assets/lib/helper-functions.php | 22 ++++++++++++++++++++++ njk/assets/lib/theme-setup.php | 12 ++++++++++++ njk/assets/style.css | 1 + njk/templates/_globals-defaults.html | 8 +++++--- 7 files changed, 56 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c4b224..f782001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 1.3.6 + +Changes: +* ( build/ ) Now pointing to v1.3.6 commit +* Implemented Method v1.3.6 revisions to njk templates (see release notes: https://github.com/pixelwatt/method/blob/v1.3.6/CHANGELOG) +* Added ability to specify theme license (by way of Velpeo's pull request), and added to style.css +* Changed the theme_license global to "GNU General Public License v2 or later" (mirroring Automattic) +* Added new bool to globals: require_method_alerts (if true, the custom theme build will require Method Alerts to be installed - https://github.com/pixelwatt/method-alerts) +* Added new bool to globals: require_elliston (if true, the custom theme build will require Elliston to be installed - https://github.com/theboldagency/elliston) + +--- + ## 1.3.5 Changes: diff --git a/build b/build index 9d2fc56..1f9acc6 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 9d2fc564276ccd9aa586a97096498a71d9e3d89c +Subproject commit 1f9acc6f96a797a7a9fc35d036090d0df5a7000a diff --git a/njk/assets/lib/cmb2-metaboxes.php b/njk/assets/lib/cmb2-metaboxes.php index 167cfde..fce8429 100644 --- a/njk/assets/lib/cmb2-metaboxes.php +++ b/njk/assets/lib/cmb2-metaboxes.php @@ -11,11 +11,9 @@ add_action( 'cmb2_admin_init', '{{globals.code_prefix}}register_page_front_metabox' ); function {{globals.code_prefix}}register_page_front_metabox() { - $prefix = '_{{globals.code_prefix}}'; - $cmb_options = new_cmb2_box( array( - 'id' => $prefix . 'metabox_page_front', + 'id' => '_{{globals.code_prefix}}metabox_page_front', 'title' => esc_html__( 'Front Page Options', 'cmb2' ), 'object_types' => array( 'page' ), 'show_on' => array( @@ -36,11 +34,9 @@ function {{globals.code_prefix}}register_page_front_metabox() { add_action( 'cmb2_admin_init', '{{globals.code_prefix}}register_page_default_metabox' ); function {{globals.code_prefix}}register_page_default_metabox() { - $prefix = '_{{globals.code_prefix}}'; - $cmb_options = new_cmb2_box( array( - 'id' => $prefix . 'metabox_page_default', + 'id' => '_{{globals.code_prefix}}metabox_page_default', 'title' => esc_html__( 'Additional Options', 'cmb2' ), 'object_types' => array( 'page' ), 'show_on' => array( @@ -60,11 +56,9 @@ function {{globals.code_prefix}}register_page_default_metabox() { add_action( 'cmb2_admin_init', '{{globals.code_prefix}}register_page_template_tmpname_metabox' ); function {{globals.code_prefix}}register_page_template_tmpname_metabox() { - $prefix = '_{{globals.code_prefix}}'; - $cmb_options = new_cmb2_box( array( - 'id' => $prefix . 'metabox_page_template_tmpname', + 'id' => '_{{globals.code_prefix}}metabox_page_template_tmpname', 'title' => esc_html__( 'Template Options', 'cmb2' ), 'object_types' => array( 'page' ), 'priority' => 'high', diff --git a/njk/assets/lib/helper-functions.php b/njk/assets/lib/helper-functions.php index ff4ab1d..1ab6c11 100644 --- a/njk/assets/lib/helper-functions.php +++ b/njk/assets/lib/helper-functions.php @@ -119,6 +119,28 @@ function {{globals.code_prefix}}get_term_array( $tax, $none = '' ) { } +//----------------------------------------------------- +// Get an array of nav menus created in the menu editor +//----------------------------------------------------- + +function {{globals.code_prefix}}get_menus_array() { + $menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) ); + $output = array(); + + if ( ! empty( $menus ) ) { + foreach ( $menus as $menu ) { + $output[ $menu->term_id ] = $menu->name; + } + } + + return $output; +} + + +//----------------------------------------------------- +// Additional utility functions +//----------------------------------------------------- + function {{globals.code_prefix}}str_replace_assoc( array $replace, $subject ) { return str_replace( array_keys( $replace ), array_values( $replace ), $subject ); } diff --git a/njk/assets/lib/theme-setup.php b/njk/assets/lib/theme-setup.php index d744098..8598322 100644 --- a/njk/assets/lib/theme-setup.php +++ b/njk/assets/lib/theme-setup.php @@ -107,6 +107,18 @@ function {{globals.code_prefix}}register_required_plugins() { 'slug' => 'cmb2-mapbox', 'source' => 'https://github.com/pixelwatt/cmb2-mapbox/archive/master.zip', 'required' => true, + ),{% endif %}{% if globals.require_method_alerts %} + array( + 'name' => 'Method Alerts', + 'slug' => 'method-alerts', + 'source' => 'https://github.com/pixelwatt/method-alerts/archive/main.zip', + 'required' => true, + ),{% endif %}{% if globals.require_elliston %} + array( + 'name' => 'Elliston', + 'slug' => 'elliston', + 'source' => 'https://github.com/theboldagency/elliston/archive/master.zip', + 'required' => true, ),{% endif %} ); diff --git a/njk/assets/style.css b/njk/assets/style.css index ac3a7e6..1219560 100644 --- a/njk/assets/style.css +++ b/njk/assets/style.css @@ -3,6 +3,7 @@ Theme Name: {{globals.theme_name}} Theme URI: {{globals.theme_uri}} Description: {{globals.theme_description}} Version: {{globals.theme_version}} +License: {{globals.theme_license}}, Author: {{globals.theme_author}} Author URI: {{globals.theme_author_uri}} Tags: {{globals.theme_tags}} diff --git a/njk/templates/_globals-defaults.html b/njk/templates/_globals-defaults.html index 8d98648..c63cf99 100644 --- a/njk/templates/_globals-defaults.html +++ b/njk/templates/_globals-defaults.html @@ -10,8 +10,8 @@ {% set theme_name = "Method" %} {% set theme_uri = "https://github.com/pixelwatt/method" %} {% set theme_description = "A barebones foundation for custom theme development." %} -{% set theme_version = "1.3.5" %} -{% set theme_license = "LGPL" %} +{% set theme_version = "1.3.6" %} +{% set theme_license = "GNU General Public License v2 or later" %} {% set theme_author = "Rob Clark" %} {% set theme_author_uri = "https://robclark.io/" %} {% set theme_tags = "CMB2, Bootstrap 5" %} @@ -41,7 +41,7 @@ {# ---------------------------------------------------------------- #} {% set image_sizes = [ - { name: "header_bg", width: 1400, height: 600, cropped: true } + { name: "method_1400_600", width: 1400, height: 600, cropped: true } ] %} @@ -54,6 +54,8 @@ {% set require_github_updater = false %} {% set require_cmb2_roadway_segments = false %} {% set require_cmb2_mapbox = false %} +{% set require_method_alerts = false %} +{% set require_elliston = false %} {# ---------------------------------------------------------------- #}