Version Description
- Changed admin notices
Download this release
Release Info
Developer | MyThemeShop |
Plugin | WP Shortcode by MyThemeShop |
Version | 1.4.13 |
Comparing to | |
See all releases |
Code changes from version 1.4.12 to 1.4.13
- readme.txt +4 -1
- wp-shortcode.php +49 -2
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Creator's website link: http://mythemeshop.com/
|
|
4 |
Tags: shortcodes, shortcode, shortcodes list, toggle shortcode, buttons, google map shortcode, youtube shortcode, vimeo shortcode, alert shortcode, notification shortcode, column shortcodes
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.9.4
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -65,6 +65,9 @@ Please disable all plugins and check if shortcode plugin is working properly. Th
|
|
65 |
|
66 |
== Changelog ==
|
67 |
|
|
|
|
|
|
|
68 |
= 1.4.12 =
|
69 |
* Fixed responsive column issue.
|
70 |
|
4 |
Tags: shortcodes, shortcode, shortcodes list, toggle shortcode, buttons, google map shortcode, youtube shortcode, vimeo shortcode, alert shortcode, notification shortcode, column shortcodes
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.9.4
|
7 |
+
Stable tag: 1.4.13
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
+
= 1.4.13 =
|
69 |
+
* Changed admin notices
|
70 |
+
|
71 |
= 1.4.12 =
|
72 |
* Fixed responsive column issue.
|
73 |
|
wp-shortcode.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Shortcode by MyThemeShop
|
|
4 |
Plugin URI: http://mythemeshop.com/
|
5 |
Description: With the vast array of shortcodes, you can quickly and easily build content for your posts and pages and turbocharge your blogging experience.
|
6 |
Author: MyThemeShop
|
7 |
-
Version: 1.4.
|
8 |
Author URI: http://mythemeshop.com/
|
9 |
*/
|
10 |
|
@@ -481,4 +481,51 @@ function mts_tooltip( $atts, $content ) {
|
|
481 |
do_action('wps_enqueue_style', 'tooltip');
|
482 |
return '<span class="wp_shortcodes_tooltip" title="'.esc_attr( $atts['content'] ).'" data-gravity="'.esc_attr( $atts['gravity'] ).'" data-fade="'.esc_attr( $atts['fade'] ).'">'.$content.'</span>';
|
483 |
}
|
484 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
Plugin URI: http://mythemeshop.com/
|
5 |
Description: With the vast array of shortcodes, you can quickly and easily build content for your posts and pages and turbocharge your blogging experience.
|
6 |
Author: MyThemeShop
|
7 |
+
Version: 1.4.13
|
8 |
Author URI: http://mythemeshop.com/
|
9 |
*/
|
10 |
|
481 |
do_action('wps_enqueue_style', 'tooltip');
|
482 |
return '<span class="wp_shortcodes_tooltip" title="'.esc_attr( $atts['content'] ).'" data-gravity="'.esc_attr( $atts['gravity'] ).'" data-fade="'.esc_attr( $atts['fade'] ).'">'.$content.'</span>';
|
483 |
}
|
484 |
+
|
485 |
+
register_activation_hook( __FILE__, 'wp_shortcode_activation' );
|
486 |
+
|
487 |
+
if(!function_exists('wp_shortcode_activation')) {
|
488 |
+
function wp_shortcode_activation(){
|
489 |
+
/* Loads activation functions */
|
490 |
+
update_option('wp_shortcode_activated', time());
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
|
495 |
+
/* Display a notice */
|
496 |
+
add_action('admin_notices', 'wp_shortcode_admin_notice');
|
497 |
+
function wp_shortcode_admin_notice() {
|
498 |
+
global $current_user ;
|
499 |
+
$user_id = $current_user->ID;
|
500 |
+
/* Check that the user hasn't already clicked to ignore the message */
|
501 |
+
/* Only show the notice 2 days after plugin activation */
|
502 |
+
if ( ! get_user_meta($user_id, 'wp_shortcode_ignore_notice') && time() >= (get_option( 'wp_shortcode_activated', 0 ) + (2 * 24 * 60 * 60)) ) {
|
503 |
+
echo '<div class="updated notice-info wp-shortcode-notice" id="wpshortcode-notice" style="position:relative;">';
|
504 |
+
printf(__('<p>Like WP Shortcode plugin? You will LOVE <a target="_blank" href="https://mythemeshop.com/plugins/wp-shortcode-pro/?utm_source=WP+Shortcode&utm_medium=Notification+Link&utm_content=WP+Shortcode+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Shortcode Pro!</strong></a></p><a class="notice-dismiss" href="%1$s"></a>', 'wp-shortcode'), '?wp_shortcode_admin_notice_ignore=0');
|
505 |
+
echo "</div>";
|
506 |
+
}
|
507 |
+
/* Other notice appears right after activating */
|
508 |
+
/* And it gets hidden after showing 3 times */
|
509 |
+
if ( ! get_user_meta($user_id, 'wp_shortcode_ignore_notice_2') && get_option('wp_shortcode_notice_views', 0) < 3 ) {
|
510 |
+
$views = get_option('wp_shortcode_notice_views', 0);
|
511 |
+
update_option( 'wp_shortcode_notice_views', ($views + 1) );
|
512 |
+
echo '<div class="updated notice-info wp-shortcode-notice" id="wpshortcode-notice2" style="position:relative;">';
|
513 |
+
echo '<p>';
|
514 |
+
_e('Thank you for trying WP Shortcode. We hope you will like it.', 'wp-shortcode');
|
515 |
+
echo '</p><a class="notice-dismiss" href="?wp_shortcode_admin_notice_ignore=0"></a>';
|
516 |
+
echo "</div>";
|
517 |
+
}
|
518 |
+
}
|
519 |
+
add_action('admin_init', 'wp_shortcode_admin_notice_ignore');
|
520 |
+
function wp_shortcode_admin_notice_ignore() {
|
521 |
+
global $current_user;
|
522 |
+
$user_id = $current_user->ID;
|
523 |
+
/* If user clicks to ignore the notice, add that to their user meta */
|
524 |
+
if ( isset($_GET['wp_shortcode_admin_notice_ignore']) ) {
|
525 |
+
if ( '0' == $_GET['wp_shortcode_admin_notice_ignore'] ) {
|
526 |
+
add_user_meta($user_id, 'wp_shortcode_ignore_notice', '1', true);
|
527 |
+
} elseif ( '1' == $_GET['wp_shortcode_admin_notice_ignore'] ) {
|
528 |
+
add_user_meta($user_id, 'wp_shortcode_ignore_notice_2', '1', true);
|
529 |
+
}
|
530 |
+
}
|
531 |
+
}
|