generator-chisel 1.0.0 → 2.0.0-alpha.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 +25 -0
- package/README.md +2 -4
- package/bin/chisel.js +2 -22
- package/lib/commands/create/creators/app/{template → chisel-starter-theme}/.editorconfig +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/.eslintrc.cjs +36 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.nvmrc +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.stylelintignore +2 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.twig-cs-fixer.php +13 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/404.php +16 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/README.md +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_6665890751dc3.json +63 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_666eb7f38d2ed.json +59 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_66d5a4ebb41cd.json +148 -0
- package/lib/commands/create/creators/{wp/chisel-starter-theme/archive.chisel-tpl.php → app/chisel-starter-theme/archive.php} +16 -15
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/quicksand-700.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/quicksand-regular.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons/minus.svg +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons/plus.svg +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/author.php +18 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Acf.php +187 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/AcfBlocks.php +190 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/AcfSync.php +230 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Ajax.php +161 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/AjaxEnpoints.php +102 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Assets.php +480 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Blocks.php +238 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/ChiselCache.php +85 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Components.php +191 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/CustomPostTypes.php +442 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/ExtendedImage.php +24 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/ExtendedPost.php +63 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/ExtendedProduct.php +41 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/ExtendedTerm.php +13 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Helpers.php +97 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/RegisterBlocks.php +273 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Sidebars.php +107 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Site.php +123 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Theme.php +249 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Twig.php +241 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Woocommerce.php +125 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/interfaces/Instance.php +31 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/composer.json +18 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/composer.lock +2180 -0
- package/lib/commands/create/creators/{wp → app}/chisel-starter-theme/footer.php +11 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/functions.php +47 -0
- package/lib/commands/create/creators/{wp → app}/chisel-starter-theme/header.php +3 -1
- package/lib/commands/create/creators/{wp/chisel-starter-theme/index.chisel-tpl.php → app/chisel-starter-theme/index.php} +15 -8
- package/lib/commands/create/creators/app/chisel-starter-theme/languages/.gitkeep +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/lint-staged.config.mjs +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/package.chisel-tpl.json +57 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/page.php +25 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/patterns/cta.php +19 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/phpcs.xml +63 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/prettier.config.mjs +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/screenshot.jpg +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/search.php +15 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/single.php +19 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/accordion-item.js +79 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/block.json +36 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/edit.js +80 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/editor.scss +24 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/index.js +44 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/save.js +40 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/style.scss +81 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/view.js +146 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/acf-json/group_66462c70b851f.json +133 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/block.json +28 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/script.js +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/slider.twig +26 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/style.scss +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/_index.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/settings/_index.scss +27 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_breakpoints.scss +70 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_buttons.scss +33 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_icon.scss +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_index.scss +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_media.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_px-to-rem.scss +21 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_screen-readers.scss +30 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_theme.scss +57 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_width.scss +12 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/acf-sync.js +26 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/admin/acf.js +27 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/admin.js +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/app.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/blog.js +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/blocks-attributes.js +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/blocks-styles.js +82 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/blocks.js +55 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/components/BlockEditSelector.js +39 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/components/RenderAppender.js +32 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor.js +2 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/load-more.js +93 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/main-nav.js +97 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/slider.js +385 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/utils.js +43 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/acf-sync.scss +60 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/admin.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-button.scss +26 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-search.scss +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-spacer.scss +27 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_badge.scss +23 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_buttons.scss +23 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_content.scss +38 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_footer.scss +18 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_header.scss +32 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_icon.scss +19 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_load-more.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_main-nav-toggle.scss +804 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_main-nav.scss +305 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_pagination.scss +29 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_post-card.scss +12 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_post.scss +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_posts-items.scss +76 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_sidebar.scss +16 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_slider.scss +122 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/editor.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_form.scss +331 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_html.scss +16 -0
- package/lib/commands/create/creators/app/{template → chisel-starter-theme}/src/styles/elements/_images.scss +2 -12
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_link.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_shared.scss +24 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_table.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/generic/_reset.scss +84 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/main.scss +9 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_block.scss +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_grid.scss +30 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_layout.scss +62 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_wrapper.scss +18 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/utilities/_sr.scss +9 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/vendor/.gitkeep +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/widgets/_nav-menu.scss +20 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/widgets/_widget.scss +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_archive.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_btn.scss +29 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_general.scss +38 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_notices.scss +47 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_product-item.scss +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woocommerce.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_block-edit-selector.scss +47 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_block-sidebar.scss +14 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_core-button.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_core-spacer.scss +14 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_render-appender.scss +33 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_swiper-sliders.scss +12 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/style.chisel-tpl.css +12 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/stylelint.config.mjs +27 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/theme.json +480 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/twig_cs.php +14 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/404.twig +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/archive.twig +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/author.twig +11 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/base.twig +43 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/footer.twig +9 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/header.twig +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/main-nav-item.twig +21 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/main-nav.twig +27 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/page-title.twig +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/pagination.twig +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/post-item.twig +26 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/search-form.twig +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/slider.twig +12 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/index.twig +36 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/page-copy.twig +390 -0
- package/lib/commands/create/creators/{wp/chisel-starter-theme/templates → app/chisel-starter-theme/views}/page-plugin.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/page-with-icons.twig +470 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/page.twig +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/partials/logo.twig +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/partials/pagination.twig +70 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/search.twig +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/sidebar-blog.twig +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/single-password.twig +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/single.twig +30 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/archive-product.twig +81 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/content-product.twig +51 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/linked-products.twig +15 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/single-product.twig +75 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/webpack.config.js +6 -0
- package/lib/commands/create/creators/app/index.js +28 -75
- package/lib/commands/create/creators/app/template/.gitignore.chisel-tpl +2 -2
- package/lib/commands/create/creators/init.js +2 -4
- package/lib/commands/create/creators/wp/index.js +28 -42
- package/lib/commands/create/creators/wp-plugins/index.js +1 -1
- package/lib/commands/create/packages-versions.js +3 -9
- package/lib/commands/create/priorities.js +0 -3
- package/lib/utils/sort-package.js +3 -9
- package/package.json +3 -9
- package/lib/commands/create/creators/app/template/.browserslistrc.chisel-tpl +0 -19
- package/lib/commands/create/creators/app/template/.eslintignore +0 -4
- package/lib/commands/create/creators/app/template/.eslintrc.js +0 -25
- package/lib/commands/create/creators/app/template/.prettierignore +0 -4
- package/lib/commands/create/creators/app/template/.stylelintignore +0 -3
- package/lib/commands/create/creators/app/template/babel.config.js +0 -16
- package/lib/commands/create/creators/app/template/chisel.config.chisel-tpl.js +0 -48
- package/lib/commands/create/creators/app/template/package.chisel-tpl.json +0 -43
- package/lib/commands/create/creators/app/template/postcss.config.js +0 -8
- package/lib/commands/create/creators/app/template/prettier.config.js +0 -4
- package/lib/commands/create/creators/app/template/src/scripts/app.chisel-tpl.js +0 -8
- package/lib/commands/create/creators/app/template/src/scripts/modules/greeting.chisel-tpl.js +0 -17
- package/lib/commands/create/creators/app/template/src/styles/components/_btn.scss +0 -60
- package/lib/commands/create/creators/app/template/src/styles/components/_footer.scss +0 -10
- package/lib/commands/create/creators/app/template/src/styles/components/_header.scss +0 -9
- package/lib/commands/create/creators/app/template/src/styles/elements/_blockquote.scss +0 -20
- package/lib/commands/create/creators/app/template/src/styles/elements/_headings.scss +0 -33
- package/lib/commands/create/creators/app/template/src/styles/elements/_html.scss +0 -40
- package/lib/commands/create/creators/app/template/src/styles/elements/_links.scss +0 -12
- package/lib/commands/create/creators/app/template/src/styles/elements/_lists.scss +0 -23
- package/lib/commands/create/creators/app/template/src/styles/elements/_tables.scss +0 -11
- package/lib/commands/create/creators/app/template/src/styles/generic/_box-sizing.scss +0 -20
- package/lib/commands/create/creators/app/template/src/styles/generic/_font-face.scss +0 -8
- package/lib/commands/create/creators/app/template/src/styles/generic/_normalize.scss +0 -5
- package/lib/commands/create/creators/app/template/src/styles/generic/_reset.scss +0 -51
- package/lib/commands/create/creators/app/template/src/styles/generic/_shared.scss +0 -32
- package/lib/commands/create/creators/app/template/src/styles/main.chisel-tpl.scss +0 -13
- package/lib/commands/create/creators/app/template/src/styles/objects/_layout.scss +0 -49
- package/lib/commands/create/creators/app/template/src/styles/objects/_list-bare.scss +0 -13
- package/lib/commands/create/creators/app/template/src/styles/objects/_list-inline.scss +0 -16
- package/lib/commands/create/creators/app/template/src/styles/objects/_media.scss +0 -53
- package/lib/commands/create/creators/app/template/src/styles/objects/_table.scss +0 -26
- package/lib/commands/create/creators/app/template/src/styles/objects/_wrapper.scss +0 -14
- package/lib/commands/create/creators/app/template/src/styles/settings/_global.scss +0 -50
- package/lib/commands/create/creators/app/template/src/styles/tools/_breakpoints.scss +0 -67
- package/lib/commands/create/creators/app/template/src/styles/tools/_clearfix.scss +0 -18
- package/lib/commands/create/creators/app/template/src/styles/tools/_hidden.scss +0 -17
- package/lib/commands/create/creators/app/template/src/styles/utilities/_align.scss +0 -27
- package/lib/commands/create/creators/app/template/src/styles/utilities/_clearfix.scss +0 -11
- package/lib/commands/create/creators/app/template/src/styles/utilities/_hide.scss +0 -28
- package/lib/commands/create/creators/app/template/src/templates/components/footer.chisel-tpl.twig +0 -3
- package/lib/commands/create/creators/app/template/src/templates/components/header.chisel-tpl.twig +0 -3
- package/lib/commands/create/creators/app/template/src/templates/layouts/base.chisel-tpl.twig +0 -42
- package/lib/commands/create/creators/app/template/src/templates/layouts/page.twig +0 -8
- package/lib/commands/create/creators/app/template/stylelint.config.js +0 -3
- package/lib/commands/create/creators/fe/index-styles.css +0 -147
- package/lib/commands/create/creators/fe/index.js +0 -51
- package/lib/commands/create/creators/fe/template/.htmlhintrc +0 -3
- package/lib/commands/create/creators/fe/template-index/index.chisel-tpl.html +0 -77
- package/lib/commands/create/creators/fe/template-index/index.chisel-tpl.html.rej +0 -13
- package/lib/commands/create/creators/wp/chisel-starter-theme/.gitignore.chisel-tpl +0 -1
- package/lib/commands/create/creators/wp/chisel-starter-theme/404.chisel-tpl.php +0 -9
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Extensions/ChiselExtension.php +0 -14
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Extensions/ChiselTwig.php +0 -234
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Extensions/DataType.php +0 -27
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Extensions/Theme.php +0 -21
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Extensions/Twig.php +0 -137
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Helpers.php +0 -29
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Image.php +0 -29
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Media.php +0 -79
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Performance.php +0 -59
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Post.php +0 -82
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Security.php +0 -30
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Settings.php +0 -38
- package/lib/commands/create/creators/wp/chisel-starter-theme/Chisel/Site.php +0 -50
- package/lib/commands/create/creators/wp/chisel-starter-theme/README.chisel-tpl.md +0 -5
- package/lib/commands/create/creators/wp/chisel-starter-theme/author.chisel-tpl.php +0 -16
- package/lib/commands/create/creators/wp/chisel-starter-theme/functions.php +0 -31
- package/lib/commands/create/creators/wp/chisel-starter-theme/page.chisel-tpl.php +0 -23
- package/lib/commands/create/creators/wp/chisel-starter-theme/screenshot.png +0 -0
- package/lib/commands/create/creators/wp/chisel-starter-theme/search.chisel-tpl.php +0 -14
- package/lib/commands/create/creators/wp/chisel-starter-theme/single.chisel-tpl.php +0 -18
- package/lib/commands/create/creators/wp/chisel-starter-theme/style.chisel-tpl.css +0 -5
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/404.twig +0 -5
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/author.twig +0 -7
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/components/comment.twig +0 -7
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/components/main-nav.twig +0 -20
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/components/tease-post.twig +0 -9
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/components/tease.twig +0 -9
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/index.twig +0 -7
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/page.twig +0 -10
- package/lib/commands/create/creators/wp/chisel-starter-theme/templates/single.twig +0 -31
- package/lib/commands/create/creators/wp/template/src/styles/components/_comment-form.scss +0 -21
- package/lib/commands/create/creators/wp/template/src/styles/components/_comment.scss +0 -17
- package/lib/commands/create/creators/wp/template/src/styles/components/_main-nav.scss +0 -54
- package/lib/commands/create/creators/wp/template/src/styles/components/_post.scss +0 -36
- package/lib/commands/create/creators/wp/template/wp/.gitignore.chisel-tpl +0 -2
- package/lib/commands/create/creators/wp/template/wp-cli.yml +0 -1
- /package/lib/commands/create/creators/app/{template/src → chisel-starter-theme}/assets/fonts/.keep +0 -0
- /package/lib/commands/create/creators/app/{template/src → chisel-starter-theme}/assets/images/.keep +0 -0
- /package/lib/commands/create/creators/app/{template/src/styles/vendor/.keep → chisel-starter-theme/classes/Comments.php} +0 -0
- /package/lib/commands/create/creators/{fe/template/public/.keep → app/chisel-starter-theme/classes/Yoast.php} +0 -0
- /package/lib/commands/create/creators/app/{template → chisel-starter-theme}/src/styles/elements/_hr.scss +0 -0
- /package/lib/commands/create/creators/{wp/template/wp → app/template}/.htaccess +0 -0
- /package/lib/commands/create/creators/{wp/template/wp → app/template}/wp-config.php +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Chisel;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Class to register custom blocks.
|
|
7
|
+
*
|
|
8
|
+
* @package Chisel
|
|
9
|
+
*/
|
|
10
|
+
abstract class RegisterBlocks {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Blocks type.
|
|
14
|
+
*
|
|
15
|
+
* @var string
|
|
16
|
+
*/
|
|
17
|
+
protected $blocks_type;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Blocks path.
|
|
21
|
+
*
|
|
22
|
+
* @var string
|
|
23
|
+
*/
|
|
24
|
+
protected $blocks_folder;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Blocks src path.
|
|
28
|
+
*
|
|
29
|
+
* @var string
|
|
30
|
+
*/
|
|
31
|
+
protected $blocks_path_src;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Blocks path.
|
|
35
|
+
*
|
|
36
|
+
* @var string
|
|
37
|
+
*/
|
|
38
|
+
protected $blocks_path;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Blocks url.
|
|
42
|
+
*
|
|
43
|
+
* @var string
|
|
44
|
+
*/
|
|
45
|
+
protected $blocks_url;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Blocks.
|
|
49
|
+
*
|
|
50
|
+
* @var array
|
|
51
|
+
*/
|
|
52
|
+
protected $blocks = array();
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Blocks option name.
|
|
56
|
+
*
|
|
57
|
+
* @var string
|
|
58
|
+
*/
|
|
59
|
+
protected $blocks_option_name;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Blocks version option name.
|
|
63
|
+
*
|
|
64
|
+
* @var string
|
|
65
|
+
*/
|
|
66
|
+
protected $blocks_version_option_name;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Theme.
|
|
70
|
+
*
|
|
71
|
+
* @var mixed
|
|
72
|
+
*/
|
|
73
|
+
protected $theme = null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Build folder.
|
|
77
|
+
*
|
|
78
|
+
* @var string
|
|
79
|
+
*/
|
|
80
|
+
protected $build_folder = 'build';
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Src folder.
|
|
84
|
+
*
|
|
85
|
+
* @var string
|
|
86
|
+
*/
|
|
87
|
+
protected $src_folder = 'src';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Register scripts. By default block styles are inlined and js is registered by wp. Setting this to true will use custom hndles to register and enqueue scripts and styles and styles will not be inlined.
|
|
91
|
+
*
|
|
92
|
+
* @var bool
|
|
93
|
+
*/
|
|
94
|
+
protected $register_scripts;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Class constructor.
|
|
98
|
+
*
|
|
99
|
+
* @param string $blocks_type The blocks type : acf or wp.
|
|
100
|
+
*/
|
|
101
|
+
public function __construct( $blocks_type ) {
|
|
102
|
+
$this->blocks_type = $blocks_type;
|
|
103
|
+
$this->theme = wp_get_theme();
|
|
104
|
+
$this->blocks_folder = $this->blocks_type === 'acf' ? 'blocks-acf' : 'blocks';
|
|
105
|
+
$this->blocks_path = get_template_directory() . '/' . $this->build_folder . '/' . $this->blocks_folder;
|
|
106
|
+
$this->blocks_path_src = get_template_directory() . '/' . $this->src_folder . '/' . $this->blocks_folder;
|
|
107
|
+
$this->blocks_url = get_template_directory_uri() . '/' . $this->build_folder . '/' . $this->blocks_folder;
|
|
108
|
+
$this->blocks = $this->get_blocks();
|
|
109
|
+
$this->blocks_option_name = 'chisel_' . $this->blocks_type;
|
|
110
|
+
$this->blocks_version_option_name = 'chisel_' . $this->blocks_type . '_version';
|
|
111
|
+
|
|
112
|
+
$this->register_scripts = apply_filters( 'chisel_blocks_register_scripts', true, $this->blocks_type );
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Register custom blocks and their assets.
|
|
117
|
+
*/
|
|
118
|
+
public function register_custom_blocks() {
|
|
119
|
+
if ( ! function_exists( 'register_block_type' ) ) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if ( ! is_array( $this->blocks ) || ! $this->blocks ) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
$block_scripts = array(
|
|
128
|
+
'editorScript',
|
|
129
|
+
'editorStyle',
|
|
130
|
+
'style',
|
|
131
|
+
'script',
|
|
132
|
+
'viewScript',
|
|
133
|
+
'viewStyle',
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
foreach ( $this->blocks as $block ) {
|
|
137
|
+
$block_path = $this->blocks_path . '/' . $block . '/';
|
|
138
|
+
$block_json = $block_path . 'block.json';
|
|
139
|
+
|
|
140
|
+
if ( ! is_file( $block_json ) ) {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if ( $this->register_scripts ) {
|
|
145
|
+
$block_url = $this->blocks_url . '/' . $block . '/';
|
|
146
|
+
|
|
147
|
+
// Read json file to array.
|
|
148
|
+
$block_metadata = wp_json_file_decode( $block_json, array( 'associative' => true ) );
|
|
149
|
+
|
|
150
|
+
foreach ( $block_scripts as $script ) {
|
|
151
|
+
if ( ! isset( $block_metadata[$script] ) ) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
$block_files = is_array( $block_metadata[$script] ) ? $block_metadata[$script] : array( $block_metadata[$script] );
|
|
156
|
+
|
|
157
|
+
if ( ! $block_files ) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
$script_handle = strtolower( $script );
|
|
162
|
+
$block_handle = 'block-' . $this->blocks_type . '-' . $block . '-' . $script_handle;
|
|
163
|
+
|
|
164
|
+
foreach ( $block_files as $block_file ) {
|
|
165
|
+
if ( isset( $block_file ) && strpos( $block_file, 'file:' ) !== false ) {
|
|
166
|
+
$file_name = str_replace( 'file:./', '', $block_file );
|
|
167
|
+
$is_style = strpos( $script_handle, 'style' ) !== false;
|
|
168
|
+
$load_css_only = isset( $block_metadata['loadCssOnly'] ) ? absint( $block_metadata['loadCssOnly'] ) : 0;
|
|
169
|
+
|
|
170
|
+
// Set the asset handle.
|
|
171
|
+
$block_metadata[$script] = $block_handle;
|
|
172
|
+
|
|
173
|
+
$file_path = $block_path . $file_name;
|
|
174
|
+
$file_url = $block_url . $file_name;
|
|
175
|
+
$script_asset = $this->get_block_script_asset( $block, $file_name );
|
|
176
|
+
|
|
177
|
+
if ( is_file( $file_path ) && $is_style ) {
|
|
178
|
+
wp_register_style( $block_handle, $file_url, array(), $script_asset['version'] );
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if ( is_file( $file_path ) && ! $is_style ) {
|
|
182
|
+
$register_script_args = apply_filters(
|
|
183
|
+
'chisel_block_register_script_args',
|
|
184
|
+
array(
|
|
185
|
+
'strategy' => 'defer',
|
|
186
|
+
'in_footer' => true,
|
|
187
|
+
),
|
|
188
|
+
$block_handle
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
if ( ! $load_css_only ) {
|
|
192
|
+
wp_register_script(
|
|
193
|
+
$block_handle,
|
|
194
|
+
$file_url,
|
|
195
|
+
$script_asset['dependencies'],
|
|
196
|
+
$script_asset['version'],
|
|
197
|
+
$register_script_args,
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if ( $this->register_scripts ) {
|
|
207
|
+
register_block_type( $block_path, $block_metadata );
|
|
208
|
+
} else {
|
|
209
|
+
register_block_type( $block_json );
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// In case we need to do some custom logic. All variables from this method are available in the init file.
|
|
213
|
+
if ( file_exists( $block_path . 'init.php' ) ) {
|
|
214
|
+
include_once $block_path . 'init.php';
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Get the list of all acf blocks.
|
|
221
|
+
*
|
|
222
|
+
* @return array
|
|
223
|
+
*/
|
|
224
|
+
protected function get_blocks() {
|
|
225
|
+
$blocks = get_option( $this->blocks_option_name, array() );
|
|
226
|
+
$blocks_version = get_option( $this->blocks_version_option_name, 0 );
|
|
227
|
+
|
|
228
|
+
if ( ! $blocks || version_compare( $this->theme->get( 'Version' ), $blocks_version ) ) {
|
|
229
|
+
$blocks_list = is_dir( $this->blocks_path ) ? new \DirectoryIterator( $this->blocks_path ) : array();
|
|
230
|
+
|
|
231
|
+
if ( $blocks_list ) {
|
|
232
|
+
foreach ( $blocks_list as $item ) {
|
|
233
|
+
if ( $item->isDot() || ! $item->isDir() ) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
$blocks[] = $item->getFilename();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if ( ! Assets::is_fast_refresh() ) {
|
|
242
|
+
update_option( $this->blocks_option_name, $blocks );
|
|
243
|
+
update_option( $this->blocks_version_option_name, $this->theme->get( 'Version' ) );
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return $blocks;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Get script asset.
|
|
252
|
+
*
|
|
253
|
+
* @param string $block The block name.
|
|
254
|
+
* @param string $file_name The file name.
|
|
255
|
+
*
|
|
256
|
+
* @return array
|
|
257
|
+
*/
|
|
258
|
+
protected function get_block_script_asset( $block, $file_name ) {
|
|
259
|
+
$block_path = $this->blocks_path . '/' . $block . '/';
|
|
260
|
+
$assets_file_name = preg_replace( '/\.[^.]+$/', '', $file_name ) . '.asset.php';
|
|
261
|
+
$script_asset_path = $block_path . $assets_file_name;
|
|
262
|
+
$script_asset = array(
|
|
263
|
+
'dependencies' => array(),
|
|
264
|
+
'version' => $this->theme->get( 'Version' ),
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
if ( is_file( $script_asset_path ) ) {
|
|
268
|
+
$script_asset = include $script_asset_path;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return $script_asset;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Chisel;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WordPress Sidebars setup related functionality.
|
|
7
|
+
*
|
|
8
|
+
* @package Chisel
|
|
9
|
+
*/
|
|
10
|
+
class Sidebars implements Instance {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sidebars to register.
|
|
14
|
+
*
|
|
15
|
+
* @var array
|
|
16
|
+
*/
|
|
17
|
+
protected $sidebars = array();
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Class constructor.
|
|
21
|
+
*/
|
|
22
|
+
private function __construct() {
|
|
23
|
+
$this->set_properties();
|
|
24
|
+
$this->action_hooks();
|
|
25
|
+
$this->filter_hooks();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Set properties.
|
|
30
|
+
*/
|
|
31
|
+
public function set_properties() {
|
|
32
|
+
$this->sidebars = apply_filters(
|
|
33
|
+
'chisel_sidebars',
|
|
34
|
+
array(
|
|
35
|
+
'blog' => array(
|
|
36
|
+
'name' => __( 'Blog Sidebar', 'chisel' ),
|
|
37
|
+
'description' => __( 'Sidebar for blog pages', 'chisel' ),
|
|
38
|
+
),
|
|
39
|
+
'footer-1' => array(
|
|
40
|
+
'name' => __( 'Footer Column 1', 'chisel' ),
|
|
41
|
+
'description' => __( 'First column in the footer', 'chisel' ),
|
|
42
|
+
),
|
|
43
|
+
'footer-2' => array(
|
|
44
|
+
'name' => __( 'Footer Column 2', 'chisel' ),
|
|
45
|
+
'description' => __( 'Second column in the footer', 'chisel' ),
|
|
46
|
+
),
|
|
47
|
+
'footer-3' => array(
|
|
48
|
+
'name' => __( 'Footer Column 3', 'chisel' ),
|
|
49
|
+
'description' => __( 'Third column in the footer', 'chisel' ),
|
|
50
|
+
),
|
|
51
|
+
'footer-4' => array(
|
|
52
|
+
'name' => __( 'Footer Column 4', 'chisel' ),
|
|
53
|
+
'description' => __( 'Fourth column in the footer', 'chisel' ),
|
|
54
|
+
),
|
|
55
|
+
'copyright' => array(
|
|
56
|
+
'name' => __( 'Copyright', 'chisel' ),
|
|
57
|
+
'description' => __( 'Footer copyright', 'chisel' ),
|
|
58
|
+
),
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Register action hooks.
|
|
65
|
+
*/
|
|
66
|
+
public function action_hooks() {
|
|
67
|
+
add_action( 'widgets_init', array( $this, 'register_sidebars' ) );
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Register filter hooks.
|
|
72
|
+
*/
|
|
73
|
+
public function filter_hooks() {
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Register sidebars.
|
|
78
|
+
*/
|
|
79
|
+
public function register_sidebars() {
|
|
80
|
+
foreach ( $this->sidebars as $id => $data ) {
|
|
81
|
+
register_sidebar(
|
|
82
|
+
array(
|
|
83
|
+
'name' => $data['name'],
|
|
84
|
+
'id' => 'chisel-sidebar-' . $id,
|
|
85
|
+
'description' => $data['description'],
|
|
86
|
+
'before_widget' => '<section id="%1$s" class="c-widget %2$s">',
|
|
87
|
+
'after_widget' => '</section>',
|
|
88
|
+
'before_title' => '<h3 class="c-widget__title">',
|
|
89
|
+
'after_title' => '</h3>',
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get the instance of the class.
|
|
97
|
+
*/
|
|
98
|
+
public static function get_instance() {
|
|
99
|
+
static $instance = null;
|
|
100
|
+
|
|
101
|
+
if ( null === $instance ) {
|
|
102
|
+
$instance = new self();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return $instance;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Chisel;
|
|
4
|
+
|
|
5
|
+
use Automattic\WooCommerce\Internal\Admin\ProductForm\Component;
|
|
6
|
+
use Timber\Timber;
|
|
7
|
+
use Timber\Site as TimberSite;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Site related functionality related to timber.
|
|
11
|
+
*
|
|
12
|
+
* @package Chisel
|
|
13
|
+
*/
|
|
14
|
+
class Site extends TimberSite implements Instance {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Class constructor.
|
|
18
|
+
*/
|
|
19
|
+
private function __construct() {
|
|
20
|
+
$this->set_properties();
|
|
21
|
+
$this->action_hooks();
|
|
22
|
+
$this->filter_hooks();
|
|
23
|
+
|
|
24
|
+
parent::__construct();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set properties.
|
|
29
|
+
*/
|
|
30
|
+
public function set_properties() {}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Register action hooks.
|
|
34
|
+
*/
|
|
35
|
+
public function action_hooks() {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Register filter hooks.
|
|
40
|
+
*/
|
|
41
|
+
public function filter_hooks() {
|
|
42
|
+
add_filter( 'timber/context', array( $this, 'add_to_context' ) );
|
|
43
|
+
add_filter( 'timber/context', array( $this, 'set_page_title' ) );
|
|
44
|
+
add_filter( 'timber/post/classmap', array( $this, 'post_classmap' ) );
|
|
45
|
+
add_filter( 'timber/term/classmap', array( $this, 'term_classmap' ) );
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Add data to the context.
|
|
50
|
+
*
|
|
51
|
+
* @param array $context The context.
|
|
52
|
+
* @return array
|
|
53
|
+
*/
|
|
54
|
+
public function add_to_context( $context ) {
|
|
55
|
+
$context['logo'] = Components::get_logo();
|
|
56
|
+
$context['menus'] = Components::get_menus();
|
|
57
|
+
$context['sidebar'] = Components::get_sidebar();
|
|
58
|
+
$context['footer_sidebars'] = Components::get_footer_sidebars();
|
|
59
|
+
|
|
60
|
+
return $context;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Set the page / post title
|
|
65
|
+
*
|
|
66
|
+
* @param array $context The context.
|
|
67
|
+
*
|
|
68
|
+
* @return array
|
|
69
|
+
*/
|
|
70
|
+
public function set_page_title( $context ) {
|
|
71
|
+
global $post;
|
|
72
|
+
|
|
73
|
+
if ( isset( $post->post_type ) ) {
|
|
74
|
+
$context['the_title'] = Components::get_the_title( $post->ID );
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return $context;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Add custom post class map.
|
|
82
|
+
*
|
|
83
|
+
* @param array $classmap The class map.
|
|
84
|
+
* @return array
|
|
85
|
+
*/
|
|
86
|
+
public function post_classmap( $classmap ) {
|
|
87
|
+
$custom_classmap = array(
|
|
88
|
+
'post' => ExtendedPost::class,
|
|
89
|
+
'page' => ExtendedPost::class,
|
|
90
|
+
'product' => ExtendedProduct::class,
|
|
91
|
+
'attachment' => ExtendedImage::class,
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
return array_merge( $classmap, $custom_classmap );
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Add custom term class map.
|
|
99
|
+
*
|
|
100
|
+
* @param array $classmap The class map.
|
|
101
|
+
* @return array
|
|
102
|
+
*/
|
|
103
|
+
public function term_classmap( $classmap ) {
|
|
104
|
+
$custom_classmap = array(
|
|
105
|
+
'category' => ExtendedTerm::class,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return array_merge( $classmap, $custom_classmap );
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Get the instance of the class.
|
|
113
|
+
*/
|
|
114
|
+
public static function get_instance() {
|
|
115
|
+
static $instance = null;
|
|
116
|
+
|
|
117
|
+
if ( null === $instance ) {
|
|
118
|
+
$instance = new self();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return $instance;
|
|
122
|
+
}
|
|
123
|
+
}
|