Changes from branches/3.1/wp-admin/includes/post.php at r18023 to trunk/wp-admin/includes/post.php at r18254
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r18023 r18254 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']; … … 998 1005 $q['post_type'] = 'attachment'; 999 1006 $post_type = get_post_type_object( 'attachment' ); 1000 $states = array( 'inherit' );1007 $states = 'inherit'; 1001 1008 if ( current_user_can( $post_type->cap->read_private_posts ) ) 1002 $states [] = 'private';1009 $states .= ',private'; 1003 1010 1004 1011 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states; … … 1030 1037 1031 1038 /** 1032 * {@internal Missing Short Description}}1039 * Returns the list of classes to be used by a metabox 1033 1040 * 1034 1041 * @uses get_user_option() … … 1040 1047 */ 1041 1048 function postbox_classes( $id, $page ) { 1042 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) 1043 return ''; 1044 1045 if ( $closed = get_user_option('closedpostboxes_'.$page ) ) { 1049 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) { 1050 $classes = array( '' ); 1051 } elseif ( $closed = get_user_option('closedpostboxes_'.$page ) ) { 1046 1052 if ( !is_array( $closed ) ) { 1047 return ''; 1048 } 1049 return in_array( $id, $closed )? 'closed' : ''; 1053 $classes = array( '' ); 1054 } else { 1055 $classes = in_array( $id, $closed ) ? array( 'closed' ) : array( '' ); 1056 } 1050 1057 } else { 1051 return ''; 1052 } 1058 $classes = array( '' ); 1059 } 1060 1061 $classes = apply_filters( "postbox_classes_{$page}_{$id}", $classes ); 1062 return implode( ' ', $classes ); 1053 1063 } 1054 1064 … … 1101 1111 $uri = strrev( stristr( strrev( $uri ), '/' ) ); 1102 1112 $uri = untrailingslashit($uri); 1113 $uri = apply_filters( 'editable_slug', $uri ); 1103 1114 if ( !empty($uri) ) 1104 1115 $uri .= '/'; … … 1419 1430 $ext_plugins = ''; 1420 1431 } else { 1421 $plugins = array( 'inlinepopups', 'spellchecker', ' paste', 'wordpress', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus', 'wplink', 'wpdialogs' );1432 $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'wordpress', 'wpfullscreen', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' ); 1422 1433 1423 1434 /* … … 1560 1571 'remove_linebreaks' => true, 1561 1572 'gecko_spellcheck' => true, 1573 'keep_styles' => false, 1562 1574 'entities' => '38,amp,60,lt,62,gt', 1563 1575 'accessibility_focus' => true, … … 1568 1580 'paste_strip_class_attributes' => 'all', 1569 1581 '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', 1570 1583 'wpeditimage_disable_captions' => $no_captions, 1584 'wp_fullscreen_content_css' => "$baseurl/plugins/wpfullscreen/css/wp-fullscreen.css", 1571 1585 'plugins' => implode( ',', $plugins ), 1572 1586 ); … … 1623 1637 1624 1638 $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) 1625 && false !== str pos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip');1639 && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'); 1626 1640 1627 1641 /** … … 1644 1658 $mce_options .= $k . ':' . $val . ', '; 1645 1659 continue; 1646 } elseif ( !empty($v) && is_string($v) && ( '{' == $v{0} || '[' == $v{0}) ) {1660 } elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) { 1647 1661 $mce_options .= $k . ':' . $v . ', '; 1648 1662 continue; … … 1652 1666 } 1653 1667 1654 $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?> 1668 $mce_options = rtrim( trim($mce_options), '\n\r,' ); 1669 1670 do_action('before_wp_tiny_mce', $initArray); ?> 1655 1671 1656 1672 <script type="text/javascript"> … … 1693 1709 <?php 1694 1710 1695 // Load additional inline scripts based on active plugins. 1696 if ( in_array( 'wpdialogs', $plugins ) ) { 1697 wp_print_scripts( array( 'wpdialogs-popup' ) ); 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'); 1698 1720 wp_print_styles('wp-jquery-ui-dialog'); 1699 1721 } 1700 if ( in_array( 'wplink', $plugins ) ) { 1722 1723 if ( in_array( 'wplink', $plugins, true ) ) { 1701 1724 require_once ABSPATH . 'wp-admin/includes/internal-linking.php'; 1702 add_action('tiny_mce_preload_dialogs', 'wp_link_dialog');1725 ?><div style="display:none;"><?php wp_link_dialog(); ?></div><?php 1703 1726 wp_print_scripts('wplink'); 1704 1727 wp_print_styles('wplink'); 1705 1728 } 1706 } 1707 function wp_tiny_mce_preload_dialogs() { ?> 1708 <div id="preloaded-dialogs" style="display:none;"> 1709 <?php do_action('tiny_mce_preload_dialogs'); ?> 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> 1710 1818 </div> 1711 <?php } 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
Note: See TracChangeset
for help on using the changeset viewer.