Changeset 4576 for trunk/includes/common/template-tags.php
- Timestamp:
- 12/15/2012 12:23:31 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/common/template-tags.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r4573 r4576 1630 1630 // Parse arguments against default values 1631 1631 $r = bbp_parse_args( $args, array( 1632 'context' => 'topic', 1633 'before' => '<div class="bbp-the-content-wrapper">', 1634 'after' => '</div>', 1635 'wpautop' => true, 1636 'media_buttons' => false, 1637 'textarea_rows' => '12', 1638 'tabindex' => bbp_get_tab_index(), 1639 'editor_class' => 'bbp-the-content', 1640 'tinymce' => true, 1641 'teeny' => true, 1642 'quicktags' => true 1632 'context' => 'topic', 1633 'before' => '<div class="bbp-the-content-wrapper">', 1634 'after' => '</div>', 1635 'wpautop' => true, 1636 'media_buttons' => false, 1637 'textarea_rows' => '12', 1638 'tabindex' => bbp_get_tab_index(), 1639 'tabfocus_elements' => '#bbp_topic_title,#bbp_topic_tags', 1640 'editor_class' => 'bbp-the-content', 1641 'tinymce' => true, 1642 'teeny' => true, 1643 'quicktags' => true, 1644 'dfw' => false 1643 1645 ), 'get_the_content' ); 1644 1646 … … 1656 1658 // Use TinyMCE if available 1657 1659 if ( bbp_use_wp_editor() ) : 1660 1661 // Enable additional TinyMCE plugins before outputting the editor 1662 add_filter( 'tiny_mce_plugins', 'bbp_get_tiny_mce_plugins' ); 1663 add_filter( 'teeny_mce_plugins', 'bbp_get_tiny_mce_plugins' ); 1664 1665 // Output the editor 1658 1666 wp_editor( htmlspecialchars_decode( $post_content, ENT_QUOTES ), 'bbp_' . $r['context'] . '_content', array( 1659 'wpautop' => $r['wpautop'], 1660 'media_buttons' => $r['media_buttons'], 1661 'textarea_rows' => $r['textarea_rows'], 1662 'tabindex' => $r['tabindex'], 1663 'editor_class' => $r['editor_class'], 1664 'tinymce' => $r['tinymce'], 1665 'teeny' => $r['teeny'], 1666 'quicktags' => $r['quicktags'] 1667 'wpautop' => $r['wpautop'], 1668 'media_buttons' => $r['media_buttons'], 1669 'textarea_rows' => $r['textarea_rows'], 1670 'tabindex' => $r['tabindex'], 1671 'tabfocus_elements' => $r['tabfocus_elements'], 1672 'editor_class' => $r['editor_class'], 1673 'tinymce' => $r['tinymce'], 1674 'teeny' => $r['teeny'], 1675 'quicktags' => $r['quicktags'], 1676 'dfw' => $r['dfw'], 1667 1677 ) ); 1678 1679 // Remove additional TinyMCE plugins after outputting the editor 1680 remove_filter( 'tiny_mce_plugins', 'bbp_get_tiny_mce_plugins' ); 1681 remove_filter( 'teeny_mce_plugins', 'bbp_get_tiny_mce_plugins' ); 1668 1682 1669 1683 /** … … 1692 1706 return apply_filters( 'bbp_get_the_content', $output, $args, $post_content ); 1693 1707 } 1708 1709 /** 1710 * Edit TinyMCE plugins to match core behaviour 1711 * 1712 * @since bbPress (r4574) 1713 * 1714 * @param array $plugins 1715 * @see tiny_mce_plugins, teeny_mce_plugins 1716 * @return array 1717 */ 1718 function bbp_get_tiny_mce_plugins( $plugins = array() ) { 1719 1720 // Unset fullscreen 1721 foreach ( $plugins as $key => $value ) { 1722 if ( 'fullscreen' == $value ) { 1723 unset( $plugins[$key] ); 1724 break; 1725 } 1726 } 1727 1728 // Add the tabfocus plugin 1729 $plugins[] = 'tabfocus'; 1730 1731 return apply_filters( 'bbp_get_tiny_mce_plugins', $plugins ); 1732 } 1694 1733 1695 1734 /** Views *********************************************************************/
Note: See TracChangeset
for help on using the changeset viewer.