Shortcodes by Angie Makes - Version 1.20

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Shortcodes by Angie Makes
Version 1.20
Comparing to
See all releases

Code changes from version 1.19 to 1.20

README.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  **Contributors:** cbaldelomar
4
  **Donate link:** http://webplantmedia.com/pay-now/
5
- **Tags:** shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type
6
  **Requires at least:** 3.7
7
  **Tested up to:** 3.8.1
8
  **Stable tag:** trunk
@@ -28,6 +28,7 @@ Enhance your pages and posts with the following features.
28
  * Social Icons
29
  * Progress Bars
30
  * Pricing
 
31
  * Highlights
32
  * Countdown
33
  * RSVP
@@ -64,6 +65,11 @@ Use the shortcode manager in the TinyMCE text editor
64
 
65
  ## Changelog ##
66
 
 
 
 
 
 
67
  ### Version 1.19
68
 
69
  * Refreshed isotope display on image load.
2
 
3
  **Contributors:** cbaldelomar
4
  **Donate link:** http://webplantmedia.com/pay-now/
5
+ **Tags:** shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, image, flags, banners, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type
6
  **Requires at least:** 3.7
7
  **Tested up to:** 3.8.1
8
  **Stable tag:** trunk
28
  * Social Icons
29
  * Progress Bars
30
  * Pricing
31
+ * Images with Flags
32
  * Highlights
33
  * Countdown
34
  * RSVP
65
 
66
  ## Changelog ##
67
 
68
+ ### Version 1.20
69
+
70
+ * Added image shortcode.
71
+ * Appended version number to JS file so new scripts get loaded.
72
+
73
  ### Version 1.19
74
 
75
  * Refreshed isotope display on image load.
includes/css/style.css CHANGED
@@ -1281,3 +1281,26 @@ pre.pre-wrap {
1281
  right: 0;
1282
  background-image: url("../img/slide-arrow-right.png");
1283
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1281
  right: 0;
1282
  background-image: url("../img/slide-arrow-right.png");
1283
  }
1284
+
1285
+
1286
+ /**
1287
+ * [wc_image]
1288
+ * ----------------------------------------------------------------------------
1289
+ */
1290
+ .wc-shortcodes-image-wrapper {
1291
+ position: relative;
1292
+ }
1293
+ .wc-shortcodes-image-anchor {
1294
+ }
1295
+ .wc-shortcodes-image {
1296
+ }
1297
+ .wc-shortcodes-image-flag-bg {
1298
+ position: absolute;
1299
+ padding: 5px 10px;
1300
+ background-color: #56ab00;
1301
+ color: #ffffff;
1302
+ }
1303
+ .wc-shortcodes-image-wrapper.alignnone,
1304
+ .wc-shortcodes-image-wrapper.aligncenter {
1305
+ margin-bottom: 20px;
1306
+ }
includes/mce/js/shortcodes_tinymce.js CHANGED
@@ -50,6 +50,7 @@
50
  a.render( c, "Skillbar", "skillbar" );
51
  a.render( c, "Social Icon", "social" );
52
  a.render( c, "Testimonial", "testimonial" );
 
53
  a.render( c, "Countdown", "countdown" );
54
  a.render( c, "RSVP", "rsvp" );
55
  a.render( c, "HTML", "html" );
@@ -175,6 +176,15 @@
175
 
176
 
177
 
 
 
 
 
 
 
 
 
 
178
  // Posts
179
  if(id === "posts") {
180
  tinyMCE.activeEditor.selection.setContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="0.020" heading_type="h2" layout="isotope"][/wc_posts]');
50
  a.render( c, "Skillbar", "skillbar" );
51
  a.render( c, "Social Icon", "social" );
52
  a.render( c, "Testimonial", "testimonial" );
53
+ a.render( c, "Image", "image" );
54
  a.render( c, "Countdown", "countdown" );
55
  a.render( c, "RSVP", "rsvp" );
56
  a.render( c, "HTML", "html" );
176
 
177
 
178
 
179
+ // Image
180
+ if(id === "image") {
181
+ tinyMCE.activeEditor.selection.setContent('[wc_image attachment_id="" size="" title="" alt="" caption="" link_to="post" url="" align="none" flag="For Sale" left="" top="" right="0" bottom="20" text_color="" background_color="" font_size=""][/wc_image]');
182
+ }
183
+
184
+
185
+
186
+
187
+
188
  // Posts
189
  if(id === "posts") {
190
  tinyMCE.activeEditor.selection.setContent('[wc_posts author="" author_name="" p="" post__in="" order="DESC" orderby="date" post_status="publish" post_type="post" posts_per_page="10" taxonomy="" field="slug" terms="" title="yes" meta_all="yes" meta_author="yes" meta_date="yes" meta_comments="yes" thumbnail="yes" content="yes" paging="yes" size="large" filtering="yes" columns="3" gutter_space="0.020" heading_type="h2" layout="isotope"][/wc_posts]');
includes/mce/shortcodes_tinymce.php CHANGED
@@ -1,17 +1,4 @@
1
  <?php
2
- /**
3
- * This file has all the main shortcode functions
4
- * @package wc Shortcodes Plugin
5
- * @since 1.0
6
- * @author AJ Clarke : http://wpexplorer.com
7
- * @copyright Copyright (c) 2012, AJ Clarke
8
- * @link http://wpexplorer.com
9
- * @License: GNU General Public License version 3.0
10
- * @License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
- *
12
- *
13
- * Special thank you to my buddy Syamil @ http://aquagraphite.com/
14
- */
15
  class WC_Shortcodes_TinyMCE_Buttons {
16
  function __construct() {
17
  add_action( 'init', array(&$this,'init') );
@@ -19,18 +6,20 @@ class WC_Shortcodes_TinyMCE_Buttons {
19
  function init() {
20
  if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
21
  return;
 
22
  if ( get_user_option('rich_editing') == 'true' ) {
23
  add_filter( 'mce_external_plugins', array(&$this, 'add_plugin') );
24
  add_filter( 'mce_buttons', array(&$this,'register_button') );
25
  }
26
  }
27
  function add_plugin($plugin_array) {
28
- $plugin_array['wc_shortcodes'] = plugin_dir_url( __FILE__ ) .'js/shortcodes_tinymce.js';
29
- return $plugin_array;
 
30
  }
31
  function register_button($buttons) {
32
- array_push($buttons, "wc_shortcodes_button");
33
- return $buttons;
34
  }
35
  }
36
  $wcshortcode = new WC_Shortcodes_TinyMCE_Buttons;
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class WC_Shortcodes_TinyMCE_Buttons {
3
  function __construct() {
4
  add_action( 'init', array(&$this,'init') );
6
  function init() {
7
  if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
8
  return;
9
+
10
  if ( get_user_option('rich_editing') == 'true' ) {
11
  add_filter( 'mce_external_plugins', array(&$this, 'add_plugin') );
12
  add_filter( 'mce_buttons', array(&$this,'register_button') );
13
  }
14
  }
15
  function add_plugin($plugin_array) {
16
+ $ver = WC_SHORTCODES_VERSION;
17
+ $plugin_array['wc_shortcodes'] = plugin_dir_url( __FILE__ ) .'js/shortcodes_tinymce.js?ver=' . $ver;
18
+ return $plugin_array;
19
  }
20
  function register_button($buttons) {
21
+ array_push($buttons, "wc_shortcodes_button");
22
+ return $buttons;
23
  }
24
  }
25
  $wcshortcode = new WC_Shortcodes_TinyMCE_Buttons;
includes/shortcode-functions.php CHANGED
@@ -1141,3 +1141,123 @@ if( ! function_exists( 'wc_shortcodes_posts' ) ) {
1141
  }
1142
  }
1143
  add_shortcode( 'wc_posts', 'wc_shortcodes_posts' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1141
  }
1142
  }
1143
  add_shortcode( 'wc_posts', 'wc_shortcodes_posts' );
1144
+
1145
+
1146
+ if( !function_exists('wc_shortcodes_image') ) {
1147
+ function wc_shortcodes_image( $atts ) {
1148
+ extract( shortcode_atts( array(
1149
+ // attachment detail settings
1150
+ 'title' => '',
1151
+ 'alt' => '',
1152
+ 'caption' => '',
1153
+
1154
+ // attachment display settings
1155
+ 'link_to' => '', // post, file, none
1156
+ 'url' => '', // for custom link_to
1157
+ 'align' => '', // none, left, center, right
1158
+ 'attachment_id' => '', // int id
1159
+ 'size' => 'large', // image size
1160
+
1161
+ // flag options
1162
+ 'flag' => '',
1163
+ 'left' => '',
1164
+ 'right' => '',
1165
+ 'top' => '',
1166
+ 'bottom' => '',
1167
+ 'text_color' => '',
1168
+ 'background_color' => '',
1169
+ 'font_size' => '',
1170
+
1171
+ // misc options
1172
+ 'src' => '',
1173
+ 'class' => '',
1174
+ ), $atts ) );
1175
+
1176
+ // function options
1177
+ $div_wrapper = false;
1178
+
1179
+ // sanitize
1180
+ $attachment_id = (int) $attachment_id;
1181
+ $src = esc_url( $src );
1182
+
1183
+ // classes
1184
+ $classes = array();
1185
+
1186
+ $classes[] = 'wc-shortcodes-image';
1187
+
1188
+ $whitelist = array( 'none', 'left', 'center', 'right' );
1189
+ if ( in_array( $align, $whitelist ) )
1190
+ $classes[] = 'align' . $align;
1191
+
1192
+ if ( ! empty( $size ) )
1193
+ $classes[] = 'size-' . $size;
1194
+
1195
+ if ( ! empty( $attachment_id ) )
1196
+ $classes[] = 'wp-image-' . $attachment_id;
1197
+
1198
+ if ( ! empty( $class ) )
1199
+ $classes[] = $class;
1200
+
1201
+ // check if src is set
1202
+ list( $src, $width, $height ) = wp_get_attachment_image_src( $attachment_id, $size );
1203
+ if ( empty( $src ) ) {
1204
+ return '<p>Please insert a valid image</p>';
1205
+ }
1206
+
1207
+ $html = '<img alt="' . $alt . '" title="' . $title . '" src="' . $src . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" />';
1208
+
1209
+ // insert flag
1210
+ if ( ! empty( $flag ) ) {
1211
+ $style = array();
1212
+ if ( is_numeric( $top ) )
1213
+ $style[] = 'top:' . (int) $top . 'px';
1214
+ if ( is_numeric( $right ) )
1215
+ $style[] = 'right:' . (int) $right . 'px';
1216
+ if ( is_numeric( $bottom ) )
1217
+ $style[] = 'bottom:' . (int) $bottom . 'px';
1218
+ if ( is_numeric( $left ) )
1219
+ $style[] = 'left:' . (int) $left . 'px';
1220
+ if ( ! empty( $background_color ) )
1221
+ $style[] = 'background-color:' . $background_color;
1222
+ if ( ! empty( $text_color ) )
1223
+ $style[] = 'color:' . $text_color;
1224
+ if ( is_numeric( $font_size ) )
1225
+ $style[] = 'font-size:' . (int) $font_size . 'px';
1226
+
1227
+ $html .= '<span style="' . implode( ';', $style ) . '" class="wc-shortcodes-image-flag-bg"><span class="wc-shortcodes-image-flag-text">' . esc_html( $flag ) . '</span></span>';
1228
+ $div_wrapper = true;
1229
+
1230
+ }
1231
+
1232
+ // insert caption
1233
+ if ( ! empty( $caption ) ) {
1234
+ $html .= '<p class="wp-caption-text">' . esc_html( $caption ) . '</p>';
1235
+ $div_wrapper = true;
1236
+ }
1237
+
1238
+ // check link_to
1239
+ if ( ! empty( $url ) )
1240
+ $url = esc_url( $url );
1241
+ else if ( 'file' == $link_to )
1242
+ $url = wp_get_attachment_url( $attachment_id );
1243
+ else if ( 'post' == $link_to )
1244
+ $url = get_attachment_link( $attachment_id );
1245
+
1246
+ if ( 'none' != $link_to )
1247
+ $html = '<a class="wc-shortcodes-image-anchor" href="' . $url . '">' . $html . '</a>';
1248
+
1249
+ // do we need a div wrapper?
1250
+ if ( $div_wrapper ) {
1251
+ $html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
1252
+ $html = '<div id="attachment_' . $attachment_id . '" class="wc-shortcodes-image-wrapper wp-caption align' . $align . '" style="width:' . $width . 'px">' . $html . '</div>';
1253
+ }
1254
+ else if ( in_array( $align, array( 'none', 'center' ) ) ) {
1255
+ $html = '<p>' . $html . '</p>';
1256
+ }
1257
+
1258
+ return $html;
1259
+ }
1260
+ add_shortcode( 'wc_image', 'wc_shortcodes_image' );
1261
+ }
1262
+
1263
+
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
 
3
  Contributors: cbaldelomar
4
  Donate link: http://webplantmedia.com/pay-now/
5
- Tags: shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type
6
  Requires at least: 3.7
7
  Tested up to: 3.8.1
8
  Stable tag: trunk
@@ -28,6 +28,7 @@ Enhance your pages and posts with the following features.
28
  * Social Icons
29
  * Progress Bars
30
  * Pricing
 
31
  * Highlights
32
  * Countdown
33
  * RSVP
@@ -81,9 +82,15 @@ Use the shortcode manager in the TinyMCE text editor
81
  15. Custom HTML
82
  16. Code Snippets
83
  17. Isotope / Masonry Posts
 
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
87
  ### Version 1.19
88
 
89
  * Refreshed isotope display on image load.
2
 
3
  Contributors: cbaldelomar
4
  Donate link: http://webplantmedia.com/pay-now/
5
+ Tags: shortcode, shortcodes, accordion, accordions, tab, tabs, toggle, columns, column, section, sections, testimonials, border, borders, button, buttons, fullwidth, full width, notification, notifications, google maps, maps, googlemaps, social icons, progress bar, pricing, pricing box, highlights, image, flags, banners, countdown, rsvp, custom html, code, code snippets, snippets, isotope, masonry, posts, post_type
6
  Requires at least: 3.7
7
  Tested up to: 3.8.1
8
  Stable tag: trunk
28
  * Social Icons
29
  * Progress Bars
30
  * Pricing
31
+ * Images with Flags
32
  * Highlights
33
  * Countdown
34
  * RSVP
82
  15. Custom HTML
83
  16. Code Snippets
84
  17. Isotope / Masonry Posts
85
+ 17. Images with Flags
86
 
87
  == Changelog ==
88
 
89
+ ### Version 1.20
90
+
91
+ * Added image shortcode.
92
+ * Appended version number to JS file so new scripts get loaded.
93
+
94
  ### Version 1.19
95
 
96
  * Refreshed isotope display on image load.
wc-shortcodes.php CHANGED
@@ -5,11 +5,11 @@ Plugin URI: http://wordpresscanvas.com/features/shortcodes/
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.19
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.19' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.20
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.20' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );