generator-chisel 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/404.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/archive.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/author.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/composer.json +7 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/footer.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/functions.php +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Controllers/AjaxController.php +20 -15
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Enums/AcfOptionsPageType.php +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Enums/BlocksType.php +17 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factories/RegisterAcfOptionsPage.php +78 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Factory → Factories}/RegisterBlocks.php +41 -30
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Factory → Factories}/RegisterCustomPostType.php +44 -32
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Factory → Factories}/RegisterCustomTaxonomy.php +39 -27
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/AcfHelpers.php +12 -12
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helpers/AjaxHelpers.php +36 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/AssetsHelpers.php +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/BlocksHelpers.php +22 -18
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helpers/CacheHelpers.php +43 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/CommentsHelpers.php +8 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/DataHelpers.php +5 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/GravityFormsHelpers.php +13 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/ImageHelpers.php +30 -15
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/ThemeHelpers.php +29 -25
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/WoocommerceHelpers.php +15 -9
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Helper → Helpers}/YoastHelpers.php +6 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Interfaces/HooksInterface.php +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Interfaces/InstanceInterface.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Plugin → Plugins}/GravityForms.php +13 -15
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Plugin → Plugins}/Woocommerce.php +14 -14
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/{Plugin → Plugins}/Yoast.php +6 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Traits/PageBlocks.php +14 -14
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Traits/Singleton.php +28 -7
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Acf.php +16 -15
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/AcfBlocks.php +19 -19
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/{AjaxEnpoints.php → AjaxEndpoints.php} +13 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Assets.php +42 -68
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Blocks.php +23 -23
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Cache.php +10 -11
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselImage.php +3 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselPost.php +13 -7
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselProduct.php +11 -10
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselProductCategory.php +10 -10
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Comments.php +27 -35
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Components.php +44 -61
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/CustomPostTypes.php +12 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/CustomTaxonomies.php +12 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Sidebars.php +6 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Site.php +7 -8
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Theme.php +22 -22
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Twig.php +53 -48
- package/lib/commands/create/creators/app/chisel-starter-theme/index.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/page.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/search.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/single.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/blocks-styles.js +3 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/vendor/_breadcrumbs.scss +6 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/style.chisel-tpl.css +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/woocommerce.php +3 -3
- package/lib/commands/create/packages-versions.js +1 -1
- package/package.json +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factory/RegisterAcfOptionsPage.php +0 -62
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/AjaxHelpers.php +0 -33
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/CacheHelpers.php +0 -41
package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/vendor/_breadcrumbs.scss
CHANGED
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
.c-breadcrumbs {
|
|
5
5
|
position: relative;
|
|
6
|
-
|
|
7
|
-
margin-inline: auto;
|
|
6
|
+
margin: get-margin('small') 0;
|
|
8
7
|
font-size: get-font-size('small');
|
|
9
8
|
|
|
10
9
|
span {
|
|
11
10
|
span {
|
|
12
11
|
display: inline-block;
|
|
13
|
-
margin-inline:
|
|
12
|
+
margin-inline: get-margin('tiny');
|
|
13
|
+
|
|
14
|
+
&:first-child {
|
|
15
|
+
margin-inline-start: 0;
|
|
16
|
+
}
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Theme URI: https://www.getchisel.co/
|
|
4
4
|
* Author: <%= app.author %>
|
|
5
5
|
* Description: Chisel Wordpress Starter Theme based on Timber library.
|
|
6
|
-
* Version: 2.
|
|
6
|
+
* Version: 2.2.0
|
|
7
7
|
* License: GNU General Public License v2 or later
|
|
8
8
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
9
9
|
* Tags: chisel, custom, starter, theme, WordPress
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
use Timber\Timber;
|
|
9
|
-
use Chisel\
|
|
10
|
-
use Chisel\
|
|
9
|
+
use Chisel\Helpers\CacheHelpers;
|
|
10
|
+
use Chisel\Helpers\WoocommerceHelpers;
|
|
11
11
|
|
|
12
12
|
$context = Timber::context();
|
|
13
13
|
|
|
@@ -52,7 +52,7 @@ if ( is_singular( 'product' ) ) {
|
|
|
52
52
|
$loop_columns = wc_get_loop_prop( 'columns' );
|
|
53
53
|
$loop_rows = wc_get_default_product_rows_per_page();
|
|
54
54
|
|
|
55
|
-
$grid_classnames = WoocommerceHelpers::get_products_grid_classnames(
|
|
55
|
+
$grid_classnames = WoocommerceHelpers::get_products_grid_classnames( true, $has_sidebar );
|
|
56
56
|
|
|
57
57
|
$context['show_products'] = $show_products;
|
|
58
58
|
$context['items'] = $items;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-chisel",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A generator for scaffolding front-end and WordPress projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"chisel": "bin/chisel.js"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"tinyqueue": "^2.0.3",
|
|
38
38
|
"update-notifier": "^4.1.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "a6ea9900a1267c1c80c36a12355890c70205cade"
|
|
41
41
|
}
|
package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factory/RegisterAcfOptionsPage.php
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
namespace Chisel\Factory;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Custom post types wrapper class.
|
|
7
|
-
*
|
|
8
|
-
* @package Chisel
|
|
9
|
-
*/
|
|
10
|
-
class RegisterAcfOptionsPage {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Page arguments.
|
|
14
|
-
*
|
|
15
|
-
* @var array
|
|
16
|
-
*/
|
|
17
|
-
private $args;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Page type - page or subpage.
|
|
21
|
-
*
|
|
22
|
-
* @var array
|
|
23
|
-
*/
|
|
24
|
-
private $type;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Class constructor.
|
|
28
|
-
*
|
|
29
|
-
* @param array $args page arguments.
|
|
30
|
-
* @param string $type page or subpage.
|
|
31
|
-
*/
|
|
32
|
-
public function __construct( $args, $type = 'page' ) {
|
|
33
|
-
$this->args = $args;
|
|
34
|
-
$this->type = $type;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Register ACF options page.
|
|
39
|
-
*/
|
|
40
|
-
public function register() {
|
|
41
|
-
$options_page_args = array(
|
|
42
|
-
'page_title' => $this->args['page_title'],
|
|
43
|
-
'menu_title' => isset( $this->args['menu_title'] ) ? $this->args['menu_title'] : $this->args['page_title'],
|
|
44
|
-
'menu_slug' => $this->args['menu_slug'],
|
|
45
|
-
'capability' => isset( $this->args['capability'] ) ? $this->args['capability'] : 'edit_posts',
|
|
46
|
-
'position' => isset( $this->args['position'] ) ? $this->args['position'] : 45,
|
|
47
|
-
'redirect' => isset( $this->args['redirect'] ) ? $this->args['redirect'] : true,
|
|
48
|
-
'icon_url' => isset( $this->args['icon_url'] ) ? $this->args['icon_url'] : 'dashicons-screenoptions',
|
|
49
|
-
'post_id' => isset( $this->args['post_id'] ) ? $this->args['post_id'] : 'options',
|
|
50
|
-
'autoload' => isset( $this->args['autoload'] ) ? $this->args['autoload'] : false,
|
|
51
|
-
'update_button' => isset( $this->args['update_button'] ) ? $this->args['update_button'] : __( 'Update', 'chisel' ),
|
|
52
|
-
'updated_message' => isset( $this->args['updated_message'] ) ? $this->args['updated_message'] : __( 'Options Updated', 'chisel' ),
|
|
53
|
-
'parent_slug' => isset( $this->args['parent_slug'] ) ? $this->args['parent_slug'] : '',
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
if ( $this->type === 'subpage' ) {
|
|
57
|
-
acf_add_options_sub_page( $options_page_args );
|
|
58
|
-
} else {
|
|
59
|
-
acf_add_options_page( $options_page_args );
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
namespace Chisel\Helper;
|
|
4
|
-
|
|
5
|
-
use Chisel\Controllers\AjaxController;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Helper functions.
|
|
9
|
-
*
|
|
10
|
-
* @package Chisel
|
|
11
|
-
*/
|
|
12
|
-
class AjaxHelpers {
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get custom ajax endpint
|
|
16
|
-
*
|
|
17
|
-
* @return string
|
|
18
|
-
*/
|
|
19
|
-
public static function get_ajax_endpoint_url() {
|
|
20
|
-
return sprintf( '%s/wp-json/%s/%s', esc_url( get_bloginfo( 'url' ) ), AjaxController::ROUTE_NAMESPACE, AjaxController::ROUTE_BASE );
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Decode json string from ajax request
|
|
25
|
-
*
|
|
26
|
-
* @param string $value
|
|
27
|
-
*
|
|
28
|
-
* @return array
|
|
29
|
-
*/
|
|
30
|
-
public static function ajax_json_decode( $value ) {
|
|
31
|
-
return (array) json_decode( stripslashes( $value ) );
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
|
|
3
|
-
namespace Chisel\Helper;
|
|
4
|
-
|
|
5
|
-
use Timber\Timber;
|
|
6
|
-
use Timber\Loader;
|
|
7
|
-
|
|
8
|
-
use Chisel\WP\Cache;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Image Helper functions.
|
|
12
|
-
*
|
|
13
|
-
* @package Chisel
|
|
14
|
-
*/
|
|
15
|
-
class CacheHelpers {
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get the cache expiry time.
|
|
19
|
-
*
|
|
20
|
-
* @param int $custom_expiry The custom expiry time.
|
|
21
|
-
*
|
|
22
|
-
* @return int
|
|
23
|
-
*/
|
|
24
|
-
public static function expiry( $custom_expiry = null ) {
|
|
25
|
-
if ( ! Cache::get_instance()->cache_everything ) {
|
|
26
|
-
return 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return $custom_expiry ? $custom_expiry : Cache::get_instance()->cache_expiry;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Clear twig environment cache.
|
|
34
|
-
*
|
|
35
|
-
* @return void
|
|
36
|
-
*/
|
|
37
|
-
public static function clear_environment_cache() {
|
|
38
|
-
$loader = new Loader();
|
|
39
|
-
$loader->clear_cache_twig();
|
|
40
|
-
}
|
|
41
|
-
}
|