WP Edit - Version 3.8

Version Description

  • 05/11/16

  • Added support for WP Edit toolbars in custom post types excerpt areas.

  • Fixed deprecated function. (htmledit_pre changed to format_for_editor) (main.php ~line 115).

  • Updated introduction video link.

  • Minor changes to ensure WordPress 4.6 compatibility.

  • Increased stable tag version.

Download this release

Release Info

Developer josh401
Plugin Icon wp plugin WP Edit
Version 3.8
Comparing to
See all releases

Code changes from version 3.7 to 3.8

Files changed (3) hide show
  1. includes/functions.php +27 -0
  2. main.php +65 -9
  3. readme.txt +13 -4
includes/functions.php CHANGED
@@ -200,6 +200,33 @@ if($plugin_options_general['page_excerpt_editor'] == 1) {
200
  }
201
  }
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  // Extend editor to profile biography
204
  if($plugin_options_general['profile_editor'] == 1) {
205
 
200
  }
201
  }
202
 
203
+ // Add Editor to CPT's
204
+ if(isset($plugin_options_general['cpt_excerpt_editor']) && !empty($plugin_options_general['cpt_excerpt_editor'])) {
205
+
206
+ add_action('admin_init', 'wp_edit_change_cpt_excerpt');
207
+ }
208
+ function wp_edit_change_cpt_excerpt() {
209
+
210
+ $plugin_options_general = get_option('wp_edit_general');
211
+ $cpt_excerpts = $plugin_options_general['cpt_excerpt_editor'];
212
+
213
+ foreach($cpt_excerpts as $key => $cpt) {
214
+
215
+ remove_meta_box('postexcerpt', $cpt, 'normal');
216
+ add_meta_box('postexcerpt', __('Wp Edit (' . $cpt . ') Excerpt','wp-edit'), 'wp_edit_cpt_excerpt_meta_box', $cpt, 'normal');
217
+ }
218
+ }
219
+ function wp_edit_cpt_excerpt_meta_box() {
220
+
221
+ global $wpdb, $post;
222
+ $get_cpt_excerpt = $wpdb->get_row("SELECT post_excerpt FROM $wpdb->posts WHERE id = '$post->ID'");
223
+ $cpt_excerpt = $get_cpt_excerpt->post_excerpt;
224
+ $id = 'excerpt';
225
+ $settings = array('quicktags' => array('buttons' => 'em,strong,link',), 'text_area_name' => 'excerpt', 'quicktags' => true, 'tinymce' => true, 'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:250px; width:100%;}</style>');
226
+
227
+ wp_editor($cpt_excerpt, $id, $settings);
228
+ }
229
+
230
  // Extend editor to profile biography
231
  if($plugin_options_general['profile_editor'] == 1) {
232
 
main.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Edit
4
  * Plugin URI: https://wpeditpro.com
5
  * Description: Ultimate WordPress Content Editing.
6
- * Version: 3.7
7
  * Author: Josh Lobe
8
  * Author URI: https://wpeditpro.com
9
  * License: GPL2
@@ -50,7 +50,8 @@ class wp_edit_class {
50
  'shortcodes_in_excerpts' => '0',
51
  'post_excerpt_editor' => '0',
52
  'page_excerpt_editor' => '0',
53
- 'profile_editor' => '0'
 
54
  );
55
  public $global_options_posts = array(
56
  'post_title_field' => 'Enter title here',
@@ -112,7 +113,7 @@ class wp_edit_class {
112
  add_filter('tiny_mce_before_init', array($this, 'wp_edit_tiny_mce_before_init')); // Before tinymce initialization
113
  add_action('init', array($this, 'wp_edit_init_tinymce')); // Tinymce initialization
114
 
115
- add_filter('htmledit_pre', array($this, 'htlmedit_pre'), 999); // Filter html content if wpautop is disabled
116
 
117
  $plugin_file = basename( __FILE__ );
118
  $plugin_folder = basename( dirname( __FILE__ ) );
@@ -984,6 +985,9 @@ class wp_edit_class {
984
  */
985
  else if($active_tab == 'general'){
986
 
 
 
 
987
  echo '<div class="main_container">';
988
 
989
  ?>
@@ -1001,6 +1005,7 @@ class wp_edit_class {
1001
  $post_excerpt_editor = isset($options_general['post_excerpt_editor']) && $options_general['post_excerpt_editor'] === '1' ? 'checked="checked"' : '';
1002
  $page_excerpt_editor = isset($options_general['page_excerpt_editor']) && $options_general['page_excerpt_editor'] === '1' ? 'checked="checked"' : '';
1003
  $profile_editor = isset($options_general['profile_editor']) && $options_general['profile_editor'] === '1' ? 'checked="checked"' : '';
 
1004
  ?>
1005
 
1006
  <table cellpadding="8">
@@ -1023,6 +1028,22 @@ class wp_edit_class {
1023
  <label for="shortcodes_in_excerpts"><?php _e('Use shortcodes in excerpt areas.', 'wp-edit'); ?></label>
1024
  </td>
1025
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1026
  <tr><td><?php _e('WP Edit Post Excerpt', 'wp-edit'); ?></td>
1027
  <td>
1028
  <input id="post_excerpt_editor" type="checkbox" value="1" name="post_excerpt_editor" <?php echo $post_excerpt_editor; ?> />
@@ -1035,12 +1056,27 @@ class wp_edit_class {
1035
  <label for="page_excerpt_editor"><?php _e('Add the WP Edit editor to the Page Excerpt area.', 'wp-edit'); ?></label>
1036
  </td>
1037
  </tr>
1038
- <tr><td><?php _e('Profile Editor', 'wp-edit'); ?></td>
1039
- <td class="jwl_user_cell">
1040
- <input id="profile_editor" type="checkbox" value="1" name="profile_editor" <?php echo $profile_editor; ?> />
1041
- <label for="profile_editor"><?php _e('Use modified editor in profile biography field.', 'wp-edit'); ?></label>
1042
- </td>
1043
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1044
  </tbody>
1045
  </table>
1046
  </div>
@@ -1921,6 +1957,25 @@ class wp_edit_class {
1921
  $options_general['page_excerpt_editor'] = isset($_POST['page_excerpt_editor']) ? '1' : '0';
1922
  $options_general['profile_editor'] = isset($_POST['profile_editor']) ? '1' : '0';
1923
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1924
  update_option('wp_edit_general', $options_general);
1925
 
1926
  function general_saved_notice(){
@@ -2567,6 +2622,7 @@ class wp_edit_class {
2567
  $content = wpautop( $content );
2568
  $content = preg_replace( '/^<p>(https?:\/\/[^<> "]+?)<\/p>$/im', '$1', $content );
2569
  $content = htmlspecialchars( $content, ENT_NOQUOTES, get_option( 'blog_charset' ) );
 
2570
  }
2571
  return $content;
2572
  }
3
  * Plugin Name: WP Edit
4
  * Plugin URI: https://wpeditpro.com
5
  * Description: Ultimate WordPress Content Editing.
6
+ * Version: 3.8
7
  * Author: Josh Lobe
8
  * Author URI: https://wpeditpro.com
9
  * License: GPL2
50
  'shortcodes_in_excerpts' => '0',
51
  'post_excerpt_editor' => '0',
52
  'page_excerpt_editor' => '0',
53
+ 'profile_editor' => '0',
54
+ 'cpt_excerpt_editor' => array()
55
  );
56
  public $global_options_posts = array(
57
  'post_title_field' => 'Enter title here',
113
  add_filter('tiny_mce_before_init', array($this, 'wp_edit_tiny_mce_before_init')); // Before tinymce initialization
114
  add_action('init', array($this, 'wp_edit_init_tinymce')); // Tinymce initialization
115
 
116
+ add_filter('format_for_editor', array($this, 'htlmedit_pre')); // Filter html content if wpautop is disabled
117
 
118
  $plugin_file = basename( __FILE__ );
119
  $plugin_folder = basename( dirname( __FILE__ ) );
985
  */
986
  else if($active_tab == 'general'){
987
 
988
+ // Get all cpt's (_builtin will exclude default post types)
989
+ $post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names' );
990
+
991
  echo '<div class="main_container">';
992
 
993
  ?>
1005
  $post_excerpt_editor = isset($options_general['post_excerpt_editor']) && $options_general['post_excerpt_editor'] === '1' ? 'checked="checked"' : '';
1006
  $page_excerpt_editor = isset($options_general['page_excerpt_editor']) && $options_general['page_excerpt_editor'] === '1' ? 'checked="checked"' : '';
1007
  $profile_editor = isset($options_general['profile_editor']) && $options_general['profile_editor'] === '1' ? 'checked="checked"' : '';
1008
+ $cpt_excerpts = isset($options_general['cpt_excerpt_editor']) ? $options_general['cpt_excerpt_editor'] : array();
1009
  ?>
1010
 
1011
  <table cellpadding="8">
1028
  <label for="shortcodes_in_excerpts"><?php _e('Use shortcodes in excerpt areas.', 'wp-edit'); ?></label>
1029
  </td>
1030
  </tr>
1031
+ <tr><td><?php _e('Profile Editor', 'wp-edit'); ?></td>
1032
+ <td class="jwl_user_cell">
1033
+ <input id="profile_editor" type="checkbox" value="1" name="profile_editor" <?php echo $profile_editor; ?> />
1034
+ <label for="profile_editor"><?php _e('Use modified editor in profile biography field.', 'wp-edit'); ?></label>
1035
+ </td>
1036
+ </tr>
1037
+ </tbody>
1038
+ </table>
1039
+ </div>
1040
+ </div>
1041
+
1042
+ <div class="postbox">
1043
+ <div class="inside">
1044
+
1045
+ <table cellpadding="8">
1046
+ <tbody>
1047
  <tr><td><?php _e('WP Edit Post Excerpt', 'wp-edit'); ?></td>
1048
  <td>
1049
  <input id="post_excerpt_editor" type="checkbox" value="1" name="post_excerpt_editor" <?php echo $post_excerpt_editor; ?> />
1056
  <label for="page_excerpt_editor"><?php _e('Add the WP Edit editor to the Page Excerpt area.', 'wp-edit'); ?></label>
1057
  </td>
1058
  </tr>
1059
+ </tbody>
1060
+ </table>
1061
+
1062
+ <h3><?php _e('Custom Post Types', 'wp-edit'); ?></h3>
1063
+ <table cellpadding="3" style="margin-left:7px;">
1064
+ <tbody>
1065
+ <?php
1066
+ if( !empty( $post_types) ) {
1067
+ foreach ( $post_types as $post_type ) {
1068
+
1069
+ $selected = in_array($post_type, $cpt_excerpts) ? 'checked="checked"' : '';
1070
+ echo '<tr><td><input type="checkbox" name="cpt_excerpt_editor['.$post_type.']" '.$selected.'> '.$post_type.'</td></tr>';
1071
+ }
1072
+ }
1073
+ else {
1074
+
1075
+ echo '<tr><td>';
1076
+ _e('No registered custom post types were found.', 'wp-edit');
1077
+ echo '</td></tr>';
1078
+ }
1079
+ ?>
1080
  </tbody>
1081
  </table>
1082
  </div>
1957
  $options_general['page_excerpt_editor'] = isset($_POST['page_excerpt_editor']) ? '1' : '0';
1958
  $options_general['profile_editor'] = isset($_POST['profile_editor']) ? '1' : '0';
1959
 
1960
+ // Save cpt excerpts
1961
+ $cpt_excerpts = array();
1962
+ $options_general['cpt_excerpt_editor'] = array();
1963
+
1964
+ if(isset($_POST['cpt_excerpt_editor'])) {
1965
+
1966
+ $cpt_excerpts = $_POST['cpt_excerpt_editor'];
1967
+
1968
+ // Loop checked cpt's and create array
1969
+ foreach($cpt_excerpts as $key => $value) {
1970
+
1971
+ if($value === 'on')
1972
+ $options_general['cpt_excerpt_editor'][] = $key;
1973
+ }
1974
+ }
1975
+ else {
1976
+ $options_general['cpt_excerpt_editor'] = array();
1977
+ }
1978
+
1979
  update_option('wp_edit_general', $options_general);
1980
 
1981
  function general_saved_notice(){
2622
  $content = wpautop( $content );
2623
  $content = preg_replace( '/^<p>(https?:\/\/[^<> "]+?)<\/p>$/im', '$1', $content );
2624
  $content = htmlspecialchars( $content, ENT_NOQUOTES, get_option( 'blog_charset' ) );
2625
+ var_dump($content);
2626
  }
2627
  return $content;
2628
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: josh401
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9E5VNRBMVBCS
4
  Tags: wpedit, wp edit, editor, buttons, button, add, font, font style, font select, table, tables, visual editor, search, replace, colors, color, anchor, advance, advanced, links, link, popup, javascript, upgrade, update, admin, image, images, citations, preview, html, custom css, borders, pages, posts, colorful, php, php widget, shortcode, shortcodes, style, styles, plugin, login, excerpt, id, post, page, youtube, tinymce
5
  Requires at least: 3.9
6
- Tested up to: 4.5 Alpha
7
- Stable tag: 3.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,7 +13,7 @@ Take complete control over the WordPress content editor.
13
  == Description ==
14
 
15
  = Introduction =
16
- For a riveting video introduction into the possibilities available with WP Edit; please visit [Jupiter Jim's Marketing Team](http://jupiterjimsmarketingteam.com/wordpress-video-tutorials/change-font-size-family-wordpress/).
17
 
18
  = Description =
19
 
@@ -97,8 +97,17 @@ OR...
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
 
 
 
 
100
  = 3.7 =
101
- * 01/11-16
102
 
103
  * Fixed Feedblitz image loading insecure over https.
104
  * Fixed WP_PLUGIN_URL constant; switched to using plugins_url() function.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9E5VNRBMVBCS
4
  Tags: wpedit, wp edit, editor, buttons, button, add, font, font style, font select, table, tables, visual editor, search, replace, colors, color, anchor, advance, advanced, links, link, popup, javascript, upgrade, update, admin, image, images, citations, preview, html, custom css, borders, pages, posts, colorful, php, php widget, shortcode, shortcodes, style, styles, plugin, login, excerpt, id, post, page, youtube, tinymce
5
  Requires at least: 3.9
6
+ Tested up to: 4.6
7
+ Stable tag: 3.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
13
  == Description ==
14
 
15
  = Introduction =
16
+ For a riveting video introduction into the possibilities available with WP Edit; please visit [Jupiter Jim's Marketing Team](http://jupiterjim.club/wordpress/tutorials/change-font-family-font-size-wordpress-4-4-1/).
17
 
18
  = Description =
19
 
97
 
98
  == Changelog ==
99
 
100
+ = 3.8 =
101
+ * 05/11/16
102
+
103
+ * Added support for WP Edit toolbars in custom post types excerpt areas.
104
+ * Fixed deprecated function. (htmledit_pre changed to format_for_editor) (main.php ~line 115).
105
+ * Updated introduction video link.
106
+ * Minor changes to ensure WordPress 4.6 compatibility.
107
+ * Increased stable tag version.
108
+
109
  = 3.7 =
110
+ * 01/11/16
111
 
112
  * Fixed Feedblitz image loading insecure over https.
113
  * Fixed WP_PLUGIN_URL constant; switched to using plugins_url() function.