Plugin Directory

Changeset 1333393


Ignore:
Timestamp:
01/22/2016 03:57:58 AM (10 years ago)
Author:
BCorp
Message:

Added [icon_box] shortcode.

Location:
bcorp-shortcodes/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bcorp-shortcodes/trunk/bcorp_shortcodes.php

    r1322164 r1333393  
    44Plugin URI: http://shortcodes.bcorp.com
    55Description: Advanced word press shortcodes for use with any wordpress theme.
    6 Version: 0.14
     6Version: 0.17
    77Author: Tim Brattberg
    88Author URI: http://bcorp.com
     
    372372  }
    373373
     374  function bcorp_icon_box_shortcode($atts,$content=null,$tag ) {
     375    /* [bcorp_icon_box]
     376     * title
     377     * size (h1,h2,h3,h4,h5,h6)
     378     * headingcolor (heading,font,altfont,link,custom)
     379     * ->custom
     380     *     headingcustomcolor
     381     * textcolor (heading,font,altfont,link,custom)
     382     * ->custom
     383     *     textcustomcolor
     384     * showicon (true,false)
     385     * ->true
     386     *     icon
     387     * align (left, center)
     388     * textblock
     389     * background (none,alt,custom)
     390     * ->custom
     391     *     backgroundcolor
     392     */
     393   $data=$GLOBALS['bcorp_shortcodes_data']->bcorp_sanitize_data($tag,$atts);
     394   if ($data['background']=='alt') $alt = ' bcorp-alt-background'; else $alt='';
     395   if ($data['background']=='custom') $bgcolor = ' background-color:'.$data['backgroundcolor'].';'; else $bgcolor ='';
     396   if ($data['padding'] !='') $padding = ' padding:'.$data['padding'].';'; else $padding ='';
     397   if ($data['showicon'] == 'true' && $data['icon']) {
     398     if ($data['iconcolor']) $iconcolor = ' style="color:'.$data['iconcolor'].';"'; else $iconcolor = '';
     399     $icon = '<span class="bcorp-icon-box-icon" aria-hidden="true" data-icon="&#x'.$data['icon'].';"'.$iconcolor.'></span>';
     400   } else $icon = '';
     401  if ($data['align']=='center') $align = ' style="text-align:center;"'; else $align ='';
     402   $headingcustomcolor = '';
     403   if ($data['headingcolor'] == 'custom') {
     404     $headingcolor = '';
     405     if ($data['headingcustomcolor']) $headingcustomcolor = ' style="color:'.$data['headingcustomcolor'].';"';
     406   } elseif ($data['headingcolor'] == 'altfont') $headingcolor = ' bcorp-color-font-alt';
     407   elseif ($data['headingcolor'] == 'font') $headingcolor = ' bcorp-color-font';
     408   elseif ($data['headingcolor'] == 'link') $headingcolor = ' bcorp-color-link';
     409   else $headingcolor =' bcorp-color-heading';
     410
     411   $textcustomcolor = '';
     412   if ($data['textcolor'] == 'custom') {
     413     $textcolor = '';
     414     if ($data['textcustomcolor']) $textcustomcolor = ' style="color:'.$data['textcustomcolor'].';"';
     415   } elseif ($data['textcolor'] == 'altfont') $textcolor = ' bcorp-color-font-alt';
     416   elseif ($data['textcolor'] == 'font') $textcolor = ' bcorp-color-font';
     417   elseif ($data['textcolor'] == 'link') $textcolor = ' bcorp-color-link';
     418   else $textcolor =' bcorp-color-heading';
     419
     420   return '<div class="bcorp-icon-box'.$alt.'" style="'.$bgcolor.$padding.'">
     421              <div class="bcorp-icon-box-title'.$headingcolor.'"'.$headingcustomcolor.'><'.$data['size'].' class="bcorp-heading bcorp-heading"'.$align.'>'.$icon.$data['title'].'</'.$data['size'].'></div>
     422              <div class="bcorp-icon-box-content'.$textcolor.'"'.$textcustomcolor.'>'.do_shortcode($content).'</div>
     423           </div>';
     424  }
     425
    374426  function bcorp_image_shortcode($atts,$content=null,$tag ) {
    375427    /* [bcorp_image]
     
    567619    static $bcorp_id;
    568620    $bcorp_id++;
    569    return '<div class="bcorp-tab-panel bcorp-alt-background" id="bcorp-tab-'.$bcorp_id.'"><div class="bcorp-tab-panel-inner">'.do_shortcode(rawurldecode($content)).'</div></div>';
     621   return '<div class="bcorp-tab-panel bcorp-alt-background" id="bcorp-tab-'.$bcorp_id.'"><div class="bcorp-tab-panel-inner">'.do_shortcode($content).'</div></div>';
    570622  }
    571623
  • bcorp-shortcodes/trunk/bcorp_shortcodes_data.php

    r1322164 r1333393  
    152152        'type'=>'dropdown',
    153153        'default'=>'center',
     154        'admin_class'=>true,
    154155        'values'=>array(
    155156          'left'=>'Left',
     
    662663        "admin_icon"=>"&#xe824;",
    663664        "closing_tag"=>false,
    664         "admin_default"=>'<button class="bcve-bcorp_button bcorp-button-medium"><span class="bcve-bcorp_button-icon" data-icon="&#xe809;"></span><span class="bcve-bcorp_button-label">Button - Edit Me</span></button>',
     665        "admin_default"=>'<div class="bcve-bcorp_button bcorp-button-medium">
     666                            <button>
     667                              <span class="bcve-bcorp_button-icon" data-icon="&#xe809;"></span>
     668                              <span class="bcve-bcorp_button-label">Button - Edit Me</span>
     669                            </button>
     670                          </div>',
    665671        "variables"=>array(
    666672          'label'=>array(
     
    10261032
    10271033    $this->bcorp_add_shortcode(
     1034      "bcorp_icon_box",array(
     1035        "title"=>"Icon Box",
     1036        "admin_icon"=>"&#xe809;",
     1037        "admin_default"=>'<div class="bcve-bcorp_icon_box">
     1038                            <span class="bcve-bcorp_icon_box-icon bcve-bcorp_heading-size-h3" aria-hidden="true" data-icon="&#59401;"></span>
     1039                            <span class="bcve-bcorp_icon_box-title bcve-bcorp_heading-text bcve-bcorp_heading-size-h3">Icon Box - Edit Me</span>
     1040                            <div class="bcve-bcorp_icon_box-textblock"><p>Content - Edit Me</p></div>
     1041                          </div>',
     1042        "variables"=>array(
     1043          'title'=>array(
     1044            'name'=>'Title',
     1045            'type'=>'textfield',
     1046            'default' =>''),
     1047          'size'=>array(
     1048            'name'=>'Size',
     1049            'type'=>'dropdown',
     1050            'default'=>'h1',
     1051            'values'=>array(
     1052              'h1'=>'Heading 1',
     1053              'h2'=>'Heading 2',
     1054              'h3'=>'Heading 3',
     1055              'h4'=>'Heading 4',
     1056              'h5'=>'Heading 5',
     1057              'h6'=>'Heading 6')),
     1058            'headingcolor'=>array(
     1059              'name'=>'Heading Color',
     1060              'admin_tab'=>'Colors',
     1061              'type'=>'dropdown',
     1062              'default'=>'heading',
     1063              'dependents'=>array(
     1064                  'custom'=>array('headingcustomcolor')),
     1065              'values'=>array(
     1066                  'heading'=>'Heading Color',
     1067                  'font'=>'Main Font Color',
     1068                  'altfont'=>'Alternate Font Color',
     1069                  'link'=>'Link Color',
     1070                  'custom'=>'Custom Color')),
     1071            'headingcustomcolor'=>array(
     1072              'name'=>'Heading Custom Color',
     1073              'type'=>'color',
     1074              'default'=>''),
     1075            'textcolor'=>array(
     1076              'name'=>'Text Color',
     1077              'admin_tab'=>'Colors',
     1078              'type'=>'dropdown',
     1079              'default'=>'heading',
     1080              'dependents'=>array(
     1081                  'custom'=>array('textcustomcolor')),
     1082              'values'=>array(
     1083                  'heading'=>'Heading Color',
     1084                  'font'=>'Main Font Color',
     1085                  'altfont'=>'Alternate Font Color',
     1086                  'link'=>'Link Color',
     1087                  'custom'=>'Custom Color')),
     1088            'textcustomcolor'=>array(
     1089              'name'=>'Text Custom Color',
     1090              'type'=>'color',
     1091              'default'=>''),
     1092          'showicon'=>'showicon',
     1093          'align'=>array(
     1094            'name'=>'Alignment',
     1095            'type'=>'dropdown',
     1096            'default'=>'left',
     1097            'values'=>array(
     1098              'left'=>'Left Aligned',
     1099              'center'=>'Centered')),
     1100          'textblock'=>array(
     1101            'name'=>'Text Block',
     1102            'type'=>'textarea',
     1103            'editor'=>'tinymce',
     1104            'default' =>''
     1105          ),
     1106          'background'=>array(
     1107            'name'=>'Type',
     1108            'admin_tab'=>'Box',
     1109            'type'=>'dropdown',
     1110            'default'=>'success',
     1111            'dependents'=>array(
     1112              'custom'=>array('backgroundcolor')),
     1113            'values'=>array(
     1114              'none'=>'None',
     1115              'alt'=>'Alternate Background Color',
     1116              'custom'=>'Custom Background Color')),
     1117          'backgroundcolor'=>array(
     1118            'name'=>'Background Color',
     1119            'type'=>'color',
     1120            'default'=>''),
     1121          'padding'=>array(
     1122            'name'=>'Padding',
     1123            'admin_tab'=>'Box',
     1124            'units'=>array('px','em','%'),
     1125            'description'=>'Enter a margin size in px, em or %. Defaults to px if no unit is entered.',
     1126            'type'=>'textfield',
     1127            'default'=>''),
     1128
     1129
     1130        )
     1131      )
     1132    );
     1133
     1134    $this->bcorp_add_shortcode(
    10281135      "bcorp_image",array(
    10291136        "title"=>"Image",
     
    10671174        "child_element"=>"bcorp_tab_panel",
    10681175        "width" => "1-1",
    1069         "admin_default"=>'<div class="bcve-bcorp_tabs"><i class="bcve-icon bcve-header-icon">&#xe822;</i>
    1070     <div class="bcve-bcorp_tabs-details">Position: <span class="bcve-bcorp_tabs-position">top</span></div></div>',
     1176        "admin_default"=>'<div class="bcve-bcorp_tabs">
     1177                            <i class="bcve-icon bcve-header-icon">&#xe822;</i>
     1178                            <div class="bcve-bcorp_tabs-details">Position: <span class="bcve-bcorp_tabs-position">top</span></div>
     1179                          </div>',
    10711180        "variables"=>array(
    10721181          'position'=>array(
     
    10991208        "width"=>"1-3-min",
    11001209        "parent_element"=>"bcorp_tabs",
    1101         "admin_default"=>'<div class="bcve-bcorp_tab_panel"><span class="bcve-bcorp_tab_panel-title bcve-bcorp_heading-text bcve-bcorp_heading-size-h3">Tab - Edit Me</span><div class="bcve-bcorp_tab_panel-textblock"><p>Tab Content - Edit Me</p></div></div>',
     1210        "admin_default"=>'<div class="bcve-bcorp_tab_panel">
     1211                            <span class="bcve-bcorp_tab_panel-title bcve-bcorp_heading-text bcve-bcorp_heading-size-h3">Tab - Edit Me</span>
     1212                            <div class="bcve-bcorp_tab_panel-textblock"><p>Tab Content - Edit Me</p></div>
     1213                          </div>',
    11021214        "variables"=>array(
    11031215          'title'=>array(
  • bcorp-shortcodes/trunk/css/bcsc.css

    r1322164 r1333393  
     1html,body { height:100% !important; }
     2
    13@font-face {
    24  font-family: 'FontAwesome';
     
    3537.bcorp-gutter { margin-left:2% }
    3638
    37 
    38 
    3939@media screen and (min-width: 568px) and (max-width: 767px) {
    4040  .bcorp-mobile-1-6 { width:15%; }
     
    5151  .bcorp-mobile-1-1 { width:100%; }
    5252}
    53 
    5453
    5554.bcorp-1-8-no-gutter { width:12.75%;}
     
    179178.bcorp-icon a {box-shadow: none; }
    180179
     180/* [bcorp_icon_box] */
     181.bcorp-icon-box-icon { margin-right:8px; }
     182.bcorp-icon-box-title h1, .bcorp-icon-box-title h2, .bcorp-icon-box-title h3, .bcorp-icon-box-title h4, .bcorp-icon-box-title h5, .bcorp-icon-box-title h6 {margin-bottom:16px; }
    181183/* [bcorp_image] */
    182184.bcorp-image { font-size:0; }
     
    189191.bcorp-section .site-content { position:relative; }
    190192.bcorp-section {position:relative; overflow:hidden; }
     193.bcorp-section .site-content { position:relative; }
     194.bcorp-background-video {
     195  z-index:-1;
     196  position:absolute;
     197}
     198.bcorp-cell { z-index:0; }
     199.bcorp-background-image {
     200  z-index: -1;
     201  font-size:0;
     202  position: absolute;
     203}
     204.bcorp-background-image img { max-width:none; }
    191205
    192206/* [bcorp_tabs] */
  • bcorp-shortcodes/trunk/readme.txt

    r1322164 r1333393  
    44Tags: shortcode, shortcodes, plugin, image, images, icons, widget, page, editor, button
    55Requires at least: 4.2.0
    6 Tested up to: 4.4
    7 Stable tag: 0.14
     6Tested up to: 4.4.1
     7Stable tag: 0.17
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1010
    11 Powerful shortcode collection configured in a simple popup window or for use with the BCorp Visual Editor.
     11Powerful shortcode collection configured in a simple popup window or for use with the drag and drop BCorp Visual Editor.
    1212
    1313== Description ==
     
    2424* [bcorp_cell width="1-6|1-5|1-4|1-3|2-5|1-2|3-5|2-3|3-4|4-5|5-6|1-1"]
    2525
    26 **11 x Shortcode Elements**
     26**12 x Shortcode Elements**
    2727
    2828* [bcorp_alert]
     
    3030* [bcorp_button]
    3131* [bcorp_heading]
     32* [bcorp_icon_box]
    3233* [bcorp_image]
    3334* [bcorp_divider]
     
    7172== Changelog ==
    7273
     74= 0.17 =
     75Added [icon_box] shortcode.
     76
     77= 0.16 =
     78Author got married 16th January 2016.
     79
    7380= 0.14 =
    7481Added [bcorp_section] shortcode for themes that directly support it.
     
    9198== Upgrade Notice ==
    9299
     100= 0.17 =
     101Added [icon_box] shortcode.
     102
     103= 0.16 =
     104Author got married 16th January 2016.
     105
    93106= 0.14 =
    94107Added [bcorp_section] shortcode for themes that directly support it.
Note: See TracChangeset for help on using the changeset viewer.