Version Description
Be careful! This is a great update and completely new code! Don't forget, you can always install old version.
Upgrade normally via your Wordpress admin -> Plugins panel.
Download this release
Release Info
Developer | gn_themes |
Plugin | Shortcodes Ultimate |
Version | 4.4.2 |
Comparing to | |
See all releases |
Code changes from version 4.4.1 to 4.4.2
- inc/core/data.php +8 -2
- inc/core/generator.php +6 -0
- inc/core/shortcodes.php +6 -1
- inc/vendor/class.image-meta.php +0 -52
- inc/vendor/class.media-upload.php +0 -190
- readme.txt +5 -7
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- shortcodes-ultimate.php +2 -4
inc/core/data.php
CHANGED
@@ -153,7 +153,7 @@ class Su_Data {
|
|
153 |
'default' => 20,
|
154 |
'name' => __( 'Margin', 'su' ),
|
155 |
'desc' => __( 'Bottom margin (pixels)', 'su' )
|
156 |
-
),
|
157 |
'class' => array(
|
158 |
'default' => '',
|
159 |
'name' => __( 'Class', 'su' ),
|
@@ -2270,7 +2270,7 @@ class Su_Data {
|
|
2270 |
'default' => 'no',
|
2271 |
'name' => __( 'Inline', 'su' ),
|
2272 |
'desc' => __( 'This parameter determines what HTML tag will be used for animation wrapper. Turn this option to YES and animated element will be wrapped in SPAN instead of DIV. Useful for inline animations, like buttons', 'su' )
|
2273 |
-
),
|
2274 |
'class' => array(
|
2275 |
'default' => '',
|
2276 |
'name' => __( 'Class', 'su' ),
|
@@ -2286,3 +2286,9 @@ class Su_Data {
|
|
2286 |
return ( is_string( $shortcode ) ) ? $shortcodes[sanitize_text_field( $shortcode )] : $shortcodes;
|
2287 |
}
|
2288 |
}
|
|
|
|
|
|
|
|
|
|
|
|
153 |
'default' => 20,
|
154 |
'name' => __( 'Margin', 'su' ),
|
155 |
'desc' => __( 'Bottom margin (pixels)', 'su' )
|
156 |
+
),
|
157 |
'class' => array(
|
158 |
'default' => '',
|
159 |
'name' => __( 'Class', 'su' ),
|
2270 |
'default' => 'no',
|
2271 |
'name' => __( 'Inline', 'su' ),
|
2272 |
'desc' => __( 'This parameter determines what HTML tag will be used for animation wrapper. Turn this option to YES and animated element will be wrapped in SPAN instead of DIV. Useful for inline animations, like buttons', 'su' )
|
2273 |
+
),
|
2274 |
'class' => array(
|
2275 |
'default' => '',
|
2276 |
'name' => __( 'Class', 'su' ),
|
2286 |
return ( is_string( $shortcode ) ) ? $shortcodes[sanitize_text_field( $shortcode )] : $shortcodes;
|
2287 |
}
|
2288 |
}
|
2289 |
+
|
2290 |
+
class Shortcodes_Ultimate_Data extends Su_Data {
|
2291 |
+
function __construct() {
|
2292 |
+
parent::__construct();
|
2293 |
+
}
|
2294 |
+
}
|
inc/core/generator.php
CHANGED
@@ -220,3 +220,9 @@ class Su_Generator {
|
|
220 |
}
|
221 |
|
222 |
new Su_Generator;
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
|
222 |
new Su_Generator;
|
223 |
+
|
224 |
+
class Shortcodes_Ultimate_Generator extends Su_Generator {
|
225 |
+
function __construct() {
|
226 |
+
parent::__construct();
|
227 |
+
}
|
228 |
+
}
|
inc/core/shortcodes.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
class Su_Shortcodes {
|
4 |
static $tabs = array();
|
5 |
static $tab_count = 0;
|
@@ -1259,3 +1258,9 @@ class Su_Shortcodes {
|
|
1259 |
}
|
1260 |
|
1261 |
new Su_Shortcodes;
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
|
|
2 |
class Su_Shortcodes {
|
3 |
static $tabs = array();
|
4 |
static $tab_count = 0;
|
1258 |
}
|
1259 |
|
1260 |
new Su_Shortcodes;
|
1261 |
+
|
1262 |
+
class Shortcodes_Ultimate_Shortcodes extends Su_Shortcodes {
|
1263 |
+
function __construct() {
|
1264 |
+
parent::__construct();
|
1265 |
+
}
|
1266 |
+
}
|
inc/vendor/class.image-meta.php
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !class_exists( 'ImageMeta' ) ) {
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Handle manipulating and processing of image meta information.
|
7 |
-
*/
|
8 |
-
Class ImageMeta {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Parse the iptc info and retrive the given value.
|
12 |
-
*
|
13 |
-
* Ref. http://codex.wordpress.org/Function_Reference/wp_read_image_metadata#Parameters
|
14 |
-
* WP already adds some IPTC data
|
15 |
-
*
|
16 |
-
* @param $value The item you want returned
|
17 |
-
* @param $image The image you want info from
|
18 |
-
*/
|
19 |
-
public function iptcParser( $value = null, $image = null ) {
|
20 |
-
|
21 |
-
$size = getimagesize( $image, $info );
|
22 |
-
|
23 |
-
if ( !isset( $info['APP13'] ) )
|
24 |
-
return;
|
25 |
-
|
26 |
-
$iptc = iptcparse( $info['APP13'] );
|
27 |
-
|
28 |
-
switch ( $value ) {
|
29 |
-
case 'keywords':
|
30 |
-
if ( isset( $iptc['2#025'] ) )
|
31 |
-
return $iptc['2#025'];
|
32 |
-
|
33 |
-
case 'city':
|
34 |
-
if ( isset( $iptc['2#090'][0] ) )
|
35 |
-
return $iptc['2#090'][0];
|
36 |
-
|
37 |
-
case 'region':
|
38 |
-
if ( isset( $iptc['2#095'][0] ) )
|
39 |
-
return $iptc['2#095'][0];
|
40 |
-
|
41 |
-
case 'country':
|
42 |
-
if ( isset( $iptc['2#101'][0] ) )
|
43 |
-
return $iptc['2#101'][0];
|
44 |
-
|
45 |
-
default:
|
46 |
-
return false;
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/vendor/class.media-upload.php
DELETED
@@ -1,190 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Permissions NOT handled here!
|
5 |
-
*
|
6 |
-
* A series of related methods for managing file uploads within
|
7 |
-
* WordPress.
|
8 |
-
*
|
9 |
-
* @author Zane M. Kolnik zanematthew[at]gmail[dot]com
|
10 |
-
*/
|
11 |
-
if ( !class_exists( 'MediaUpload' ) ) {
|
12 |
-
|
13 |
-
Class MediaUpload {
|
14 |
-
|
15 |
-
public $upload_dir;
|
16 |
-
private $attachment_id;
|
17 |
-
|
18 |
-
public function __construct() {
|
19 |
-
|
20 |
-
$this->upload_dir = wp_upload_dir();
|
21 |
-
|
22 |
-
if ( is_admin() )
|
23 |
-
add_action( 'post_edit_form_tag', array( &$this, 'addEnctype' ) );
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Handles the saving, i.e. creates a post type of attachment.
|
28 |
-
*
|
29 |
-
* During form submission run the method:
|
30 |
-
* $class->fileUpload( $field_name='form_field_name' );
|
31 |
-
*
|
32 |
-
* @return $final_file An array of array of f*cking cool stuff
|
33 |
-
* I guess if you think arrays are cool i like (*)(*)s
|
34 |
-
* $final_file['attachment_id'] = $this->attachment_id;
|
35 |
-
* $final_file['file'] = $uploaded_file['file'];
|
36 |
-
* $final_file['file_info'] = $file_info[];
|
37 |
-
*/
|
38 |
-
public function saveUpload( $field_name = null, $user_id = null ) {
|
39 |
-
|
40 |
-
if ( is_null( $field_name ) )
|
41 |
-
die( 'Need field_name' );
|
42 |
-
|
43 |
-
// Move the file to the uploads directory, returns an array
|
44 |
-
// of information from $_FILES
|
45 |
-
$uploaded_file = $this->handleUpload( $_FILES[$field_name] );
|
46 |
-
|
47 |
-
if ( !isset( $uploaded_file['file'] ) )
|
48 |
-
return false;
|
49 |
-
|
50 |
-
// If we were to have a unique user account for uploading
|
51 |
-
if ( is_null( $user_id ) ) {
|
52 |
-
$current_user = wp_get_current_user();
|
53 |
-
$user_id = $current_user->ID;
|
54 |
-
}
|
55 |
-
|
56 |
-
// Build the Global Unique Identifier
|
57 |
-
$guid = $this->buildGuid( $uploaded_file['file'] );
|
58 |
-
|
59 |
-
// Build our array of data to be inserted as a post
|
60 |
-
$attachment = array(
|
61 |
-
'post_mime_type' => $_FILES[$field_name]['type'],
|
62 |
-
'guid' => $guid,
|
63 |
-
'post_title' => 'Uploaded : ' . $this->mediaTitle( $uploaded_file['file'] ),
|
64 |
-
'post_content' => '',
|
65 |
-
'post_author' => $user_id,
|
66 |
-
'post_status' => 'inherit',
|
67 |
-
'post_date' => date( 'Y-m-d H:i:s' ),
|
68 |
-
'post_date_gmt' => date( 'Y-m-d H:i:s' )
|
69 |
-
);
|
70 |
-
|
71 |
-
// Add the file to the media library and generate thumbnail.
|
72 |
-
$this->attachment_id = wp_insert_attachment( $attachment, $uploaded_file['file'] );
|
73 |
-
|
74 |
-
// @todo bug, this does NOT work when used in a PLUGIN!, so you'll have to make
|
75 |
-
// your OWN thumbnail sizes!
|
76 |
-
require_once( ABSPATH . "wp-admin" . '/includes/image.php' );
|
77 |
-
$meta = wp_generate_attachment_metadata( $this->attachment_id, $uploaded_file['file'] );
|
78 |
-
|
79 |
-
$image_meta = wp_read_image_metadata( $uploaded_file['file'] );
|
80 |
-
$meta['image_meta'] = $image_meta;
|
81 |
-
|
82 |
-
$image = New ImageMeta;
|
83 |
-
$meta['image_meta']['keywords'] = $image->iptcParser( 'keywords', $uploaded_file['file'] );
|
84 |
-
$meta['image_meta']['city'] = $image->iptcParser( 'city', $uploaded_file['file'] );
|
85 |
-
$meta['image_meta']['region'] = $image->iptcParser( 'region', $uploaded_file['file'] );
|
86 |
-
$meta['image_meta']['country'] = $image->iptcParser( 'country', $uploaded_file['file'] );
|
87 |
-
wp_update_attachment_metadata( $this->attachment_id, $meta );
|
88 |
-
|
89 |
-
$file_info = pathinfo( $uploaded_file['file'] );
|
90 |
-
|
91 |
-
// Set the feedback flag to false, since the upload was successful
|
92 |
-
$upload_feedback = false;
|
93 |
-
|
94 |
-
$final_file = array( );
|
95 |
-
$final_file['attachment_id'] = $this->attachment_id;
|
96 |
-
$final_file['file'] = $uploaded_file['file'];
|
97 |
-
$final_file['file_info'] = $file_info;
|
98 |
-
|
99 |
-
return $final_file;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Do some set-up before calling the wp_handle_upload function
|
104 |
-
*/
|
105 |
-
public function handleUpload( $file = array( ) ) {
|
106 |
-
require_once( ABSPATH . "wp-admin" . '/includes/file.php' );
|
107 |
-
return wp_handle_upload( $file, array( 'test_form' => false ), date( 'Y/m' ) );
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Builds the GUID for a given file from the media library
|
112 |
-
* @param full/path/to/file.jpg
|
113 |
-
* @return guid
|
114 |
-
*/
|
115 |
-
public function buildGuid( $file = null ) {
|
116 |
-
// $wp_upload_dir = wp_upload_dir();
|
117 |
-
return $this->upload_dir['baseurl'] . '/' . _wp_relative_upload_path( $file );
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Parse the title of the media based on the file name
|
122 |
-
* @return title
|
123 |
-
*/
|
124 |
-
public function mediaTitle( $file ) {
|
125 |
-
return addslashes( preg_replace( '/\.[^.]+$/', '', basename( $file ) ) );
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Adds the enctype for file upload, used with the hook
|
130 |
-
* post_edit_form_tag for adding uploader to post meta
|
131 |
-
*/
|
132 |
-
public function addEnctype() {
|
133 |
-
echo ' enctype="multipart/form-data"';
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Resize images based on the "type"
|
138 |
-
*
|
139 |
-
* Normally this is done in WordPress, but for some reason
|
140 |
-
* wp_generate_attachment_metadata() does not work when
|
141 |
-
* used in a plugin.
|
142 |
-
*
|
143 |
-
* @param $file = /my/file/path/image.jpg
|
144 |
-
* @param $type = thumb|square|main
|
145 |
-
*
|
146 |
-
* @todo Since images are NOT "registered" with WordPress
|
147 |
-
* they will NOT be deleted from the media library when the
|
148 |
-
* original image is deleted!
|
149 |
-
*
|
150 |
-
* @todo use wp_update_attachment_metadata() to update
|
151 |
-
* the postmeta thumbnails ref. the array in
|
152 |
-
* wp_generate_attachment_metadata()
|
153 |
-
*
|
154 |
-
* @todo remove hardcoded sizes and suffix, possibly a
|
155 |
-
* public variable.
|
156 |
-
*
|
157 |
-
* @return same as image_resize() wp_error
|
158 |
-
*/
|
159 |
-
public function resizeImage( $file = null, $type = null ) {
|
160 |
-
switch ( $type ) {
|
161 |
-
case 'thumb':
|
162 |
-
$max_w = 104;
|
163 |
-
$max_h = 70;
|
164 |
-
$suffix = 'zm-thumb';
|
165 |
-
break;
|
166 |
-
|
167 |
-
case 'square':
|
168 |
-
$max_w = 50;
|
169 |
-
$max_h = 50;
|
170 |
-
$suffix = 'zm-square';
|
171 |
-
break;
|
172 |
-
|
173 |
-
case 'main':
|
174 |
-
$max_w = 454;
|
175 |
-
$max_h = 300;
|
176 |
-
$suffix = 'zm-main';
|
177 |
-
break;
|
178 |
-
|
179 |
-
default:
|
180 |
-
# code...
|
181 |
-
break;
|
182 |
-
}
|
183 |
-
|
184 |
-
return image_resize( $file, $max_w, $max_h, $crop = true, $suffix, $path = $this->upload_dir['path'] );
|
185 |
-
}
|
186 |
-
|
187 |
-
}
|
188 |
-
|
189 |
-
// End 'MediaUpload'
|
190 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -97,11 +97,11 @@ Upgrade normally via your Wordpress admin -> Plugins panel.
|
|
97 |
|
98 |
== Changelog ==
|
99 |
|
100 |
-
= 4.4
|
101 |
-
* Fixed file_get_contents() (disabled http wrappers) issue at the examples page
|
102 |
-
|
103 |
-
= 4.4.0 =
|
104 |
* __IMPORTANT__: new galleries mechanism. Your created galleries will work but will not be visible in admin panel. Now, you're able to create galleries right in "Insert shortcode" window. Also, you can now create galleries from posts, categories or even custom taxonomies.
|
|
|
|
|
|
|
105 |
* New shortocde [dummy_image]
|
106 |
* New shortocde [dummy_text]
|
107 |
* New shortocde [animate]
|
@@ -114,12 +114,10 @@ Upgrade normally via your Wordpress admin -> Plugins panel.
|
|
114 |
* New slider control for shortcode generator
|
115 |
* Small fixes
|
116 |
|
117 |
-
= 4.3
|
118 |
* New text-shadow picker for [button]
|
119 |
* Anchor navigation for spoilers and tabs - [forum topic](http://wordpress.org/support/topic/hyperlinks-to-spoilers-and-tabs)
|
120 |
* Small fixes
|
121 |
-
|
122 |
-
= 4.3 =
|
123 |
* IMPORTANT: removed old list icons. These icons replaced with new font-awesome icons
|
124 |
* New icon picker for [service], [button] and [list]
|
125 |
* Media manager is now works on widgets page
|
97 |
|
98 |
== Changelog ==
|
99 |
|
100 |
+
= 4.4 =
|
|
|
|
|
|
|
101 |
* __IMPORTANT__: new galleries mechanism. Your created galleries will work but will not be visible in admin panel. Now, you're able to create galleries right in "Insert shortcode" window. Also, you can now create galleries from posts, categories or even custom taxonomies.
|
102 |
+
* Fixed file_get_contents() (disabled http wrappers) issue at the examples page
|
103 |
+
* Added classes Shortcodes_Ultimate_Generator, Shortcodes_Ultimate_Shortcodes and Shortcodes_Ultimate_Data
|
104 |
+
* Removed unused classes MediaUpload and ImageMeta
|
105 |
* New shortocde [dummy_image]
|
106 |
* New shortocde [dummy_text]
|
107 |
* New shortocde [animate]
|
114 |
* New slider control for shortcode generator
|
115 |
* Small fixes
|
116 |
|
117 |
+
= 4.3 =
|
118 |
* New text-shadow picker for [button]
|
119 |
* Anchor navigation for spoilers and tabs - [forum topic](http://wordpress.org/support/topic/hyperlinks-to-spoilers-and-tabs)
|
120 |
* Small fixes
|
|
|
|
|
121 |
* IMPORTANT: removed old list icons. These icons replaced with new font-awesome icons
|
122 |
* New icon picker for [service], [button] and [list]
|
123 |
* Media manager is now works on widgets page
|
screenshot-1.png
DELETED
Binary file
|
screenshot-2.png
DELETED
Binary file
|
screenshot-3.png
DELETED
Binary file
|
screenshot-4.png
DELETED
Binary file
|
screenshot-5.png
DELETED
Binary file
|
shortcodes-ultimate.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Shortcodes Ultimate
|
4 |
Plugin URI: http://gndev.info/shortcodes-ultimate/
|
5 |
-
Version: 4.4.
|
6 |
Author: Vladimir Anokhin
|
7 |
Author URI: http://gndev.info/
|
8 |
Description: Supercharge your WordPress theme with mega pack of shortcodes
|
@@ -13,12 +13,10 @@
|
|
13 |
|
14 |
// Define plugin file constant
|
15 |
define( 'SU_PLUGIN_FILE', __FILE__ );
|
16 |
-
define( 'SU_PLUGIN_VERSION', '4.4.
|
17 |
define( 'SU_ENABLE_CACHE', true );
|
18 |
|
19 |
// Includes
|
20 |
-
require_once 'inc/vendor/class.image-meta.php';
|
21 |
-
require_once 'inc/vendor/class.media-upload.php';
|
22 |
require_once 'inc/vendor/class.sunrise.php';
|
23 |
require_once 'inc/core/admin-views.php';
|
24 |
require_once 'inc/core/admin.php';
|
2 |
/*
|
3 |
Plugin Name: Shortcodes Ultimate
|
4 |
Plugin URI: http://gndev.info/shortcodes-ultimate/
|
5 |
+
Version: 4.4.2
|
6 |
Author: Vladimir Anokhin
|
7 |
Author URI: http://gndev.info/
|
8 |
Description: Supercharge your WordPress theme with mega pack of shortcodes
|
13 |
|
14 |
// Define plugin file constant
|
15 |
define( 'SU_PLUGIN_FILE', __FILE__ );
|
16 |
+
define( 'SU_PLUGIN_VERSION', '4.4.2' );
|
17 |
define( 'SU_ENABLE_CACHE', true );
|
18 |
|
19 |
// Includes
|
|
|
|
|
20 |
require_once 'inc/vendor/class.sunrise.php';
|
21 |
require_once 'inc/core/admin-views.php';
|
22 |
require_once 'inc/core/admin.php';
|