1: <?php
2:
3: 4: 5:
6: class Papi_Property_Editor extends Papi_Property {
7:
8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
18: public function format_value( $value, $slug, $post_id ) {
19: return is_admin() ? $value : apply_filters( 'the_content', $value );
20: }
21:
22: 23: 24:
25: public function html() {
26: $value = $this->get_value();
27: $id = str_replace(
28: '[',
29: '',
30: str_replace( ']', '', $this->html_name() )
31: ) . '-' . uniqid();
32:
33: wp_editor( $value, $id, [
34: 'textarea_name' => $this->html_name(),
35: 'media_buttons' => true
36: ] );
37:
38: if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
39: add_filter( 'mce_external_plugins', '__return_empty_array' );
40: }
41: }
42: }
43: