Changeset 1934413
- Timestamp:
- 09/01/2018 07:12:02 PM (7 years ago)
- Location:
- smart-popup/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (5 diffs)
-
smart-popup.php (modified) (11 diffs)
-
view/admin/template/forms/popup-settings.php (modified) (2 diffs)
-
view/how_to_use.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smart-popup/trunk/readme.txt
r1911798 r1934413 5 5 Requires PHP: 5.2.4 6 6 Requires at least: 4.0 7 Tested up to: 4.9. 77 Tested up to: 4.9.1 8 8 Stable tag: trunk 9 9 License: GPLv2 or later … … 19 19 For short code use: [wps-popup id="ID"] (you can see this in popup list, just copy & past) 20 20 21 For PHP hard code in your theme or template page, use: do_shortcode("[wps-popup id='ID' inline='1']") 22 21 23 22 24 … … 25 27 * Use Custom post as popup. 26 28 * Use anywhere in your site. 29 * Use as do_short code 27 30 * Use popup as Link 28 31 * Use Popup as button … … 70 73 71 74 == Changelog == 75 = 1.0.2 = 76 * [new] Short code support on theme and template page as php code. 77 * [new] Add "How to use" submenu for help. 78 72 79 = 1.0.1 = 73 * Fixed JavaScript error for auto load popup74 80 * [fix] Fix some bug on popup load. 81 75 82 = 1.0.0 = 76 83 * Initial release. … … 88 95 = How to hide popup shortcode from Post Excerpt? 89 96 You can change settings from settings page for it. 97 98 99 100 -
smart-popup/trunk/smart-popup.php
r1911795 r1934413 2 2 /* 3 3 * Plugin Name: Smart Popup 4 * Version: 1.0. 14 * Version: 1.0.2 5 5 * Plugin URI: 6 6 * Description: A Complete solution for the popup. You can add a stylish and easily add a popup for page auto load or link on page and post. … … 12 12 * Text Domain: wpsp 13 13 * Domain Path: /lang/ 14 * 14 * 15 15 */ 16 16 … … 41 41 add_action('wp_enqueue_scripts', array($this, 'enqueue')); 42 42 add_action('wp_head', array($this, 'render_global_style')); 43 44 45 43 register_activation_hook(__FILE__, array($this, 'activate')); 46 44 register_deactivation_hook(__FILE__, array($this, 'deactivate')); … … 82 80 83 81 add_action('the_content', array($this, 'add_data_in_post_content')); 84 85 82 } 86 83 … … 166 163 wp_enqueue_script('wps_popup_front', plugins_url('assets/js/script.js', __FILE__), '', false, true); 167 164 wp_enqueue_style('wps_popup_front', plugins_url('/assets/css/style.css', __FILE__)); 168 wp_enqueue_script('jquery-p-js', "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js", array('jquery'),false, false);169 wp_enqueue_script('bootstrap-js', "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js", array('jquery'),false, false);170 165 wp_enqueue_script('jquery-p-js', "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js", array('jquery'), false, false); 166 wp_enqueue_script('bootstrap-js', "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js", array('jquery'), false, false); 167 171 168 $act_theme = get_option('wpsp_active_theme'); 172 169 wp_enqueue_style('wps_popup_front_theme', plugins_url('/assets/css/theme/' . $act_theme . '.css', __FILE__)); … … 198 195 199 196 add_submenu_page('edit.php?post_type=' . $this->custom_post_name, __('Theme', $this->text_domain), __('Theme', $this->text_domain), $capability, __('theme', $this->text_domain), array($this, 'manage_menu_pages')); 200 //add_submenu_page('edit.php?post_type=' . $this->custom_post_name, __('How To USE', $this->text_domain), __('How to Use', $this->text_domain), $capability, __('how_to_use', $this->text_domain), array($this, 'manage_menu_pages'));197 add_submenu_page('edit.php?post_type=' . $this->custom_post_name, __('How To USE', $this->text_domain), __('How to Use', $this->text_domain), $capability, __('how_to_use', $this->text_domain), array($this, 'manage_menu_pages')); 201 198 add_submenu_page('edit.php?post_type=' . $this->custom_post_name, __('WPSP Settings', $this->text_domain), __('Setting', $this->text_domain), $capability, __('global_settings', $this->text_domain), array($this, 'manage_menu_pages')); 202 199 } … … 292 289 function render_short_code($atts, $content = null) { 293 290 294 if ( ! is_single() AND $this->global_setting['hide_in_excerpt'] == 'yes' ){ 291 if (!array_key_exists('inline', $atts)) 292 $atts['inline'] = false; 293 if (!is_single() AND $this->global_setting['hide_in_excerpt'] == 'yes' AND ! $atts['inline']) { 295 294 return; 296 295 } … … 300 299 'id' => '', 301 300 'title' => '', 301 'inline' => false 302 302 ), $atts); 303 303 304 304 extract($a); 305 305 // var_dump($a); 306 306 307 307 if ($id) { … … 312 312 $metadata = get_post_meta($post->ID, $this->text_domain . '_popup_settings', TRUE); 313 313 $metadata = unserialize($metadata); 314 315 ob_start();316 314 $popup_type = $metadata['popup_type']; 315 $html_output = ''; 317 316 318 317 if ($metadata['load_on'] == 'onclick') { … … 320 319 $style = "style=' background-color:{$metadata['button_color']}; border-radius:{$metadata['button_border_radious']}px; border-color:{$metadata['button_color']}'"; 321 320 $style = $metadata['show_as'] == 'button' ? $style : ''; 322 echo $data = "<a href='' {$style} class=' {$class}' data-toggle='modal' data-target='#wpsp-{$id}'>{$title}</a>"; 323 } 324 325 //include WPSP_PATH . '/view/frontend/popup.php'; 326 327 $output = ob_get_clean(); 328 329 return $output; 321 $html_output = "<a href='' {$style} class=' {$class}' data-toggle='modal' data-target='#wpsp-{$id}'>{$title}</a>"; 322 } 323 324 325 if ($inline) { 326 echo $html_output; 327 include WPSP_PATH . '/view/frontend/popup.php'; 328 } else { 329 330 ob_start(); 331 echo $html_output; 332 $output = ob_get_clean(); 333 return $output; 334 } 330 335 } 331 336 332 337 function add_data_in_post_content($content) { 333 if ( ! is_single() AND $this->global_setting['hide_in_excerpt'] == 'yes' ){338 if (!is_single() AND $this->global_setting['hide_in_excerpt'] == 'yes') { 334 339 return $content; 335 } 340 } 336 341 $pattern = get_shortcode_regex(array('wps-popup')); 337 342 preg_match_all('/' . $pattern . '/s', $content, $matches); … … 432 437 return $content; 433 438 } 434 435 436 439 437 440 function show_custom_popup_input() { -
smart-popup/trunk/view/admin/template/forms/popup-settings.php
r1911343 r1934413 10 10 <input type="radio" name="load_on" value="onclick" <?php if($metadata['load_on'] == 'onclick') echo 'checked'; ?> onclick="return switch_mode()" /> On Link click 11 11 </label> 12 <label style="">12 <!-- <label style=""> 13 13 <input type="radio" name="load_on" value="scrool" <?php if($metadata['load_on'] == 'scrool') echo 'checked'; ?> disabled/> On Scrool (Coming soon) 14 </label> 14 </label>--> 15 15 </div> 16 16 … … 25 25 <input type="radio" name="show_as" value="link" <?php if($metadata['show_as'] == 'link') echo 'checked'; ?> /> Link 26 26 </label> 27 <label style="">27 <!-- <label style=""> 28 28 <input type="radio" name="show_as" value="image" <?php if($metadata['show_as'] == 'image') echo 'checked'; ?> disabled/> Image(Coming soon) 29 </label> 29 </label>--> 30 30 31 31 -
smart-popup/trunk/view/how_to_use.php
r1911343 r1934413 3 3 4 4 <div class="how-to-group"> 5 <div class="title"> With Custom posts</div>5 <div class="title"> Use a popup in a post or page </div> 6 6 <div> 7 If you want to use custom post, you can easily use as copy short code from our custom list. or you can use it following : <br/> 7 <ul> 8 <li> * Make popup from smart popup menu </li> 9 <li> * Select your appropriate popup type and settings. </li> 10 <li> * Add short code in any post or page. </li> 11 </ul> 12 8 13 <pre> 9 [wp ob-popover id='YourCustomPostID']14 [wps-popup id='YourPopupID'] 10 15 11 16 for example : 12 [wp ob-popoverid='99']17 [wps-popup id='99'] 13 18 </pre> 14 19 </div> 15 20 </div> 16 21 22 23 24 <div class="how-to-group"> 25 <div class="title"> Use a popup in your theme or template page as PHP code </div> 26 <div> 27 You can add popup in any where in your site with PHP do_short code command. 28 If use in any page template you must use "inline=1" attribute. 29 <pre> 30 do_shortcode("[wps-popup id='YourPopUpID' inline='1']"); 31 32 for example : 33 do_shortcode("[wps-popup id='99' inline='1']"); 34 </pre> 35 </div> 36 </div> 37 17 38 18 39 <div class="how-to-group"> 19 <div class="title"> Set custom style</div>40 <div class="title"> Add Video From YouTube </div> 20 41 <div> 21 If you want to change style of popover, you can set custom background color, text color, popover position, width and more for plugin settings page.42 Select popup type as 'YouTube' than add Video ID in YouTube Settings. 22 43 </div> 23 44 </div> 24 25 45 26 46 <div class="how-to-group"> 27 <div class="title"> Set height-width for popover</div>47 <div class="title"> Add Facebook Page Likebox </div> 28 48 <div> 29 Set 'auto' for popover height and width in settings.49 Select popup type as 'Facebook' than add your Page URL in Facebook Settings. 30 50 </div> 31 51 </div> 32 33 34 35 52 53 54 55 36 56 </div>
Note: See TracChangeset
for help on using the changeset viewer.