Changes from trunk/wp-admin/includes/post.php at r18254 to branches/3.1/wp-admin/includes/post.php at r18023
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/wp-admin/includes/post.php
r18254 r18023 26 26 if ( $update ) 27 27 $post_data['ID'] = (int) $post_data['post_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 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'] : ''; 38 31 if ( isset($post_data['trackback_url']) ) 39 32 $post_data['to_ping'] = $post_data['trackback_url']; … … 1005 998 $q['post_type'] = 'attachment'; 1006 999 $post_type = get_post_type_object( 'attachment' ); 1007 $states = 'inherit';1000 $states = array( 'inherit' ); 1008 1001 if ( current_user_can( $post_type->cap->read_private_posts ) ) 1009 $states .= ',private';1002 $states[] = 'private'; 1010 1003 1011 1004 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states; … … 1037 1030 1038 1031 /** 1039 * Returns the list of classes to be used by a metabox1032 * {@internal Missing Short Description}} 1040 1033 * 1041 1034 * @uses get_user_option() … … 1047 1040 */ 1048 1041 function postbox_classes( $id, $page ) { 1049 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) { 1050 $classes = array( '' ); 1051 } elseif ( $closed = get_user_option('closedpostboxes_'.$page ) ) { 1042 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) 1043 return ''; 1044 1045 if ( $closed = get_user_option('closedpostboxes_'.$page ) ) { 1052 1046 if ( !is_array( $closed ) ) { 1053 $classes = array( '' ); 1054 } else { 1055 $classes = in_array( $id, $closed ) ? array( 'closed' ) : array( '' ); 1056 } 1047 return ''; 1048 } 1049 return in_array( $id, $closed )? 'closed' : ''; 1057 1050 } else { 1058 $classes = array( '' ); 1059 } 1060 1061 $classes = apply_filters( "postbox_classes_{$page}_{$id}", $classes ); 1062 return implode( ' ', $classes ); 1051 return ''; 1052 } 1063 1053 } 1064 1054 … … 1111 1101 $uri = strrev( stristr( strrev( $uri ), '/' ) ); 1112 1102 $uri = untrailingslashit($uri); 1113 $uri = apply_filters( 'editable_slug', $uri );1114 1103 if ( !empty($uri) ) 1115 1104 $uri .= '/'; … … 1430 1419 $ext_plugins = ''; 1431 1420 } else { 1432 $plugins = array( 'inlinepopups', 'spellchecker', ' tabfocus', 'paste', 'media', 'wordpress', 'wpfullscreen', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );1421 $plugins = array( 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus', 'wplink', 'wpdialogs' ); 1433 1422 1434 1423 /* … … 1571 1560 'remove_linebreaks' => true, 1572 1561 'gecko_spellcheck' => true, 1573 'keep_styles' => false,1574 1562 'entities' => '38,amp,60,lt,62,gt', 1575 1563 'accessibility_focus' => true, … … 1580 1568 'paste_strip_class_attributes' => 'all', 1581 1569 'paste_text_use_dialog' => true, 1582 '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',1583 1570 'wpeditimage_disable_captions' => $no_captions, 1584 'wp_fullscreen_content_css' => "$baseurl/plugins/wpfullscreen/css/wp-fullscreen.css",1585 1571 'plugins' => implode( ',', $plugins ), 1586 1572 ); … … 1637 1623 1638 1624 $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) 1639 && false !== str ipos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');1625 && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip'); 1640 1626 1641 1627 /** … … 1658 1644 $mce_options .= $k . ':' . $val . ', '; 1659 1645 continue; 1660 } elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v)) ) {1646 } elseif ( !empty($v) && is_string($v) && ( '{' == $v{0} || '[' == $v{0} ) ) { 1661 1647 $mce_options .= $k . ':' . $v . ', '; 1662 1648 continue; … … 1666 1652 } 1667 1653 1668 $mce_options = rtrim( trim($mce_options), '\n\r,' ); 1669 1670 do_action('before_wp_tiny_mce', $initArray); ?> 1654 $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?> 1671 1655 1672 1656 <script type="text/javascript"> … … 1709 1693 <?php 1710 1694 1711 do_action('after_wp_tiny_mce', $initArray); 1712 } 1713 1714 // Load additional inline scripts based on active plugins. 1715 function wp_preload_dialogs($init) { 1716 $plugins = preg_split('/[ ,-]+/', $init['plugins']); 1717 1718 if ( in_array( 'wpdialogs', $plugins, true ) ) { 1719 wp_print_scripts('wpdialogs-popup'); 1695 // Load additional inline scripts based on active plugins. 1696 if ( in_array( 'wpdialogs', $plugins ) ) { 1697 wp_print_scripts( array( 'wpdialogs-popup' ) ); 1720 1698 wp_print_styles('wp-jquery-ui-dialog'); 1721 1699 } 1722 1723 if ( in_array( 'wplink', $plugins, true ) ) { 1700 if ( in_array( 'wplink', $plugins ) ) { 1724 1701 require_once ABSPATH . 'wp-admin/includes/internal-linking.php'; 1725 ?><div style="display:none;"><?php wp_link_dialog(); ?></div><?php1702 add_action('tiny_mce_preload_dialogs', 'wp_link_dialog'); 1726 1703 wp_print_scripts('wplink'); 1727 1704 wp_print_styles('wplink'); 1728 1705 } 1729 1730 // Distraction Free Writing mode 1731 if ( in_array( 'wpfullscreen', $plugins, true ) ) { 1732 wp_fullscreen_html(); 1733 wp_print_scripts('wp-fullscreen'); 1734 } 1735 1736 wp_print_scripts('word-count'); 1737 } 1738 1739 function wp_quicktags() { 1740 global $tinymce_version; 1741 1742 wp_preload_dialogs( array( 'plugins' => 'wpdialogs,wplink,wpfullscreen' ) ); 1743 1744 if ( !user_can_richedit() ) { 1745 wp_enqueue_style( 'tinymce-buttons', includes_url('js/tinymce/themes/advanced/skins/wp_theme/ui.css'), array(), $tinymce_version ); 1746 wp_print_styles('tinymce-buttons'); 1747 } 1748 } 1749 1750 function wp_print_editor_js() { 1751 wp_print_scripts('editor'); 1752 } 1753 1754 function wp_fullscreen_html() { 1755 global $content_width, $post; 1756 1757 $width = isset($content_width) && 800 > $content_width ? $content_width : 800; 1758 $width = $width + 10; // compensate for the padding 1759 $dfw_width = get_user_setting( 'dfw_width', $width ); 1760 $save = $post->post_status == 'publish' ? __('Update') : __('Save'); 1761 ?> 1762 <div id="wp-fullscreen-body"> 1763 <div id="fullscreen-topbar"> 1764 <div id="wp-fullscreen-toolbar"> 1765 <div id="wp-fullscreen-close"><a href="#" onclick="fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div> 1766 <div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?>px;"> 1767 1768 <div id="wp-fullscreen-mode-bar"><div id="wp-fullscreen-modes"> 1769 <a href="#" onclick="fullscreen.switchmode('tinymce');return false;"><?php _e('Visual'); ?></a> 1770 <a href="#" onclick="fullscreen.switchmode('html');return false;"><?php _e('HTML'); ?></a> 1771 </div></div> 1772 1773 <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="wp_themeSkin"> 1774 <?php 1775 1776 $buttons = array( 1777 // format: title, onclick, show in both editors 1778 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'onclick' => 'fullscreen.b();', 'both' => false ), 1779 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'onclick' => 'fullscreen.i();', 'both' => false ), 1780 '0' => 'separator', 1781 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'onclick' => 'fullscreen.ul();', 'both' => false ), 1782 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'onclick' => 'fullscreen.ol();', 'both' => false ), 1783 '1' => 'separator', 1784 'blockquote' => array( 'title' => __('Blockquote (Alt+Shift+Q)'), 'onclick' => 'fullscreen.blockquote();', 'both' => false ), 1785 'image' => array( 'title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "jQuery('#add_image').click();", 'both' => true ), 1786 '2' => 'separator', 1787 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'onclick' => 'fullscreen.link();', 'both' => true ), 1788 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'onclick' => 'fullscreen.unlink();', 'both' => false ), 1789 '3' => 'separator', 1790 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'onclick' => 'fullscreen.help();', 'both' => false ) 1791 ); 1792 1793 $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons ); 1794 1795 foreach ( $buttons as $button => $args ) { 1796 if ( 'separator' == $args ) { ?> 1797 <div><span aria-orientation="vertical" role="separator" class="mceSeparator"></span></div> 1798 <?php continue; 1799 } ?> 1800 1801 <div<?php if ( $args['both'] ) { ?> class="wp-fullscreen-both"<?php } ?>> 1802 <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"> 1803 <span class="mceIcon mce_<?php echo $button; ?>"></span> 1804 </a> 1805 </div> 1806 <?php 1807 } ?> 1808 1809 </div></div> 1810 1811 <div id="wp-fullscreen-save"> 1812 <span><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span> 1813 <img src="images/wpspin_light.gif" alt="" /> 1814 <input type="button" class="button-primary" value="<?php echo $save; ?>" onclick="fullscreen.save();" /> 1815 </div> 1816 1817 </div> 1706 } 1707 function wp_tiny_mce_preload_dialogs() { ?> 1708 <div id="preloaded-dialogs" style="display:none;"> 1709 <?php do_action('tiny_mce_preload_dialogs'); ?> 1818 1710 </div> 1819 </div> 1820 1821 <div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;"> 1822 <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 1823 <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" /> 1824 1825 <div id="wp-fullscreen-container"> 1826 <textarea id="wp_mce_fullscreen"></textarea> 1827 </div> 1828 1829 <div id="wp-fullscreen-status"> 1830 <div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div> 1831 <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div> 1832 </div> 1833 </div> 1834 </div> 1835 1836 <div class="fullscreen-overlay" id="fullscreen-overlay"></div> 1837 <div class="fullscreen-overlay fullscreen-fader fade-600" id="fullscreen-fader"></div> 1838 <?php 1839 } 1840 1841 1711 <?php }
Note: See TracChangeset
for help on using the changeset viewer.