Tribe__Events__Community__Main::formContentEditor( object $event = null )
Form event content.
Contents
Parameters
- $event
-
(object) (Optional) The event to display the tile for.
Default value: null
Return
(void)
Source
File: src/Tribe/Main.php
public function formContentEditor( $event = null ) {
if ( $event == null ) {
$event = get_post();
}
if ( $event ) {
$post_content = $event->post_content;
} elseif ( ! empty( $_POST['post_content'] ) ) {
$post_content = stripslashes( $_POST['post_content'] );
} else {
$post_content = '';
}
// if the admin wants the rich editor, and they are using WP 3.3, show the WYSIWYG, otherwise default to just a text box
if ( $this->useVisualEditor && function_exists( 'wp_editor' ) ) {
$settings = array(
'wpautop' => true,
'media_buttons' => false,
'editor_class' => 'frontend',
'textarea_rows' => 5,
);
wp_editor( $post_content, 'tcepostcontent', $settings );
} else {
?><textarea id="post_content" name="tcepostcontent"><?php
echo esc_textarea( $post_content );
?></textarea><?php
}
}
Changelog
| Version | Description |
|---|---|
| 1.0 | Introduced. |