Changeset 4484
- Timestamp:
- 11/23/2012 11:08:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r4483 r4484 1579 1579 function bbp_get_the_content( $args = array() ) { 1580 1580 1581 // Default arguments1582 $ defaults =array(1581 // Parse arguments with default values 1582 $r = bbp_parse_args( $args, array( 1583 1583 'context' => 'topic', 1584 1584 'before' => '<div class="bbp-the-content-wrapper">', … … 1592 1592 'teeny' => true, 1593 1593 'quicktags' => true 1594 ); 1595 $r = bbp_parse_args( $args, $defaults, 'get_the_content' ); 1596 extract( $r ); 1594 ), 'get_the_content' ); 1597 1595 1598 1596 // Assume we are not editing … … 1603 1601 1604 1602 // Output something before the editor 1605 if ( !empty( $before ) ) 1606 echo $before; 1603 if ( !empty( $r['before'] ) ) { 1604 echo $r['before']; 1605 } 1607 1606 1608 1607 // Get sanitized content 1609 if ( bbp_is_edit() ) 1610 $post_content = call_user_func( 'bbp_get_form_' . $context . '_content' ); 1608 if ( bbp_is_edit() ) { 1609 $post_content = call_user_func( 'bbp_get_form_' . $r['context'] . '_content' ); 1610 } 1611 1611 1612 1612 // Use TinyMCE if available 1613 1613 if ( bbp_use_wp_editor() ) : 1614 wp_editor( htmlspecialchars_decode( $post_content, ENT_QUOTES ), 'bbp_' . $ context. '_content', array(1615 'wpautop' => $ wpautop,1616 'media_buttons' => $ media_buttons,1617 'textarea_rows' => $ textarea_rows,1618 'tabindex' => $ tabindex,1619 'editor_class' => $ editor_class,1620 'tinymce' => $ tinymce,1621 'teeny' => $ teeny,1622 'quicktags' => $ quicktags1614 wp_editor( htmlspecialchars_decode( $post_content, ENT_QUOTES ), 'bbp_' . $r['context'] . '_content', array( 1615 'wpautop' => $r['wpautop'], 1616 'media_buttons' => $r['media_buttons'], 1617 'textarea_rows' => $r['textarea_rows'], 1618 'tabindex' => $r['tabindex'], 1619 'editor_class' => $r['editor_class'], 1620 'tinymce' => $r['tinymce'], 1621 'teeny' => $r['teeny'], 1622 'quicktags' => $r['quicktags'] 1623 1623 ) ); 1624 1624 … … 1631 1631 else : ?> 1632 1632 1633 <textarea id="bbp_<?php echo esc_attr( $ context ); ?>_content" class="<?php echo esc_attr( $editor_class ); ?>" name="bbp_<?php echo esc_attr( $context ); ?>_content" cols="60" rows="<?php echo esc_attr( $textarea_rows ); ?>" tabindex="<?php echo esc_attr( $tabindex ); ?>"><?php echo $post_content; ?></textarea>1633 <textarea id="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" class="<?php echo esc_attr( $r['editor_class'] ); ?>" name="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" cols="60" rows="<?php echo esc_attr( $r['textarea_rows'] ); ?>" tabindex="<?php echo esc_attr( $r['tabindex'] ); ?>"><?php echo $r['post_content']; ?></textarea> 1634 1634 1635 1635 <?php endif; 1636 1636 1637 1637 // Output something after the editor 1638 if ( !empty( $after ) ) 1639 echo $after; 1638 if ( !empty( $r['after'] ) ) { 1639 echo $r['after']; 1640 } 1640 1641 1641 1642 // Put the output into a usable variable
Note: See TracChangeset
for help on using the changeset viewer.