PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 3.3.8
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v3.3.8
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / custom-field-types / class-wpsc-df-description.php

class-wpsc-df-description.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 3.3.8, at includes/custom-field-types/class-wpsc-df-description.php

735 lines 22.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly!
4 }
5
6 if ( ! class_exists( 'WPSC_DF_Description' ) ) :
7
8 final class WPSC_DF_Description {
9
10 /**
11 * Slug for this custom field type
12 *
13 * @var string
14 */
15 public static $slug = 'df_description';
16
17 /**
18 * Set whether this custom field type is of type date
19 *
20 * @var boolean
21 */
22 public static $is_date = false;
23
24 /**
25 * Set whether this custom field type has applicable to date range
26 *
27 * @var boolean
28 */
29 public static $has_date_range = false;
30
31 /**
32 * Set whether this custom field type has multiple values
33 *
34 * @var boolean
35 */
36 public static $has_multiple_val = false;
37
38 /**
39 * Set whether this custom field type has reference to other class
40 *
41 * @var boolean
42 */
43 public static $has_ref = false;
44
45 /**
46 * Reference class for this custom field type so that its value(s) return with object or array of objects automatically. Empty string indicate no reference.
47 *
48 * @var string
49 */
50 public static $ref_class = '';
51
52 /**
53 * Set whether this custom field field type is system default (no fields can be created from it).
54 *
55 * @var boolean
56 */
57 public static $is_default = true;
58
59 /**
60 * Set whether this field type has extra information that can be used in ticket form, edit custom fields, etc.
61 *
62 * @var boolean
63 */
64 public static $has_extra_info = true;
65
66 /**
67 * Set whether this custom field type can accept personal info.
68 *
69 * @var boolean
70 */
71 public static $has_personal_info = false;
72
73 /**
74 * Set whether fields created from this custom field type is allowed in create ticket form
75 *
76 * @var boolean
77 */
78 public static $is_ctf = true;
79
80 /**
81 * Set whether fields created from this custom field type is allowed in ticket list
82 *
83 * @var boolean
84 */
85 public static $is_list = false;
86
87 /**
88 * Set whether fields created from this custom field type is allowed in ticket filter
89 *
90 * @var boolean
91 */
92 public static $is_filter = true;
93
94 /**
95 * Set whether fields created from this custom field type can be given character limits
96 *
97 * @var boolean
98 */
99 public static $has_char_limit = false;
100
101 /**
102 * Set whether fields created from this custom field type has custom options set in options table
103 *
104 * @var boolean
105 */
106 public static $has_options = false;
107
108 /**
109 * Set whether fields created from this custom field type can be auto-filled
110 *
111 * @var boolean
112 */
113 public static $is_auto_fill = true;
114
115 /**
116 * Set whether fields created from this custom field type can be available for ticket list sorting
117 *
118 * @var boolean
119 */
120 public static $is_sort = false;
121
122 /**
123 * Set whether fields created from this custom field type can have placeholder
124 *
125 * @var boolean
126 */
127 public static $is_placeholder = false;
128
129 /**
130 * Set whether fields created from this custom field type is applicable for visibility conditions in create ticket form
131 *
132 * @var boolean
133 */
134 public static $is_visibility_conditions = true;
135
136 /**
137 * Set whether fields created from this custom field type is applicable for macros
138 *
139 * @var boolean
140 */
141 public static $has_macro = true;
142
143 /**
144 * Set whether fields of this custom field type is applicalbe for search on ticket list page.
145 * threads type is already available, no need to use this specific type.
146 *
147 * @var boolean
148 */
149 public static $is_search = false;
150
151 /**
152 * Initialize the class
153 *
154 * @return void
155 */
156 public static function init() {
157
158 // Get object of this class.
159 add_filter( 'wpsc_load_ref_classes', array( __CLASS__, 'load_ref_class' ) );
160
161 // JS events.
162 add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
163 add_action( 'wpsc_js_create_ticket_formdata', array( __CLASS__, 'js_create_ticket_formdata' ) );
164 add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
165
166 // create ticket form.
167 add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
168
169 // create ticket data for rest api.
170 add_filter( 'wpsc_rest_create_ticket', array( __CLASS__, 'set_rest_ticket_data' ), 10, 3 );
171
172 // Add ticket id to description attachments.
173 add_action( 'wpsc_create_new_ticket', array( __CLASS__, 'add_attachment_ticket_id' ), 1 );
174 }
175
176 /**
177 * Load current class to reference classes
178 *
179 * @param array $classes - Associative array of class names indexed by its slug.
180 * @return array
181 */
182 public static function load_ref_class( $classes ) {
183
184 $classes[ self::$slug ] = array(
185 'class' => __CLASS__,
186 'save-key' => 'id',
187 );
188 return $classes;
189 }
190
191 /**
192 * Print operators for ticket form filter
193 *
194 * @param WPSC_Custom_Field $cf - custom field object.
195 * @param array $filter - Existing filters (if any).
196 * @return void
197 */
198 public static function get_operators( $cf, $filter = array() ) {
199 ?>
200
201 <div class="item conditional">
202 <select class="operator" onchange="wpsc_tc_get_operand(this, '<?php echo esc_attr( $cf->slug ); ?>', '<?php echo esc_attr( wp_create_nonce( 'wpsc_tc_get_operand' ) ); ?>');">
203 <option value=""><?php esc_attr_e( 'Compare As', 'supportcandy' ); ?></option>
204 <option <?php isset( $filter['operator'] ) && selected( $filter['operator'], 'LIKE' ); ?> value="LIKE"><?php esc_attr_e( 'Has Words', 'supportcandy' ); ?></option>
205 </select>
206 </div>
207 <?php
208 }
209
210 /**
211 * Print operators for ticket form filter
212 *
213 * @param string $operator - condition operator on which operands should be returned.
214 * @param WPSC_Custom_Field $cf - custom field object.
215 * @param array $filter - Exising functions (if any).
216 * @return void
217 */
218 public static function get_operands( $operator, $cf, $filter = array() ) {
219
220 $value = isset( $filter['operand_val_1'] ) ? stripslashes( $filter['operand_val_1'] ) : ''
221 ?>
222 <div class="item conditional operand single">
223 <textarea class="operand_val_1" placeholder="<?php esc_attr_e( 'One condition per line!', 'supportcandy' ); ?>" style="width: 100%;"><?php echo esc_attr( $value ); ?></textarea>
224 </div>
225 <?php
226 }
227
228 /**
229 * Check condition for this type
230 *
231 * @param array $condition - condition data.
232 * @param WPSC_Custom_Field $cf - custom field object.
233 * @param mixed $value - value to compare.
234 * @return boolean
235 */
236 public static function is_valid( $condition, $cf, $value ) {
237
238 $response = false;
239 $value = stripslashes( $value );
240 $terms = explode( PHP_EOL, $condition['operand_val_1'] );
241 $response = false;
242 foreach ( $terms as $term ) {
243 $index = strpos( $value, trim( stripslashes( $term ) ) );
244 if ( is_numeric( $index ) ) {
245 $response = true;
246 break;
247 }
248 }
249 return $response;
250 }
251
252 /**
253 * Parse filter and return sql query to be merged in ticket model query builder
254 *
255 * @param WPSC_Custom_Field $cf - custom field of this type.
256 * @param mixed $compare - comparison operator.
257 * @param mixed $val - value to compare.
258 * @return string
259 */
260 public static function parse_filter( $cf, $compare, $val ) {
261
262 $str = '';
263
264 switch ( $compare ) {
265
266 case 'LIKE':
267 $arr = array();
268 $val = explode( PHP_EOL, $val );
269 foreach ( $val as $term ) {
270 $term = str_replace( '*', '%', trim( $term ) );
271 $arr[] = 'CONVERT(th.body USING utf8) LIKE \'%' . $term . '%\'';
272 }
273 $str = '(' . implode( ' OR ', $arr ) . ')';
274 break;
275
276 default:
277 $str = '1=1';
278 }
279
280 return $str;
281 }
282
283 /**
284 * Check ticket condition
285 *
286 * @param array $condition - array with condition data.
287 * @param WPSC_Custom_Field $cf - custom field object.
288 * @param WPSC_Ticket $ticket - ticket object.
289 * @return boolean
290 */
291 public static function is_valid_ticket_condition( $condition, $cf, $ticket ) {
292
293 $filters = array(
294 'meta_query' => array(
295 'relation' => 'AND',
296 array(
297 'slug' => 'ticket',
298 'compare' => '=',
299 'val' => $ticket->id,
300 ),
301 array(
302 'slug' => 'type',
303 'compare' => '=',
304 'val' => 'report',
305 ),
306 ),
307 );
308 $threads = WPSC_Thread::find( $filters );
309 $thread = isset( $threads['results'][0] ) ? $threads['results'][0] : array();
310
311 if ( $thread && $thread->is_active ) {
312
313 $value = stripslashes( $thread->body );
314 $terms = explode( PHP_EOL, $condition['operand_val_1'] );
315 $response = false;
316 foreach ( $terms as $term ) {
317 $index = strpos( $value, trim( stripslashes( $term ) ) );
318 if ( is_numeric( $index ) ) {
319 $response = true;
320 break;
321 }
322 }
323 return $response;
324
325 } else {
326
327 return false;
328 }
329 }
330
331 /**
332 * Print ticket form field
333 *
334 * @param WPSC_Custom_Field $cf - Custom field object.
335 * @param array $tff - Array of ticket form field settings for this field.
336 * @return string
337 */
338 public static function print_tff( $cf, $tff ) {
339
340 $unique_id = uniqid( 'wpsc_' );
341 $val = $cf->is_auto_fill && $cf->default_value ? stripslashes( htmlspecialchars( $cf->default_value[0] ) ) : '';
342 $current_user = WPSC_Current_User::$current_user;
343
344 ob_start();
345 ?>
346 <div class="<?php echo esc_attr( WPSC_Functions::get_tff_classes( $cf, $tff ) ); ?>" data-cft="<?php echo esc_attr( self::$slug ); ?>" data-slug="<?php echo esc_attr( $cf->slug ); ?>">
347 <div class="wpsc-tff-label">
348 <span class="name"><?php echo esc_attr( $cf->name ); ?></span>
349 <?php
350 if ( $tff['is-required'] ) {
351 ?>
352 <span class="required-indicator">*</span>
353 <?php
354 }
355 ?>
356 </div>
357 <span class="extra-info"><?php echo esc_attr( $cf->extra_info ); ?></span>
358 <textarea name="<?php echo esc_attr( $cf->slug ); ?>" id="description" class="wpsc_textarea" onchange="wpsc_check_tff_visibility();"><?php echo esc_attr( $val ); ?></textarea>
359 <input
360 class="<?php echo esc_attr( $unique_id ); ?>"
361 type="file"
362 onchange="wpsc_set_attach_multiple(this, '<?php echo esc_attr( $unique_id ); ?>', 'description_attachments')"
363 multiple
364 style="display: none;"/>
365 <div class="wpsc-it-editor-action-container">
366 <div class="actions">
367 <div class="wpsc-editor-actions">
368 <?php
369
370 if ( WPSC_Text_Editor::is_allow_attachments() ) {
371 ?>
372 <span class="wpsc-link wpsc-ct-attach" onclick="wpsc_trigger_desc_attachments('<?php echo esc_attr( $unique_id ); ?>');"><?php esc_attr_e( 'Attach Files', 'supportcandy' ); ?></span>
373 <?php
374 }
375
376 if ( $current_user->is_agent ) {
377 ?>
378 <span class="wpsc-link wpsc-ct-macro" onclick="wpsc_get_macros()"><?php esc_attr_e( 'Insert Macro', 'supportcandy' ); ?></span>
379 <?php
380 }
381
382 do_action( 'wpsc_tff_editor_actions' );
383
384 ?>
385 </div>
386
387 <?php
388 if ( WPSC_Text_Editor::is_attachment_notice() && WPSC_Text_Editor::is_allow_attachments() ) {
389 ?>
390 <div class="wpsc-file-attachment-notice"><?php echo esc_html( WPSC_Text_Editor::file_attachment_notice_text() ); ?></div>
391 <?php
392 }
393 ?>
394
395 <div class="<?php echo esc_attr( $unique_id ); ?> wpsc-editor-attachment-container"></div>
396
397 </div>
398 </div>
399 <script>
400 <?php WPSC_Text_Editor::print_editor_init_scripts( 'description', 'wpsc-description' ); ?>
401 </script>
402 </div>
403 <?php
404 return ob_get_clean();
405 }
406
407 /**
408 * Validate this type field in create ticket
409 *
410 * @return void
411 */
412 public static function js_validate_ticket_form() {
413 ?>
414
415 case '<?php echo esc_attr( self::$slug ); ?>':
416 var is_tinymce = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden();
417 if (is_tinymce && tinymce.get('description')){
418 var val = tinyMCE.get('description').getContent();
419 } else {
420 var val = jQuery('#description').val().trim();
421 }
422 if (customField.hasClass('required') && !val) {
423 isValid = false;
424 alert(supportcandy.translations.req_fields_missing);
425 }
426 break;
427 <?php
428 echo PHP_EOL;
429 }
430
431 /**
432 * Submit ticket FormData append of description
433 *
434 * @return void
435 */
436 public static function js_create_ticket_formdata() {
437
438 $cf = WPSC_Custom_Field::get_cf_by_slug( 'description' );
439
440 $tff = get_option( 'wpsc-tff', array() );
441 if ( array_key_exists( $cf->slug, $tff ) ) {
442 ?>
443 var is_tinymce = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden();
444 if (is_tinymce && tinymce.get('description')){
445 var description = tinyMCE.get('description').getContent();
446 } else {
447 var description = jQuery('#description').val().trim();
448 }
449 dataform.append('description', description);
450 <?php
451 echo PHP_EOL;
452 }
453 }
454
455 /**
456 * Return default value for custom field of this type
457 *
458 * @param WPSC_Custom_Field $cf - custom field object.
459 * @return mixed
460 */
461 public static function get_default_value( $cf ) {
462
463 return $cf->default_value ? stripslashes( $cf->default_value[0] ) : '';
464 }
465
466 /**
467 * Return custom field value in $_POST
468 * Ignore phpcs nonce issue as we already checked where it is called from.
469 *
470 * @param string $slug - Custom field slug.
471 * @param mixed $cf - Custom field object or false.
472 * @return mixed
473 */
474 public static function get_tff_value( $slug, $cf = false ) {
475
476 $cf = WPSC_Custom_Field::get_cf_by_slug( $slug );
477 $default_val = self::get_default_value( $cf );
478 $description = isset( $_POST[ $slug ] ) ? wp_kses_post( wp_unslash( $_POST[ $slug ] ) ) : ''; // phpcs:ignore
479
480 // replace new line with br if no text editor.
481 $is_editor = isset( $_POST['is_editor'] ) ? intval( $_POST['is_editor'] ) : 0; // phpcs:ignore
482 if ( $description && ! $is_editor ) {
483 $description = nl2br( $description );
484 }
485
486 return $description ? $description : $default_val;
487 }
488
489 /**
490 * Check and return custom field value for new ticket to be created.
491 * This function is used by filter for set create ticket form and called directly by my-profile for each applicable custom fields.
492 * Ignore phpcs nonce issue as we already checked where it is called from.
493 *
494 * @param array $data - Array of values to to stored in ticket in an insert function.
495 * @param array $custom_fields - Array containing all applicable custom fields indexed by unique custom field types.
496 * @param boolean $is_my_profile - Whether it or not it is created from my-profile. This function is used by create ticket as well as my-profile. Due to customer fields handling is done same way, this flag gives apportunity to identify where it being called.
497 * @return array
498 */
499 public static function set_create_ticket_data( $data, $custom_fields, $is_my_profile ) {
500
501 $data['description'] = self::get_tff_value( 'description' );
502 $description_attachments = isset( $_POST['description_attachments'] ) ? array_filter( array_map( 'intval', $_POST['description_attachments'] ) ) : array(); // phpcs:ignore
503 foreach ( $description_attachments as $key => $id ) {
504 $attachment = new WPSC_Attachment( $id );
505 // Check if attachment is already active and linked to a ticket.
506 if ( $attachment->is_active && $attachment->ticket_id ) {
507 unset( $description_attachments[ $key ] );
508 continue;
509 }
510 $attachment->is_active = 1;
511 $attachment->save();
512 }
513 $data['description_attachments'] = $description_attachments ? implode( '|', $description_attachments ) : '';
514 return $data;
515 }
516
517 /**
518 * Set create ticket data for rest api request
519 *
520 * @param array $data - create ticket data array.
521 * @param WP_REST_Request $request - rest request object.
522 * @param array $custom_fields - custom field objects indexed by unique custom field types.
523 * @return array
524 */
525 public static function set_rest_ticket_data( $data, $request, $custom_fields ) {
526
527 $cf = WPSC_Custom_Field::get_cf_by_slug( 'description' );
528 $description = $request->get_param( 'description' );
529 $is_html = $description != wp_strip_all_tags( $description ) ? true : false;
530 $description = $is_html ? wp_kses_post( $description ) : str_replace( PHP_EOL, '<br />', $description );
531 $description = $description ? $description : self::get_default_value( $cf );
532
533 // check description is present.
534 if ( ! $description ) {
535 $data['errors']->add( 'req_fields_missing', 'description is missing!', 'description' );
536 return $data;
537 }
538
539 $data['description'] = $description;
540
541 // description attachments.
542 $attachments = sanitize_text_field( $request->get_param( 'description_attachments' ) );
543 if ( $attachments ) {
544 $attachments = implode(
545 '|',
546 array_filter(
547 array_map(
548 function ( $id ) {
549 $attachment = new WPSC_Attachment( intval( $id ) );
550 if ( $attachment->id ) {
551 $attachment->is_active = 1;
552 $attachment->save();
553 return $attachment->id;
554 } else {
555 return false;
556 }
557 },
558 explode( ',', $attachments )
559 )
560 )
561 );
562 }
563
564 $data['description_attachments'] = $attachments;
565 return $data;
566 }
567
568 /**
569 * Return val field for meta query of this type of custom field
570 *
571 * @param array $condition - condition data.
572 * @return mixed
573 */
574 public static function get_meta_value( $condition ) {
575
576 $operator = $condition['operator'];
577 switch ( $operator ) {
578
579 case 'LIKE':
580 return $condition['operand_val_1'];
581 }
582 return false;
583 }
584
585 /**
586 * Add ticket id to description attachments
587 *
588 * @param WPSC_Ticket $ticket - ticket object.
589 * @return void
590 */
591 public static function add_attachment_ticket_id( $ticket ) {
592
593 $thread = $ticket->get_description_thread();
594 foreach ( $thread->attachments as $attachment ) {
595 $attachment->ticket_id = $ticket->id;
596 $attachment->source = 'report';
597 $attachment->source_id = $thread->id;
598 $attachment->save();
599 }
600 }
601
602 /**
603 * Print edit custom field properties
604 *
605 * @param WPSC_Custom_Fields $cf - custom field object.
606 * @param string $field_class - class name of field category.
607 * @return void
608 */
609 public static function get_edit_custom_field_properties( $cf, $field_class ) {
610
611 if ( in_array( 'extra_info', $field_class::$allowed_properties ) ) :
612 ?>
613 <div data-type="textfield" data-required="false" class="wpsc-input-group extra-info">
614 <div class="label-container">
615 <label for=""><?php esc_attr_e( 'Extra info', 'supportcandy' ); ?></label>
616 </div>
617 <input name="extra_info" type="text" value="<?php echo esc_attr( $cf->extra_info ); ?>" autocomplete="off" />
618 </div>
619 <?php
620 endif;
621
622 if ( in_array( 'default_value', $field_class::$allowed_properties ) ) :
623 $default_val = $cf->default_value ? $cf->default_value[0] : '';
624 ?>
625 <div data-type="textarea" data-required="false" class="wpsc-input-group default_value">
626 <div class="label-container">
627 <label for="">
628 <?php esc_attr_e( 'Default value', 'supportcandy' ); ?>
629 </label>
630 </div>
631 <textarea name="default_value" rows="5"><?php echo esc_attr( $default_val ); ?></textarea>
632 </div>
633 <?php
634 endif;
635
636 if ( in_array( 'is_auto_fill', $field_class::$allowed_properties ) ) :
637 ?>
638 <div data-type="single-select" data-required="false" class="wpsc-input-group is_auto_fill">
639 <div class="label-container">
640 <label for="">
641 <?php esc_html_e( 'Auto-fill in ticket form', 'supportcandy' ); ?>
642 </label>
643 </div>
644 <select name="is_auto_fill">
645 <option <?php selected( $cf->is_auto_fill, '0' ); ?> value="0"><?php esc_html_e( 'No', 'supportcandy' ); ?></option>
646 <option <?php selected( $cf->is_auto_fill, '1' ); ?> value="1"><?php esc_html_e( 'Yes', 'supportcandy' ); ?></option>
647 </select>
648 </div>
649 <?php
650 endif;
651 }
652
653 /**
654 * Set custom field properties. Can be used by add/edit custom field.
655 * Ignore phpcs nonce issue as we already checked where it is called from.
656 *
657 * @param WPSC_Custom_Field $cf - custom field object.
658 * @param string $field_class - class of field category.
659 * @return void
660 */
661 public static function set_cf_properties( $cf, $field_class ) {
662
663 // extra info.
664 if ( in_array( 'extra_info', $field_class::$allowed_properties ) ) {
665 $cf->extra_info = isset( $_POST['extra_info'] ) ? sanitize_text_field( wp_unslash( $_POST['extra_info'] ) ) : ''; // phpcs:ignore
666 }
667
668 // default value.
669 if ( in_array( 'default_value', $field_class::$allowed_properties ) ) {
670 $default_value = isset( $_POST['default_value'] ) ? wp_kses_post( wp_unslash( $_POST['default_value'] ) ) : ''; // phpcs:ignore
671 $cf->default_value = $default_value ? array( $default_value ) : array();
672 }
673
674 // auto fill.
675 if ( in_array( 'is_auto_fill', $field_class::$allowed_properties ) ) {
676 $cf->is_auto_fill = isset( $_POST['is_auto_fill'] ) ? sanitize_text_field( wp_unslash( $_POST['is_auto_fill'] ) ) : ''; // phpcs:ignore
677 }
678
679 // save!
680 $cf->save();
681 }
682
683 /**
684 * Returns printable ticket value for custom field. Can be used in export tickets, replace macros etc.
685 *
686 * @param WPSC_Custom_Field $cf - custom field object.
687 * @param WPSC_Ticket $ticket - ticket object.
688 * @param string $module - module name.
689 * @return string
690 */
691 public static function get_ticket_field_val( $cf, $ticket, $module = '' ) {
692
693 $filters = array(
694 'meta_query' => array(
695 'relation' => 'AND',
696 array(
697 'slug' => 'ticket',
698 'compare' => '=',
699 'val' => $ticket->id,
700 ),
701 array(
702 'slug' => 'type',
703 'compare' => '=',
704 'val' => 'report',
705 ),
706 ),
707 );
708 $threads = WPSC_Thread::find( $filters );
709 $thread = isset( $threads['results'][0] ) ? $threads['results'][0] : array();
710 return $thread && $thread->is_active ? $thread->get_printable_string() : '';
711 }
712
713 /**
714 * Clear value of hidden fields
715 *
716 * @return void
717 */
718 public static function js_clear_value_hidden_fields() {
719 ?>
720 case '<?php echo esc_attr( self::$slug ); ?>':
721 var is_tinymce = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden();
722 if (is_tinymce && tinymce.get('description')){
723 tinyMCE.get('description').setContent('');
724 } else {
725 jQuery('#description').val('');
726 }
727 break;
728 <?php
729 echo PHP_EOL;
730 }
731 }
732 endif;
733
734 WPSC_DF_Description::init();
735