Strip trailing whites.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-03 20:26:11 +00:00
parent ebff7d7c0f
commit 7b7243d94a
45 changed files with 325 additions and 325 deletions

View File

@ -134,7 +134,7 @@ case 'imgedit-preview' :
case 'menu-quick-search': case 'menu-quick-search':
if ( ! current_user_can( 'switch_themes' ) ) if ( ! current_user_can( 'switch_themes' ) )
die('-1'); die('-1');
require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
_wp_ajax_menu_quick_search( $_REQUEST ); _wp_ajax_menu_quick_search( $_REQUEST );
@ -399,7 +399,7 @@ case 'delete-link' :
case 'delete-menu-item' : case 'delete-menu-item' :
$menu_item_id = (int) $_POST['menu-item']; $menu_item_id = (int) $_POST['menu-item'];
check_admin_referer( 'delete-menu_item_' . $menu_item_id ); check_admin_referer( 'delete-menu_item_' . $menu_item_id );
if ( ! current_user_can( 'switch_themes' ) ) if ( ! current_user_can( 'switch_themes' ) )
die('-1'); die('-1');
if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) )
@ -827,12 +827,12 @@ case 'add-menu-item' :
$menu_id = (int) $_POST['menu']; $menu_id = (int) $_POST['menu'];
if ( isset( $_POST['menu-item'] ) ) { if ( isset( $_POST['menu-item'] ) ) {
$item_ids = wp_save_nav_menu_item( $menu_id, $_POST['menu-item'] ); $item_ids = wp_save_nav_menu_item( $menu_id, $_POST['menu-item'] );
if ( is_wp_error( $item_ids ) ) if ( is_wp_error( $item_ids ) )
die('-1'); die('-1');
} else { } else {
$item_ids = array(); $item_ids = array();
} }
foreach ( (array) $item_ids as $menu_item_id ) { foreach ( (array) $item_ids as $menu_item_id ) {
$menu_obj = get_post( $menu_item_id ); $menu_obj = get_post( $menu_item_id );
if ( ! empty( $menu_obj->ID ) ) { if ( ! empty( $menu_obj->ID ) ) {
@ -847,7 +847,7 @@ case 'add-menu-item' :
'context' => 'backend', 'context' => 'backend',
'link_after' => '', 'link_after' => '',
'link_before' => '', 'link_before' => '',
'walker' => new Walker_Nav_Menu_Edit, 'walker' => new Walker_Nav_Menu_Edit,
); );
echo walk_nav_menu_tree( $menu_items, 0, (object) $args ); echo walk_nav_menu_tree( $menu_items, 0, (object) $args );
} }
@ -1093,7 +1093,7 @@ case 'hidden-columns' :
case 'menu-quick-search': case 'menu-quick-search':
if ( ! current_user_can( 'switch_themes' ) ) if ( ! current_user_can( 'switch_themes' ) )
die('-1'); die('-1');
require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
_wp_ajax_menu_quick_search( $_REQUEST ); _wp_ajax_menu_quick_search( $_REQUEST );

View File

@ -9,8 +9,8 @@
font-size: 16px; font-size: 16px;
} }
#dashboard_right_now div.musubtable { #dashboard_right_now div.musubtable {
border-top: none; border-top: none;
} }
/* No drag and drop on ms-sites.php */ /* No drag and drop on ms-sites.php */

View File

@ -1,14 +1,14 @@
.howto span { .howto span {
float: right; float: right;
} }
.menu-item-textbox { .menu-item-textbox {
float: left; float: left;
} }
.add-to-menu { .add-to-menu {
float: left; float: left;
} }
.menu-item-title input[type="checkbox"] { .menu-item-title input[type="checkbox"] {
margin-left: 3px; margin-left: 3px;
} }
.menu li dl dt { .menu li dl dt {
padding-left: 0; padding-left: 0;
@ -16,17 +16,17 @@
} }
.menu li ul li { .menu li ul li {
margin-left: 0; margin-left: 0;
margin-right: 20px; margin-right: 20px;
} }
.menu li .item-title { .menu li .item-title {
margin-right: 0; margin-right: 0;
margin-left: 18em; margin-left: 18em;
} }
.item-controls { .item-controls {
right: auto; right: auto;
left: 15px; left: 15px;
} }
.item-type { .item-type {
padding-right: 0; padding-right: 0;
padding-left: 10px; padding-left: 10px;
} }

View File

@ -55,12 +55,12 @@ body {
#menu-management .menu-edit { #menu-management .menu-edit {
margin-bottom: 20px; margin-bottom: 20px;
} }
#nav-menu-header, #post-body { #nav-menu-header, #post-body {
border-color: #ccc; border-color: #ccc;
border-style: solid; border-style: solid;
} }
#nav-menu-header { #nav-menu-header {
background: url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf; background: url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf;
border-width: 1px 1px 0 1px; border-width: 1px 1px 0 1px;
@ -73,7 +73,7 @@ body {
-khtml-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px;
border-top-right-radius: 6px; border-top-right-radius: 6px;
} }
#post-body { #post-body {
background: #fff; background: #fff;
padding:0 0 10px 10px; padding:0 0 10px 10px;
@ -87,11 +87,11 @@ body {
-khtml-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px;
border-bottom-right-radius: 6px; border-bottom-right-radius: 6px;
} }
#post-body-content { #post-body-content {
position: relative; position: relative;
} }
.post-body-plain { .post-body-plain {
padding: 10px 10px 0 0; padding: 10px 10px 0 0;
} }
@ -99,9 +99,9 @@ body {
#menu-management .menu-add-new abbr { #menu-management .menu-add-new abbr {
font-weight:bold; font-weight:bold;
} }
/* Menu Tabs */ /* Menu Tabs */
#menu-management .nav-tabs-nav { #menu-management .nav-tabs-nav {
margin: 0 20px; margin: 0 20px;
} }
@ -162,12 +162,12 @@ body {
text-align: right; text-align: right;
padding: 0 10px 3px 10px; padding: 0 10px 3px 10px;
margin-bottom: 5px; margin-bottom: 5px;
} }
#select-nav-menu { #select-nav-menu {
width: 100px; width: 100px;
display: inline; display: inline;
} }
/* Menu Toolbar */ /* Menu Toolbar */
#menu-management #major-publishing-actions #delete-action { #menu-management #major-publishing-actions #delete-action {
float: right; float: right;
@ -184,7 +184,7 @@ body {
#wpbody .open-label span { #wpbody .open-label span {
padding-right: 10px; padding-right: 10px;
} }
.js .input-with-default-title { .js .input-with-default-title {
color: #aaa; color: #aaa;
font-style: italic; font-style: italic;
@ -210,7 +210,7 @@ body {
/* Button Secondary Actions */ /* Button Secondary Actions */
.list-controls { float: left; margin-top: 5px; } .list-controls { float: left; margin-top: 5px; }
.add-to-menu { .add-to-menu {
float: right; float: right;
} }
@ -265,7 +265,7 @@ body {
.menu ul { width: 100%; } .menu ul { width: 100%; }
.menu ul.sub-menu { .menu ul.sub-menu {
} }
.menu li { .menu li {
margin-bottom: 0; margin-bottom: 0;
} }
.menu li dl { .menu li dl {
@ -276,12 +276,12 @@ body {
} }
.menu li dl dt { .menu li dl dt {
background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF; background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF;
border: 1px solid #E6E6E6; border: 1px solid #E6E6E6;
clear:both; clear:both;
position: relative; position: relative;
padding-left: 10px; padding-left: 10px;
height: auto; height: auto;
width: 400px; width: 400px;
line-height: 35px; line-height: 35px;
text-shadow: 0 1px 0 #FFFFFF; text-shadow: 0 1px 0 #FFFFFF;
font-weight:bold; font-weight:bold;
@ -289,7 +289,7 @@ body {
} }
.menu li dl.menu-item-edit-inactive dt { .menu li dl.menu-item-edit-inactive dt {
border-radius: 6px; border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-khtml-border-radius: 6px; -khtml-border-radius: 6px;
} }
@ -311,7 +311,7 @@ body {
background-color:#faa; background-color:#faa;
} }
.menu li .item-title { .menu li .item-title {
padding: 7px 0; padding: 7px 0;
line-height: 20px; line-height: 20px;
display:block; display:block;
@ -424,9 +424,9 @@ body.js .item-order {
font-size: 11px; font-size: 11px;
color: #777; color: #777;
font-style: italic; font-style: italic;
border: 1px solid #dfdfdf; border: 1px solid #dfdfdf;
border-radius: 6px; border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-khtml-border-radius: 6px; -khtml-border-radius: 6px;
} }

View File

@ -316,7 +316,7 @@ h3.tb {
font-size: 12px; font-size: 12px;
margin: 1px; margin: 1px;
} }
.category-add select { .category-add select {
width: 100%; width: 100%;
-x-system-font: none; -x-system-font: none;

View File

@ -2014,11 +2014,11 @@ input#link_url {
} }
div.tabs-panel-active { div.tabs-panel-active {
display:block; display:block;
} }
div.tabs-panel-inactive { div.tabs-panel-inactive {
display:none; display:none;
} }
#post-body .categorydiv div.tabs-panel, #post-body .categorydiv div.tabs-panel,

View File

@ -154,7 +154,7 @@ class Custom_Background {
<tr valign="top"> <tr valign="top">
<th scope="row"><?php _e('Current Image'); ?></th> <th scope="row"><?php _e('Current Image'); ?></th>
<td> <td>
<style type="text/css"> <style type="text/css">
#custom-background-image { #custom-background-image {
background-color: #<?php echo get_background_color()?>; background-color: #<?php echo get_background_color()?>;
<?php if ( get_background_image() ) { ?> <?php if ( get_background_image() ) { ?>
@ -164,7 +164,7 @@ class Custom_Background {
background-attachment: <?php echo get_theme_mod('background_position', 'fixed'); ?>; background-attachment: <?php echo get_theme_mod('background_position', 'fixed'); ?>;
<?php } ?> <?php } ?>
} }
</style> </style>
<div id="custom-background-image"> <div id="custom-background-image">
<?php if ( get_background_image() ) { ?> <?php if ( get_background_image() ) { ?>
<img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" /><br /> <img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" /><br />

View File

@ -641,7 +641,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
continue; continue;
if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files
continue; continue;
$contents = $z->getFromIndex($i); $contents = $z->getFromIndex($i);
if ( false === $contents ) if ( false === $contents )
@ -685,9 +685,9 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
// Determine any children directories needed (From within the archive) // Determine any children directories needed (From within the archive)
foreach ( $archive_files as $file ) { foreach ( $archive_files as $file ) {
if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Skip the OS X-created __MACOSX directory if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Skip the OS X-created __MACOSX directory
continue; continue;
$needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname($file['filename']) ); $needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname($file['filename']) );
} }

View File

@ -2160,7 +2160,7 @@ function type_url_form_file() {
function _insert_into_post_button($type) { function _insert_into_post_button($type) {
if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') ) if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') )
return ''; return '';
if ( 'image' == $type ) if ( 'image' == $type )
return ' return '
<tr> <tr>
@ -2168,7 +2168,7 @@ function _insert_into_post_button($type) {
<td> <td>
<input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" /> <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" />
</td> </td>
</tr> </tr>
'; ';
return ' return '

View File

@ -248,7 +248,7 @@ function post_tags_meta_box($post, $box) {
$help_hint = isset( $taxonomy->help_hint ) ? $taxonomy->help_hint : __('Add new tag'); $help_hint = isset( $taxonomy->help_hint ) ? $taxonomy->help_hint : __('Add new tag');
$help_nojs = isset( $taxonomy->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags'); $help_nojs = isset( $taxonomy->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags');
$help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s'); $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s');
$disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : ''; $disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : '';
?> ?>
<div class="tagsdiv" id="<?php echo $tax_name; ?>"> <div class="tagsdiv" id="<?php echo $tax_name; ?>">

View File

@ -452,7 +452,7 @@ function display_space_usage() {
/* translators: Gigabytes */ /* translators: Gigabytes */
$space .= __( 'GB' ); $space .= __( 'GB' );
} else { } else {
/* translators: Megabytes */ /* translators: Megabytes */
$space .= __( 'MB' ); $space .= __( 'MB' );
} }
?> ?>
@ -546,7 +546,7 @@ function refresh_user_details( $id ) {
function format_code_lang( $code = '' ) { function format_code_lang( $code = '' ) {
$code = strtolower( substr( $code, 0, 2 ) ); $code = strtolower( substr( $code, 0, 2 ) );
$lang_codes = array( $lang_codes = array(
'aa' => 'Afar', 'ab' => 'Abkhazian', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'bm' => 'Bambara', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali', 'aa' => 'Afar', 'ab' => 'Abkhazian', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'bm' => 'Bambara', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali',
'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree', 'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree',
'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi; Dhivehi; Maldivian', 'nl' => 'Dutch; Flemish', 'dz' => 'Dzongkha', 'en' => 'English', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijjian', 'fi' => 'Finnish', 'fr' => 'French', 'fy' => 'Western Frisian', 'ff' => 'Fulah', 'ka' => 'Georgian', 'de' => 'German', 'gd' => 'Gaelic; Scottish Gaelic', 'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi; Dhivehi; Maldivian', 'nl' => 'Dutch; Flemish', 'dz' => 'Dzongkha', 'en' => 'English', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijjian', 'fi' => 'Finnish', 'fr' => 'French', 'fy' => 'Western Frisian', 'ff' => 'Fulah', 'ka' => 'Georgian', 'de' => 'German', 'gd' => 'Gaelic; Scottish Gaelic',
@ -630,7 +630,7 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
if ( $code_lang == 'en_US' ) { // American English if ( $code_lang == 'en_US' ) { // American English
$flag = true; $flag = true;
$ae = __( 'American English' ); $ae = __( 'American English' );
$output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang ) . '> ' . $ae . '</option>'; $output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang ) . '> ' . $ae . '</option>';
} elseif ( $code_lang == 'en_GB' ) { // British English } elseif ( $code_lang == 'en_GB' ) { // British English
$flag = true; $flag = true;

View File

@ -16,7 +16,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* @param int $depth Depth of page. * @param int $depth Depth of page.
*/ */
function start_lvl(&$output, $depth) {} function start_lvl(&$output, $depth) {}
/** /**
* @see Walker_Nav_Menu::end_lvl() * @see Walker_Nav_Menu::end_lvl()
* @since 3.0.0 * @since 3.0.0
@ -25,7 +25,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* @param int $depth Depth of page. * @param int $depth Depth of page.
*/ */
function end_lvl(&$output, $depth) {} function end_lvl(&$output, $depth) {}
/** /**
* @see Walker::start_el() * @see Walker::start_el()
* @since 3.0.0 * @since 3.0.0
@ -49,7 +49,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
'page-tab', 'page-tab',
'_wpnonce', '_wpnonce',
); );
$original_title = ''; $original_title = '';
if ( 'taxonomy' == $item->type ) { if ( 'taxonomy' == $item->type ) {
$original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
@ -59,7 +59,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
} }
?> ?>
<li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>"> <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">
<dl class="<?php <dl class="<?php
if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ) if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
echo 'menu-item-edit-active'; echo 'menu-item-edit-active';
else else
@ -71,44 +71,44 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
<span class="item-type"><?php echo esc_html( $item->append ); ?></span> <span class="item-type"><?php echo esc_html( $item->append ); ?></span>
<span class="item-order"> <span class="item-order">
<a href="<?php <a href="<?php
echo wp_nonce_url( echo wp_nonce_url(
add_query_arg( add_query_arg(
array( array(
'action' => 'move-up-menu-item', 'action' => 'move-up-menu-item',
'menu-item' => $item_id, 'menu-item' => $item_id,
), ),
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
), ),
'move-item' 'move-item'
); );
?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?>">&#8593;</abbr></a> ?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?>">&#8593;</abbr></a>
| |
<a href="<?php <a href="<?php
echo wp_nonce_url( echo wp_nonce_url(
add_query_arg( add_query_arg(
array( array(
'action' => 'move-down-menu-item', 'action' => 'move-down-menu-item',
'menu-item' => $item_id, 'menu-item' => $item_id,
), ),
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
), ),
'move-item' 'move-item'
); );
?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?>">&#8595;</abbr></a> ?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?>">&#8595;</abbr></a>
</span> </span>
<a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php <a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php
echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) ); echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) );
?>#menu-item-settings-<?php echo $item_id; ?>">Edit Menu Item</a> ?>#menu-item-settings-<?php echo $item_id; ?>">Edit Menu Item</a>
</span> </span>
</dt> </dt>
</dl> </dl>
<div class="menu-item-settings <?php <div class="menu-item-settings <?php
if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ) if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
echo 'menu-item-edit-active'; echo 'menu-item-edit-active';
else else
echo 'menu-item-edit-inactive'; echo 'menu-item-edit-inactive';
?>" id="menu-item-settings-<?php echo $item_id; ?>"> ?>" id="menu-item-settings-<?php echo $item_id; ?>">
<?php if( 'custom' == $item->type ) : ?> <?php if( 'custom' == $item->type ) : ?>
<p class="field-url description description-wide"> <p class="field-url description description-wide">
<label for="edit-menu-item-url-<?php echo $item_id; ?>"> <label for="edit-menu-item-url-<?php echo $item_id; ?>">
@ -157,11 +157,11 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
<span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span> <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span>
</label> </label>
</p> </p>
<span class="menu-item-actions description-wide submitbox"> <span class="menu-item-actions description-wide submitbox">
<?php if( 'custom' != $item->type ) : ?> <?php if( 'custom' != $item->type ) : ?>
<p class="link-to-original"><?php <p class="link-to-original"><?php
_e('Original '); _e('Original ');
echo esc_html( $item->append ); echo esc_html( $item->append );
echo ":"; ?> echo ":"; ?>
<a href="<?php echo esc_attr( $item->url ); ?>"> <a href="<?php echo esc_attr( $item->url ); ?>">
@ -169,20 +169,20 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
</a> </a>
</p> </p>
<?php endif; ?> <?php endif; ?>
<a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
echo wp_nonce_url( echo wp_nonce_url(
add_query_arg( add_query_arg(
array( array(
'action' => 'delete-menu-item', 'action' => 'delete-menu-item',
'menu-item' => $item_id, 'menu-item' => $item_id,
), ),
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
), ),
'delete-menu_item_' . $item_id 'delete-menu_item_' . $item_id
); ?>"><?php _e('Remove'); ?></a> | <a class="item-close submitclose" id="close-<?php echo $item_id; ?>" href=""><?php _e('Close'); ?></a> ); ?>"><?php _e('Remove'); ?></a> | <a class="item-close submitclose" id="close-<?php echo $item_id; ?>" href=""><?php _e('Close'); ?></a>
<input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" /> <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" />
</span> </span>
<input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" /> <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
<input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" /> <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
<input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" /> <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
@ -190,7 +190,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
<input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_parent ); ?>" /> <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_parent ); ?>" />
<input class="menu-item-data-position" type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" /> <input class="menu-item-data-position" type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
<input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" /> <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
</div><!-- .menu-item-settings--> </div><!-- .menu-item-settings-->
<ul class="menu-item-transport"></ul> <ul class="menu-item-transport"></ul>
<?php <?php
$output .= ob_get_clean(); $output .= ob_get_clean();
@ -201,7 +201,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* Prints the appropriate response to a menu quick search. * Prints the appropriate response to a menu quick search.
* *
* @since 3.0.0 * @since 3.0.0
* *
* @param array $request The unsanitized request values. * @param array $request The unsanitized request values.
*/ */
function _wp_ajax_menu_quick_search( $request = array() ) { function _wp_ajax_menu_quick_search( $request = array() ) {
@ -313,15 +313,15 @@ function wp_nav_menu_setup() {
add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
wp_nav_menu_post_type_meta_boxes(); wp_nav_menu_post_type_meta_boxes();
wp_nav_menu_taxonomy_meta_boxes(); wp_nav_menu_taxonomy_meta_boxes();
// Register advanced menu items (columns) // Register advanced menu items (columns)
add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns'); add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
add_filter( 'columns_prefs_header', create_function( '', "return __('Show advanced menu properties');" )); add_filter( 'columns_prefs_header', create_function( '', "return __('Show advanced menu properties');" ));
// If first time editing, disable advanced items by default. // If first time editing, disable advanced items by default.
if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
$user = wp_get_current_user(); $user = wp_get_current_user();
@ -422,7 +422,7 @@ function wp_nav_menu_item_link_meta_box() {
} }
$removed_args = array( $removed_args = array(
'action', 'action',
'customlink-tab', 'customlink-tab',
'edit-menu-item', 'edit-menu-item',
'menu-item', 'menu-item',
@ -476,13 +476,13 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
$pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
$offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
$args = array( $args = array(
'offset' => $offset, 'offset' => $offset,
'order' => 'ASC', 'order' => 'ASC',
'orderby' => 'title', 'orderby' => 'title',
'posts_per_page' => $per_page, 'posts_per_page' => $per_page,
'post_type' => $post_type_name, 'post_type' => $post_type_name,
'suppress_filters' => true, 'suppress_filters' => true,
); );
if ( isset( $post_type['args']->_default_query ) ) if ( isset( $post_type['args']->_default_query ) )
@ -511,7 +511,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
} }
$parent_ids = array_unique($parent_ids); $parent_ids = array_unique($parent_ids);
$child_ids = array_unique($child_ids); $child_ids = array_unique($child_ids);
$missing_parents = array(); $missing_parents = array();
do { do {
foreach( (array) $missing_parents as $missing_parent_id ) { foreach( (array) $missing_parents as $missing_parent_id ) {
@ -520,27 +520,27 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
$child_ids[] = $missing_parent_id; $child_ids[] = $missing_parent_id;
$parent_ids[] = $missing_parent->post_parent; $parent_ids[] = $missing_parent->post_parent;
} }
$missing_parents = array_filter( array_diff( array_unique( $parent_ids ), array_unique( $child_ids ) ) ); $missing_parents = array_filter( array_diff( array_unique( $parent_ids ), array_unique( $child_ids ) ) );
} while( 0 < count( $missing_parents ) ); } while( 0 < count( $missing_parents ) );
} }
$page_links = paginate_links( array( $page_links = paginate_links( array(
'base' => add_query_arg( 'base' => add_query_arg(
array( array(
$post_type_name . '-tab' => 'all', $post_type_name . '-tab' => 'all',
'paged' => '%#%', 'paged' => '%#%',
) )
), ),
'format' => '', 'format' => '',
'prev_text' => __('&laquo;'), 'prev_text' => __('&laquo;'),
'next_text' => __('&raquo;'), 'next_text' => __('&raquo;'),
'total' => $num_pages, 'total' => $num_pages,
'current' => $pagenum 'current' => $pagenum
)); ));
if ( !$posts ) if ( !$posts )
$error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>'; $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>';
@ -554,7 +554,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
} }
$removed_args = array( $removed_args = array(
'action', 'action',
'customlink-tab', 'customlink-tab',
'edit-menu-item', 'edit-menu-item',
'menu-item', 'menu-item',
@ -569,10 +569,10 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li> <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
</ul> </ul>
<div class="tabs-panel <?php <div class="tabs-panel <?php
echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search"> ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
<?php <?php
if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) { if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
$searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] ); $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
$search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) ); $search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) );
@ -614,7 +614,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) { if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
$checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items); $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
} }
echo $checkbox_items; echo $checkbox_items;
?> ?>
@ -627,7 +627,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
<p class="button-controls"> <p class="button-controls">
<span class="list-controls"> <span class="list-controls">
<a href="<?php <a href="<?php
echo add_query_arg( echo add_query_arg(
array( array(
$post_type_name . '-tab' => 'all', $post_type_name . '-tab' => 'all',
@ -669,35 +669,35 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
$offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
$args = array( $args = array(
'child_of' => 0, 'child_of' => 0,
'exclude' => '', 'exclude' => '',
'hide_empty' => false, 'hide_empty' => false,
'hierarchical' => 1, 'hierarchical' => 1,
'include' => '', 'include' => '',
'include_last_update_time' => false, 'include_last_update_time' => false,
'number' => $per_page, 'number' => $per_page,
'offset' => $offset, 'offset' => $offset,
'order' => 'ASC', 'order' => 'ASC',
'orderby' => 'name', 'orderby' => 'name',
'pad_counts' => false, 'pad_counts' => false,
); );
$num_pages = ceil( $term_count / $per_page ); $num_pages = ceil( $term_count / $per_page );
$page_links = paginate_links( array( $page_links = paginate_links( array(
'base' => add_query_arg( 'base' => add_query_arg(
array( array(
$taxonomy_name . '-tab' => 'all', $taxonomy_name . '-tab' => 'all',
'paged' => '%#%', 'paged' => '%#%',
) )
), ),
'format' => '', 'format' => '',
'prev_text' => __('&laquo;'), 'prev_text' => __('&laquo;'),
'next_text' => __('&raquo;'), 'next_text' => __('&raquo;'),
'total' => $num_pages, 'total' => $num_pages,
'current' => $pagenum 'current' => $pagenum
)); ));
$walker = new Walker_Nav_Menu_Checklist; $walker = new Walker_Nav_Menu_Checklist;
// @todo transient caching of these results with proper invalidation on updating of a tax of this type // @todo transient caching of these results with proper invalidation on updating of a tax of this type
$terms = get_terms( $taxonomy_name, $args ); $terms = get_terms( $taxonomy_name, $args );
@ -715,7 +715,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
} }
$removed_args = array( $removed_args = array(
'action', 'action',
'customlink-tab', 'customlink-tab',
'edit-menu-item', 'edit-menu-item',
'menu-item', 'menu-item',
@ -740,15 +740,15 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
$args['walker'] = $walker; $args['walker'] = $walker;
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args ); echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
?> ?>
<?php <?php
?> ?>
</ul> </ul>
</div><!-- /.tabs-panel --> </div><!-- /.tabs-panel -->
<div class="tabs-panel <?php <div class="tabs-panel <?php
echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"> ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
<?php <?php
if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) { if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
$searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ); $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
$search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) ); $search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) );
@ -761,7 +761,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
<input type="text" class="quick-search regular-text" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" /> <input type="text" class="quick-search regular-text" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
<input type="submit" class="quick-search-submit button-secondary" value="<?php esc_attr_e('Search'); ?>" /> <input type="submit" class="quick-search-submit button-secondary" value="<?php esc_attr_e('Search'); ?>" />
</p> </p>
<ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear"> <ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear">
<?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?> <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
<?php <?php
@ -795,7 +795,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
<p class="button-controls"> <p class="button-controls">
<span class="list-controls"> <span class="list-controls">
<a href="<?php <a href="<?php
echo add_query_arg( echo add_query_arg(
array( array(
$taxonomy_name . '-tab' => 'all', $taxonomy_name . '-tab' => 'all',
@ -834,12 +834,12 @@ function wp_save_nav_menu_item( $menu_id = 0, $menu_data = array() ) {
// Loop through all the menu items' POST values // Loop through all the menu items' POST values
foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) { foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
if ( if (
empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked
( (
! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set
in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default
'custom' != $_item_object_data['menu-item-type'] || // or it's not a custom menu item 'custom' != $_item_object_data['menu-item-type'] || // or it's not a custom menu item
! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists ! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists
) )
) { ) {
@ -847,7 +847,7 @@ function wp_save_nav_menu_item( $menu_id = 0, $menu_data = array() ) {
} }
// if this possible menu item doesn't actually have a menu database ID yet // if this possible menu item doesn't actually have a menu database ID yet
if ( if (
empty( $_item_object_data['menu-item-db-id'] ) || empty( $_item_object_data['menu-item-db-id'] ) ||
( 0 > $_possible_db_id ) || ( 0 > $_possible_db_id ) ||
$_possible_db_id != $_item_object_data['menu-item-db-id'] $_possible_db_id != $_item_object_data['menu-item-db-id']
@ -856,7 +856,7 @@ function wp_save_nav_menu_item( $menu_id = 0, $menu_data = array() ) {
} else { } else {
$_actual_db_id = (int) $_item_object_data['menu-item-db-id']; $_actual_db_id = (int) $_item_object_data['menu-item-db-id'];
} }
$args = array( $args = array(
'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ), 'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ),
'menu-item-object-id' => ( isset( $_item_object_data['menu-item-object-id'] ) ? $_item_object_data['menu-item-object-id'] : '' ), 'menu-item-object-id' => ( isset( $_item_object_data['menu-item-object-id'] ) ? $_item_object_data['menu-item-object-id'] : '' ),
@ -885,7 +885,7 @@ function wp_save_nav_menu_item( $menu_id = 0, $menu_data = array() ) {
* Adds custom arguments to some of the meta box object types. * Adds custom arguments to some of the meta box object types.
* *
* @since 3.0.0 * @since 3.0.0
* *
* @access private * @access private
* *
* @param object $object The post type or taxonomy meta-object. * @param object $object The post type or taxonomy meta-object.
@ -896,7 +896,7 @@ function _wp_nav_menu_meta_box_object( $object = null ) {
// don't show media meta box // don't show media meta box
if ( 'attachment' == $object->name ) if ( 'attachment' == $object->name )
return false; return false;
// pages should show most recent // pages should show most recent
if ( 'page' == $object->name ) { if ( 'page' == $object->name ) {
$object->_default_query = array( $object->_default_query = array(
@ -919,7 +919,7 @@ function _wp_nav_menu_meta_box_object( $object = null ) {
); );
} }
} }
return $object; return $object;
} }
@ -933,16 +933,16 @@ function _wp_nav_menu_meta_box_object( $object = null ) {
*/ */
function wp_get_nav_menu_to_edit( $menu_item_id = 0 ) { function wp_get_nav_menu_to_edit( $menu_item_id = 0 ) {
$menu = wp_get_nav_menu_object( $menu_item_id ); $menu = wp_get_nav_menu_object( $menu_item_id );
// If the menu exists, get its items. // If the menu exists, get its items.
if ( is_nav_menu( $menu ) ) { if ( is_nav_menu( $menu ) ) {
$menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') ); $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') );
$walker = new Walker_Nav_Menu_Edit; $walker = new Walker_Nav_Menu_Edit;
return walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $menu_items), 0, (object) array('walker' => $walker ) ); return walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $menu_items), 0, (object) array('walker' => $walker ) );
} elseif ( is_wp_error( $menu ) ) { } elseif ( is_wp_error( $menu ) ) {
return $menu; return $menu;
} }

View File

@ -1198,7 +1198,7 @@ function wp_set_post_lock( $post_id ) {
$now = time(); $now = time();
update_post_meta( $post->ID, '_edit_lock', $now ); update_post_meta( $post->ID, '_edit_lock', $now );
} }
/** /**

View File

@ -897,7 +897,7 @@ function inline_edit_row( $screen ) {
<?php <?php
if ( post_type_supports( $screen->post_type, 'title' ) ) : if ( post_type_supports( $screen->post_type, 'title' ) ) :
if ( $bulk ) : ?> if ( $bulk ) : ?>
<div id="bulk-title-div"> <div id="bulk-title-div">
<div id="bulk-titles"></div> <div id="bulk-titles"></div>
@ -1031,7 +1031,7 @@ if ( !$bulk ) :
</select> </select>
</label> </label>
<?php <?php
endif; // post_type_supports page-attributes endif; // post_type_supports page-attributes
endif; // $post_type_object->hierarchical ?> endif; // $post_type_object->hierarchical ?>

View File

@ -210,30 +210,30 @@ function _get_template_edit_filename($fullpath, $containingfolder) {
/** /**
* Check the current theme for reliance on deprecated theme compatibility * Check the current theme for reliance on deprecated theme compatibility
* *
* Check to see if the current theme has all the required templates available * Check to see if the current theme has all the required templates available
* from itself or its parent * from itself or its parent
* @since 3.0 * @since 3.0
* @access private * @access private
* @return nothing * @return nothing
*/ */
function _check_theme_deprecated_files() { function _check_theme_deprecated_files() {
$files = array( ); $files = array( );
if ( ! locate_template( array( 'header.php' ) ) ) if ( ! locate_template( array( 'header.php' ) ) )
$files[] = 'header.php'; $files[] = 'header.php';
if ( ! locate_template( array( 'footer.php' ) ) ) if ( ! locate_template( array( 'footer.php' ) ) )
$files[] = 'footer.php'; $files[] = 'footer.php';
if ( ! locate_template( array( 'sidebar.php' ) ) ) if ( ! locate_template( array( 'sidebar.php' ) ) )
$files[] = 'sidebar.php'; $files[] = 'sidebar.php';
// Only notify if both are missing as you can use one or the other // Only notify if both are missing as you can use one or the other
if ( ! locate_template( array( 'comments.php' ) ) && ! locate_template( array( 'comments-popup.php' ) ) ) { if ( ! locate_template( array( 'comments.php' ) ) && ! locate_template( array( 'comments-popup.php' ) ) ) {
$files[] = 'comments.php'; $files[] = 'comments.php';
$files[] = 'comments-popup.php'; $files[] = 'comments-popup.php';
} }
if ( ! empty( $files ) ) : ?> if ( ! empty( $files ) ) : ?>
<div id="deprecated-files-message" class="error"><p> <div id="deprecated-files-message" class="error"><p>
<?php echo sprintf( __('The current theme is incomplete as it is missing %1$s. Please update your theme to include these files as you are currently relying on deprecated behaviour.'), implode( $files, ', ') ); ?> <?php echo sprintf( __('The current theme is incomplete as it is missing %1$s. Please update your theme to include these files as you are currently relying on deprecated behaviour.'), implode( $files, ', ') ); ?>

View File

@ -144,19 +144,19 @@ columns = {
page: pagenow page: pagenow
}); });
}, },
checked : function(column) { checked : function(column) {
$('.column-' + column).show(); $('.column-' + column).show();
}, },
unchecked : function(column) { unchecked : function(column) {
$('.column-' + column).hide(); $('.column-' + column).hide();
}, },
hidden : function() { hidden : function() {
return $('.manage-column').filter(':hidden').map(function() { return this.id; }).get().join(','); return $('.manage-column').filter(':hidden').map(function() { return this.id; }).get().join(',');
}, },
useCheckboxesForHidden : function() { useCheckboxesForHidden : function() {
this.hidden = function(){ this.hidden = function(){
return $('.hide-column-tog').not(':checked').map(function() { return $('.hide-column-tog').not(':checked').map(function() {

View File

@ -27,7 +27,7 @@ jQuery(document).ready(function() {
jQuery('select[name="background-repeat"]').change(function() { jQuery('select[name="background-repeat"]').change(function() {
jQuery('#custom-background-image').css('background-repeat', jQuery(this).val()); jQuery('#custom-background-image').css('background-repeat', jQuery(this).val());
}); });
farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) { farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) {
pickColor(color); pickColor(color);
}); });

View File

@ -10,7 +10,7 @@
var WPNavMenuHandler = function ($) { var WPNavMenuHandler = function ($) {
var autoCompleteData = {}, var autoCompleteData = {},
menuItemDepthPerLevel = 30, // Do not use directly. Use depthToPx and pxToDepth instead. menuItemDepthPerLevel = 30, // Do not use directly. Use depthToPx and pxToDepth instead.
globalMaxDepth = 11, globalMaxDepth = 11,
@ -32,9 +32,9 @@ var WPNavMenuHandler = function ($) {
return data.post_title; return data.post_title;
} }
}, },
getListDataFromID = function(menuItemID, parentEl) { getListDataFromID = function(menuItemID, parentEl) {
if ( ! menuItemID ) if ( ! menuItemID )
return false; return false;
parentEl = parentEl || document; parentEl = parentEl || document;
var fields = [ var fields = [
@ -62,10 +62,10 @@ var WPNavMenuHandler = function ($) {
while ( i-- ) { while ( i-- ) {
j = fields.length; j = fields.length;
while ( j-- ) { while ( j-- ) {
if ( if (
inputs[i] && inputs[i] &&
inputs[i].name && inputs[i].name &&
'menu-item[' + menuItemID + '][' + fields[j] + ']' == inputs[i].name 'menu-item[' + menuItemID + '][' + fields[j] + ']' == inputs[i].name
) { ) {
itemData[fields[j]] = inputs[i].value; itemData[fields[j]] = inputs[i].value;
} }
@ -74,21 +74,21 @@ var WPNavMenuHandler = function ($) {
return itemData; return itemData;
}, },
recalculateMenuItemPositions = function() { recalculateMenuItemPositions = function() {
menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } ); menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } );
}, },
depthToPx = function(depth) { depthToPx = function(depth) {
return depth * menuItemDepthPerLevel; return depth * menuItemDepthPerLevel;
}, },
pxToDepth = function(px) { pxToDepth = function(px) {
return Math.floor(px / menuItemDepthPerLevel); return Math.floor(px / menuItemDepthPerLevel);
}, },
menuList; menuList;
// jQuery extensions // jQuery extensions
$.fn.extend({ $.fn.extend({
menuItemDepth : function() { menuItemDepth : function() {
@ -149,29 +149,29 @@ var WPNavMenuHandler = function ($) {
}); });
return { return {
// Functions that run on init. // Functions that run on init.
init : function() { init : function() {
menuList = $('#menu-to-edit'); menuList = $('#menu-to-edit');
this.attachMenuEditListeners(); this.attachMenuEditListeners();
this.attachMenuMetaListeners(document.getElementById('nav-menu-meta')); this.attachMenuMetaListeners(document.getElementById('nav-menu-meta'));
this.attachTabsPanelListeners(); this.attachTabsPanelListeners();
if( menuList.length ) // If no menu, we're in the + tab. if( menuList.length ) // If no menu, we're in the + tab.
this.initSortables(); this.initSortables();
this.initToggles(); this.initToggles();
this.initTabManager(); this.initTabManager();
}, },
initToggles : function() { initToggles : function() {
// init postboxes // init postboxes
postboxes.add_postbox_toggles('nav-menus'); postboxes.add_postbox_toggles('nav-menus');
// adjust columns functions for menus UI // adjust columns functions for menus UI
columns.useCheckboxesForHidden(); columns.useCheckboxesForHidden();
columns.checked = function(field) { columns.checked = function(field) {
@ -183,22 +183,22 @@ var WPNavMenuHandler = function ($) {
// hide fields // hide fields
menuList.hideAdvancedMenuItemFields(); menuList.hideAdvancedMenuItemFields();
}, },
initSortables : function() { initSortables : function() {
var currentDepth = 0, originalDepth, minDepth, maxDepth, var currentDepth = 0, originalDepth, minDepth, maxDepth,
menuLeft = menuList.offset().left; menuLeft = menuList.offset().left;
menuList.sortable({ menuList.sortable({
handle: ' > dl', handle: ' > dl',
placeholder: 'sortable-placeholder', placeholder: 'sortable-placeholder',
start: function(e, ui) { start: function(e, ui) {
var next, height, width, parent, children, maxChildDepth, var next, height, width, parent, children, maxChildDepth,
transport = ui.item.children('.menu-item-transport'); transport = ui.item.children('.menu-item-transport');
// Set depths // Set depths
originalDepth = ui.item.menuItemDepth(); originalDepth = ui.item.menuItemDepth();
updateCurrentDepth(ui, originalDepth); updateCurrentDepth(ui, originalDepth);
// Attach child elements to parent // Attach child elements to parent
// Skip the placeholder // Skip the placeholder
parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item; parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item;
@ -207,7 +207,7 @@ var WPNavMenuHandler = function ($) {
// Now that the element is complete, we can update... // Now that the element is complete, we can update...
updateDepthRange(ui); updateDepthRange(ui);
// Update the height of the placeholder to match the moving item. // Update the height of the placeholder to match the moving item.
height = transport.outerHeight(); height = transport.outerHeight();
// If there are children, account for distance between top of children and parent // If there are children, account for distance between top of children and parent
@ -215,7 +215,7 @@ var WPNavMenuHandler = function ($) {
height += ui.item.outerHeight(); height += ui.item.outerHeight();
height -= 2; // Subtract 2 for borders height -= 2; // Subtract 2 for borders
ui.placeholder.height(height); ui.placeholder.height(height);
// Update the width of the placeholder to match the moving item. // Update the width of the placeholder to match the moving item.
maxChildDepth = originalDepth; maxChildDepth = originalDepth;
children.each(function(){ children.each(function(){
@ -229,10 +229,10 @@ var WPNavMenuHandler = function ($) {
}, },
stop: function(e, ui) { stop: function(e, ui) {
var children, depthChange = currentDepth - originalDepth; var children, depthChange = currentDepth - originalDepth;
// Return child elements to the list // Return child elements to the list
children = ui.item.children('.menu-item-transport').children().insertAfter(ui.item); children = ui.item.children('.menu-item-transport').children().insertAfter(ui.item);
// Update depth classes // Update depth classes
if( depthChange != 0 ) { if( depthChange != 0 ) {
ui.item.updateDepthClass( currentDepth ); ui.item.updateDepthClass( currentDepth );
@ -247,7 +247,7 @@ var WPNavMenuHandler = function ($) {
// Otherwise fix it, or we're in trouble. // Otherwise fix it, or we're in trouble.
if( ! ui.placeholder.parent().hasClass('menu') ) if( ! ui.placeholder.parent().hasClass('menu') )
ui.placeholder.appendTo(menuList); ui.placeholder.appendTo(menuList);
updateDepthRange(ui); updateDepthRange(ui);
}, },
sort: function(e, ui) { sort: function(e, ui) {
@ -255,34 +255,34 @@ var WPNavMenuHandler = function ($) {
// Check and correct if depth is not within range. // Check and correct if depth is not within range.
if ( depth < minDepth ) depth = minDepth; if ( depth < minDepth ) depth = minDepth;
else if ( depth > maxDepth ) depth = maxDepth; else if ( depth > maxDepth ) depth = maxDepth;
if( depth != currentDepth ) if( depth != currentDepth )
updateCurrentDepth(ui, depth); updateCurrentDepth(ui, depth);
} }
}); });
function updateDepthRange(ui) { function updateDepthRange(ui) {
var prev = ui.placeholder.prev(), var prev = ui.placeholder.prev(),
next = ui.placeholder.next(), depth; next = ui.placeholder.next(), depth;
// Make sure we don't select the moving item. // Make sure we don't select the moving item.
if( prev[0] == ui.item[0] ) prev = prev.prev(); if( prev[0] == ui.item[0] ) prev = prev.prev();
if( next[0] == ui.item[0] ) next = next.next(); if( next[0] == ui.item[0] ) next = next.next();
minDepth = (next.length) ? next.menuItemDepth() : 0; minDepth = (next.length) ? next.menuItemDepth() : 0;
if( prev.length ) if( prev.length )
maxDepth = ( (depth = prev.menuItemDepth() + 1) > globalMaxDepth ) ? globalMaxDepth : depth; maxDepth = ( (depth = prev.menuItemDepth() + 1) > globalMaxDepth ) ? globalMaxDepth : depth;
else else
maxDepth = 0; maxDepth = 0;
} }
function updateCurrentDepth(ui, depth) { function updateCurrentDepth(ui, depth) {
ui.placeholder.updateDepthClass( depth, currentDepth ); ui.placeholder.updateDepthClass( depth, currentDepth );
currentDepth = depth; currentDepth = depth;
} }
}, },
attachMenuEditListeners : function() { attachMenuEditListeners : function() {
var that = this; var that = this;
$('#update-nav-menu').bind('click', function(e) { $('#update-nav-menu').bind('click', function(e) {
@ -299,7 +299,7 @@ var WPNavMenuHandler = function ($) {
} }
}); });
}, },
/** /**
* An interface for managing default values for input elements * An interface for managing default values for input elements
* that is both JS and accessibility-friendly. * that is both JS and accessibility-friendly.
@ -309,11 +309,11 @@ var WPNavMenuHandler = function ($) {
*/ */
setupInputWithDefaultTitle : function() { setupInputWithDefaultTitle : function() {
var name = 'input-with-default-title'; var name = 'input-with-default-title';
$('.' + name).each( function(){ $('.' + name).each( function(){
var $t = $(this), title = $t.attr('title'), val = $t.val(); var $t = $(this), title = $t.attr('title'), val = $t.val();
$t.data( name, title ); $t.data( name, title );
if( '' == val ) $t.val( title ); if( '' == val ) $t.val( title );
else if ( title == val ) return; else if ( title == val ) return;
else $t.removeClass( name ); else $t.removeClass( name );
@ -334,17 +334,17 @@ var WPNavMenuHandler = function ($) {
var that = this; var that = this;
this.setupInputWithDefaultTitle(); this.setupInputWithDefaultTitle();
// auto-suggest for the quick-search boxes // auto-suggest for the quick-search boxes
$('input.quick-search').each(function(i, el) { $('input.quick-search').each(function(i, el) {
that.setupQuickSearchEventListeners(el); that.setupQuickSearchEventListeners(el);
}); });
$(formEL).bind('submit', function(e) { $(formEL).bind('submit', function(e) {
return that.eventSubmitMetaForm.call(that, this, e); return that.eventSubmitMetaForm.call(that, this, e);
}); });
$(formEL).find('input:submit').click(function() { $(formEL).find('input:submit').click(function() {
$(this).siblings('img.waiting').show(); $(this).siblings('img.waiting').show();
}); });
}, },
@ -359,7 +359,7 @@ var WPNavMenuHandler = function ($) {
i = inputs.length; i = inputs.length;
// upon changing tabs, we want to uncheck all checkboxes // upon changing tabs, we want to uncheck all checkboxes
while( i-- ) while( i-- )
inputs[i].checked = false; inputs[i].checked = false;
$('.tabs-panel', wrapper).each(function() { $('.tabs-panel', wrapper).each(function() {
@ -379,7 +379,7 @@ var WPNavMenuHandler = function ($) {
activePanel.className = activePanel.className.replace('tabs-panel-inactive', 'tabs-panel-active'); activePanel.className = activePanel.className.replace('tabs-panel-inactive', 'tabs-panel-active');
} }
} }
return false; return false;
} else if ( e.target && e.target.className && -1 != e.target.className.indexOf('select-all') ) { } else if ( e.target && e.target.className && -1 != e.target.className.indexOf('select-all') ) {
var selectAreaMatch = /#(.*)$/.exec(e.target.href); var selectAreaMatch = /#(.*)$/.exec(e.target.href);
@ -390,7 +390,7 @@ var WPNavMenuHandler = function ($) {
} }
}); });
}, },
initTabManager : function() { initTabManager : function() {
var fixed = $('.nav-tabs-wrapper'), var fixed = $('.nav-tabs-wrapper'),
fluid = fixed.children('.nav-tabs'), fluid = fixed.children('.nav-tabs'),
@ -400,13 +400,13 @@ var WPNavMenuHandler = function ($) {
fixedRight, fixedLeft, fixedRight, fixedLeft,
arrowLeft, arrowRight arrowLeft, arrowRight
resizing = false; resizing = false;
function resetMenuTabs() { function resetMenuTabs() {
fixedLeft = fixed.offset().left; fixedLeft = fixed.offset().left;
fixedRight = fixedLeft + fixed.width(); fixedRight = fixedLeft + fixed.width();
active.makeTabVisible(); active.makeTabVisible();
} }
$.fn.extend({ $.fn.extend({
makeTabVisible : function() { makeTabVisible : function() {
var t = this.eq(0), left, right; var t = this.eq(0), left, right;
@ -426,43 +426,43 @@ var WPNavMenuHandler = function ($) {
return ( right <= fixedRight && left >= fixedLeft ) ? true : false; return ( right <= fixedRight && left >= fixedLeft ) ? true : false;
} }
}); });
// Find the width of all tabs // Find the width of all tabs
tabs.each(function(){ tabs.each(function(){
tabsWidth += $(this).outerWidth(true); tabsWidth += $(this).outerWidth(true);
}); });
// Check if we need the tab manager // Check if we need the tab manager
if( tabsWidth <= fixed.width() if( tabsWidth <= fixed.width()
- fluid.css('padding-left').slice(0,-2) - fluid.css('padding-left').slice(0,-2)
- fluid.css('padding-right').slice(0,-2) ) - fluid.css('padding-right').slice(0,-2) )
return; return;
// Set up right margin for overflow, unset padding // Set up right margin for overflow, unset padding
fluid.css({ fluid.css({
'margin-right' : (-1 * tabsWidth) + 'px', 'margin-right' : (-1 * tabsWidth) + 'px',
'padding' : 0, 'padding' : 0,
}); });
// Build tab navigation // Build tab navigation
arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>&laquo;</a></div>'); arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>&laquo;</a></div>');
arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>&raquo;</a></div>'); arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>&raquo;</a></div>');
// Attach to the document // Attach to the document
fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight ); fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight );
// Set the menu tabs // Set the menu tabs
resetMenuTabs(); resetMenuTabs();
// Make sure the tabs reset on resize // Make sure the tabs reset on resize
$(window).resize(function() { $(window).resize(function() {
if( resizing ) return; if( resizing ) return;
resizing = true; resizing = true;
setTimeout(function(){ setTimeout(function(){
resetMenuTabs(); resetMenuTabs();
resizing = false; resizing = false;
}, 1000); }, 1000);
}); });
// Build arrow functions // Build arrow functions
$.each([{ $.each([{
arrow : arrowLeft, arrow : arrowLeft,
next : "next", next : "next",
@ -501,23 +501,23 @@ var WPNavMenuHandler = function ($) {
*/ */
setupQuickSearchEventListeners : function(el) { setupQuickSearchEventListeners : function(el) {
var that = this; var that = this;
$(el).autocomplete( ajaxurl + '?action=menu-quick-search&type=' + el.name, $(el).autocomplete( ajaxurl + '?action=menu-quick-search&type=' + el.name,
{ {
delay: 500, delay: 500,
formatItem: formatAutocompleteResponse, formatItem: formatAutocompleteResponse,
formatResult: formatAutocompleteResult, formatResult: formatAutocompleteResult,
minchars: 2, minchars: 2,
multiple: false multiple: false
} }
).bind('blur', function(e) { ).bind('blur', function(e) {
var changedData = autoCompleteData[this.value], var changedData = autoCompleteData[this.value],
inputEl = this; inputEl = this;
if ( changedData ) { if ( changedData ) {
$.post( $.post(
ajaxurl + '?action=menu-quick-search&type=get-post-item&response-format=markup', ajaxurl + '?action=menu-quick-search&type=get-post-item&response-format=markup',
changedData, changedData,
function(r) { function(r) {
that.processQuickSearchQueryResponse.call(that, r, changedData); that.processQuickSearchQueryResponse.call(that, r, changedData);
autoCompleteData[inputEl.value] = false; autoCompleteData[inputEl.value] = false;
} }
); );
@ -546,12 +546,12 @@ var WPNavMenuHandler = function ($) {
} }
} }
}, },
eventOnClickCloseLink : function(clickedEl) { eventOnClickCloseLink : function(clickedEl) {
$(clickedEl).closest('.menu-item-settings').siblings('dl').find('.item-edit').click(); $(clickedEl).closest('.menu-item-settings').siblings('dl').find('.item-edit').click();
return false; return false;
}, },
eventOnClickMenuDelete : function(clickedEl) { eventOnClickMenuDelete : function(clickedEl) {
// Delete warning AYS // Delete warning AYS
if ( confirm( navMenuL10n.warnDeleteMenu ) ) { if ( confirm( navMenuL10n.warnDeleteMenu ) ) {
@ -570,7 +570,7 @@ var WPNavMenuHandler = function ($) {
if ( confirm( navMenuL10n.warnDeleteMenuItem ) ) { if ( confirm( navMenuL10n.warnDeleteMenuItem ) ) {
matchedSection = /_wpnonce=([a-zA-Z0-9]*)$/.exec(clickedEl.href); matchedSection = /_wpnonce=([a-zA-Z0-9]*)$/.exec(clickedEl.href);
if ( matchedSection && matchedSection[1] ) { if ( matchedSection && matchedSection[1] ) {
itemID = parseInt(clickedEl.id.replace('delete-', ''), 10); itemID = parseInt(clickedEl.id.replace('delete-', ''), 10);
$.post( $.post(
ajaxurl, ajaxurl,
{ {
@ -583,7 +583,7 @@ var WPNavMenuHandler = function ($) {
that.removeMenuItem(document.getElementById('menu-item-' + itemID)); that.removeMenuItem(document.getElementById('menu-item-' + itemID));
} }
); );
return false; return false;
} }
return true; return true;
} else { } else {
@ -629,7 +629,7 @@ var WPNavMenuHandler = function ($) {
listItemDBIDMatch = re.exec(inputs[i].name); listItemDBIDMatch = re.exec(inputs[i].name);
listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10); listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10);
listItemData = getListDataFromID(listItemDBID); listItemData = getListDataFromID(listItemDBID);
for ( j in listItemData ) { for ( j in listItemData ) {
params['menu-item[' + listItemDBID + '][' + j + ']'] = listItemData[j]; params['menu-item[' + listItemDBID + '][' + j + ']'] = listItemData[j];
} }
@ -654,7 +654,7 @@ var WPNavMenuHandler = function ($) {
params['menu-settings-column-nonce'] = thisForm.elements['menu-settings-column-nonce'].value; params['menu-settings-column-nonce'] = thisForm.elements['menu-settings-column-nonce'].value;
$.post( ajaxurl, params, function(menuMarkup) { $.post( ajaxurl, params, function(menuMarkup) {
processMethod.call(that, menuMarkup, params); processMethod.call(that, menuMarkup, params);
$(thisForm).find('img.waiting').hide(); $(thisForm).find('img.waiting').hide();
}); });
@ -677,7 +677,7 @@ var WPNavMenuHandler = function ($) {
/** /**
* Process the quick search response into a search result * Process the quick search response into a search result
* *
* @param string resp The server response to the query. * @param string resp The server response to the query.
* @param object req The request arguments. * @param object req The request arguments.
*/ */
@ -708,7 +708,7 @@ var WPNavMenuHandler = function ($) {
} }
wrap.innerHTML = resp; wrap.innerHTML = resp;
items = wrap.getElementsByTagName('li'); items = wrap.getElementsByTagName('li');
if ( items[0] && req.object_type ) { if ( items[0] && req.object_type ) {
@ -738,7 +738,7 @@ var WPNavMenuHandler = function ($) {
removeMenuItem : function(el) { removeMenuItem : function(el) {
el = $(el) el = $(el)
var children = el.childMenuItems(); var children = el.childMenuItems();
el.addClass('deleting').fadeOut( 350 , function() { el.addClass('deleting').fadeOut( 350 , function() {
el.remove(); el.remove();
children.shiftDepthClass(-1).updateParentMenuItemDBId(); children.shiftDepthClass(-1).updateParentMenuItemDBId();

View File

@ -50,7 +50,7 @@ jQuery(document).ready(function($) {
$('#TB_iframeContent').width('100%'); $('#TB_iframeContent').width('100%');
thickDims(); thickDims();
return false; return false;
} ); } );

View File

@ -15,7 +15,7 @@ if ( !is_multisite() )
// @todo Create a delete blog cap. // @todo Create a delete blog cap.
if ( ! current_user_can( 'manage_options' ) ) if ( ! current_user_can( 'manage_options' ) )
wp_die(__( 'You do not have sufficient permissions to delete this site.')); wp_die(__( 'You do not have sufficient permissions to delete this site.'));
if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) { if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) { if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) {
wpmu_delete_blog( $wpdb->blogid ); wpmu_delete_blog( $wpdb->blogid );

View File

@ -329,7 +329,7 @@ switch ( $_GET['action'] ) {
if ( ! current_user_can( 'manage_sites' ) ) if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ) ); wp_die( __( 'You do not have permission to access this page.' ) );
if ( $_GET['action'] != -1 || $_POST['action2'] != -1 ) if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
$doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2']; $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
@ -454,7 +454,7 @@ switch ( $_GET['action'] ) {
nocache_headers(); nocache_headers();
header( 'Content-Type: text/html; charset=utf-8' ); header( 'Content-Type: text/html; charset=utf-8' );
} }
if ( $current_site->blog_id == $id ) if ( $current_site->blog_id == $id )
wp_die( __( 'You are not allowed to change the current site.' ) ); wp_die( __( 'You are not allowed to change the current site.' ) );
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -489,8 +489,8 @@ switch ( $_GET['action'] ) {
if ( $id != '0' && $id != '1' ) { if ( $id != '0' && $id != '1' ) {
$_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
$title = __( 'Users' ); $title = __( 'Users' );
$parent_file = 'ms-admin.php'; $parent_file = 'ms-admin.php';
require_once( 'admin-header.php' ); require_once( 'admin-header.php' );
echo '<div class="wrap">'; echo '<div class="wrap">';
confirm_delete_users( $_POST['allusers'] ); confirm_delete_users( $_POST['allusers'] );
@ -498,7 +498,7 @@ switch ( $_GET['action'] ) {
require_once( 'admin-footer.php' ); require_once( 'admin-footer.php' );
exit(); exit();
} else { } else {
wp_redirect( admin_url( 'ms-users.php' ) ); wp_redirect( admin_url( 'ms-users.php' ) );
} }
break; break;
@ -516,8 +516,8 @@ switch ( $_GET['action'] ) {
if ( !empty( $val ) ) { if ( !empty( $val ) ) {
switch ( $doaction ) { switch ( $doaction ) {
case 'delete': case 'delete':
$title = __( 'Users' ); $title = __( 'Users' );
$parent_file = 'ms-admin.php'; $parent_file = 'ms-admin.php';
require_once( 'admin-header.php' ); require_once( 'admin-header.php' );
echo '<div class="wrap">'; echo '<div class="wrap">';
confirm_delete_users( $_POST['allusers'] ); confirm_delete_users( $_POST['allusers'] );
@ -543,13 +543,13 @@ switch ( $_GET['action'] ) {
case 'notspam': case 'notspam':
$userfunction = 'all_notspam'; $userfunction = 'all_notspam';
$blogs = get_blogs_of_user( $val, true ); $blogs = get_blogs_of_user( $val, true );
foreach ( (array) $blogs as $key => $details ) foreach ( (array) $blogs as $key => $details )
update_blog_status( $details->userblog_id, 'spam', '0' ); update_blog_status( $details->userblog_id, 'spam', '0' );
update_user_status( $val, 'spam', '0', 1 ); update_user_status( $val, 'spam', '0', 1 );
break; break;
} }
} }
} }
wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) ); wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
@ -578,7 +578,7 @@ switch ( $_GET['action'] ) {
if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) ) if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) )
foreach( $_POST['user'] as $id ) { foreach( $_POST['user'] as $id ) {
wpmu_delete_user( $id ); wpmu_delete_user( $id );
$i++; $i++;
} }
if ( $i == 1 ) if ( $i == 1 )

View File

@ -92,7 +92,7 @@ if (isset($_GET['updated'])) {
<th scope="row"><label for="admin_notice_feed"><?php _e( 'Admin Notice Feed' ) ?></label></th> <th scope="row"><label for="admin_notice_feed"><?php _e( 'Admin Notice Feed' ) ?></label></th>
<td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br /> <td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br />
<?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br /> <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br />
<?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site->id, 'feed/' ) ) <?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site->id, 'feed/' ) )
echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site->id, 'feed/' ) ) ?></td> echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site->id, 'feed/' ) ) ?></td>
</tr> </tr>

View File

@ -255,7 +255,7 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['
<?php <?php
break; break;
case 'registered': case 'registered':
if ( 'list' == $mode ) if ( 'list' == $mode )
$date = 'Y/m/d'; $date = 'Y/m/d';
else else
@ -284,7 +284,7 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['
if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 ) if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
echo 'style="background-color: #faa" '; echo 'style="background-color: #faa" ';
echo 'href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>'; echo 'href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
echo '</small><br />'; echo '</small><br />';
} }
} }

View File

@ -31,7 +31,7 @@ if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) {
update_user_option( $current_user->id, 'primary_blog', (int) $_POST['primary_blog'], true ); update_user_option( $current_user->id, 'primary_blog', (int) $_POST['primary_blog'], true );
$updated = true; $updated = true;
} else { } else {
wp_die( __( 'The primary site you chose does not exist.' ) ); wp_die( __( 'The primary site you chose does not exist.' ) );
} }
} }

View File

@ -107,17 +107,17 @@ switch ( $action ) {
if ( ! empty( $possible_object_id ) ) { if ( ! empty( $possible_object_id ) ) {
$dbids_to_objectids[$ordered_menu_item_object->ID] = $possible_object_id; $dbids_to_objectids[$ordered_menu_item_object->ID] = $possible_object_id;
$objectids_to_dbids[$possible_object_id] = $ordered_menu_item_object->ID; $objectids_to_dbids[$possible_object_id] = $ordered_menu_item_object->ID;
} }
} }
} }
// if this menu item is not first // if this menu item is not first
if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) { if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) {
// if this menu item is a child of the previous // if this menu item is a child of the previous
if ( if (
! empty( $menu_item_data['post_parent'] ) && ! empty( $menu_item_data['post_parent'] ) &&
isset( $objectids_to_dbids[$menu_item_data['post_parent']] ) && isset( $objectids_to_dbids[$menu_item_data['post_parent']] ) &&
isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) && isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) &&
( $objectids_to_dbids[$menu_item_data['post_parent']] == $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ( $objectids_to_dbids[$menu_item_data['post_parent']] == $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] )
@ -127,7 +127,7 @@ switch ( $action ) {
$parent_data = get_post( $parent_db_id, ARRAY_A ); $parent_data = get_post( $parent_db_id, ARRAY_A );
if ( ! is_wp_error( $parent_data ) ) { if ( ! is_wp_error( $parent_data ) ) {
// if there is something before the parent, make menu item a child of the parent's parent // if there is something before the parent, make menu item a child of the parent's parent
if ( ! empty( $dbids_to_orders[$parent_db_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) ) { if ( ! empty( $dbids_to_orders[$parent_db_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) ) {
$menu_item_data['post_parent'] = $parent_data['post_parent']; $menu_item_data['post_parent'] = $parent_data['post_parent'];
@ -136,13 +136,13 @@ switch ( $action ) {
} else { } else {
$menu_item_data['post_parent'] = 0; $menu_item_data['post_parent'] = 0;
} }
// set former parent's [menu_order] to that of menu-item's // set former parent's [menu_order] to that of menu-item's
$parent_data['menu_order'] = $parent_data['menu_order'] + 1; $parent_data['menu_order'] = $parent_data['menu_order'] + 1;
// set menu-item's [menu_order] to that of former parent // set menu-item's [menu_order] to that of former parent
$menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1; $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1;
// save changes // save changes
wp_update_post($menu_item_data); wp_update_post($menu_item_data);
wp_update_post($parent_data); wp_update_post($parent_data);
@ -168,7 +168,7 @@ switch ( $action ) {
if ( is_nav_menu_item( $menu_item_id ) ) { if ( is_nav_menu_item( $menu_item_id ) ) {
if ( wp_delete_post( $menu_item_id, true ) ) { if ( wp_delete_post( $menu_item_id, true ) ) {
$messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>'; $messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>';
} }
} }
@ -248,7 +248,7 @@ switch ( $action ) {
$menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args ); $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
if ( is_wp_error( $menu_item_db_id ) ) if ( is_wp_error( $menu_item_db_id ) )
$messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>'; $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
elseif ( isset( $menu_items[$menu_item_db_id] ) ) elseif ( isset( $menu_items[$menu_item_db_id] ) )
unset( $menu_items[$menu_item_db_id] ); unset( $menu_items[$menu_item_db_id] );
@ -327,12 +327,12 @@ require_once( 'admin-header.php' );
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php esc_html_e('Menus'); ?></h2> <h2><?php esc_html_e('Menus'); ?></h2>
<?php <?php
foreach( $messages as $message ) : foreach( $messages as $message ) :
echo $message . "\n"; echo $message . "\n";
endforeach; endforeach;
?> ?>
<?php if ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) : ?> <?php if ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) : ?>
<div id="nav-menus-frame"> <div id="nav-menus-frame">
<div id="menu-settings-column" class="metabox-holder"> <div id="menu-settings-column" class="metabox-holder">
@ -364,10 +364,10 @@ require_once( 'admin-header.php' );
</div> </div>
<div class="nav-tabs-wrapper"> <div class="nav-tabs-wrapper">
<div class="nav-tabs"> <div class="nav-tabs">
<?php <?php
foreach( (array) $nav_menus as $_nav_menu ) : foreach( (array) $nav_menus as $_nav_menu ) :
?><a href="<?php ?><a href="<?php
echo add_query_arg( echo add_query_arg(
array( array(
'action' => 'edit', 'action' => 'edit',
@ -375,14 +375,14 @@ require_once( 'admin-header.php' );
), ),
admin_url( 'nav-menus.php' ) admin_url( 'nav-menus.php' )
); );
?>" class="nav-tab<?php ?>" class="nav-tab<?php
if ( $nav_menu_selected_id == $_nav_menu->term_id ) if ( $nav_menu_selected_id == $_nav_menu->term_id )
echo ' nav-tab-active'; echo ' nav-tab-active';
else else
echo ' hide-if-no-js'; echo ' hide-if-no-js';
?>"><?php echo esc_html( $_nav_menu->name ); ?></a><?php ?>"><?php echo esc_html( $_nav_menu->name ); ?></a><?php
endforeach; endforeach;
?><a href="<?php ?><a href="<?php
echo add_query_arg( echo add_query_arg(
array( array(
'action' => 'edit', 'action' => 'edit',
@ -390,8 +390,8 @@ require_once( 'admin-header.php' );
), ),
admin_url( 'nav-menus.php' ) admin_url( 'nav-menus.php' )
); );
?>" class="nav-tab menu-add-new<?php ?>" class="nav-tab menu-add-new<?php
if ( 0 == $nav_menu_selected_id ) if ( 0 == $nav_menu_selected_id )
echo ' nav-tab-active'; echo ' nav-tab-active';
?>"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?></a> ?>"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?></a>
</div> </div>
@ -406,11 +406,11 @@ require_once( 'admin-header.php' );
<input name="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" /> <input name="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" />
<br class="clear" /> <br class="clear" />
</label> </label>
<div class="publishing-action"> <div class="publishing-action">
<input class="button-primary" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" /> <input class="button-primary" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" />
</div><!--END .publishing-action--> </div><!--END .publishing-action-->
<?php if ( ! empty( $nav_menu_selected_id ) ) : ?> <?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
<div class="delete-action"> <div class="delete-action">
<a class="submitdelete deletion menu-delete" href="<?php echo wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ); ?>"><?php _e('Delete Menu'); ?></a> <a class="submitdelete deletion menu-delete" href="<?php echo wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ); ?>"><?php _e('Delete Menu'); ?></a>
@ -429,8 +429,8 @@ require_once( 'admin-header.php' );
<div id="post-body-content"> <div id="post-body-content">
<?php if ( is_nav_menu( $nav_menu_selected_id ) && ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) ) : ?> <?php if ( is_nav_menu( $nav_menu_selected_id ) && ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) ) : ?>
<ul class="menu" id="menu-to-edit"> <ul class="menu" id="menu-to-edit">
<?php <?php
$edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
if ( ! is_wp_error( $edit_markup ) ) { if ( ! is_wp_error( $edit_markup ) ) {
echo $edit_markup; echo $edit_markup;
} }

View File

@ -486,7 +486,7 @@ var photostorage = false;
<h3 class="hndle"><?php _e('Categories') ?></h3> <h3 class="hndle"><?php _e('Categories') ?></h3>
<div class="inside"> <div class="inside">
<div id="taxonomy-category" class="categorydiv"> <div id="taxonomy-category" class="categorydiv">
<ul id="category-tabs" class="category-tabs"> <ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#category-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li> <li class="tabs"><a href="#category-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li>
<li class="hide-if-no-js"><a href="#category-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> <li class="hide-if-no-js"><a href="#category-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>

View File

@ -160,9 +160,9 @@ switch($step) {
if ( empty($prefix) ) if ( empty($prefix) )
$prefix = 'wp_'; $prefix = 'wp_';
// Validate $prefix: it can only contain letters, numbers and underscores // Validate $prefix: it can only contain letters, numbers and underscores
if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) if ( preg_match( '|[^a-z0-9_]|i', $prefix ) )
wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ ); wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ );
// Test the db connection. // Test the db connection.
/**#@+ /**#@+

View File

@ -86,7 +86,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
$id = max( get_query_var('p'), get_query_var('page_id'), get_query_var('attachment_id')); $id = max( get_query_var('p'), get_query_var('page_id'), get_query_var('attachment_id'));
if ( $id && $redirect_url = get_permalink($id) ) if ( $id && $redirect_url = get_permalink($id) )
$redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id'), $redirect['query']); $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id'), $redirect['query']);
if ( ! $redirect_url ) if ( ! $redirect_url )
$redirect_url = redirect_guess_404_permalink(); $redirect_url = redirect_guess_404_permalink();

View File

@ -1180,9 +1180,9 @@ function remove_role( $role ) {
* Retrieve a list of super admins. * Retrieve a list of super admins.
* *
* @since 3.0.0 * @since 3.0.0
* *
* @uses $super_admins Super admins global variable, if set. * @uses $super_admins Super admins global variable, if set.
* *
* @return array List of super admin logins * @return array List of super admin logins
*/ */
function get_super_admins() { function get_super_admins() {

View File

@ -473,7 +473,7 @@ function wp_list_categories( $args = '' ) {
$r['exclude_tree'] = $r['exclude']; $r['exclude_tree'] = $r['exclude'];
$r['exclude'] = ''; $r['exclude'] = '';
} }
if ( !isset( $r['class'] ) ) if ( !isset( $r['class'] ) )
$r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];

View File

@ -391,7 +391,7 @@ class WP_Http {
*/ */
function processResponse($strResponse) { function processResponse($strResponse) {
$res = explode("\r\n\r\n", $strResponse, 2); $res = explode("\r\n\r\n", $strResponse, 2);
return array('headers' => isset($res[0]) ? $res[0] : array(), 'body' => isset($res[1]) ? $res[1] : ''); return array('headers' => isset($res[0]) ? $res[0] : array(), 'body' => isset($res[1]) ? $res[1] : '');
} }

View File

@ -168,7 +168,7 @@ class WP_oEmbed {
$provider = add_query_arg( 'maxwidth', $args['width'], $provider ); $provider = add_query_arg( 'maxwidth', $args['width'], $provider );
$provider = add_query_arg( 'maxheight', $args['height'], $provider ); $provider = add_query_arg( 'maxheight', $args['height'], $provider );
$provider = add_query_arg( 'url', urlencode($url), $provider ); $provider = add_query_arg( 'url', urlencode($url), $provider );
foreach( array( 'json', 'xml' ) as $format ) { foreach( array( 'json', 'xml' ) as $format ) {
$result = $this->_fetch_with_format( $provider, $format ); $result = $this->_fetch_with_format( $provider, $format );
if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() ) if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() )

View File

@ -1257,7 +1257,7 @@ class Walker_Comment extends Walker {
* display children of higher nesting levels than selected inline on * display children of higher nesting levels than selected inline on
* the highest depth level displayed. This prevents them being orphaned * the highest depth level displayed. This prevents them being orphaned
* at the end of the comment list. * at the end of the comment list.
* *
* Example: max_depth = 2, with 5 levels of nested content. * Example: max_depth = 2, with 5 levels of nested content.
* 1 * 1
* 1.1 * 1.1

View File

@ -52,10 +52,10 @@ function wptexturize($text) {
$cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
$cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round","&#8217;cause"); $cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round","&#8217;cause");
} }
$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'\'', ' (tm)'), $cockney); $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'\'', ' (tm)'), $cockney);
$static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, $closing_quote, ' &#8482;'), $cockneyreplace); $static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, $closing_quote, ' &#8482;'), $cockneyreplace);
$dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/\'(\d+)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/'); $dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/\'(\d+)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/');
$dynamic_replacements = array('&#8217;$1','&#8217;$1', '$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2'); $dynamic_replacements = array('&#8217;$1','&#8217;$1', '$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2');

View File

@ -2912,7 +2912,7 @@ function wp_parse_id_list( $list ) {
* *
* @param array $list An array of objects to filter * @param array $list An array of objects to filter
* @param array $args An array of key => value arguments to match against each object * @param array $args An array of key => value arguments to match against each object
* @param string $operator The logical operation to perform. 'or' means only one element * @param string $operator The logical operation to perform. 'or' means only one element
* from the array needs to match; 'and' means all elements must match. The default is 'and'. * from the array needs to match; 'and' means all elements must match. The default is 'and'.
* @param bool|string $field A field from the object to place instead of the entire object * @param bool|string $field A field from the object to place instead of the entire object
* @return array A list of objects or object fields * @return array A list of objects or object fields

View File

@ -181,7 +181,7 @@ class WP_Locale {
/* translators: $thousands_sep argument for http://php.net/number_format, default is , */ /* translators: $thousands_sep argument for http://php.net/number_format, default is , */
$trans = __('number_format_thousands_sep'); $trans = __('number_format_thousands_sep');
$this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
/* translators: $dec_point argument for http://php.net/number_format, default is . */ /* translators: $dec_point argument for http://php.net/number_format, default is . */
$trans = __('number_format_decimal_point'); $trans = __('number_format_decimal_point');
$this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;

View File

@ -1325,7 +1325,7 @@ function maybe_add_existing_user_to_blog() {
if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) )
wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), site_url() ) ); wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), site_url() ) );
wp_die( sprintf(__('You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">login</a> using your username and password.'), site_url(), admin_url() ), __('Success') ); wp_die( sprintf(__('You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">login</a> using your username and password.'), site_url(), admin_url() ), __('Success') );
} }

View File

@ -84,7 +84,7 @@ class Walker_Nav_Menu extends Walker {
$classes = ' class="' . esc_attr( $classes ) . '"'; $classes = ' class="' . esc_attr( $classes ) . '"';
$output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $classes .'>'; $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $classes .'>';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : ''; $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : ''; $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : ''; $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
@ -95,7 +95,7 @@ class Walker_Nav_Menu extends Walker {
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title ) . $args->link_after; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title ) . $args->link_after;
$item_output .= '</a>'; $item_output .= '</a>';
$item_output .= $args->after; $item_output .= $args->after;
$output .= apply_filters( 'wp_get_nav_menu_item', $item_output, $args ); $output .= apply_filters( 'wp_get_nav_menu_item', $item_output, $args );
} }
@ -208,7 +208,7 @@ function wp_nav_menu( $args = array() ) {
} }
} }
} }
// If the menu exists, get its items. // If the menu exists, get its items.
if ( $menu && ! is_wp_error($menu) ) if ( $menu && ! is_wp_error($menu) )
$menu_items = wp_get_nav_menu_items( $menu->term_id ); $menu_items = wp_get_nav_menu_items( $menu->term_id );
@ -219,7 +219,7 @@ function wp_nav_menu( $args = array() ) {
return call_user_func( $args->fallback_cb, (array) $args ); return call_user_func( $args->fallback_cb, (array) $args );
} }
} }
$nav_menu = ''; $nav_menu = '';
$items = ''; $items = '';
$container_allowedtags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'p', 'nav' ) ); $container_allowedtags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'p', 'nav' ) );
@ -236,10 +236,10 @@ function wp_nav_menu( $args = array() ) {
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args ); $items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
// Attributes // Attributes
$attributes = ' id="menu-' . $menu->slug . '"'; $attributes = ' id="menu-' . $menu->slug . '"';
$attributes .= $args->menu_class ? ' class="'. $args->menu_class .'"' : ''; $attributes .= $args->menu_class ? ' class="'. $args->menu_class .'"' : '';
$nav_menu .= '<ul'. $attributes .'>'; $nav_menu .= '<ul'. $attributes .'>';
// Allow plugins to hook into the menu to add their own <li>'s // Allow plugins to hook into the menu to add their own <li>'s

View File

@ -16,7 +16,7 @@
* @return mixed $menu|false Or WP_Error * @return mixed $menu|false Or WP_Error
*/ */
function wp_get_nav_menu_object( $menu ) { function wp_get_nav_menu_object( $menu ) {
if ( ! $menu ) if ( ! $menu )
return false; return false;
$menu_obj = get_term( $menu, 'nav_menu' ); $menu_obj = get_term( $menu, 'nav_menu' );
@ -47,17 +47,17 @@ function wp_get_nav_menu_object( $menu ) {
function is_nav_menu( $menu ) { function is_nav_menu( $menu ) {
if ( ! $menu ) if ( ! $menu )
return false; return false;
$menu_obj = wp_get_nav_menu_object( $menu ); $menu_obj = wp_get_nav_menu_object( $menu );
if ( if (
$menu_obj && $menu_obj &&
! is_wp_error( $menu_obj ) && ! is_wp_error( $menu_obj ) &&
! empty( $menu_obj->taxonomy ) && ! empty( $menu_obj->taxonomy ) &&
'nav_menu' == $menu_obj->taxonomy 'nav_menu' == $menu_obj->taxonomy
) )
return true; return true;
return false; return false;
} }
@ -163,22 +163,22 @@ function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
return $_menu; return $_menu;
if ( $_menu && isset( $_menu->term_id ) ) { if ( $_menu && isset( $_menu->term_id ) ) {
$args = array( $args = array(
'description' => ( isset( $menu_data['description'] ) ? $menu_data['description'] : '' ), 'description' => ( isset( $menu_data['description'] ) ? $menu_data['description'] : '' ),
'name' => ( isset( $menu_data['menu-name'] ) ? $menu_data['menu-name'] : '' ), 'name' => ( isset( $menu_data['menu-name'] ) ? $menu_data['menu-name'] : '' ),
'parent' => ( isset( $menu_data['parent'] ) ? (int) $menu_data['parent'] : 0 ), 'parent' => ( isset( $menu_data['parent'] ) ? (int) $menu_data['parent'] : 0 ),
'slug' => null, 'slug' => null,
); );
$menu_id = (int) $_menu->term_id; $menu_id = (int) $_menu->term_id;
// double-check that we're not changing a menu to the name of another // double-check that we're not changing a menu to the name of another
$_possible_existing = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' ); $_possible_existing = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' );
if ( if (
$_possible_existing && $_possible_existing &&
! is_wp_error( $_possible_existing ) && ! is_wp_error( $_possible_existing ) &&
isset( $_possible_existing->term_id ) && isset( $_possible_existing->term_id ) &&
$_possible_existing->term_id != $menu_id $_possible_existing->term_id != $menu_id
) { ) {
return new WP_Error( 'menu_exists', sprintf( __('The menu name <strong>%s</strong> conflicts with another menu name. Please try another.'), esc_html( $menu_data['menu-name'] ) ) ); return new WP_Error( 'menu_exists', sprintf( __('The menu name <strong>%s</strong> conflicts with another menu name. Please try another.'), esc_html( $menu_data['menu-name'] ) ) );
} }
@ -255,7 +255,7 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
$args['menu-item-position'] = $count; $args['menu-item-position'] = $count;
} }
} }
if ( 'custom' != $args['menu-item-type'] ) { if ( 'custom' != $args['menu-item-type'] ) {
/* if non-custom menu item, then: /* if non-custom menu item, then:
* use original object's URL * use original object's URL
@ -297,9 +297,9 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
'ping_status' => 0, 'ping_status' => 0,
'post_content' => $args['menu-item-description'], 'post_content' => $args['menu-item-description'],
'post_excerpt' => $args['menu-item-attr-title'], 'post_excerpt' => $args['menu-item-attr-title'],
'post_parent' => $args['menu-item-parent-id'], 'post_parent' => $args['menu-item-parent-id'],
'post_title' => $args['menu-item-title'], 'post_title' => $args['menu-item-title'],
'post_type' => 'nav_menu_item', 'post_type' => 'nav_menu_item',
'tax_input' => array( 'nav_menu' => $menu->name ), 'tax_input' => array( 'nav_menu' => $menu->name ),
); );
@ -376,10 +376,10 @@ function _sort_nav_menu_items($a, $b) {
$_b = (int) $b->$_menu_item_sort_prop; $_b = (int) $b->$_menu_item_sort_prop;
if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop ) { if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop ) {
return 0; return 0;
} elseif ( } elseif (
( $_a == $a->$_menu_item_sort_prop ) && ( $_a == $a->$_menu_item_sort_prop ) &&
( $_b == $b->$_menu_item_sort_prop ) ( $_b == $b->$_menu_item_sort_prop )
) { ) {
return $_a < $_b ? -1 : 1; return $_a < $_b ? -1 : 1;
} else { } else {
@ -404,7 +404,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
if ( ! $menu ) if ( ! $menu )
return false; return false;
$items = get_objects_in_term( $menu->term_id, 'nav_menu' ); $items = get_objects_in_term( $menu->term_id, 'nav_menu' );
if ( ! empty( $items ) ) { if ( ! empty( $items ) ) {
@ -448,7 +448,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
* - url: The URL to which this menu item points. * - url: The URL to which this menu item points.
* - title: The title of this menu item. * - title: The title of this menu item.
* - target: The target attribute of the link element for this menu item. * - target: The target attribute of the link element for this menu item.
* - attr_title: The title attribute of the link element for this menu item. * - attr_title: The title attribute of the link element for this menu item.
* - classes: The class attribute value for the link element of this menu item. * - classes: The class attribute value for the link element of this menu item.
* - xfn: The XFN relationship expressed in the link of this menu item. * - xfn: The XFN relationship expressed in the link of this menu item.
* - description: The description of this menu item. * - description: The description of this menu item.
@ -465,12 +465,12 @@ function wp_setup_nav_menu_item( $menu_item ) {
$menu_item->object_id = get_post_meta( $menu_item->ID, '_menu_item_object_id', true ); $menu_item->object_id = get_post_meta( $menu_item->ID, '_menu_item_object_id', true );
$menu_item->object = get_post_meta( $menu_item->ID, '_menu_item_object', true ); $menu_item->object = get_post_meta( $menu_item->ID, '_menu_item_object', true );
$menu_item->type = get_post_meta( $menu_item->ID, '_menu_item_type', true ); $menu_item->type = get_post_meta( $menu_item->ID, '_menu_item_type', true );
if ( 'post_type' == $menu_item->type ) { if ( 'post_type' == $menu_item->type ) {
$object = get_post_type_object( $menu_item->object ); $object = get_post_type_object( $menu_item->object );
$menu_item->append = $object->singular_label; $menu_item->append = $object->singular_label;
$menu_item->url = get_permalink( $menu_item->object_id ); $menu_item->url = get_permalink( $menu_item->object_id );
$original_object = get_post( $menu_item->object_id ); $original_object = get_post( $menu_item->object_id );
$original_title = $original_object->post_title; $original_title = $original_object->post_title;
$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title; $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
@ -488,7 +488,7 @@ function wp_setup_nav_menu_item( $menu_item ) {
$menu_item->title = $menu_item->post_title; $menu_item->title = $menu_item->post_title;
$menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true ); $menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true );
} }
$menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true ); $menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true );
$menu_item->attr_title = strip_tags( $menu_item->post_excerpt ); $menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
@ -542,7 +542,7 @@ function wp_setup_nav_menu_item( $menu_item ) {
* Get the menu items associated with a particular object. * Get the menu items associated with a particular object.
* *
* @since 3.0.0 * @since 3.0.0
* *
* @param int $object_id The ID of the original object. * @param int $object_id The ID of the original object.
* @param string $object_type The type of object, such as "taxonomy" or "post_type." * @param string $object_type The type of object, such as "taxonomy" or "post_type."
* @return array The array of menu item IDs; empty array if none; * @return array The array of menu item IDs; empty array if none;

View File

@ -632,7 +632,7 @@ function get_post_status_object( $post_status ) {
* *
* @param array|string $args An array of key => value arguments to match against the post status objects. * @param array|string $args An array of key => value arguments to match against the post status objects.
* @param string $output The type of output to return, either post status 'names' or 'objects'. 'names' is the default. * @param string $output The type of output to return, either post status 'names' or 'objects'. 'names' is the default.
* @param string $operator The logical operation to perform. 'or' means only one element * @param string $operator The logical operation to perform. 'or' means only one element
* from the array needs to match; 'and' means all elements must match. The default is 'and'. * from the array needs to match; 'and' means all elements must match. The default is 'and'.
* @return array A list of post type names or objects * @return array A list of post type names or objects
*/ */
@ -738,7 +738,7 @@ function get_post_type_object( $post_type ) {
* *
* @param array|string $args An array of key => value arguments to match against the post type objects. * @param array|string $args An array of key => value arguments to match against the post type objects.
* @param string $output The type of output to return, either post type 'names' or 'objects'. 'names' is the default. * @param string $output The type of output to return, either post type 'names' or 'objects'. 'names' is the default.
* @param string $operator The logical operation to perform. 'or' means only one element * @param string $operator The logical operation to perform. 'or' means only one element
* from the array needs to match; 'and' means all elements must match. The default is 'and'. * from the array needs to match; 'and' means all elements must match. The default is 'and'.
* @return array A list of post type names or objects * @return array A list of post type names or objects
*/ */

View File

@ -1719,7 +1719,7 @@ class WP_Query {
// Non-hierarchical post_types & parent-level-hierarchical post_types can directly use 'name' // Non-hierarchical post_types & parent-level-hierarchical post_types can directly use 'name'
$q['name'] = $q[ $ptype_obj->query_var ]; $q['name'] = $q[ $ptype_obj->query_var ];
} else { } else {
// Hierarchical post_types will operate through the // Hierarchical post_types will operate through the
$q['pagename'] = $q[ $ptype_obj->query_var ]; $q['pagename'] = $q[ $ptype_obj->query_var ];
$q['name'] = ''; $q['name'] = '';
} }
@ -2482,7 +2482,7 @@ class WP_Query {
$stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" ); $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" );
foreach ( $stickies as $sticky_post ) { foreach ( $stickies as $sticky_post ) {
// Ignore sticky posts the current user cannot read or are not published. // Ignore sticky posts the current user cannot read or are not published.
if ( 'publish' != $sticky_post->post_status ) if ( 'publish' != $sticky_post->post_status )
continue; continue;
array_splice($this->posts, $sticky_offset, 0, array($sticky_post)); array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
$sticky_offset++; $sticky_offset++;

View File

@ -1567,7 +1567,7 @@ class WP_Rewrite {
// robots.txt -only if installed at the root // robots.txt -only if installed at the root
$home_path = parse_url( home_url() ); $home_path = parse_url( home_url() );
$robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array(); $robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array();
// Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category% // Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
$default_feeds = array( '.*wp-atom.php$' => $this->index . '?feed=atom', $default_feeds = array( '.*wp-atom.php$' => $this->index . '?feed=atom',
'.*wp-rdf.php$' => $this->index . '?feed=rdf', '.*wp-rdf.php$' => $this->index . '?feed=rdf',

View File

@ -69,7 +69,7 @@ add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
* *
* @param array $args An array of key => value arguments to match against the taxonomy objects. * @param array $args An array of key => value arguments to match against the taxonomy objects.
* @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
* @param string $operator The logical operation to perform. 'or' means only one element * @param string $operator The logical operation to perform. 'or' means only one element
* from the array needs to match; 'and' means all elements must match. The default is 'and'. * from the array needs to match; 'and' means all elements must match. The default is 'and'.
* @return array A list of taxonomy names or objects * @return array A list of taxonomy names or objects
*/ */
@ -1571,7 +1571,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
} }
// Seems unreachable, However, Is used in the case that a term name is provided, which sanitizes to an empty string. // Seems unreachable, However, Is used in the case that a term name is provided, which sanitizes to an empty string.
if ( empty($slug) ) { if ( empty($slug) ) {
$slug = sanitize_title($slug, $term_id); $slug = sanitize_title($slug, $term_id);
do_action( 'edit_terms', $term_id ); do_action( 'edit_terms', $term_id );
$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );

View File

@ -844,9 +844,9 @@ function get_date_template() {
/** /**
* Retrieve path of home template in current or parent template. * Retrieve path of home template in current or parent template.
* *
* This is the template used for the page containing the blog posts * This is the template used for the page containing the blog posts
* *
* Attempts to locate 'home.php' first before falling back to 'index.php'. * Attempts to locate 'home.php' first before falling back to 'index.php'.
* *
* @since 1.5.0 * @since 1.5.0

View File

@ -558,9 +558,9 @@ function register_sidebar($args = array()) {
$wp_registered_sidebars[$sidebar['id']] = $sidebar; $wp_registered_sidebars[$sidebar['id']] = $sidebar;
add_theme_support('widgets'); add_theme_support('widgets');
do_action( 'register_sidebar', $sidebar ); do_action( 'register_sidebar', $sidebar );
return $sidebar['id']; return $sidebar['id'];
} }
@ -690,7 +690,7 @@ function wp_sidebar_description( $id ) {
*/ */
function wp_unregister_sidebar_widget($id) { function wp_unregister_sidebar_widget($id) {
do_action( 'wp_unregister_sidebar_widget', $id ); do_action( 'wp_unregister_sidebar_widget', $id );
wp_register_sidebar_widget($id, '', ''); wp_register_sidebar_widget($id, '', '');
wp_unregister_widget_control($id); wp_unregister_widget_control($id);
} }
@ -884,7 +884,7 @@ function dynamic_sidebar($index = 1) {
$params = apply_filters( 'dynamic_sidebar_params', $params ); $params = apply_filters( 'dynamic_sidebar_params', $params );
$callback = $wp_registered_widgets[$id]['callback']; $callback = $wp_registered_widgets[$id]['callback'];
do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] ); do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );
if ( is_callable($callback) ) { if ( is_callable($callback) ) {