Propose patch to add image tag in shortcode
-
Hi,
I propose a patch for “Onclick show popup” 6.7 to have an image support in the shortcode.
This is used as follows:
[onclick-show-popup group=”2″ image=”https://www.actif-coaching.com/XXXXXX/charte_preview_2.jpg” width=”176″ height=”248″]This can be seen at: https://www.actif-coaching.com/coaching/
Feel free to add it in mainline if you have any interest in it.
####################################################################
— onclick-show-popup/onclick-show-popup.php 2015-11-13 07:28:15.495155340 +0100
+++ onclick-show-popup.old/onclick-show-popup.php 2015-11-13 07:35:24.295210365 +0100
@@ -2,9 +2,9 @@
/*
Plugin Name: Onclick show popup
Plugin URI: https://www.gopiplus.com/work/2011/12/17/wordpress-plugin-onclick-show-popup-for-content/
-Description: Sometimes its useful to add a popup to your website to show your ads, special announcement and offers. Using this plugin you can creates unblockable, dynamic and fully configurable popups for your blog.
+Description: Sometimes its useful to add a pop up to your website to show your ads, special announcement and offers. Using this plug-in you can creates unblockable, dynamic and fully configurable popups for your blog.
Author: Gopi Ramasamy
-Version: 6.7
+Version: 6.5
Author URI: https://www.gopiplus.com/work/2011/12/17/wordpress-plugin-onclick-show-popup-for-content/
Donate link: https://www.gopiplus.com/work/2011/12/17/wordpress-plugin-onclick-show-popup-for-content/
License: GPLv2 or later
@@ -248,6 +248,7 @@global $wpdb;
$group = “”;
+ $image = “”;//[onclick-show-popup group=”1″]
if ( ! is_array( $atts ) )
@@ -255,6 +256,9 @@
return ”;
}
$group = OnclickShowPopup_Group($atts[‘group’]);
+ $image = $atts[‘image’];
+ $width = $atts[‘width’];
+ $height = $atts[‘height’];$OnclickShowPopup_widget = $group;
$OnclickShowPopup_random = get_option(‘OnclickShowPopup_random’);
@@ -284,9 +288,15 @@
$OnclickShowPopup_title = stripslashes($data->OnclickShowPopup_title);
$OnclickShowPopup_text = stripslashes($data->OnclickShowPopup_text);
$OnclickShowPopup_text = str_replace(“\r\n”, “
“, $OnclickShowPopup_text);
–
– $li = $li . ‘- ‘.$OnclickShowPopup_title.’
- ‘.$OnclickShowPopup_title.’
‘;
–
+
+ if ($image == “”)
+ {
+ $li = $li . ‘‘;
+ }
+ else
+ {
+ $li = $li . ‘<img src=”‘.$image.'” width=”‘.$width.'” height=”‘.$height.'” class=”aligncenter size-full”/>‘;
+ }$div = $div . ‘<div id=”inline_demo’.$counter.'” style=”display:none;”>’.$OnclickShowPopup_text.'</div>’;
$counter = $counter + 1;
@@ -327,4 +337,4 @@
register_activation_hook(__FILE__, ‘OnclickShowPopup_activation’);
add_action(“plugins_loaded”, “OnclickShowPopup_plugins_loaded”);
register_deactivation_hook( __FILE__, ‘OnclickShowPopup_deactivate’ );
-?>
\ Pas de fin de ligne à la fin du fichier
+?>
####################################################################
- The topic ‘Propose patch to add image tag in shortcode’ is closed to new replies.