Plugin Directory

Changeset 2071707


Ignore:
Timestamp:
04/20/2019 09:54:06 AM (7 years ago)
Author:
navthemes
Message:

[Fixed] NavThemes Blocks Cateogory issue

Location:
navthemes-fontawesome-icons/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • navthemes-fontawesome-icons/trunk/navthemesfa.php

    r2063596 r2071707  
    33 * Plugin Name: NavThemes FontAwesome Icons
    44 * Plugin URI: https://www.navthemes.com
    5  * Description: FontAwesome Icon Block for WordPress 2
     5 * Description: FontAwesome Icon Block for WordPress
    66 * Author: NavThemes
    77 * Author URI: https://www.navthemes.com
    8  * Version: 1.0.2
     8 * Version: 1.0
    99 * Text Domain: navthemesfa
    1010 *
     
    7474    }
    7575
    76     // NavThemes Blocks's block category
    77     add_filter( 'block_categories', 'navthemes_fa_block_categories', 10, 2 );
    78     function navthemes_fa_block_categories( $categories, $post ) {
    79         return array_merge( $categories, array(
    80             array(
    81                 'slug'  => 'navthemes-block',
    82                 'title' => __( 'NavThemes Blocks', 'navthemesfa' ),
    83             ),
    84         ) );
    85     }
     76    if(!function_exists('NavThemesBlocksAddCategory')) :
     77
     78    function NavThemesBlocksAddCategory (){
     79
     80        /**
     81         - This functions checks and add navthemes-blocks category
     82        **/
     83
     84        global $post;   
     85       
     86        $block_categories = get_block_categories($post) ;
     87
     88        $available_Block_categories = array();
     89
     90        foreach ($block_categories as $category) {
     91            $slug = $category['slug'];
     92            array_push($available_Block_categories, $slug);
     93        }
     94
     95        if(!in_array("navthemes-blocks", $available_Block_categories)){
     96                // NavThemes Blocks's block category
     97                add_filter( 'block_categories', 'navthemes_fa_block_categories', 10, 2 );
     98                function navthemes_fa_block_categories( $categories, $post ) {
     99                    return array_merge( $categories, array(
     100                        array(
     101                            'slug'  => 'navthemes-blocks',
     102                            'title' => __( 'NavThemes Blocks', 'navthemesfa' ),
     103                        ),
     104                    ) );
     105                }
     106        } // if
     107
     108    }
     109   
     110    add_action('admin_init','NavThemesBlocksAddCategory');
     111
     112endif;
    86113
    87114   
  • navthemes-fontawesome-icons/trunk/readme.txt

    r2063596 r2071707  
    33Tags: gutenberg, blocks
    44Requires at least: 5.0
    5 Tested up to: 5.0.2
    6 Stable tag: 1.0.2
     5Tested up to: 5.1.1
     6Stable tag: 1.0.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licen2ses/gpl-2.0.html
    99Requires PHP: 5.6
    1010
    11 NavThemes FontAwesome Icons allows you to add beautfiul FontAwesome Icons. 
     11GutenBee enhances the Gutenberg editor with more blocks!
    1212
    1313== Description ==
     
    3232== Changelog ==
    3333
     34= 1.0.3 =
     35*[Fixed] NavThemes Blocks Cateogory issue.
     36
    3437= 1.0.2 =
    35 * [Fixed] Fixed NavThemes Landing Pages Compatibility Issue.
    36 
     38*[Fixed] Fixed NavThemes Landing Pages Compatibility Issue.
    3739
    3840= 1.0.1 =
    39 * [Fixed] Repeating Block Category issue.
     41*[Fixed] Repeating Block Category issue.
    4042
    41 = 1.0.0 =
    42 * Initial release.
     43= 1.0.0 = 
     44*Initial release.
Note: See TracChangeset for help on using the changeset viewer.