Changes from branches/3.1/wp-admin/includes/post.php at r18370 to trunk/wp-admin/includes/post.php at r18386
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r18370 r18386 26 26 if ( $update ) 27 27 $post_data['ID'] = (int) $post_data['post_ID']; 28 $post_data['post_content'] = isset($post_data['content']) ? $post_data['content'] : ''; 29 $post_data['post_excerpt'] = isset($post_data['excerpt']) ? $post_data['excerpt'] : ''; 30 $post_data['post_parent'] = isset($post_data['parent_id'])? $post_data['parent_id'] : ''; 28 29 if ( isset( $post_data['content'] ) ) 30 $post_data['post_content'] = $post_data['content']; 31 32 if ( isset( $post_data['excerpt'] ) ) 33 $post_data['post_excerpt'] = $post_data['excerpt']; 34 35 if ( isset( $post_data['parent_id'] ) ) 36 $post_data['post_parent'] = (int) $post_data['parent_id']; 37 31 38 if ( isset($post_data['trackback_url']) ) 32 39 $post_data['to_ping'] = $post_data['trackback_url']; … … 1049 1056 1050 1057 /** 1051 * {@internal Missing Short Description}}1058 * Returns the list of classes to be used by a metabox 1052 1059 * 1053 1060 * @uses get_user_option() … … 1059 1066 */ 1060 1067 function postbox_classes( $id, $page ) { 1061 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) 1062 return ''; 1063 1064 if ( $closed = get_user_option('closedpostboxes_'.$page ) ) { 1068 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) { 1069 $classes = array( '' ); 1070 } elseif ( $closed = get_user_option('closedpostboxes_'.$page ) ) { 1065 1071 if ( !is_array( $closed ) ) { 1066 return ''; 1067 } 1068 return in_array( $id, $closed )? 'closed' : ''; 1072 $classes = array( '' ); 1073 } else { 1074 $classes = in_array( $id, $closed ) ? array( 'closed' ) : array( '' ); 1075 } 1069 1076 } else { 1070 return ''; 1071 } 1077 $classes = array( '' ); 1078 } 1079 1080 $classes = apply_filters( "postbox_classes_{$page}_{$id}", $classes ); 1081 return implode( ' ', $classes ); 1072 1082 } 1073 1083 … … 1120 1130 $uri = strrev( stristr( strrev( $uri ), '/' ) ); 1121 1131 $uri = untrailingslashit($uri); 1132 $uri = apply_filters( 'editable_slug', $uri ); 1122 1133 if ( !empty($uri) ) 1123 1134 $uri .= '/'; … … 1438 1449 $ext_plugins = ''; 1439 1450 } else { 1440 $plugins = array( 'inlinepopups', 'spellchecker', ' paste', 'wordpress', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus', 'wplink', 'wpdialogs' );1451 $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'wordpress', 'wpfullscreen', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' ); 1441 1452 1442 1453 /* … … 1579 1590 'remove_linebreaks' => true, 1580 1591 'gecko_spellcheck' => true, 1592 'keep_styles' => false, 1581 1593 'entities' => '38,amp,60,lt,62,gt', 1582 1594 'accessibility_focus' => true, … … 1587 1599 'paste_strip_class_attributes' => 'all', 1588 1600 'paste_text_use_dialog' => true, 1601 'extended_valid_elements' => 'article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr', 1589 1602 'wpeditimage_disable_captions' => $no_captions, 1603 'wp_fullscreen_content_css' => "$baseurl/plugins/wpfullscreen/css/wp-fullscreen.css", 1590 1604 'plugins' => implode( ',', $plugins ), 1591 1605 ); … … 1642 1656 1643 1657 $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) 1644 && false !== str pos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip');1658 && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'); 1645 1659 1646 1660 /** … … 1663 1677 $mce_options .= $k . ':' . $val . ', '; 1664 1678 continue; 1665 } elseif ( !empty($v) && is_string($v) && ( '{' == $v{0} || '[' == $v{0}) ) {1679 } elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) { 1666 1680 $mce_options .= $k . ':' . $v . ', '; 1667 1681 continue; … … 1671 1685 } 1672 1686 1673 $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?> 1687 $mce_options = rtrim( trim($mce_options), '\n\r,' ); 1688 1689 do_action('before_wp_tiny_mce', $initArray); ?> 1674 1690 1675 1691 <script type="text/javascript"> … … 1712 1728 <?php 1713 1729 1714 // Load additional inline scripts based on active plugins. 1715 if ( in_array( 'wpdialogs', $plugins ) ) { 1716 wp_print_scripts( array( 'wpdialogs-popup' ) ); 1730 do_action('after_wp_tiny_mce', $initArray); 1731 } 1732 1733 // Load additional inline scripts based on active plugins. 1734 function wp_preload_dialogs($init) { 1735 $plugins = preg_split('/[ ,-]+/', $init['plugins']); 1736 1737 if ( in_array( 'wpdialogs', $plugins, true ) ) { 1738 wp_print_scripts('wpdialogs-popup'); 1717 1739 wp_print_styles('wp-jquery-ui-dialog'); 1718 1740 } 1719 if ( in_array( 'wplink', $plugins ) ) { 1741 1742 if ( in_array( 'wplink', $plugins, true ) ) { 1720 1743 require_once ABSPATH . 'wp-admin/includes/internal-linking.php'; 1721 add_action('tiny_mce_preload_dialogs', 'wp_link_dialog');1744 ?><div style="display:none;"><?php wp_link_dialog(); ?></div><?php 1722 1745 wp_print_scripts('wplink'); 1723 1746 wp_print_styles('wplink'); 1724 1747 } 1725 } 1726 function wp_tiny_mce_preload_dialogs() { ?> 1727 <div id="preloaded-dialogs" style="display:none;"> 1728 <?php do_action('tiny_mce_preload_dialogs'); ?> 1748 1749 // Distraction Free Writing mode 1750 if ( in_array( 'wpfullscreen', $plugins, true ) ) { 1751 wp_fullscreen_html(); 1752 wp_print_scripts('wp-fullscreen'); 1753 } 1754 1755 wp_print_scripts('word-count'); 1756 } 1757 1758 function wp_quicktags() { 1759 global $tinymce_version; 1760 1761 wp_preload_dialogs( array( 'plugins' => 'wpdialogs,wplink,wpfullscreen' ) ); 1762 1763 if ( !user_can_richedit() ) { 1764 wp_enqueue_style( 'tinymce-buttons', includes_url('js/tinymce/themes/advanced/skins/wp_theme/ui.css'), array(), $tinymce_version ); 1765 wp_print_styles('tinymce-buttons'); 1766 } 1767 } 1768 1769 function wp_print_editor_js() { 1770 wp_print_scripts('editor'); 1771 } 1772 1773 function wp_fullscreen_html() { 1774 global $content_width, $post; 1775 1776 $width = isset($content_width) && 800 > $content_width ? $content_width : 800; 1777 $width = $width + 10; // compensate for the padding 1778 $dfw_width = get_user_setting( 'dfw_width', $width ); 1779 $save = isset($post->post_status) && $post->post_status == 'publish' ? __('Update') : __('Save'); 1780 ?> 1781 <div id="wp-fullscreen-body"> 1782 <div id="fullscreen-topbar"> 1783 <div id="wp-fullscreen-toolbar"> 1784 <div id="wp-fullscreen-close"><a href="#" onclick="fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div> 1785 <div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?>px;"> 1786 1787 <div id="wp-fullscreen-mode-bar"><div id="wp-fullscreen-modes"> 1788 <a href="#" onclick="fullscreen.switchmode('tinymce');return false;"><?php _e('Visual'); ?></a> 1789 <a href="#" onclick="fullscreen.switchmode('html');return false;"><?php _e('HTML'); ?></a> 1790 </div></div> 1791 1792 <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="wp_themeSkin"> 1793 <?php 1794 1795 $media_link_type = 'image'; 1796 if ( is_multisite() && ( ( ! $mu_media_buttons = get_site_option( 'mu_media_buttons' ) ) || empty( $mu_media_buttons['image'] ) ) ) 1797 $media_link_type = 'media'; 1798 1799 $buttons = array( 1800 // format: title, onclick, show in both editors 1801 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'onclick' => 'fullscreen.b();', 'both' => false ), 1802 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'onclick' => 'fullscreen.i();', 'both' => false ), 1803 '0' => 'separator', 1804 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'onclick' => 'fullscreen.ul();', 'both' => false ), 1805 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'onclick' => 'fullscreen.ol();', 'both' => false ), 1806 '1' => 'separator', 1807 'blockquote' => array( 'title' => __('Blockquote (Alt+Shift+Q)'), 'onclick' => 'fullscreen.blockquote();', 'both' => false ), 1808 'image' => array( 'title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "jQuery('#add_{$media_link_type}').click();", 'both' => true ), 1809 '2' => 'separator', 1810 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'onclick' => 'fullscreen.link();', 'both' => true ), 1811 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'onclick' => 'fullscreen.unlink();', 'both' => false ), 1812 '3' => 'separator', 1813 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'onclick' => 'fullscreen.help();', 'both' => false ) 1814 ); 1815 1816 $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons ); 1817 1818 foreach ( $buttons as $button => $args ) { 1819 if ( 'separator' == $args ) { ?> 1820 <div><span aria-orientation="vertical" role="separator" class="mceSeparator"></span></div> 1821 <?php continue; 1822 } ?> 1823 1824 <div<?php if ( $args['both'] ) { ?> class="wp-fullscreen-both"<?php } ?>> 1825 <a title="<?php echo $args['title']; ?>" onclick="<?php echo $args['onclick']; ?>return false;" class="mceButton mceButtonEnabled mce_<?php echo $button; ?>" href="#" id="wp_fs_<?php echo $button; ?>" role="button" aria-pressed="false"> 1826 <span class="mceIcon mce_<?php echo $button; ?>"></span> 1827 </a> 1828 </div> 1829 <?php 1830 } ?> 1831 1832 </div></div> 1833 1834 <div id="wp-fullscreen-save"> 1835 <span><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span> 1836 <img src="images/wpspin_light.gif" alt="" /> 1837 <input type="button" class="button-primary" value="<?php echo $save; ?>" onclick="fullscreen.save();" /> 1838 </div> 1839 1840 </div> 1729 1841 </div> 1730 <?php } 1842 </div> 1843 1844 <div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;"> 1845 <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 1846 <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" /> 1847 1848 <div id="wp-fullscreen-container"> 1849 <textarea id="wp_mce_fullscreen"></textarea> 1850 </div> 1851 1852 <div id="wp-fullscreen-status"> 1853 <div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div> 1854 <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div> 1855 </div> 1856 </div> 1857 </div> 1858 1859 <div class="fullscreen-overlay" id="fullscreen-overlay"></div> 1860 <div class="fullscreen-overlay fullscreen-fader fade-600" id="fullscreen-fader"></div> 1861 <?php 1862 } 1863 1864
Note: See TracChangeset
for help on using the changeset viewer.