Easy Modal - Version 1.2.0.1

Version Description

  • Fixed issue that caused wp editor to not load with certain themes.
Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Easy Modal
Version 1.2.0.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.0.1

Files changed (2) hide show
  1. easy-modal.php +22 -23
  2. readme.txt +4 -1
easy-modal.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
  Plugin Name: Easy Modal
4
- Plugin URI: http://wizardinternetsolutions.com/plugins/easy-modal/
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Wizard Internet Solutions
7
- Version: 1.2
8
  Author URI: http://wizardinternetsolutions.com
9
  */
10
  if (!defined('EASYMODAL'))
@@ -20,7 +20,7 @@ if (!defined('EASYMODAL_URL'))
20
  define('EASYMODAL_URL', WP_PLUGIN_URL . '/' . EASYMODAL_SLUG);
21
 
22
  if (!defined('EASYMODAL_VERSION'))
23
- define('EASYMODAL_VERSION', '1.2' );
24
 
25
  class Easy_Modal {
26
  protected $api_url = 'http://easy-modal.com/api';
@@ -53,7 +53,8 @@ class Easy_Modal {
53
  }
54
  add_filter( 'plugin_action_links', array(&$this, '_actionLinks') , 10, 2 );
55
  add_filter('mce_buttons_2', array(&$this, '_TinyMCEButtons'), 999);
56
- add_filter('tiny_mce_before_init', array(&$this, '_TinyMCEInit'));
 
57
 
58
  add_action( 'load-post.php', array(&$this, 'post_meta_boxes_setup'));
59
  add_action( 'load-post-new.php', array(&$this, 'post_meta_boxes_setup') );
@@ -104,7 +105,6 @@ class Easy_Modal {
104
  return $post_id;
105
 
106
  $post_modals = ( !empty( $_POST['easy_modal_post_modals']) && $this->all_numeric($_POST['easy_modal_post_modals']) ) ? $_POST['easy_modal_post_modals'] : array() ;
107
-
108
  $current_post_modals = get_post_meta( $post_id, 'easy_modal_post_modals', true );
109
  if ( $post_modals && '' == $current_post_modals )
110
  add_post_meta( $post_id, 'easy_modal_post_modals', $post_modals, true );
@@ -376,32 +376,31 @@ class Easy_Modal {
376
  {
377
  $posk_links = '<a href="'.get_admin_url().'admin.php?page='.EASYMODAL_SLUG.'-settings">'.__('Settings').'</a>';
378
  array_unshift( $links, $posk_links );
379
- $posk_links = '<a href="http://wizardinternetsolutions.com/plugins/easy-modal?utm_source=em-lite&utm_medium=dashboard+link&utm_campaign=upgrade">'.__('Upgrade').'</a>';
380
  array_unshift( $links, $posk_links );
381
  }
382
  return $links;
383
  }
384
- public function _TinyMCEButtons($orig)
385
  {
386
- return array_merge($orig, array('styleselect'));
 
 
387
  }
388
  public function _TinyMCEInit($initArray)
389
  {
390
- global $wpdb;
391
- // Custom classes
392
- $modals = $this->getModalList();
393
- $customClasses = array();
394
- foreach($modals as $key => $modal)
395
- {
396
- $customClasses['Modal - '.$modal] = 'eModal-'.$key;
397
- }
398
- // Build array
399
- $initArray['theme_advanced_styles'] = isset($initArray['theme_advanced_styles']) ? $initArray['theme_advanced_styles'] : '';
400
- foreach($customClasses as $name => $css)
401
- {
402
- $initArray['theme_advanced_styles'] .= $name.'='.$css.';';
403
- }
404
- $initArray['theme_advanced_styles'] = rtrim($initArray['theme_advanced_styles'], ';'); // Remove final semicolon from list
405
  return $initArray;
406
  }
407
  private $_accepted_modal_ids = array('new');
1
  <?php
2
  /*
3
  Plugin Name: Easy Modal
4
+ Plugin URI: https://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Wizard Internet Solutions
7
+ Version: 1.2.0.1
8
  Author URI: http://wizardinternetsolutions.com
9
  */
10
  if (!defined('EASYMODAL'))
20
  define('EASYMODAL_URL', WP_PLUGIN_URL . '/' . EASYMODAL_SLUG);
21
 
22
  if (!defined('EASYMODAL_VERSION'))
23
+ define('EASYMODAL_VERSION', '1.2.0.1' );
24
 
25
  class Easy_Modal {
26
  protected $api_url = 'http://easy-modal.com/api';
53
  }
54
  add_filter( 'plugin_action_links', array(&$this, '_actionLinks') , 10, 2 );
55
  add_filter('mce_buttons_2', array(&$this, '_TinyMCEButtons'), 999);
56
+ add_filter('tiny_mce_before_init', array(&$this, '_TinyMCEInit'),999);
57
+
58
 
59
  add_action( 'load-post.php', array(&$this, 'post_meta_boxes_setup'));
60
  add_action( 'load-post-new.php', array(&$this, 'post_meta_boxes_setup') );
105
  return $post_id;
106
 
107
  $post_modals = ( !empty( $_POST['easy_modal_post_modals']) && $this->all_numeric($_POST['easy_modal_post_modals']) ) ? $_POST['easy_modal_post_modals'] : array() ;
 
108
  $current_post_modals = get_post_meta( $post_id, 'easy_modal_post_modals', true );
109
  if ( $post_modals && '' == $current_post_modals )
110
  add_post_meta( $post_id, 'easy_modal_post_modals', $post_modals, true );
376
  {
377
  $posk_links = '<a href="'.get_admin_url().'admin.php?page='.EASYMODAL_SLUG.'-settings">'.__('Settings').'</a>';
378
  array_unshift( $links, $posk_links );
379
+ $posk_links = '<a href="https://easy-modal.com/pricing-purchase?utm_source=em-lite&utm_medium=dashboard+link&utm_campaign=upgrade">'.__('Upgrade').'</a>';
380
  array_unshift( $links, $posk_links );
381
  }
382
  return $links;
383
  }
384
+ public function _TinyMCEButtons($buttons)
385
  {
386
+ if ( ! in_array( 'styleselect', $buttons ) )
387
+ $buttons[] = 'styleselect';
388
+ return $buttons;
389
  }
390
  public function _TinyMCEInit($initArray)
391
  {
392
+ // Add Modal styles to styles dropdown
393
+ $styles = json_decode($initArray['style_formats']);
394
+ if(!is_array($styles)) $styles = array();
395
+ foreach($this->getModalList() as $key => $modal)
396
+ {
397
+ $styles[] = array(
398
+ 'title' => "Open Modal - $modal",
399
+ 'inline' => 'span',
400
+ 'classes' => "eModal-$key"
401
+ );
402
+ }
403
+ $initArray['style_formats'] = json_encode($styles);
 
 
 
404
  return $initArray;
405
  }
406
  private $_accepted_modal_ids = array('new');
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
6
  Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
7
  Requires at least: 3.2
8
  Tested up to: 3.6
9
- Stable tag: 1.2
10
  Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos, slideshows & more.
11
 
12
  == Description ==
@@ -67,6 +67,9 @@ We have only included some basic styling for the modal at this point. You can ad
67
  1. Easy Modal with default "Contact Fom 7" form.
68
  2. Shows CF7 Inline validation used during ajax submit
69
  == Changelog ==
 
 
 
70
  = 1.2 =
71
  * Code has been rewritten from ground up, JS, admin panels etc.
72
  * Added animations
6
  Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
7
  Requires at least: 3.2
8
  Tested up to: 3.6
9
+ Stable tag: 1.2.0.1
10
  Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos, slideshows & more.
11
 
12
  == Description ==
67
  1. Easy Modal with default "Contact Fom 7" form.
68
  2. Shows CF7 Inline validation used during ajax submit
69
  == Changelog ==
70
+ = 1.2.0.1 =
71
+ * Fixed issue that caused wp editor to not load with certain themes.
72
+
73
  = 1.2 =
74
  * Code has been rewritten from ground up, JS, admin panels etc.
75
  * Added animations