| 1 | <?php |
||
| 8 | class Rich_Text_Field extends Textarea_Field { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Defines if the rich text field should be loaded only when scrolled into view |
||
| 12 | * |
||
| 13 | * @var boolean |
||
| 14 | */ |
||
| 15 | protected $lazyload = true; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * {@inheritDoc} |
||
| 19 | */ |
||
| 20 | public static function field_type_activated() { |
||
| 21 | add_action( 'admin_print_footer_scripts', array( get_class(), 'editor_init' ) ); |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Display the editor. |
||
| 26 | * |
||
| 27 | * Instead of enqueueing all required scripts and stylesheets and setting up TinyMCE, |
||
| 28 | * wp_editor() automatically enqueues and sets up everything. |
||
| 29 | */ |
||
| 30 | public static function editor_init() { |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Returns an array that holds the field data, suitable for JSON representation. |
||
| 51 | * |
||
| 52 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function to_json( $load ) { |
||
| 64 | } |
||
| 65 |