Custom Post Types and Custom Fields creator – WCK - Version 2.1.9

Version Description

  • Added 'rewrite' and 'rewrite slug' advanced options for custom taxonomy creator
  • Added a plugin notification class
  • Put back the yellow background on rows when editing an entry
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 Custom Post Types and Custom Fields creator – WCK
Version 2.1.9
Comparing to
See all releases

Code changes from version 2.1.8 to 2.1.9

inc/class_notices.php CHANGED
@@ -14,18 +14,18 @@ class WCK_Add_Notices{
14
  public $endDate = '';
15
 
16
  function __construct( $notificationId, $notificationMessage, $notificationClass = 'updated' , $startDate = '', $endDate = '' ){
17
- $this->notificationId = $notificationId;
18
- $this->notificationMessage = $notificationMessage;
19
- $this->notificationClass = $notificationClass;
20
 
21
- if( !empty( $startDate ) && time() < strtotime( $startDate ) )
22
- return;
23
 
24
- if( !empty( $endDate ) && time() > strtotime( $endDate ) )
25
- return;
26
 
27
- add_action( 'admin_notices', array( $this, 'add_admin_notice' ) );
28
- add_action( 'admin_init', array( $this, 'dismiss_notification' ) );
29
  }
30
 
31
 
@@ -48,17 +48,233 @@ class WCK_Add_Notices{
48
  }
49
 
50
  function dismiss_notification() {
51
- global $current_user;
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
- $user_id = $current_user->ID;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- do_action( $this->notificationId.'_before_notification_dismissed', $current_user );
 
56
 
57
- // If user clicks to ignore the notice, add that to their user meta
58
- if ( isset( $_GET[$this->notificationId.'_dismiss_notification']) && '0' == $_GET[$this->notificationId.'_dismiss_notification'] )
59
- add_user_meta( $user_id, $this->notificationId.'_dismiss_notification', 'true', true );
60
 
61
- do_action( $this->notificationId.'_after_notification_dismissed', $current_user );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
- ?>
14
  public $endDate = '';
15
 
16
  function __construct( $notificationId, $notificationMessage, $notificationClass = 'updated' , $startDate = '', $endDate = '' ){
17
+ $this->notificationId = $notificationId;
18
+ $this->notificationMessage = $notificationMessage;
19
+ $this->notificationClass = $notificationClass;
20
 
21
+ if( !empty( $startDate ) && time() < strtotime( $startDate ) )
22
+ return;
23
 
24
+ if( !empty( $endDate ) && time() > strtotime( $endDate ) )
25
+ return;
26
 
27
+ add_action( 'admin_notices', array( $this, 'add_admin_notice' ) );
28
+ add_action( 'admin_init', array( $this, 'dismiss_notification' ) );
29
  }
30
 
31
 
48
  }
49
 
50
  function dismiss_notification() {
51
+ global $current_user;
52
+
53
+ $user_id = $current_user->ID;
54
+
55
+ do_action( $this->notificationId.'_before_notification_dismissed', $current_user );
56
+
57
+ // If user clicks to ignore the notice, add that to their user meta
58
+ if ( isset( $_GET[$this->notificationId.'_dismiss_notification']) && '0' == $_GET[$this->notificationId.'_dismiss_notification'] )
59
+ add_user_meta( $user_id, $this->notificationId.'_dismiss_notification', 'true', true );
60
+
61
+ do_action( $this->notificationId.'_after_notification_dismissed', $current_user );
62
+ }
63
+ }
64
 
65
+ Class WCK_Plugin_Notifications {
66
+
67
+ public $notifications = array();
68
+ private static $_instance = null;
69
+ private $prefix = 'wck';
70
+ private $menu_slug = 'wck-page';
71
+ public $pluginPages = array( 'sas-page', 'cptc-page', 'ctc-page', 'wck-' );
72
+
73
+ protected function __construct() {
74
+ add_action( 'admin_init', array( $this, 'dismiss_admin_notifications' ), 200 );
75
+ add_action( 'admin_init', array( $this, 'add_admin_menu_notification_counts' ), 1000 );
76
+ }
77
+
78
+
79
+ function dismiss_admin_notifications() {
80
+ if( ! empty( $_GET[$this->prefix.'_dismiss_admin_notification'] ) ) {
81
+ $notifications = self::get_instance();
82
+ $notifications->dismiss_notification( sanitize_text_field( $_GET[$this->prefix.'_dismiss_admin_notification'] ) );
83
+ }
84
+
85
+ }
86
+
87
+ function add_admin_menu_notification_counts() {
88
+
89
+ global $menu, $submenu;
90
+
91
+ $notifications = WCK_Plugin_Notifications::get_instance();
92
+
93
+ if( ! empty( $menu ) ) {
94
+ foreach( $menu as $menu_position => $menu_data ) {
95
+ if( ! empty( $menu_data[2] ) && $menu_data[2] == $this->menu_slug ) {
96
+ $menu_count = $notifications->get_count_in_menu();
97
+ if( ! empty( $menu_count ) )
98
+ $menu[$menu_position][0] .= '<span class="update-plugins '.$this->prefix.'-update-plugins"><span class="plugin-count">' . $menu_count . '</span></span>';
99
+ }
100
+ }
101
+ }
102
+
103
+ if( ! empty( $submenu[$this->menu_slug] ) ) {
104
+ foreach( $submenu[$this->menu_slug] as $menu_position => $menu_data ) {
105
+ $menu_count = $notifications->get_count_in_submenu( $menu_data[2] );
106
+ if( ! empty( $menu_count ) )
107
+ $submenu[$this->menu_slug][$menu_position][0] .= '<span class="update-plugins '.$this->prefix.'-update-plugins"><span class="plugin-count">' . $menu_count . '</span></span>';
108
+ }
109
+ }
110
+ }
111
+
112
+ /**
113
+ *
114
+ *
115
+ */
116
+ public static function get_instance() {
117
+ if( is_null( self::$_instance ) )
118
+ self::$_instance = new WCK_Plugin_Notifications();
119
+
120
+ return self::$_instance;
121
+ }
122
+
123
+
124
+ /**
125
+ *
126
+ *
127
+ */
128
+ public function add_notification( $notification_id = '', $notification_message = '', $notification_class = 'update-nag', $count_in_menu = true, $count_in_submenu = array() ) {
129
+
130
+ if( empty( $notification_id ) )
131
+ return;
132
+
133
+ if( empty( $notification_message ) )
134
+ return;
135
+
136
+ global $current_user;
137
+
138
+ if( get_user_meta( $current_user->ID, $notification_id . '_dismiss_notification' ) )
139
+ return;
140
+
141
+ $this->notifications[$notification_id] = array(
142
+ 'id' => $notification_id,
143
+ 'message' => $notification_message,
144
+ 'class' => $notification_class,
145
+ 'count_in_menu' => $count_in_menu,
146
+ 'count_in_submenu' => $count_in_submenu
147
+ );
148
+
149
+
150
+ if( $this->is_plugin_page() ) {
151
+ new WCK_Add_Notices( $notification_id, $notification_message, $notification_class );
152
+ }
153
+
154
+ }
155
+
156
+
157
+ /**
158
+ *
159
+ *
160
+ */
161
+ public function get_notifications() {
162
+ return $this->notifications;
163
+ }
164
+
165
+
166
+ /**
167
+ *
168
+ *
169
+ */
170
+ public function get_notification( $notification_id = '' ) {
171
 
172
+ if( empty( $notification_id ) )
173
+ return null;
174
 
175
+ $notifications = $this->get_notifications();
 
 
176
 
177
+ if( ! empty( $notifications[$notification_id] ) )
178
+ return $notifications[$notification_id];
179
+ else
180
+ return null;
181
+
182
+ }
183
+
184
+
185
+ /**
186
+ *
187
+ *
188
+ */
189
+ public function dismiss_notification( $notification_id = '' ) {
190
+ global $current_user;
191
+ add_user_meta( $current_user->ID, $notification_id . '_dismiss_notification', 'true', true );
192
+ }
193
+
194
+
195
+ /**
196
+ *
197
+ *
198
+ */
199
+ public function get_count_in_menu() {
200
+ $count = 0;
201
+
202
+ foreach( $this->notifications as $notification ) {
203
+ if( ! empty( $notification['count_in_menu'] ) )
204
+ $count++;
205
+ }
206
+
207
+ return $count;
208
  }
209
+
210
+
211
+ /**
212
+ *
213
+ *
214
+ */
215
+ public function get_count_in_submenu( $submenu = '' ) {
216
+
217
+ if( empty( $submenu ) )
218
+ return 0;
219
+
220
+ $count = 0;
221
+
222
+ foreach( $this->notifications as $notification ) {
223
+ if( empty( $notification['count_in_submenu'] ) )
224
+ continue;
225
+
226
+ if( ! is_array( $notification['count_in_submenu'] ) )
227
+ continue;
228
+
229
+ if( ! in_array( $submenu, $notification['count_in_submenu'] ) )
230
+ continue;
231
+
232
+ $count++;
233
+ }
234
+
235
+ return $count;
236
+
237
+ }
238
+
239
+
240
+ /**
241
+ *
242
+ *
243
+ */
244
+ protected function is_plugin_page() {
245
+ if( !empty( $this->pluginPages ) ){
246
+ foreach ( $this->pluginPages as $pluginPage ){
247
+ if( ! empty( $_GET['page'] ) && false !== strpos( $_GET['page'], $pluginPage ) )
248
+ return true;
249
+
250
+ if( ! empty( $_GET['post_type'] ) && false !== strpos( $_GET['post_type'], $pluginPage ) )
251
+ return true;
252
+
253
+ if( ! empty( $_GET['post'] ) && false !== strpos( get_post_type( (int)$_GET['post'] ), $pluginPage ) )
254
+ return true;
255
+ }
256
+ }
257
+
258
+ return false;
259
+ }
260
+
261
+ }
262
+
263
+
264
+ function wck_add_plugin_notifications() {
265
+
266
+ /*$wck_notifications = WCK_Plugin_Notifications::get_instance();
267
+
268
+ // this must be unique
269
+ $notification_id = 'wck_new_add_on_invoices';
270
+
271
+ $message = '<img style="float: left; margin: 10px 12px 10px 0; max-width: 80px;" src="' . WCK_PLUGIN_DIR_URL . 'images/pb-trp-cross-promotion.png" />';
272
+ $message .= '<p style="margin-top: 16px;">' . __( 'This is a content.', 'wck' ) . '</p>';
273
+ //make sure to use wck_dismiss_admin_notification as an argument
274
+ $message .= '<p><a href="' . add_query_arg( array( 'page' => 'cptc-page', 'wck_dismiss_admin_notification' => $notification_id ), admin_url( 'admin.php' ) ) . '" class="button-primary">' . __( 'Check it out!', 'wck' ) . '</a></p>';
275
+ $message .= '<a href="' . add_query_arg( array( 'wck_dismiss_admin_notification' => $notification_id ) ) . '" type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss this notice.', 'wck' ) . '</span></a>';
276
+
277
+ $wck_notifications->add_notification( $notification_id, $message, 'wck-notice wck-narrow notice notice-info', true, array( 'cptc-page' ) );*/
278
+
279
  }
280
+ add_action( 'admin_init', 'wck_add_plugin_notifications' );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cozmoslabs, reflectionmedia, madalin.ungureanu, sareiodata, adispi
3
  Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
4
  Tags: custom fields, custom field, wordpress custom fields, custom post type, custom post types, post types, repeater fields, meta box, metabox, custom taxonomy, custom fields creator, post meta
5
  Requires at least: 3.1
6
- Tested up to: 4.9.2
7
- Stable tag: 2.1.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -137,6 +137,11 @@ Creating a taxonomy generally automatically creates a special query variable usi
137
  10. Taxonomy listing
138
 
139
  == Changelog ==
 
 
 
 
 
140
  = 2.1.8 =
141
  * Improved speed by at least 100% in most cases for the interface
142
  * Small visual and functionality interface tweaks
3
  Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
4
  Tags: custom fields, custom field, wordpress custom fields, custom post type, custom post types, post types, repeater fields, meta box, metabox, custom taxonomy, custom fields creator, post meta
5
  Requires at least: 3.1
6
+ Tested up to: 4.9.4
7
+ Stable tag: 2.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
137
  10. Taxonomy listing
138
 
139
  == Changelog ==
140
+ = 2.1.9 =
141
+ * Added 'rewrite' and 'rewrite slug' advanced options for custom taxonomy creator
142
+ * Added a plugin notification class
143
+ * Put back the yellow background on rows when editing an entry
144
+
145
  = 2.1.8 =
146
  * Improved speed by at least 100% in most cases for the interface
147
  * Small visual and functionality interface tweaks
wck-ctc.php CHANGED
@@ -79,7 +79,9 @@ function wck_ctc_create_box(){
79
  array( 'type' => 'select', 'title' => __( 'Show Admin Column', 'wck' ), 'slug' => 'show-admin-column', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to allow automatic creation of taxonomy columns on associated post-types.', 'wck' ) ),
80
  array( 'type' => 'select', 'title' => __( 'Sortable Admin Column', 'wck' ), 'slug' => 'sortable-admin-column', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to make the columns sortable or not. WARNING: on a large number of posts the performance can be severely affected', 'wck' ) ),
81
  array( 'type' => 'select', 'title' => __( 'Show in Quick Edit', 'wck' ), 'slug' => 'show-in-quick-edit', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to show the taxonomy in the quick/bulk edit panel.', 'wck' ) ),
82
- array( 'type' => 'select', 'title' => __( 'Show in REST API', 'wck'), 'slug' => 'show-in-rest', 'options' => array( 'false', 'true'), 'default' => 'false', 'description' => __('Make this taxonomy available via WP REST API ', 'wck' ) )
 
 
83
  );
84
 
85
  foreach( $ct_creation_fields2 as $ct_creation_field ) {
@@ -167,6 +169,17 @@ function wck_ctc_create_taxonomy(){
167
  else
168
  $object_type = '';
169
 
 
 
 
 
 
 
 
 
 
 
 
170
  register_taxonomy( $ct['taxonomy'], $object_type, apply_filters( 'wck_ctc_register_taxonomy_args', $args, $ct['taxonomy'] ) );
171
 
172
  if( !empty( $object_type ) && !empty( $args['show_admin_column'] ) && $args['show_admin_column'] == true && !empty( $ct['sortable-admin-column'] ) && $ct['sortable-admin-column'] === 'true' ){
@@ -280,7 +293,7 @@ function wck_ctc_form_wrapper_start(){
280
  echo '<li id="ctc-advanced-options-container" style="display:none;"><ul>';
281
  }
282
 
283
- add_action( "wck_after_add_form_wck_ctc_element_27", 'wck_ctc_form_wrapper_end' );
284
  function wck_ctc_form_wrapper_end(){
285
  echo '</ul></li>';
286
  }
@@ -307,7 +320,7 @@ function wck_ctc_update_form_wrapper_start( $form, $i ){
307
  return $form;
308
  }
309
 
310
- add_filter( "wck_after_update_form_wck_ctc_element_27", 'wck_ctc_update_form_wrapper_end', 10, 2 );
311
  function wck_ctc_update_form_wrapper_end( $form, $i ){
312
  $form .= '</ul></li>';
313
  return $form;
@@ -336,7 +349,7 @@ function wck_ctc_display_adv_wrapper_start( $form, $i ){
336
  return $form;
337
  }
338
 
339
- add_filter( "wck_after_listed_wck_ctc_element_27", 'wck_ctc_display_adv_wrapper_end', 10, 2 );
340
  function wck_ctc_display_adv_wrapper_end( $form, $i ){
341
  $form .= '</ul></li>';
342
  return $form;
79
  array( 'type' => 'select', 'title' => __( 'Show Admin Column', 'wck' ), 'slug' => 'show-admin-column', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to allow automatic creation of taxonomy columns on associated post-types.', 'wck' ) ),
80
  array( 'type' => 'select', 'title' => __( 'Sortable Admin Column', 'wck' ), 'slug' => 'sortable-admin-column', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to make the columns sortable or not. WARNING: on a large number of posts the performance can be severely affected', 'wck' ) ),
81
  array( 'type' => 'select', 'title' => __( 'Show in Quick Edit', 'wck' ), 'slug' => 'show-in-quick-edit', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to show the taxonomy in the quick/bulk edit panel.', 'wck' ) ),
82
+ array( 'type' => 'select', 'title' => __( 'Show in REST API', 'wck'), 'slug' => 'show-in-rest', 'options' => array( 'false', 'true'), 'default' => 'false', 'description' => __('Make this taxonomy available via WP REST API ', 'wck' ) ),
83
+ array( 'type' => 'select', 'title' => __( 'Rewrite', 'wck' ), 'slug' => 'rewrite', 'options' => array( 'true', 'false' ), 'default' => 'true', 'description' => __( 'Rewrite permalinks.', 'wck' ) ),
84
+ array( 'type' => 'text', 'title' => __( 'Rewrite Slug', 'wck' ), 'slug' => 'rewrite-slug', 'description' => __( 'Defaults to post type name.', 'wck' ) ),
85
  );
86
 
87
  foreach( $ct_creation_fields2 as $ct_creation_field ) {
169
  else
170
  $object_type = '';
171
 
172
+ if( !empty( $ct['rewrite'] ) ) {
173
+ if ($ct['rewrite'] == 'false') {
174
+ $args['rewrite'] = $ct['rewrite'] == 'false' ? false : true;
175
+ }
176
+ else {
177
+ if (!empty($ct['rewrite-slug'])) {
178
+ $args['rewrite'] = array('slug' => $ct['rewrite-slug']);
179
+ }
180
+ }
181
+ }
182
+
183
  register_taxonomy( $ct['taxonomy'], $object_type, apply_filters( 'wck_ctc_register_taxonomy_args', $args, $ct['taxonomy'] ) );
184
 
185
  if( !empty( $object_type ) && !empty( $args['show_admin_column'] ) && $args['show_admin_column'] == true && !empty( $ct['sortable-admin-column'] ) && $ct['sortable-admin-column'] === 'true' ){
293
  echo '<li id="ctc-advanced-options-container" style="display:none;"><ul>';
294
  }
295
 
296
+ add_action( "wck_after_add_form_wck_ctc_element_29", 'wck_ctc_form_wrapper_end' );
297
  function wck_ctc_form_wrapper_end(){
298
  echo '</ul></li>';
299
  }
320
  return $form;
321
  }
322
 
323
+ add_filter( "wck_after_update_form_wck_ctc_element_29", 'wck_ctc_update_form_wrapper_end', 10, 2 );
324
  function wck_ctc_update_form_wrapper_end( $form, $i ){
325
  $form .= '</ul></li>';
326
  return $form;
349
  return $form;
350
  }
351
 
352
+ add_filter( "wck_after_listed_wck_ctc_element_29", 'wck_ctc_display_adv_wrapper_end', 10, 2 );
353
  function wck_ctc_display_adv_wrapper_end( $form, $i ){
354
  $form .= '</ul></li>';
355
  return $form;
wck.php CHANGED
@@ -3,8 +3,10 @@
3
  Plugin Name: WCK - Custom Fields and Custom Post Types Creator
4
  Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
5
  Author: Cozmoslabs, Madalin Ungureanu, Cristian Antohe
6
- Version: 2.1.8
7
  Author URI: http://www.cozmoslabs.com
 
 
8
 
9
  License: GPL2
10
 
@@ -25,7 +27,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
  define( 'WCK_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
28
- define( 'WCK_PLUGIN_VERSION', '2.5.1' );
 
29
 
30
  /* ready for localization */
31
  $current_theme = wp_get_theme();
3
  Plugin Name: WCK - Custom Fields and Custom Post Types Creator
4
  Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
5
  Author: Cozmoslabs, Madalin Ungureanu, Cristian Antohe
6
+ Version: 2.1.9
7
  Author URI: http://www.cozmoslabs.com
8
+ Text Domain: wck
9
+ Domain Path: /languages
10
 
11
  License: GPL2
12
 
27
  */
28
 
29
  define( 'WCK_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
30
+ define( 'WCK_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
31
+ define( 'WCK_PLUGIN_VERSION', '2.5.2' );
32
 
33
  /* ready for localization */
34
  $current_theme = wp_get_theme();
wordpress-creation-kit-api/wordpress-creation-kit.css CHANGED
@@ -301,4 +301,30 @@ td.wck-number{
301
  background: rgba(230,126,34, 0.2);
302
  color: #d35400;
303
  border-color: #f39c12;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
301
  background: rgba(230,126,34, 0.2);
302
  color: #d35400;
303
  border-color: #f39c12;
304
+ }
305
+
306
+
307
+ /**************************************************/
308
+ /* Extra styling for admin notices
309
+ /**************************************************/
310
+ div.wck-notice {
311
+ position: relative;
312
+ }
313
+
314
+ div.wck-notice:after {
315
+ display: block;
316
+ content: '';
317
+ clear: both;
318
+ }
319
+
320
+ div.wck-notice.wck-narrow {
321
+ max-width: 825px;
322
+ }
323
+
324
+ div.wck-notice .notice-dismiss {
325
+ text-decoration: none;
326
+ }
327
+
328
+ .wrap div.wck-admin-notice {
329
+ margin-bottom: 0;
330
  }
wordpress-creation-kit-api/wordpress-creation-kit.js CHANGED
@@ -342,15 +342,6 @@ function updateMeta(value, id, element_id, nonce){
342
  alert( response.error );
343
  }
344
  else{
345
- jQuery('html, body').animate({
346
- scrollTop: jQuery('#container_'+value+' #element_' + element_id).offset().top - 40 }, 700);
347
-
348
- jQuery('#container_'+value+' #element_' + element_id).animate({
349
- backgroundColor: '#FFFF9C'
350
- }, 700);
351
- jQuery('#container_'+value+' #element_' + element_id).animate({
352
- backgroundColor: 'none'
353
- }, 700);
354
 
355
  jQuery('#update_container_'+value+'_'+element_id).remove();
356
 
@@ -364,6 +355,18 @@ function updateMeta(value, id, element_id, nonce){
364
 
365
  jQuery('#container_'+value).parent().css('opacity','1');
366
  jQuery('#mb-ajax-loading').remove();
 
 
 
 
 
 
 
 
 
 
 
 
367
  }
368
  });
369
  }
342
  alert( response.error );
343
  }
344
  else{
 
 
 
 
 
 
 
 
 
345
 
346
  jQuery('#update_container_'+value+'_'+element_id).remove();
347
 
355
 
356
  jQuery('#container_'+value).parent().css('opacity','1');
357
  jQuery('#mb-ajax-loading').remove();
358
+
359
+ //the scroll works a little bit funny ( it goes way up then down, prob because we remove the update form ) so comment it out for now
360
+ /*jQuery('html, body').animate({
361
+ scrollTop: jQuery('#container_'+value+' #element_' + element_id).offset().top - 40 }, 700);*/
362
+
363
+ jQuery('#container_'+value+' #element_' + element_id).animate({
364
+ backgroundColor: '#FFFF9C'
365
+ }, 1000);
366
+ jQuery('#container_'+value+' #element_' + element_id).animate({
367
+ backgroundColor: 'none'
368
+ }, 1000);
369
+
370
  }
371
  });
372
  }