Plugin Directory

Changeset 2986891

Timestamp:
10/31/2023 03:33:02 PM (9 months ago)
Author:
dilipbheda
Message:

Release v2.5

Location:
faq-block-for-gutenberg
Files:
15 added
10 edited

Legend:

Unmodified
Added
Removed
  • faq-block-for-gutenberg/trunk/assets/css/style.css

    r2364572 r2986891  
    1 .wp-block-faq-block-for-gutenberg-faq{font-family:'roboto', sans-serif;color:#666;font-size:16px;background:#f9f9f9;line-height:1.6em;padding:20px;margin-bottom:10px}.wp-block-faq-block-for-gutenberg-faq .question{font-weight:700;font-size:120%;cursor:pointer;text-transform:capitalize;padding:7px}.wp-block-faq-block-for-gutenberg-faq .question h4{margin-bottom:10px;padding:0;clear:none}.edit-answer .answer,.answer.edit-answer,.edit-answer{display:block !important}.wp-block-faq-block-for-gutenberg-faq .answer{display:none}.answer{background:#3BB0D6;padding:7px 7px 7px 7px;overflow-wrap:break-word;color:#ffffff}.question:first-child:before{content:'\002B';font-size:20px;float:right;margin-left:5px}.wp-block-faq-block-for-gutenberg-faq .active:before{content:'\2212'}
    2 
     1.wp-block-faq-block-for-gutenberg-faq{font-family:"roboto",sans-serif;color:#666;font-size:16px;background:#f9f9f9;line-height:1.6em;padding:20px;margin-bottom:10px}.wp-block-faq-block-for-gutenberg-faq .question{font-weight:700;font-size:120%;cursor:pointer;padding:7px}.wp-block-faq-block-for-gutenberg-faq .question h4{margin-bottom:10px;padding:0;clear:none;margin:0 !important;font-size:inherit}.wp-block-faq-block-for-gutenberg-faq .answer{display:none}.wp-block-faq-block-for-gutenberg-faq .active:before{content:"−" !important}.edit-answer .answer,.answer.edit-answer,.edit-answer{display:block !important}.answer{background:#3bb0d6;padding:7px 7px 7px 7px;overflow-wrap:break-word;color:#fff}.question:first-child:before{content:"+";font-size:20px;float:right;margin-left:5px}.faq-block-action-button{margin:0 auto;margin-top:-10px;margin-right:3px;text-align:right;display:flex;gap:10px;justify-content:flex-end}.faq-block-action-button a{font-size:11px;font-weight:400;text-decoration:none;color:var(--wp-admin-theme-color, #3858e9);font-weight:700}.faq-block-action-button a.faq-block-action-remove{color:#cc1818 !important}.faq-block-action-button a:focus{border:none;outline:none;box-shadow:none}
  • faq-block-for-gutenberg/trunk/assets/js/block.build.js

    r2364572 r2986891  
    1 !function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e){var n,o,r,i,s,a,l,u,c;n=window.wp,o=n.blocks.registerBlockType,r=n.element.createElement,i=n.blockEditor.RichText,s=n.blockEditor.InspectorControls,a=n.components.PanelBody,l=n.blockEditor.ColorPalette,u=n.blockEditor.BlockControls,c=n.blockEditor.AlignmentToolbar,o("faq-block-for-gutenberg/faq",{title:n.i18n.__("FAQ","faq-block-for-gutenberg"),icon:"index-card",category:"layout",attributes:{question:{type:"array",source:"children",selector:"h4"},answer:{type:"array",source:"children",selector:".answer"},backgroundColor:{type:"string"},questionText:{type:"string"},questionBg:{type:"string"},answerText:{type:"string"},answerBg:{type:"string"},alignment:{type:"string"}},edit:function(t){var e=t.focus?t.focus.editable||"question":null,o=t.attributes,g=t.attributes.alignment,b=t.isSelected;return r("div",null,b&&r(u,{key:"controls"},r(c,{value:g,onChange:function(e){t.setAttributes({alignment:e})}})),r(s,{key:"inspector"},r(a,{title:n.i18n.__("Background color","faq-block-for-gutenberg"),initialOpen:!0},r(l,{value:t.attributes.backgroundColor,onChange:function(e){t.setAttributes({backgroundColor:e})}})),r(a,{title:n.i18n.__("Question Font Color","faq-block-for-gutenberg"),initialOpen:!1},r(l,{value:t.attributes.questionText,colors:["#F00"],onChange:function(e){t.setAttributes({questionText:e})}})),r(a,{title:n.i18n.__("Question Background","faq-block-for-gutenberg"),initialOpen:!1},r(l,{value:t.attributes.questionBg,colors:["#000"],onChange:function(e){t.setAttributes({questionBg:e})}})),r(a,{title:n.i18n.__("Answer Font Color","faq-block-for-gutenberg"),initialOpen:!1},r(l,{value:t.attributes.answerText,colors:["#F00"],onChange:function(e){t.setAttributes({answerText:e})}})),r(a,{title:n.i18n.__("Answer Background","faq-block-for-gutenberg"),initialOpen:!1},r(l,{value:t.attributes.answerBg,colors:["#000"],onChange:function(e){t.setAttributes({answerBg:e})}})),r("hr",null)),r("div",{className:t.className,key:"editor",style:{background:o.backgroundColor},onClick:function(t){var e=t.target.closest(".wp-block-faq-block-for-gutenberg-faq").querySelector(".answer");if(t.target.parentNode.parentNode.classList.length>0&&!t.target.parentNode.parentNode.classList.contains("question")&&(e=null),null!=e&&t.target.classList.length>0&&!t.target.classList.contains("question")&&(e=null),null!=e){var n=e.classList||[];n.length>0&&(n.contains("editor-rich-text")||n.contains("block-editor-rich-text__editable"))&&(n.contains("edit-answer")?(n.remove("edit-answer"),t.target.closest(".question").classList.remove("active")):(n.add("edit-answer"),t.target.closest(".question").classList.add("active")))}}},r(i,{tagName:"div",className:"question",placeholder:n.i18n.__("Question:","faq-block-for-gutenberg"),value:o.question,onChange:function(e){t.setAttributes({question:e})},focus:"question"===e,onFocus:function(e){t.setFocus(_.extend({},e,{editable:"question"}))},style:{background:o.questionBg,color:o.questionText,textAlign:g}}),r(i,{tagName:"div",className:"answer",placeholder:n.i18n.__("Answer:","faq-block-for-gutenberg"),value:o.answer,onChange:function(e){t.setAttributes({answer:e})},focus:"answer"===e,onFocus:function(e){t.setFocus(_.extend({},e,{editable:"answer"}))},style:{background:o.answerBg,color:o.answerText,textAlign:g}})))},save:function(t){var e=t.className,n=t.attributes.question,o=t.attributes.answer,i=t.attributes.id,s=t.attributes.backgroundColor,a=t.attributes.questionText,l=t.attributes.questionBg,u=t.attributes.answerText,c=t.attributes.alignment,g=t.attributes.answerBg;return r("div",{className:e,"data-id":i,style:{background:s}},r("div",{className:"question",style:{background:l,textAlign:c,color:a}},r("h4",{style:{color:a}},null,n)),r("div",{className:"answer",style:{background:g,color:u,textAlign:c}},o))}})}]);
     1!function())}})}]);
  • faq-block-for-gutenberg/trunk/faq-block-for-gutenberg.php

    r2774118 r2986891  
    99 * Text Domain: faq-block-for-gutenberg
    1010 * Domain Path: /languages
    11  * Version: 2.4
     11 * Version: 2.
    1212 * License: GPLv3 or later
    1313 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    1717
    1818// Include class file.
    19 require_once  plugin_dir_path( __FILE__ ) . '/includes/class-faq-block-for-gutenberg.php';
     19require_once plugin_dir_path( __FILE__ ) . '/includes/class-faq-block-for-gutenberg.php';
    2020
    2121/**
     
    2323 */
    2424function gutenberg_faq_block_textdomain() {
    25     load_plugin_textdomain( 'faq-block-for-gutenberg', false, basename( dirname( __FILE__ ) ) . '/languages' );
     25    load_plugin_textdomain( 'faq-block-for-gutenberg', false, basename( ) . '/languages' );
    2626}
    2727
     
    4646 */
    4747function gutenberg_faq_block_init() {
    48     new Faq_Block_For_Gutenberg;
     48    new Faq_Block_For_Gutenberg;
    4949}
    5050add_action( 'plugins_loaded', 'gutenberg_faq_block_init' );
  • faq-block-for-gutenberg/trunk/includes/class-faq-block-for-gutenberg.php

    r2774118 r2986891  
    2525        public function gutenberg_faq_block_register() {
    2626            // Register script.
    27             wp_register_script( 'gutenberg-faq-block', plugin_dir_url( __FILE__ ) . '../assets/js/block.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element' ), '', true );
     27            wp_register_script( 'gutenberg-faq-block', plugin_dir_url( __FILE__ ) . '../assets/js/block.build.js', array( 'wp-, true );
    2828            // Added wp i18n support.
    2929            wp_set_script_translations( 'gutenberg-faq-block', 'faq-block-for-gutenberg' );
    3030            // Register style.
    31             wp_register_style( 'gutenberg-faq-block-style', plugin_dir_url( __FILE__ ) . '../assets/css/style.css' );
     31            wp_register_style( 'gutenberg-faq-block-style', plugin_dir_url( __FILE__ ) . '../assets/css/style.css' );
    3232            // Register block.
    3333            register_block_type(
     
    3636                    'editor_script' => 'gutenberg-faq-block',
    3737                    'style'         => 'gutenberg-faq-block-style',
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
    3852                )
    3953            );
     
    5670        public function gutenberg_faq_block_enqueue_script() {
    5771            // Enqueue public script.
    58             wp_enqueue_script( 'gutenberg-faq-js', plugin_dir_url( __FILE__ ) . '../assets/js/faq-block-for-gutenberg.js', array( 'jquery' ), '', true );
     72            wp_enqueue_script( 'gutenberg-faq-js', plugin_dir_url( __FILE__ ) . '../assets/js/faq-block-for-gutenberg.js', array( 'jquery' ), , true );
    5973            // Enqueue faq style.
    6074            wp_enqueue_style( 'gutenberg-faq-block-style' );
     
    6882            // Default schema data.
    6983            $faq_data = array(
    70                 '@context'  => esc_url( 'https://schema.org' ),
    71                 '@type'     => 'FAQPage',
     84                '@context'=> esc_url( 'https://schema.org' ),
     85                '@type'=> 'FAQPage',
    7286            );
    7387            // If check faq parse block.
     
    7690                foreach ( $faq_parse_block as $faqs ) {
    7791                    $filter_faqs = $this->gutenberg_faq_block_strip_tags( $faqs['innerHTML'] );
    78                     if ( preg_match( '/<h4>(.*?)<\/h4>/s', $filter_faqs, $matches ) ) {
     92                    if ( preg_match( '/<h4>(.*?)<\/h4>/s', $filter_faqs, $matches ) ) {
    7993                        $faq_data['mainEntity'][] = array(
    80                             '@type' => 'Question',
    81                             '@id'         => get_the_permalink() . '#' . uniqid(),
    82                             'name'  => trim( wp_strip_all_tags( end( $matches ) ) ),
    83                             'answerCount' => 1,
    84                             'position'    => $count,
    85                             'url'         => get_the_permalink() . '#' . uniqid(),
     94                            '@type'=> 'Question',
     95                            '@id'  => get_the_permalink() . '#' . uniqid(),
     96                            'name'=> trim( wp_strip_all_tags( end( $matches ) ) ),
     97                            'answerCount' => 1,
     98                            'position'  => $count,
     99                            'url'  => get_the_permalink() . '#' . uniqid(),
    86100                            'acceptedAnswer' => array(
    87                                 '@type' => 'Answer',
    88                                 'text'  => trim( str_replace( reset( $matches ), '', $filter_faqs ) ),
     101                                '@type'=> 'Answer',
     102                                'text'=> trim( str_replace( reset( $matches ), '', $filter_faqs ) ),
    89103                            ),
    90104                        );
    91                         $count++;
     105                        ;
    92106                    }
    93107                }
     
    118132            $block_data = array();
    119133            if ( $post ) {
    120                 $blocks = parse_blocks( $post->post_content );
     134                $blocks = );
    121135                foreach ( $blocks as $block ) {
    122136                    if ( 'faq-block-for-gutenberg/faq' === $block['blockName'] ) {
  • faq-block-for-gutenberg/trunk/includes/index.php

    r1833902 r2986891  
    1 <?php // Slicense is golden.
     1<?php // Slicense is golden.
  • faq-block-for-gutenberg/trunk/index.php

    r1833902 r2986891  
    1 <?php // Slicense is golden.
     1<?php // Slicense is golden.
  • faq-block-for-gutenberg/trunk/readme.txt

    r2774118 r2986891  
    77Tags: blocks, faq, gutenberg faq, editor, faq block
    88Requires at least: 5.0
    9 Tested up to: 6.0
    10 Requires PHP: 5.6.3
    11 Stable tag: 2.4
     9Tested up to: 6.
     10Requires PHP:
     11Stable tag: 2.
    1212License: GPLv3 or later
    1313License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4141`add_filter( 'fbfg_json_ld_output', '__return_false' );`
    4242
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
    4370
    4471== Changelog ==
     72
     73
     74
     75
     76
     77
     78
     79
    4580= 2.4 =
    4681* Bug Fixed ( https://wordpress.org/support/topic/php-warning-366/ )
Note: See TracChangeset for help on using the changeset viewer.