Plugin Directory

Changeset 1494768


Ignore:
Timestamp:
09/12/2016 08:06:39 PM (10 years ago)
Author:
scui2
Message:

1.0.2

Location:
hana-block/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • hana-block/trunk/hana-block.php

    r1472274 r1494768  
    33 * Plugin Name: Hana Block
    44 * Plugin URI: http://rewindcreation.com/hana-block
    5  * Description: A simple and powerfull plugin that allows to create content block and display anywhere.
     5 * Description: A simple and powerful plugin that allows to create content block and display anywhere.
    66 * Author: RewindCreation
    7  * Version: 1.0.1
     7 * Version: 1.0.2
    88 * License: GNU General Public License v3 or later
    99 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2727    private function __construct() {
    2828        $this->setup_globals();
    29         $this->includes();
    30         $this->actions();
    31         $this->shortcodes();
     29        add_action( 'after_setup_theme', array( $this, 'includes' ), -90 ); //Before Theme after Hana Core
     30        add_action( 'after_setup_theme', array( $this, 'actions' ), 13 ); // After core setup
     31        add_action( 'init',  array( $this, 'add_post_type' ) );
     32        add_action( 'plugins_loaded', array( $this, 'loaded' ) );
     33        add_action( 'admin_menu',  array( $this, 'metabox' ) );
     34       
     35        add_filter( 'manage_edit-hana_block_columns', array( $this, 'add_columns' ) );
     36        add_action( 'admin_head', array( $this, 'column_width' ) );
     37        add_action( 'manage_posts_custom_column', array( $this, 'display_columns' ), 10, 2 );       
    3238    }
    3339   
    3440    private function setup_globals() {
    3541        /** Versions **********************************************************/
    36         $this->version    = '1.0.0';
     42        $this->version    = '1.0.2';
    3743        /** Paths *************************************************************/
    3844        $this->file       = __FILE__;
     
    5157
    5258    public function includes() {
    53        
     59        add_theme_support( 'post-thumbnails' );
    5460        if ( is_admin() ) {
    5561            require_once( $this->plugin_dir . 'inc/lib-choices.php' );
     
    6066    }
    6167   
    62     private function actions() {
    63         add_action( 'init',  array( $this, 'add_post_type' ) );
    64         add_action( 'plugins_loaded', array( $this, 'loaded' ) );
    65         add_action( 'admin_menu',  array( $this, 'metabox' ) );
    66        
    67         add_filter( 'manage_edit-hana_block_columns', array( $this, 'add_columns' ) );
    68         add_action( 'admin_head', array( $this, 'column_width' ) );
    69         add_action( 'manage_posts_custom_column', array( $this, 'display_columns' ), 10, 2 );
    70     }
    71 
    72     private function shortcodes() {
    73         add_shortcode( 'content-block',  array( $this, 'content_block' ) );
    74     }
    75    
    76     public function loaded() { //Actions after plugin loaded
    77         load_plugin_textdomain( 'hana-block' );
    78 
    79         if ( ! is_admin() ) {
    80             add_action('wp_enqueue_scripts', array( $this, 'frontend_styles') );
    81            
    82             $query = array(
     68    public function actions() {
     69        $query = array(
    8370                'post_type' => 'hana_block',
    8471                'post_status' => 'publish',
     
    9178                    )
    9279                )
    93             );
    94             $blocks = get_posts( $query );
    95             foreach ( $blocks as $block ) {
    96                 new Hana_Block_Action( $block->ID );
    97             }
     80        );
     81        $blocks = get_posts( $query );
     82        foreach ( $blocks as $block ) {
     83            new Hana_Block_Action( $block->ID );
     84        }       
     85    }
     86    public function loaded() { //Actions after plugin loaded
     87        load_plugin_textdomain( 'hana-block' );
     88        add_shortcode( 'content-block',  array( $this, 'content_block' ) );
     89       
     90        if ( ! is_admin() ) {
     91            add_action('wp_enqueue_scripts', array( $this, 'frontend_styles') );
     92
    9893        } else {
    9994            add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts') );
     
    218213        ), $atts ) );
    219214   
     215        $block = NULL;
    220216        if ( $slug )
    221217            $block = get_page_by_path( $slug, OBJECT, $this->allowed_types );
    222         else
     218        elseif ( $id )
    223219            $block = get_post( $id );
    224220       
    225 
    226221        if( $block ) {
    227222            setup_postdata( $block );
    228 
    229223            ob_start();
    230224            $type = get_post_meta( $block->ID, '_hana_block_type', true);
  • hana-block/trunk/inc/class-block-action.php

    r1472265 r1494768  
    11<?php
    22/**
    3  * Class Meta Box
     3 * Class Block Action
    44 * @package   hanacore
    55 * @since     1.0
  • hana-block/trunk/inc/class-grid.php

    r1472265 r1494768  
    2626
    2727        private function __construct() {
    28             // Core uses the own defaults if theme do not add them in customizer
     28            // Core uses the own defaults if theme do not use it
    2929            $this->grid['grid_width'] = absint(get_theme_mod( 'grid_width', $this->grid['grid_width'] ));
    3030            $this->grid['fluid_grid'] = absint(get_theme_mod( 'fluid_grid', $this->grid['fluid_grid'] ));
     
    3434            $this->grid['sidebar1_column'] = absint(get_theme_mod( 'sidebar1_column', $this->grid['sidebar1_column'] ));
    3535            $this->grid['sidebar2_column'] = absint(get_theme_mod( 'sidebar2_column', $this->grid['sidebar2_column'] ));
    36             $this->grid['sidebar_bbp'] = absint(get_theme_mod( 'sidebar_bbp', $this->grid['sidebar_bbp'] ));
     36            $this->grid['sidebar_bbp'] = absint(get_theme_mod( 'sidebar_bbp', $this->grid['sidebar_bbp'] ));           
    3737        }
    3838
     
    4848            }
    4949            $class = apply_filters( 'hanagrid_main_class', $class );
    50             $imp_class = implode( ' ', $class );
    51             if ( $echo )
    52                 echo esc_attr( $imp_class );
     50            $class = array_map("sanitize_html_class", $class);
     51            $imp_class = implode( ' ', $class );
     52            if ( $echo )
     53                echo $imp_class;
    5354            else
    5455                return $imp_class;
     
    6364                $class[] = 'expanded';
    6465            $class = apply_filters( 'hanagrid_row_class', $class );
    65             $imp_class = implode( ' ', $class );
    66             if ( $echo )
    67                 echo esc_attr( $imp_class );
     66            $class = array_map("sanitize_html_class", $class);
     67            $imp_class = implode( ' ', $class );
     68            if ( $echo )
     69                echo $imp_class;
    6870            else
    6971                return $imp_class;
     
    7678                $class[] = 'expanded';
    7779            $class = apply_filters( 'hanagrid_header_row_class', $class );
    78             $imp_class = implode( ' ', $class );
    79             if ( $echo )
    80                 echo esc_attr( $imp_class );
     80            $class = array_map("sanitize_html_class", $class);
     81            $imp_class = implode( ' ', $class );
     82            if ( $echo )
     83                echo $imp_class;
    8184            else
    8285                return $imp_class;
     
    110113            $class[] = 'columns';
    111114            $class = apply_filters( 'hanagrid_content_class', $class );
    112             $imp_class = implode( ' ', $class );
    113             if ( $echo )
    114                 echo esc_attr( $imp_class );
     115            $class = array_map("sanitize_html_class", $class);
     116            $imp_class = implode( ' ', $class );
     117            if ( $echo )
     118                echo $imp_class;
    115119            else
    116120                return $imp_class;
     
    162166                $class[] = 'columns';
    163167                $class = apply_filters( 'hanagrid_sidebartwo_class', $class ); 
    164             }       
    165             $imp_class = implode( ' ', $class );
    166             if ( $echo )
    167                 echo esc_attr( $imp_class );
     168            }
     169            $class = array_map("sanitize_html_class", $class);
     170            $imp_class = implode( ' ', $class );
     171            if ( $echo )
     172                echo $imp_class;
    168173            else
    169174                return $imp_class;
     
    174179            $class[] = 'large-' . $this->grid['grid_column'];
    175180            $class[] = 'columns';
    176             $imp_class = implode( ' ', $class );
    177             if ( $echo )
    178                 echo esc_attr( $imp_class );
     181            $class = array_map("sanitize_html_class", $class);
     182            $imp_class = implode( ' ', $class );
     183            if ( $echo )
     184                echo $imp_class;
    179185            else
    180186                return $imp_class;
     
    189195                $class[] = 'small-' . $small_col;
    190196            $class[] = 'columns';
    191             $imp_class = implode( ' ', $class );
    192             if ( $echo )
    193                 echo esc_attr( $imp_class );
     197            $class = array_map("sanitize_html_class", $class);
     198            $imp_class = implode( ' ', $class );
     199            if ( $echo )
     200                echo $imp_class;
    194201            else
    195202                return $imp_class;
     
    200207
    201208            $width = $this->grid['grid_column'] - $this->grid['sidebar_bbp'];
    202             $class[] = 'large-' . $width;
    203209            $class[] = 'medium-' . $width;
    204210            $class[] = 'columns';
    205211            $class = apply_filters( 'hanagrid_bbp_content_class', $class );
    206             $imp_class = implode( ' ', $class );
    207             if ( $echo )
    208                 echo esc_attr( $imp_class );
     212            $class = array_map("sanitize_html_class", $class);
     213            $imp_class = implode( ' ', $class );
     214            if ( $echo )
     215                echo $imp_class;
    209216            else
    210217                return $imp_class;
     
    214221            $class = array();
    215222
    216             $class[] = 'large-' . $this->grid['sidebar_bbp'];
    217223            $class[] = 'medium-' . $this->grid['sidebar_bbp'];
    218224            $class[] = 'columns';
    219225            $class = apply_filters( 'hanagrid_bbp_sidebar_class', $class );
    220             $imp_class = implode( ' ', $class );
    221             if ( $echo )
    222                 echo esc_attr( $imp_class );
     226            $class = array_map("sanitize_html_class", $class);
     227            $imp_class = implode( ' ', $class );
     228            if ( $echo )
     229                echo $imp_class;
    223230            else
    224231                return $imp_class;
  • hana-block/trunk/inc/lib-choices.php

    r1472265 r1494768  
    107107}
    108108endif;
     109
     110// Sidebar Positions
     111if ( ! function_exists( 'hana_sidebar_postion_choices' ) ) :
     112function hana_sidebar_postion_choices() {
     113    $choices = array(
     114        'right'    => esc_html__('Right Sidebar', 'hana'),
     115        'left'     => esc_html__('Left Sidebar', 'hana'),
     116        'both'     => esc_html__('Left & Right Sidebar', 'hana'),
     117        'none'   => esc_html__('No Sidebar', 'hana')
     118    );   
     119    return apply_filters( 'hana_sidebar_postion_choices', $choices );
     120}
     121endif;
  • hana-block/trunk/readme.txt

    r1472274 r1494768  
    44Tags: content block
    55Requires at least: 4.5
    6 Tested up to: 4.5.3
    7 Stable tag: 1.0.1
     6Tested up to: 4.6.1
     7Stable tag: 1.0.2
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1515<a href="http://rewindcreation.com/hana-block">Hana Block</a> is a very simple and yet powerful plugin.
    1616
    17 * Custom post type `hana_block` is created to manage content block using **use the WYSIWYG editor**
     17* Custom post type `hana_block` is created to manage content block using the **WYSIWYG editor**
    1818* There are 2 types of content blocks: Layout and Content.
    1919* The content block can be included in post, page and text widget using short code `[content-block]`
    2020* The content block can be included in any theme supported action hooks.
    2121
    22 Support is provided at <a href="http://rewindcreation.com/support">support forums</a>.
     22For documentation, please visit <a href="http://rewindcreation.com/hana-block">RewindCreation</a>.
    2323
    2424== Installation ==
Note: See TracChangeset for help on using the changeset viewer.