Plugin Directory

Changeset 3208360


Ignore:
Timestamp:
12/16/2024 06:58:41 AM (16 months ago)
Author:
Tarosky
Message:

Update to version 1.2.1 from GitHub

Location:
taro-taxonomy-blocks
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • taro-taxonomy-blocks/tags/1.2.1/assets/js/block-posts-terms-query.js

    r2999435 r3208360  
    4848                        />
    4949                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    50                         <TextControl value={ attributes.terms } label={ __( 'Term Slugs', 'label' ) }
     50                        <TextControl value={ attributes.terms } label={ __( 'Term Slugs', 'taro-taxonomy-blocks' ) }
    5151                            help={ __( 'Enter term slugs in CSV format. Default value is post\'s terms', 'taro-taxonomy-blocks' ) }
    5252                            placeholder={ __( 'Post\'s terms.', 'taro-taxonomy-blocks' ) }
     
    6464                { ( ! attributes.taxonomy ) ? (
    6565                    <div style={ { margin: '40px 0' } }>
    66                         <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     66                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-blocks' ) }</p>
    6767                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    6868                    </div>
  • taro-taxonomy-blocks/tags/1.2.1/assets/js/block-posts-terms.js

    r2999435 r3208360  
    4545                { ( ! attributes.taxonomy ) ? (
    4646                    <div style={ { margin: '40px 0' } }>
    47                         <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     47                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-blocks' ) }</p>
    4848                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4949                    </div>
  • taro-taxonomy-blocks/tags/1.2.1/assets/js/block-terms.js

    r2999435 r3208360  
    4848                { ( ! attributes.taxonomy ) ? (
    4949                    <div style={ { margin: '40px 0' } }>
    50                         <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     50                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-blocks' ) }</p>
    5151                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    5252                    </div>
  • taro-taxonomy-blocks/tags/1.2.1/composer.json

    r2999435 r3208360  
    2323    "require-dev": {
    2424        "squizlabs/php_codesniffer": "^3.0",
    25         "wp-coding-standards/wpcs": "^2.0",
    26         "phpcompatibility/php-compatibility": "^9.3",
     25        "wp-coding-standards/wpcs": "^3.0",
    2726        "dealerdirect/phpcodesniffer-composer-installer": "^1.0"
    2827    },
  • taro-taxonomy-blocks/tags/1.2.1/dist/js/block-posts-terms-query.js

    r2999435 r3208360  
    22!function(){const{registerBlockType:e}=wp.blocks,{__:__,sprintf:sprintf}=wp.i18n,{select:t}=wp.data,{InspectorControls:o}=wp.blockEditor,{PanelBody:a,TextControl:r}=wp.components,{serverSideRender:l}=wp,{TaxonomySelector:n,OrderSelector:s,PostsOrderBySelector:c}=wp.taro;e("taro/post-terms-query",{title:__("Post Terms Query","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsQueryBlockEditor.attributes,description:__("Display posts with same terms of this post in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:m,setAttributes:y}=e;
    33// translators: %s is post type.
    4 const i=sprintf(__("Default: %s","taro-taxonomy-blocks"),t("core/editor").getCurrentPostType());return React.createElement(React.Fragment,null,React.createElement(o,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(r,{label:__("Post Type","taro-taxonomy-blocks"),value:m.post_type,placeholder:i,onChange:e=>y({post_type:e}),help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})}),React.createElement(r,{value:m.terms,label:__("Term Slugs","label"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:e=>y({terms:e})}),React.createElement(r,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:m.limit,placeholder:10,onChange:e=>y({limit:parseInt(e)})}),React.createElement(c,{valu:m.orderby,onChange:e=>y({orderby:e})}),React.createElement(s,{value:m.order,onChange:e=>y({order:e})}))),m.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(l,{block:"taro/post-terms-query",attributes:m})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})})))},save(){return null}})}();
     4const i=sprintf(__("Default: %s","taro-taxonomy-blocks"),t("core/editor").getCurrentPostType());return React.createElement(React.Fragment,null,React.createElement(o,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(r,{label:__("Post Type","taro-taxonomy-blocks"),value:m.post_type,placeholder:i,onChange:e=>y({post_type:e}),help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})}),React.createElement(r,{value:m.terms,label:__("Term Slugs","taro-taxonomy-blocks"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:e=>y({terms:e})}),React.createElement(r,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:m.limit,placeholder:10,onChange:e=>y({limit:parseInt(e)})}),React.createElement(c,{valu:m.orderby,onChange:e=>y({orderby:e})}),React.createElement(s,{value:m.order,onChange:e=>y({order:e})}))),m.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(l,{block:"taro/post-terms-query",attributes:m})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-blocks")),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/tags/1.2.1/dist/js/block-posts-terms.js

    r2999435 r3208360  
    11/*! License information can be found in block-posts-terms.js.LICENSE.txt */
    2 !function(){const{registerBlockType:t}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:e}=wp.blockEditor,{PanelBody:o}=wp.components,{serverSideRender:a}=wp,{TaxonomySelector:n}=wp.taro;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit(t){let{attributes:r,setAttributes:s}=t;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})})))},save(){return null}})}();
     2!function(){const{registerBlockType:t}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:e}=wp.blockEditor,{PanelBody:o}=wp.components,{serverSideRender:a}=wp,{TaxonomySelector:n}=wp.taro;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit(t){let{attributes:r,setAttributes:s}=t;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-blocks")),React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})})))},save(){return null}})}();
  • taro-taxonomy-blocks/tags/1.2.1/dist/js/block-terms.js

    r2999435 r3208360  
    11/*! License information can be found in block-terms.js.LICENSE.txt */
    2 !function(){const{registerBlockType:e}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:t}=wp.blockEditor,{PanelBody:o,ToggleControl:a,TextControl:r}=wp.components,{serverSideRender:n}=wp,{TaxonomySelector:l,OrderSelector:c,OrderBySelector:m}=wp.taro;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:s,setAttributes:i}=e;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})}),React.createElement(a,{checked:s.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:e=>i({hide_empty:e})}),React.createElement("hr",null),React.createElement(m,{value:s.orderby,onChange:e=>i({orderby:e})}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:s.meta,onChange:e=>i({meta:e})}),React.createElement(c,{value:s.order,onChange:e=>i({order:e})}))),s.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(n,{block:"taro/terms",attributes:s})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})})))},save(){return null}})}();
     2!function(){const{registerBlockType:e}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:t}=wp.blockEditor,{PanelBody:o,ToggleControl:a,TextControl:r}=wp.components,{serverSideRender:n}=wp,{TaxonomySelector:l,OrderSelector:c,OrderBySelector:m}=wp.taro;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:s,setAttributes:i}=e;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})}),React.createElement(a,{checked:s.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:e=>i({hide_empty:e})}),React.createElement("hr",null),React.createElement(m,{value:s.orderby,onChange:e=>i({orderby:e})}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:s.meta,onChange:e=>i({meta:e})}),React.createElement(c,{value:s.order,onChange:e=>i({order:e})}))),s.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(n,{block:"taro/terms",attributes:s})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-blocks")),React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/tags/1.2.1/package.json

    r2999435 r3208360  
    2222    },
    2323    "devDependencies": {
    24         "@babel/core": "^7.1.0",
     24        "@babel/core": "^7.23.9",
    2525        "@babel/eslint-parser": "^7.23.3",
    2626        "@babel/plugin-transform-react-jsx": "^7.0.0",
    27         "@babel/preset-env": "^7.1.0",
     27        "@babel/preset-env": "^7.23.9",
    2828        "@wordpress/env": "^8.0",
    29         "@wordpress/eslint-plugin": "^17.0",
     29        "@wordpress/eslint-plugin": "^17.7",
    3030        "babel-loader": "^9.1.3",
    3131        "eslint": "^8.53",
  • taro-taxonomy-blocks/tags/1.2.1/readme.txt

    r2999435 r3208360  
    66Requires at least: 5.9 
    77Requires PHP: 7.2 
    8 Stable Tag: 1.2.0
     8Stable Tag: 1.2.1
    99License: GPLv3 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    7171== Changelog ==
    7272
     73= 1.2.1 =
     74
     75* Fix translations.
     76
    7377= 1.2.0 =
    7478
  • taro-taxonomy-blocks/tags/1.2.1/taro-taxonomy-blocks.php

    r2999435 r3208360  
    55Description: Add 3 taxonomy blockshh for block editor.
    66Author: Tarosky INC.
    7 Version: 1.2.0
     7Version: 1.2.1
    88Author URI: https://tarosky.co.jp/
    99License: GPL3 or later
     
    6565    ] );
    6666    $taxonomies = apply_filters( 'taro_taxonomy_blocks_taxonomies', array_values( get_taxonomies( $tax_args, OBJECT ) ) );
     67    wp_set_script_translations( 'taro-taxonomy-selector', 'taro-taxonomy-blocks' );
    6768    wp_localize_script( 'taro-taxonomy-selector', 'TaroTaxonomySelector', [
    6869        'taxonomies' => $taxonomies,
     
    309310                'taxonomy' => $taxonomy->name,
    310311                'field'    => 'term_id',
    311                 'terms'    => array_map( function( $term ) {
     312                'terms'    => array_map( function ( $term ) {
    312313                    return $term->term_id;
    313314                }, $terms ),
  • taro-taxonomy-blocks/tags/1.2.1/template-parts/taxonomy-blocks/term-list-hierarchical.php

    r2999435 r3208360  
    88
    99$parent = empty( $args['parent'] ) ? 0 : $args['parent'];
    10 $terms  = array_values( array_filter( $args['terms'], function( $term ) use ( $parent ) {
     10$terms  = array_values( array_filter( $args['terms'], function ( $term ) use ( $parent ) {
    1111    return (int) $parent === (int) $term->parent;
    1212} ) );
  • taro-taxonomy-blocks/trunk/assets/js/block-posts-terms-query.js

    r2999435 r3208360  
    4848                        />
    4949                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    50                         <TextControl value={ attributes.terms } label={ __( 'Term Slugs', 'label' ) }
     50                        <TextControl value={ attributes.terms } label={ __( 'Term Slugs', 'taro-taxonomy-blocks' ) }
    5151                            help={ __( 'Enter term slugs in CSV format. Default value is post\'s terms', 'taro-taxonomy-blocks' ) }
    5252                            placeholder={ __( 'Post\'s terms.', 'taro-taxonomy-blocks' ) }
     
    6464                { ( ! attributes.taxonomy ) ? (
    6565                    <div style={ { margin: '40px 0' } }>
    66                         <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     66                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-blocks' ) }</p>
    6767                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    6868                    </div>
  • taro-taxonomy-blocks/trunk/assets/js/block-posts-terms.js

    r2999435 r3208360  
    4545                { ( ! attributes.taxonomy ) ? (
    4646                    <div style={ { margin: '40px 0' } }>
    47                         <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     47                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-blocks' ) }</p>
    4848                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4949                    </div>
  • taro-taxonomy-blocks/trunk/assets/js/block-terms.js

    r2999435 r3208360  
    4848                { ( ! attributes.taxonomy ) ? (
    4949                    <div style={ { margin: '40px 0' } }>
    50                         <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     50                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-blocks' ) }</p>
    5151                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    5252                    </div>
  • taro-taxonomy-blocks/trunk/composer.json

    r2999435 r3208360  
    2323    "require-dev": {
    2424        "squizlabs/php_codesniffer": "^3.0",
    25         "wp-coding-standards/wpcs": "^2.0",
    26         "phpcompatibility/php-compatibility": "^9.3",
     25        "wp-coding-standards/wpcs": "^3.0",
    2726        "dealerdirect/phpcodesniffer-composer-installer": "^1.0"
    2827    },
  • taro-taxonomy-blocks/trunk/dist/js/block-posts-terms-query.js

    r2999435 r3208360  
    22!function(){const{registerBlockType:e}=wp.blocks,{__:__,sprintf:sprintf}=wp.i18n,{select:t}=wp.data,{InspectorControls:o}=wp.blockEditor,{PanelBody:a,TextControl:r}=wp.components,{serverSideRender:l}=wp,{TaxonomySelector:n,OrderSelector:s,PostsOrderBySelector:c}=wp.taro;e("taro/post-terms-query",{title:__("Post Terms Query","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsQueryBlockEditor.attributes,description:__("Display posts with same terms of this post in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:m,setAttributes:y}=e;
    33// translators: %s is post type.
    4 const i=sprintf(__("Default: %s","taro-taxonomy-blocks"),t("core/editor").getCurrentPostType());return React.createElement(React.Fragment,null,React.createElement(o,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(r,{label:__("Post Type","taro-taxonomy-blocks"),value:m.post_type,placeholder:i,onChange:e=>y({post_type:e}),help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})}),React.createElement(r,{value:m.terms,label:__("Term Slugs","label"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:e=>y({terms:e})}),React.createElement(r,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:m.limit,placeholder:10,onChange:e=>y({limit:parseInt(e)})}),React.createElement(c,{valu:m.orderby,onChange:e=>y({orderby:e})}),React.createElement(s,{value:m.order,onChange:e=>y({order:e})}))),m.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(l,{block:"taro/post-terms-query",attributes:m})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})})))},save(){return null}})}();
     4const i=sprintf(__("Default: %s","taro-taxonomy-blocks"),t("core/editor").getCurrentPostType());return React.createElement(React.Fragment,null,React.createElement(o,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(r,{label:__("Post Type","taro-taxonomy-blocks"),value:m.post_type,placeholder:i,onChange:e=>y({post_type:e}),help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})}),React.createElement(r,{value:m.terms,label:__("Term Slugs","taro-taxonomy-blocks"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:e=>y({terms:e})}),React.createElement(r,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:m.limit,placeholder:10,onChange:e=>y({limit:parseInt(e)})}),React.createElement(c,{valu:m.orderby,onChange:e=>y({orderby:e})}),React.createElement(s,{value:m.order,onChange:e=>y({order:e})}))),m.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(l,{block:"taro/post-terms-query",attributes:m})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-blocks")),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/trunk/dist/js/block-posts-terms.js

    r2999435 r3208360  
    11/*! License information can be found in block-posts-terms.js.LICENSE.txt */
    2 !function(){const{registerBlockType:t}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:e}=wp.blockEditor,{PanelBody:o}=wp.components,{serverSideRender:a}=wp,{TaxonomySelector:n}=wp.taro;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit(t){let{attributes:r,setAttributes:s}=t;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})})))},save(){return null}})}();
     2!function(){const{registerBlockType:t}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:e}=wp.blockEditor,{PanelBody:o}=wp.components,{serverSideRender:a}=wp,{TaxonomySelector:n}=wp.taro;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit(t){let{attributes:r,setAttributes:s}=t;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-blocks")),React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})})))},save(){return null}})}();
  • taro-taxonomy-blocks/trunk/dist/js/block-terms.js

    r2999435 r3208360  
    11/*! License information can be found in block-terms.js.LICENSE.txt */
    2 !function(){const{registerBlockType:e}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:t}=wp.blockEditor,{PanelBody:o,ToggleControl:a,TextControl:r}=wp.components,{serverSideRender:n}=wp,{TaxonomySelector:l,OrderSelector:c,OrderBySelector:m}=wp.taro;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:s,setAttributes:i}=e;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})}),React.createElement(a,{checked:s.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:e=>i({hide_empty:e})}),React.createElement("hr",null),React.createElement(m,{value:s.orderby,onChange:e=>i({orderby:e})}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:s.meta,onChange:e=>i({meta:e})}),React.createElement(c,{value:s.order,onChange:e=>i({order:e})}))),s.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(n,{block:"taro/terms",attributes:s})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})})))},save(){return null}})}();
     2!function(){const{registerBlockType:e}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:t}=wp.blockEditor,{PanelBody:o,ToggleControl:a,TextControl:r}=wp.components,{serverSideRender:n}=wp,{TaxonomySelector:l,OrderSelector:c,OrderBySelector:m}=wp.taro;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:s,setAttributes:i}=e;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})}),React.createElement(a,{checked:s.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:e=>i({hide_empty:e})}),React.createElement("hr",null),React.createElement(m,{value:s.orderby,onChange:e=>i({orderby:e})}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:s.meta,onChange:e=>i({meta:e})}),React.createElement(c,{value:s.order,onChange:e=>i({order:e})}))),s.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(n,{block:"taro/terms",attributes:s})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-blocks")),React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/trunk/package.json

    r2999435 r3208360  
    2222    },
    2323    "devDependencies": {
    24         "@babel/core": "^7.1.0",
     24        "@babel/core": "^7.23.9",
    2525        "@babel/eslint-parser": "^7.23.3",
    2626        "@babel/plugin-transform-react-jsx": "^7.0.0",
    27         "@babel/preset-env": "^7.1.0",
     27        "@babel/preset-env": "^7.23.9",
    2828        "@wordpress/env": "^8.0",
    29         "@wordpress/eslint-plugin": "^17.0",
     29        "@wordpress/eslint-plugin": "^17.7",
    3030        "babel-loader": "^9.1.3",
    3131        "eslint": "^8.53",
  • taro-taxonomy-blocks/trunk/readme.txt

    r2999435 r3208360  
    66Requires at least: 5.9 
    77Requires PHP: 7.2 
    8 Stable Tag: 1.2.0
     8Stable Tag: 1.2.1
    99License: GPLv3 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    7171== Changelog ==
    7272
     73= 1.2.1 =
     74
     75* Fix translations.
     76
    7377= 1.2.0 =
    7478
  • taro-taxonomy-blocks/trunk/taro-taxonomy-blocks.php

    r2999435 r3208360  
    55Description: Add 3 taxonomy blockshh for block editor.
    66Author: Tarosky INC.
    7 Version: 1.2.0
     7Version: 1.2.1
    88Author URI: https://tarosky.co.jp/
    99License: GPL3 or later
     
    6565    ] );
    6666    $taxonomies = apply_filters( 'taro_taxonomy_blocks_taxonomies', array_values( get_taxonomies( $tax_args, OBJECT ) ) );
     67    wp_set_script_translations( 'taro-taxonomy-selector', 'taro-taxonomy-blocks' );
    6768    wp_localize_script( 'taro-taxonomy-selector', 'TaroTaxonomySelector', [
    6869        'taxonomies' => $taxonomies,
     
    309310                'taxonomy' => $taxonomy->name,
    310311                'field'    => 'term_id',
    311                 'terms'    => array_map( function( $term ) {
     312                'terms'    => array_map( function ( $term ) {
    312313                    return $term->term_id;
    313314                }, $terms ),
  • taro-taxonomy-blocks/trunk/template-parts/taxonomy-blocks/term-list-hierarchical.php

    r2999435 r3208360  
    88
    99$parent = empty( $args['parent'] ) ? 0 : $args['parent'];
    10 $terms  = array_values( array_filter( $args['terms'], function( $term ) use ( $parent ) {
     10$terms  = array_values( array_filter( $args['terms'], function ( $term ) use ( $parent ) {
    1111    return (int) $parent === (int) $term->parent;
    1212} ) );
Note: See TracChangeset for help on using the changeset viewer.