mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-31 13:37:51 +01:00
Trim trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@13733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d5296edfad
commit
e25a65b36a
@ -35,15 +35,15 @@ $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||
//<![CDATA[
|
||||
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
var userSettings = {
|
||||
'url': '<?php echo SITECOOKIEPATH; ?>',
|
||||
'url': '<?php echo SITECOOKIEPATH; ?>',
|
||||
'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
|
||||
'time':'<?php echo time() ?>'
|
||||
},
|
||||
ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
|
||||
pagenow = '<?php echo $current_screen->id; ?>',
|
||||
typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',
|
||||
adminpage = '<?php echo $admin_body_class; ?>',
|
||||
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
|
||||
pagenow = '<?php echo $current_screen->id; ?>',
|
||||
typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',
|
||||
adminpage = '<?php echo $admin_body_class; ?>',
|
||||
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>';
|
||||
//]]>
|
||||
</script>
|
||||
|
@ -53,7 +53,7 @@ abbr {
|
||||
margin: 6px 0 14px 0;
|
||||
border-bottom: none;
|
||||
text-align:center
|
||||
}
|
||||
}
|
||||
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
|
@ -305,7 +305,7 @@ if ( $page_links )
|
||||
</div>
|
||||
<?php elseif ( 'post_tag' == $taxonomy ) : ?>
|
||||
<div class="form-wrap">
|
||||
<p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>'), 'admin.php?import=wp-cat2tag&step=3') ;?>.</p>
|
||||
<p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>'), 'admin.php?import=wp-cat2tag&step=3') ;?>.</p>
|
||||
</div>
|
||||
<?php endif;
|
||||
do_action('after-' . $taxonomy . '-table', $taxonomy);
|
||||
|
@ -49,7 +49,7 @@ require_once ('admin-header.php');
|
||||
|
||||
$months = "";
|
||||
for ( $i = 1; $i < 13; $i++ ) {
|
||||
$months .= "\t\t\t<option value=\"" . zeroise($i, 2) . '">' .
|
||||
$months .= "\t\t\t<option value=\"" . zeroise($i, 2) . '">' .
|
||||
$wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "</option>\n";
|
||||
} ?>
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
function error($error) {
|
||||
if ( is_string($error) && isset( $this->upgrader->strings[$error] ) )
|
||||
$this->error = $this->upgrader->strings[$error];
|
||||
|
||||
|
||||
if ( is_wp_error($error) && $error->get_error_code() ) {
|
||||
foreach ( $error->get_error_messages() as $emessage ) {
|
||||
if ( $error->get_error_data() )
|
||||
|
@ -38,28 +38,28 @@ header('Content-Description: File Transfer');
|
||||
header("Content-Disposition: attachment; filename=$filename");
|
||||
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
|
||||
|
||||
if ( $post_type and $post_type != 'all' ) {
|
||||
$where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
|
||||
} else {
|
||||
$where = "WHERE post_type != 'revision' ";
|
||||
}
|
||||
if ( $author and $author != 'all' ) {
|
||||
$author_id = (int) $author;
|
||||
$where .= $wpdb->prepare("AND post_author = %d ", $author_id);
|
||||
}
|
||||
if ( $start_date and $start_date != 'all' ) {
|
||||
$where .= $wpdb->prepare("AND post_date >= %s ", $start_date);
|
||||
}
|
||||
if ( $end_date and $end_date != 'all' ) {
|
||||
$where .= $wpdb->prepare("AND post_date < %s ", $end_date);
|
||||
}
|
||||
if ( $category and $category != 'all' ) {
|
||||
$taxomony_id = (int) $category;
|
||||
$where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id);
|
||||
}
|
||||
if ( $status and $status != 'all' ) {
|
||||
$where .= $wpdb->prepare("AND post_status = %s ", $status);
|
||||
}
|
||||
if ( $post_type and $post_type != 'all' ) {
|
||||
$where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
|
||||
} else {
|
||||
$where = "WHERE post_type != 'revision' ";
|
||||
}
|
||||
if ( $author and $author != 'all' ) {
|
||||
$author_id = (int) $author;
|
||||
$where .= $wpdb->prepare("AND post_author = %d ", $author_id);
|
||||
}
|
||||
if ( $start_date and $start_date != 'all' ) {
|
||||
$where .= $wpdb->prepare("AND post_date >= %s ", $start_date);
|
||||
}
|
||||
if ( $end_date and $end_date != 'all' ) {
|
||||
$where .= $wpdb->prepare("AND post_date < %s ", $end_date);
|
||||
}
|
||||
if ( $category and $category != 'all' ) {
|
||||
$taxomony_id = (int) $category;
|
||||
$where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id);
|
||||
}
|
||||
if ( $status and $status != 'all' ) {
|
||||
$where .= $wpdb->prepare("AND post_status = %s ", $status);
|
||||
}
|
||||
|
||||
// grab a snapshot of post IDs, just in case it changes during the export
|
||||
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
|
||||
|
@ -313,7 +313,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||
|
||||
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
||||
if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) )
|
||||
return call_user_func($upload_error_handler, $file, $uploads['error'] );
|
||||
return call_user_func($upload_error_handler, $file, $uploads['error'] );
|
||||
|
||||
$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
|
||||
|
||||
|
@ -656,15 +656,15 @@ function win_is_writable($path) {
|
||||
|
||||
/**
|
||||
* Send a HTTP header to disable content type sniffing in browsers which support it.
|
||||
*
|
||||
*
|
||||
* @link http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
|
||||
* @link http://src.chromium.org/viewvc/chrome?view=rev&revision=6985
|
||||
*
|
||||
*
|
||||
* @since 3.0.0.
|
||||
* @return none
|
||||
*/
|
||||
function send_nosniff_header() {
|
||||
@header( 'X-Content-Type-Options: nosniff' );
|
||||
@header( 'X-Content-Type-Options: nosniff' );
|
||||
}
|
||||
/**
|
||||
* Display the default admin color scheme picker (Used in user-edit.php)
|
||||
|
@ -168,7 +168,7 @@ function confirm_delete_users( $users ) {
|
||||
global $current_user;
|
||||
if ( !is_array( $users ) )
|
||||
return false;
|
||||
|
||||
|
||||
screen_icon('tools');
|
||||
?>
|
||||
<h2><?php esc_html_e('Users'); ?></h2>
|
||||
@ -183,13 +183,13 @@ function confirm_delete_users( $users ) {
|
||||
foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) {
|
||||
if ( $val != '' && $val != '0' ) {
|
||||
$delete_user = new WP_User( $val );
|
||||
|
||||
|
||||
if ( in_array( $delete_user->user_login, $site_admins ) )
|
||||
wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network admnistrator.' ), $delete_user->user_login ) );
|
||||
|
||||
|
||||
echo "<input type='hidden' name='user[]' value='{$val}'/>\n";
|
||||
$blogs = get_blogs_of_user( $val, true );
|
||||
|
||||
|
||||
if ( !empty( $blogs ) ) {
|
||||
echo '<p><strong>' . sprintf( __( 'Sites from %s:' ), $delete_user->user_login ) . '</strong></p>';
|
||||
foreach ( (array) $blogs as $key => $details ) {
|
||||
|
@ -13,7 +13,7 @@ wp_nav_menu_taxonomy_metaboxes();
|
||||
*/
|
||||
function wp_nav_menu_post_type_metaboxes() {
|
||||
$post_types = get_post_types( array( 'public' => true ), 'object' );
|
||||
|
||||
|
||||
if ( !$post_types )
|
||||
return false;
|
||||
|
||||
@ -99,10 +99,10 @@ function wp_nav_menu_create_metabox() { ?>
|
||||
*/
|
||||
function wp_nav_menu_item_link_metabox() {
|
||||
$args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom', 'showposts' => -1 );
|
||||
|
||||
|
||||
// @todo transient caching of these results with proper invalidation on updating links
|
||||
$query = new WP_Query( $args );
|
||||
|
||||
|
||||
?>
|
||||
<p id="menu-item-url-wrap">
|
||||
<label class="howto" for="menu-item-url">
|
||||
@ -117,7 +117,7 @@ function wp_nav_menu_item_link_metabox() {
|
||||
<input id="custom-menu-item-name" name="custom-menu-item-name" type="text" class="regular-text menu-item-textbox" value="<?php echo esc_attr( __('Menu Item') ); ?>" />
|
||||
</label>
|
||||
</p>
|
||||
|
||||
|
||||
<p class="button-controls">
|
||||
<a class="show-all"><?php _e('View All'); ?></a>
|
||||
<a class="hide-all"><?php _e('Hide All'); ?></a>
|
||||
@ -146,16 +146,16 @@ function wp_nav_menu_item_link_metabox() {
|
||||
*/
|
||||
function wp_nav_menu_item_post_type_metabox( $object, $post_type ) {
|
||||
$args = array( 'post_type' => $post_type['args']->name, 'post_status' => 'publish', 'showposts' => -1 );
|
||||
|
||||
|
||||
if ( 'attachment' == $post_type['args']->name )
|
||||
$args['post_status'] = 'any';
|
||||
|
||||
|
||||
// @todo transient caching of these results with proper invalidation on updating of a post of this type
|
||||
$query = new WP_Query( $args );
|
||||
|
||||
|
||||
if ( !$query->posts )
|
||||
$error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>';
|
||||
|
||||
|
||||
$pt_names = '';
|
||||
if ( is_array($query->posts) ) {
|
||||
foreach ( $query->posts as $post ) {
|
||||
@ -166,19 +166,19 @@ function wp_nav_menu_item_post_type_metabox( $object, $post_type ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$id = $post_type['args']->name;
|
||||
?>
|
||||
<p class="quick-search-wrap">
|
||||
<input type="text" class="quick-search regular-text" value="" />
|
||||
<a class="quick-search-submit button-secondary"><?php _e('Search'); ?></a>
|
||||
</p>
|
||||
|
||||
|
||||
<p class="button-controls">
|
||||
<a class="show-all"><?php _e('View All'); ?></a>
|
||||
<a class="hide-all"><?php _e('Hide All'); ?></a>
|
||||
</p>
|
||||
|
||||
|
||||
<div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap">
|
||||
<div class="list-container">
|
||||
<ul class="list">
|
||||
@ -218,10 +218,10 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) {
|
||||
|
||||
// @todo transient caching of these results with proper invalidation on updating of a tax of this type
|
||||
$terms = get_terms( $taxonomy['args']->name, $args );
|
||||
|
||||
|
||||
if ( !$terms )
|
||||
$error = '<li id="error">'. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'</li>';
|
||||
|
||||
|
||||
$term_names = '';
|
||||
if ( is_array($terms) ) {
|
||||
foreach ( $terms as $term ) {
|
||||
@ -232,19 +232,19 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$id = $taxonomy['args']->name;
|
||||
?>
|
||||
<p class="quick-search-wrap">
|
||||
<input type="text" class="quick-search regular-text" value="" />
|
||||
<a class="quick-search-submit button-secondary"><?php _e('Search'); ?></a>
|
||||
</p>
|
||||
|
||||
|
||||
<p class="button-controls">
|
||||
<a class="show-all"><?php _e('View All'); ?></a>
|
||||
<a class="hide-all"><?php _e('Hide All'); ?></a>
|
||||
</p>
|
||||
|
||||
|
||||
<div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap">
|
||||
<div class="list-container">
|
||||
<ul class="list">
|
||||
@ -281,7 +281,7 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) {
|
||||
function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $context = 'frontend' ) {
|
||||
if ( !$menu_items )
|
||||
return __( 'Not Found' );
|
||||
|
||||
|
||||
$output = '';
|
||||
$i = 1;
|
||||
foreach ( $menu_items as $menu_item ) {
|
||||
@ -289,16 +289,16 @@ function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $cont
|
||||
// so we don't have to duplicate this entire function.
|
||||
if ( !isset($menu_item->post_parent) )
|
||||
$menu_item->post_parent = $menu_item->parent;
|
||||
|
||||
|
||||
// Cleanest way to get all attachements
|
||||
if ( 'attachment' == $object )
|
||||
$menu_item->post_parent = 0;
|
||||
|
||||
|
||||
if ( 0 == $menu_item->post_parent ) {
|
||||
// Set up the menu item
|
||||
$menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object );
|
||||
$menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object );
|
||||
$attributes = ( 'backend' == $context ) ? ' id="menu-item-'. $i .'" value="'. $i .'"' : '';
|
||||
|
||||
|
||||
$output .= '<li'. $attributes .'>';
|
||||
$output .= wp_get_nav_menu_item( $menu_item, $object_type, $object );
|
||||
$output .= wp_get_nav_menu_sub_items( $menu_item->ID, $object_type, $object, $context );
|
||||
@ -307,7 +307,7 @@ function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $cont
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ function wp_nav_menu_get_items( $menu_items, $object_type, $object = null, $cont
|
||||
*/
|
||||
function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $context = 'frontend' ) {
|
||||
$args = array( 'child_of' => $childof, 'parent' => $childof, 'hide_empty' => false, );
|
||||
|
||||
|
||||
switch ( $object_type ) {
|
||||
case 'post_type':
|
||||
$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
|
||||
@ -334,7 +334,7 @@ function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $con
|
||||
$sub_menu_items = array();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'taxonomy':
|
||||
if ( is_taxonomy_hierarchical( $object ) ) {
|
||||
$sub_menu_items = get_terms( $object, $args );
|
||||
@ -342,12 +342,12 @@ function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $con
|
||||
$sub_menu_items = array();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$sub_menu_items = array();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$output = '';
|
||||
$i = 1;
|
||||
if ( !empty($sub_menu_items) && !is_wp_error($sub_menu_items) ) {
|
||||
|
@ -557,7 +557,7 @@ function deactivate_plugins( $plugins, $silent = false ) {
|
||||
*
|
||||
* @param string|array $plugins
|
||||
* @param string $redirect Redirect to page after successful activation.
|
||||
* @param bool $network_wide Whether to enable the plugin for all sites in the network.
|
||||
* @param bool $network_wide Whether to enable the plugin for all sites in the network.
|
||||
* @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
|
||||
*/
|
||||
function activate_plugins($plugins, $redirect = '', $network_wide) {
|
||||
|
@ -270,7 +270,7 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
else
|
||||
unset($post_data['post_category']);
|
||||
}
|
||||
|
||||
|
||||
$tax_input = array();
|
||||
if ( isset($post_data['tax_input'])) {
|
||||
foreach ( $post_data['tax_input'] as $tax_name => $terms ) {
|
||||
@ -278,7 +278,7 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
continue;
|
||||
$taxonomy = get_taxonomy( $tax_name );
|
||||
if ( $taxonomy->hierarchical )
|
||||
$tax_input[$tax_name] = array_map( 'absint', $terms );
|
||||
$tax_input[$tax_name] = array_map( 'absint', $terms );
|
||||
else {
|
||||
$tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) );
|
||||
$tax_input[$tax_name] = explode(',', $tax_input[$tax_name]);
|
||||
@ -314,14 +314,14 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
$locked[] = $post_ID;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$tax_names = get_object_taxonomies( get_post($post_ID) );
|
||||
|
||||
|
||||
if ( isset($new_cats) && in_array( 'category', $tax_names ) ) {
|
||||
$cats = (array) wp_get_post_categories($post_ID);
|
||||
$post_data['post_category'] = array_unique( array_merge($cats, $new_cats) );
|
||||
}
|
||||
|
||||
|
||||
foreach ( $tax_names as $tax_name ) {
|
||||
if( isset( $tax_input[$tax_name]) ) {
|
||||
$taxonomy = get_taxonomy( $tax_name );
|
||||
|
@ -862,15 +862,15 @@ function inline_edit_row( $screen ) {
|
||||
$flat_taxonomies = array();
|
||||
foreach ( $taxonomy_names as $taxonomy_name ) {
|
||||
$taxonomy = get_taxonomy( $taxonomy_name);
|
||||
|
||||
|
||||
if( !$taxonomy->show_ui ) continue;
|
||||
|
||||
|
||||
if( $taxonomy->hierarchical )
|
||||
$hierarchical_taxonomies[] = $taxonomy;
|
||||
else
|
||||
else
|
||||
$flat_taxonomies[] = $taxonomy;
|
||||
}
|
||||
|
||||
|
||||
$columns = wp_manage_posts_columns($screen);
|
||||
$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
|
||||
$col_count = count($columns) - count($hidden);
|
||||
@ -965,7 +965,7 @@ function inline_edit_row( $screen ) {
|
||||
<?php if ( count($hierarchical_taxonomies) && !$bulk ) : ?>
|
||||
|
||||
<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
|
||||
|
||||
|
||||
<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
|
||||
|
||||
<span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->label) ?>
|
||||
@ -2973,7 +2973,7 @@ function get_hidden_meta_boxes($screen) {
|
||||
* @global $wp_settings_sections Storage array of all settings sections added to admin pages
|
||||
|
||||
* @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
|
||||
* @param string $title Formatted title of the section. Shown as the heading for the section.
|
||||
* @param string $title Formatted title of the section. Shown as the heading for the section.
|
||||
* @param string $callback Function that echo's out content for the section heading.
|
||||
* @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...).
|
||||
*/
|
||||
@ -2999,7 +2999,7 @@ function add_settings_section($id, $title, $callback, $page) {
|
||||
*
|
||||
* The $callback argument should be the name of a function that echoes out the
|
||||
* html input tags for this setting field. Use get_option() to retrive existing
|
||||
* values to show.
|
||||
* values to show.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
@ -3102,7 +3102,7 @@ function do_settings_fields($page, $section) {
|
||||
* page is first accessed.
|
||||
*
|
||||
* @global array $wp_settings_errors Storage array of errors registered during this pageload
|
||||
*
|
||||
*
|
||||
* @param string $setting Slug title of the setting to which this error applies
|
||||
* @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output.
|
||||
* @param string $message The formatted message text to display to the user (will be shown inside styled <div> and <p>)
|
||||
@ -3129,7 +3129,7 @@ function add_settings_error( $setting, $code, $message, $type = 'error' ) {
|
||||
* Checks the $wp_settings_errors array for any errors declared during the current
|
||||
* pageload and returns them.
|
||||
*
|
||||
* If changes were just submitted ($_GET['updated']) and settings errors were saved
|
||||
* If changes were just submitted ($_GET['updated']) and settings errors were saved
|
||||
* to the 'settings_errors' transient then those errors will be returned instead. This
|
||||
* is used to pass errors back across pageloads.
|
||||
*
|
||||
@ -3177,7 +3177,7 @@ function get_settings_errors( $setting = '', $sanitize = FALSE ) {
|
||||
* Display settings errors registered by add_settings_error()
|
||||
*
|
||||
* Part of the Settings API. Outputs a <div> for each error retrieved by get_settings_errors().
|
||||
*
|
||||
*
|
||||
* This is called automatically after a settings page based on the Settings API is submitted.
|
||||
* Errors should be added during the validation callback function for a setting defined in register_setting()
|
||||
*
|
||||
@ -3300,12 +3300,12 @@ function the_post_password() {
|
||||
*/
|
||||
function favorite_actions( $screen = null ) {
|
||||
global $post_type_object;
|
||||
|
||||
|
||||
$default_action = false;
|
||||
|
||||
|
||||
if ( is_string($screen) )
|
||||
$screen = convert_to_screen($screen);
|
||||
|
||||
|
||||
if ( isset($post_type_object) ) {
|
||||
switch ( $screen->id ) {
|
||||
case $post_type_object->name:
|
||||
@ -3316,7 +3316,7 @@ function favorite_actions( $screen = null ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !$default_action ) {
|
||||
switch ( $screen->id ) {
|
||||
case 'upload':
|
||||
|
@ -265,8 +265,8 @@ function wp_install_defaults($user_id) {
|
||||
'post_content_filtered' => ''
|
||||
));
|
||||
|
||||
// Setup default widgets for default theme.
|
||||
update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
|
||||
// Setup default widgets for default theme.
|
||||
update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
|
||||
update_option( 'widget_recent-posts', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) );
|
||||
update_option( 'widget_recent-comments', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) );
|
||||
update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
|
||||
@ -1109,7 +1109,7 @@ function upgrade_300() {
|
||||
|
||||
if ( $wp_current_db_version < 12751 ) {
|
||||
populate_roles_300();
|
||||
if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
|
||||
if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
|
||||
add_site_option( 'siteurl', '' );
|
||||
}
|
||||
}
|
||||
|
@ -289,13 +289,13 @@ jQuery(document).ready( function($) {
|
||||
el.selectionStart = el.selectionEnd = selStart + 1;
|
||||
this.scrollTop = scroll;
|
||||
}
|
||||
|
||||
|
||||
if ( e.stopPropagation )
|
||||
e.stopPropagation();
|
||||
if ( e.preventDefault )
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
$('#newcontent').blur(function(e) {
|
||||
if ( this.lastKey && 9 == this.lastKey )
|
||||
this.focus();
|
||||
|
@ -158,7 +158,7 @@ inlineEditPost = {
|
||||
$('textarea.tax_input_'+taxname, editRow).suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// handle the post status
|
||||
status = $('._status', rowData).text();
|
||||
|
@ -33,11 +33,11 @@ function wp_edit_menu_item( id ) {
|
||||
var item_description = jQuery('#menu-item-description' + id).val();
|
||||
var item_classes = jQuery('#menu-item-classes' + id).val();
|
||||
var item_xfn = jQuery('#menu-item-xfn' + id).val();
|
||||
|
||||
|
||||
// Only allow custom links to be editable.
|
||||
if ( 'custom' != item_type )
|
||||
jQuery( '#edit-menu-item-url' ).attr('disabled', 'disabled' );
|
||||
|
||||
|
||||
// Populate the fields for thickbox
|
||||
jQuery( '#edit-menu-item-id' ).val(id);
|
||||
jQuery( '#edit-menu-item-title' ).val(item_title);
|
||||
@ -48,7 +48,7 @@ function wp_edit_menu_item( id ) {
|
||||
jQuery( '#edit-menu-item-description' ).val(item_description);
|
||||
jQuery( '#edit-menu-item-classes' ).val(item_classes);
|
||||
jQuery( '#edit-menu-item-xfn' ).val(item_xfn);
|
||||
|
||||
|
||||
// focus
|
||||
jQuery( '#edit-menu-item-title' ).focus();
|
||||
};
|
||||
@ -65,7 +65,7 @@ function wp_update_menu_item() {
|
||||
var item_description = jQuery('#edit-menu-item-description').val();
|
||||
var item_classes = jQuery('#edit-menu-item-classes').val();
|
||||
var item_xfn = jQuery('#edit-menu-item-xfn').val();
|
||||
|
||||
|
||||
// update menu item settings
|
||||
jQuery('.menu #menu-item' + id).find('span.item-title').html(item_title);
|
||||
jQuery('.menu #menu-item-title' + id).val(item_title);
|
||||
@ -75,7 +75,7 @@ function wp_update_menu_item() {
|
||||
jQuery('.menu #menu-item-description' + id).val(item_description);
|
||||
jQuery('.menu #menu-item-classes' + id).val(item_classes);
|
||||
jQuery('.menu #menu-item-xfn' + id).val(item_xfn);
|
||||
|
||||
|
||||
jQuery('.menu #menu-item' + id + ' dt:first').animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }});
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ function wp_update_menu_item() {
|
||||
*/
|
||||
function wp_remove_menu_item( o ) {
|
||||
var todelete = document.getElementById('menu-item' + o);
|
||||
|
||||
|
||||
if ( todelete ) {
|
||||
// Give some feedback to the user
|
||||
jQuery( todelete ).find('dt').each(function(){
|
||||
@ -114,16 +114,16 @@ function wp_remove_menu_item( o ) {
|
||||
function wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) {
|
||||
var randomnumber = wp_get_unique_menu_id();
|
||||
var hidden = wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn );
|
||||
|
||||
|
||||
// Adds the item in the queue
|
||||
jQuery('.menu').append('<li id="menu-item' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">' + item_title + '</span><span class="item-controls"><span class="item-type">' + item_append + '</span><a class="item-edit thickbox" id="edit' + randomnumber + '" value="' + randomnumber +'" onClick="wp_edit_menu_item('+ randomnumber +')" title="' + navMenuL10n.thickbox + '" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">' + navMenuL10n.edit + '</a> | <a class="item-delete" id="delete' + randomnumber + '" value="' + randomnumber +'">Delete</a></span></dt></dl>' + hidden + '</li>');
|
||||
|
||||
|
||||
// Give some feedback to the user
|
||||
jQuery( '.menu #menu-item' + randomnumber + ' dt:first' ).animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }});
|
||||
|
||||
|
||||
// Enable drag-n-drop
|
||||
wp_drag_and_drop();
|
||||
|
||||
|
||||
// Reload thickbox
|
||||
tb_init('a.thickbox, area.thickbox, input.thickbox');
|
||||
};
|
||||
@ -136,15 +136,15 @@ function wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append
|
||||
function wp_add_checked_items_to_menu( button ) {
|
||||
// Grab checked items
|
||||
var items = jQuery(button).siblings('.list-wrap').find(':checked');
|
||||
|
||||
|
||||
// If nothing was checked, cancel
|
||||
if ( 0 == items.length )
|
||||
return false;
|
||||
|
||||
|
||||
// Loop through each item, grab it's hidden data and add it to the menu.
|
||||
jQuery(items).each(function(){
|
||||
var item_type = jQuery(this).parent().siblings('.menu-item-type').val();
|
||||
|
||||
|
||||
if ( 'custom' == item_type ) {
|
||||
var item_attr_title = jQuery(this).parent().siblings('.menu-item-attr-title').val();
|
||||
var item_target = jQuery(this).parent().siblings('.menu-item-target').val();
|
||||
@ -156,7 +156,7 @@ function wp_add_checked_items_to_menu( button ) {
|
||||
var item_classes = '';
|
||||
var item_xfn = '';
|
||||
};
|
||||
|
||||
|
||||
var item_db_id = jQuery(this).parent().siblings('.menu-item-db-id').val();
|
||||
var item_object_id = jQuery(this).parent().siblings('.menu-item-object-id').val();
|
||||
var item_append = jQuery(this).parent().siblings('.menu-item-append').val();
|
||||
@ -164,14 +164,14 @@ function wp_add_checked_items_to_menu( button ) {
|
||||
var item_title = jQuery(this).parent().siblings('.menu-item-title').val();
|
||||
var item_url = jQuery(this).parent().siblings('.menu-item-url').val();
|
||||
var item_description = jQuery(this).parent().siblings('.menu-item-description').val();
|
||||
|
||||
|
||||
if ( undefined == item_description ) {
|
||||
item_description = '';
|
||||
};
|
||||
|
||||
|
||||
// Add the menu item to the menu
|
||||
wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn );
|
||||
|
||||
|
||||
// uncheck the menu item in the list
|
||||
jQuery(this).attr( 'checked', false );
|
||||
});
|
||||
@ -204,7 +204,7 @@ function wp_drag_and_drop() {
|
||||
drop: function(e, ui) {
|
||||
var li = jQuery(this).parent();
|
||||
var child = !jQuery(this).hasClass('dropzone');
|
||||
|
||||
|
||||
// Append UL to first child
|
||||
if ( child && li.children('ul').length == 0 ) {
|
||||
li.append( '<ul class="sub-menu" />' );
|
||||
@ -220,7 +220,7 @@ function wp_drag_and_drop() {
|
||||
|
||||
var draggablevalue = ui.draggable.attr('value');
|
||||
var droppablevalue = li.attr('value');
|
||||
|
||||
|
||||
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
|
||||
jQuery(this).parent().find('dt').removeAttr('style');
|
||||
jQuery(this).parent().find('div:first').removeAttr('style');
|
||||
@ -254,7 +254,7 @@ function wp_drag_and_drop() {
|
||||
*/
|
||||
function wp_update_post_data() {
|
||||
var i = 0;
|
||||
|
||||
|
||||
jQuery('.menu li').each(function(i) {
|
||||
i = i + 1;
|
||||
var j = jQuery(this).attr('value');
|
||||
@ -262,7 +262,7 @@ function wp_update_post_data() {
|
||||
jQuery(this).find('#menu-item-position' + j).attr('value', i);
|
||||
jQuery(this).attr('id','menu-item' + i);
|
||||
jQuery(this).attr('value', i);
|
||||
|
||||
|
||||
jQuery(this).find('#menu-item-db-id' + j).attr('id','menu-item-db-id' + i);
|
||||
jQuery(this).find('#menu-item-object-id' + j).attr('id','menu-item-object-id' + i);
|
||||
jQuery(this).find('#menu-item-append' + j).attr('id', 'menu-item-append' + i);
|
||||
@ -278,7 +278,7 @@ function wp_update_post_data() {
|
||||
p = 0;
|
||||
}
|
||||
jQuery(this).find('#menu-item-parent-id' + j).attr('value', p);
|
||||
|
||||
|
||||
jQuery(this).find('#menu-item-title' + j).attr('id','menu-item-title' + i);
|
||||
jQuery(this).find('#menu-item-url' + j).attr('id','menu-item-url' + i);
|
||||
jQuery(this).find('#menu-item-description' + j).attr('id','menu-item-description' + i);
|
||||
@ -287,7 +287,7 @@ function wp_update_post_data() {
|
||||
jQuery(this).find('#menu-item-description' + j).attr('id','menu-item-description' + i);
|
||||
jQuery(this).find('#menu-item-attr-title' + j).attr('id','menu-item-attr-title' + i);
|
||||
jQuery(this).find('#menu-item-target' + j).attr('id','menu-item-target' + i);
|
||||
|
||||
|
||||
jQuery('#li-count').attr( 'value', i );
|
||||
});
|
||||
};
|
||||
@ -321,7 +321,7 @@ function wp_get_unique_menu_id() {
|
||||
|
||||
/**
|
||||
* Returns all the nessecary hidden inputs for each menu item.
|
||||
*
|
||||
*
|
||||
* @param string item_db_id - The menu item's db id.
|
||||
* @param string item_object_id - The menu item's object id.
|
||||
* @param string item_type - The menu item's object type.
|
||||
@ -337,7 +337,7 @@ function wp_get_unique_menu_id() {
|
||||
*/
|
||||
function wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) {
|
||||
var hidden = '';
|
||||
|
||||
|
||||
hidden += '<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id' + randomnumber + '" value="' + item_db_id + '" />';
|
||||
hidden += '<input type="hidden" name="menu-item-object-id[]" id="menu-item-object-id' + randomnumber + '" value="' + item_object_id + '" />';
|
||||
hidden += '<input type="hidden" name="menu-item-type[]" id="menu-item-type' + randomnumber + '" value="' + item_type + '" />';
|
||||
@ -351,7 +351,7 @@ function wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_ty
|
||||
hidden += '<input type="hidden" name="menu-item-description[]" id="menu-item-description' + randomnumber + '" value="' + item_description + '" />';
|
||||
hidden += '<input type="hidden" name="menu-item-classes[]" id="menu-item-classes' + randomnumber + '" value="' + item_classes + '" />';
|
||||
hidden += '<input type="hidden" name="menu-item-xfn[]" id="menu-item-xfn' + randomnumber + '" value="' + item_xfn + '" />';
|
||||
|
||||
|
||||
return hidden;
|
||||
}
|
||||
|
||||
@ -369,9 +369,9 @@ function wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_ty
|
||||
* Init Functions
|
||||
*/
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
|
||||
wp_drag_and_drop();
|
||||
|
||||
|
||||
// Delete AYS
|
||||
$('#update-nav-menu .deletion').click(function(){
|
||||
if ( confirm( navMenuL10n.warnDelete ) ) {
|
||||
@ -380,49 +380,49 @@ jQuery(document).ready(function($){
|
||||
return false;
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// Handle Save Button Clicks
|
||||
$('#save_menu').click(function(){
|
||||
return wp_update_post_data();
|
||||
});
|
||||
|
||||
|
||||
// close postboxes that should be closed
|
||||
$('.if-js-closed').removeClass('if-js-closed').addClass('closed');
|
||||
|
||||
|
||||
// postboxes setup
|
||||
postboxes.add_postbox_toggles('menus');
|
||||
|
||||
|
||||
// Clear the quick search textbox
|
||||
$('.quick-search').click(function(){
|
||||
$(this).attr( 'value', '' );
|
||||
});
|
||||
|
||||
|
||||
// Quick Search submit
|
||||
$('.quick-search-submit').click(function(){
|
||||
$(this).siblings('.quick-search').search();
|
||||
});
|
||||
|
||||
|
||||
// Edit menu item
|
||||
$('#menu-container .item-edit').click(function(){
|
||||
return wp_edit_menu_item( $(this).attr('value') );
|
||||
});
|
||||
|
||||
|
||||
// Delete menu item
|
||||
$('#menu-container .item-delete').live( 'click', function(e){
|
||||
return wp_remove_menu_item( $(this).attr('value') );
|
||||
});
|
||||
|
||||
|
||||
// Update menu item settings (thickbox)
|
||||
$('#update-menu-item').click(function(){
|
||||
wp_update_menu_item();
|
||||
return tb_remove();
|
||||
});
|
||||
|
||||
|
||||
// Close thickbox
|
||||
$('#cancel-save').click(function(){
|
||||
return tb_remove();
|
||||
});
|
||||
|
||||
|
||||
// Show All Button
|
||||
$('.show-all').click(function(e){
|
||||
jQuery(e.currentTarget).parent().siblings('.list-wrap').css( 'display', 'block' );
|
||||
@ -430,7 +430,7 @@ jQuery(document).ready(function($){
|
||||
jQuery(e.currentTarget).hide();
|
||||
jQuery(e.currentTarget).siblings('.hide-all').show();
|
||||
});
|
||||
|
||||
|
||||
// Hide All Button
|
||||
$('.hide-all').click(function(e){
|
||||
jQuery(e.currentTarget).parent().siblings('.list-wrap').css( 'display', 'none' );
|
||||
@ -448,7 +448,7 @@ jQuery(document).ready(function($){
|
||||
$('#add-custom-links .add-to-menu a').click(function(e){
|
||||
var link_url = jQuery(e.currentTarget).parent().parent().find('#custom-menu-item-url').val();
|
||||
var link_name = jQuery(e.currentTarget).parent().parent().find('#custom-menu-item-name').val();
|
||||
|
||||
|
||||
// Add link to menu
|
||||
wp_add_item_to_menu( 0, '', 'custom', navMenuL10n.custom, 0, link_name, link_url, '', '', '_self', '', '' );
|
||||
});
|
||||
|
@ -48,7 +48,7 @@ if ( is_multisite() || is_super_admin() ) {
|
||||
|
||||
if ( is_multisite() )
|
||||
$submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
|
||||
|
||||
|
||||
if ( is_super_admin() ) {
|
||||
$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
|
||||
$update_plugins = get_site_transient( 'update_plugins' );
|
||||
@ -116,7 +116,7 @@ $_wp_last_object_menu = 25; // The index of the last top-level menu in the objec
|
||||
foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) {
|
||||
$_wp_last_object_menu++;
|
||||
$ptype_obj = get_post_type_object($ptype);
|
||||
|
||||
|
||||
$menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-posts', 'menu-' . sanitize_html_class($ptype), 'div');
|
||||
$submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), 'edit_posts', "edit.php?post_type=$ptype");
|
||||
/* translators: add new custom post type */
|
||||
|
@ -305,7 +305,7 @@ switch ( $_GET['action'] ) {
|
||||
|
||||
if ( $id != '0' && $id != $current_site->blog_id )
|
||||
wpmu_delete_blog( $id, true );
|
||||
|
||||
|
||||
wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) );
|
||||
exit();
|
||||
break;
|
||||
@ -342,8 +342,8 @@ switch ( $_GET['action'] ) {
|
||||
} else {
|
||||
wp_die( __('You are not allowed to change one of these sites.') );
|
||||
exit();
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) );
|
||||
exit();
|
||||
|
@ -243,7 +243,7 @@ switch ( $action ) {
|
||||
reset($blogusers);
|
||||
foreach ( (array) $blogusers as $key => $val ) {
|
||||
if ( isset( $val->meta_value ) && ! $val->meta_value )
|
||||
continue;
|
||||
continue;
|
||||
$t = @unserialize( $val->meta_value );
|
||||
if ( is_array( $t ) ) {
|
||||
reset( $t );
|
||||
@ -337,7 +337,7 @@ switch ( $action ) {
|
||||
$per_page = apply_filters( 'ms_sites_per_page', $per_page );
|
||||
|
||||
$s = isset($_GET['s']) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
|
||||
$like_s = esc_sql( like_escape( $s ) );
|
||||
$like_s = esc_sql( like_escape( $s ) );
|
||||
|
||||
$query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
|
||||
|
||||
@ -419,7 +419,7 @@ switch ( $action ) {
|
||||
$status_links = array();
|
||||
$status_class = '';
|
||||
$count = get_blog_count();
|
||||
|
||||
|
||||
if ( empty($_GET['blogstatus']) || $_GET['blogstatus'] == 'all' )
|
||||
$status_class = ' class="current"';
|
||||
|
||||
@ -474,12 +474,12 @@ switch ( $action ) {
|
||||
<?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
|
||||
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
|
||||
number_format_i18n( min( $pagenum * $per_page, $num_pages ) ),
|
||||
number_format_i18n( $num_pages ),
|
||||
number_format_i18n( $num_pages ),
|
||||
$page_links
|
||||
); echo $page_links_text; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="view-switch">
|
||||
<a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
|
||||
<a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
|
||||
@ -487,7 +487,7 @@ switch ( $action ) {
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php
|
||||
// define the columns to display, the syntax is 'internal name' => 'display name'
|
||||
@ -539,14 +539,14 @@ switch ( $action ) {
|
||||
$order2 = '';
|
||||
if ( $order_by == $column_id )
|
||||
$order2 = ($order == 'DESC') ? 'ASC' : 'DESC';
|
||||
|
||||
|
||||
$column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) );
|
||||
$column_link .= "'>{$column_display_name}</a>";
|
||||
$col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
|
||||
?>
|
||||
<th scope="col">
|
||||
<?php echo $col_url ?>
|
||||
</th>
|
||||
</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@ -639,7 +639,7 @@ switch ( $action ) {
|
||||
else
|
||||
$date = 'Y/m/d \<\b\r \/\> g:i:s a';
|
||||
echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?>
|
||||
</td>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
case 'registered': ?>
|
||||
|
@ -195,7 +195,7 @@ if ( isset($_GET['updated']) && $_GET['updated'] == 'true' ) {
|
||||
?>
|
||||
<td class="username column-username">
|
||||
<?php echo $avatar; ?><strong><a href="<?php echo $edit; ?>" class="edit"><?php echo stripslashes($user['user_login']); ?></a><?php
|
||||
if ( in_array( $user[ 'user_login' ], $super_admins ) )
|
||||
if ( in_array( $user[ 'user_login' ], $super_admins ) )
|
||||
echo ' - ' . __( 'Super admin' );
|
||||
?></strong>
|
||||
<br/>
|
||||
|
@ -62,10 +62,10 @@ switch ( $action ) {
|
||||
$nav_menu_selected_id = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'update':
|
||||
check_admin_referer( 'update-nav_menu' );
|
||||
|
||||
|
||||
// Add Menu
|
||||
if ( isset($_POST['create-menu']) ) {
|
||||
if ( current_theme_supports('nav-menus') ) {
|
||||
@ -91,15 +91,15 @@ switch ( $action ) {
|
||||
$args = array( 'name' => $_POST['menu-name'], 'slug' => null, 'description' => $old_nav_menu['description'], 'parent' => $old_nav_menu['parent'], );
|
||||
$new_nav_menu = wp_update_term( $nav_menu_selected_id, 'nav_menu', $args );
|
||||
}
|
||||
|
||||
|
||||
// Update menu items
|
||||
$update_nav_items = isset( $_POST['li-count'] ) ? (int) $_POST['li-count'] : 0;
|
||||
$update_nav_menu = is_nav_menu( $nav_menu_selected_id );
|
||||
|
||||
|
||||
if ( !is_wp_error($update_nav_menu) ) {
|
||||
$menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') );
|
||||
$parent_menu_ids = array();
|
||||
|
||||
|
||||
// Loop through all POST variables
|
||||
for ( $k = 0; $k < $update_nav_items; $k++ ) {
|
||||
$menu_item_db_id = isset( $_POST['menu-item-db-id'][$k] ) ? $_POST['menu-item-db-id'][$k] : 0;
|
||||
@ -108,7 +108,7 @@ switch ( $action ) {
|
||||
$menu_item_position = isset( $_POST['menu-item-position'][$k] ) ? $_POST['menu-item-position'][$k] : 0;
|
||||
$menu_item_type = isset( $_POST['menu-item-type'][$k] ) ? $_POST['menu-item-type'][$k] : 'custom';
|
||||
$menu_item_append = isset( $_POST['menu-item-append'][$k] ) ? $_POST['menu-item-append'][$k] : 'custom';
|
||||
|
||||
|
||||
$menu_item_title = isset( $_POST['menu-item-title'][$k] ) ? $_POST['menu-item-title'][$k] : '';
|
||||
$menu_item_url = isset( $_POST['menu-item-url'][$k] ) ? $_POST['menu-item-url'][$k] : '';
|
||||
$menu_item_description = isset( $_POST['menu-item-description'][$k] ) ? $_POST['menu-item-description'][$k]: '';
|
||||
@ -116,11 +116,11 @@ switch ( $action ) {
|
||||
$menu_item_target = isset( $_POST['menu-item-target'][$k] ) ? $_POST['menu-item-target'][$k] : 0;
|
||||
$menu_item_classes = isset( $_POST['menu-item-classes'][$k] ) ? $_POST['menu-item-classes'][$k] : '';
|
||||
$menu_item_xfn = isset( $_POST['menu-item-xfn'][$k] ) ? $_POST['menu-item-xfn'][$k] : '';
|
||||
|
||||
|
||||
// Menu item title can't be blank
|
||||
if ( '' == $menu_item_title )
|
||||
continue;
|
||||
|
||||
|
||||
// Populate the menu item
|
||||
$post = array( 'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'post_author' => $user_ID,
|
||||
'ping_status' => 0, 'post_parent' => $menu_item_parent_id, 'menu_order' => $menu_item_position,
|
||||
@ -136,7 +136,7 @@ switch ( $action ) {
|
||||
unset( $menu_items[$menu_item_db_id] );
|
||||
}
|
||||
$parent_menu_ids[$k] = $menu_item_db_id;
|
||||
|
||||
|
||||
// @todo sanitize type append and ID.
|
||||
update_post_meta( $menu_item_db_id, 'menu_item_type', $menu_item_type );
|
||||
update_post_meta( $menu_item_db_id, 'menu_item_append', $menu_item_append );
|
||||
@ -145,11 +145,11 @@ switch ( $action ) {
|
||||
// @todo handle sanitizing multiple classes separated by whitespace.
|
||||
update_post_meta( $menu_item_db_id, 'menu_item_classes', sanitize_html_class($menu_item_classes) );
|
||||
update_post_meta( $menu_item_db_id, 'menu_item_xfn', sanitize_html_class($menu_item_xfn) );
|
||||
|
||||
|
||||
// @todo: only save custom link urls.
|
||||
update_post_meta( $menu_item_db_id, 'menu_item_url', esc_url_raw( $menu_item_url ) );
|
||||
}
|
||||
|
||||
|
||||
// Remove menu items from the menu that weren't in $_POST
|
||||
if ( !empty( $menu_items ) ) {
|
||||
foreach ( array_keys( $menu_items ) as $menu_item_id ) {
|
||||
@ -177,7 +177,7 @@ if ( !$recently_edited && is_nav_menu($nav_menu_selected_id) ) {
|
||||
|
||||
// Else try to grab the first menu from the menus list
|
||||
} elseif ( 0 == $nav_menu_selected_id && ! empty($nav_menus) ) {
|
||||
$nav_menu_selected_id = $nav_menus[0]->term_id;
|
||||
$nav_menu_selected_id = $nav_menus[0]->term_id;
|
||||
}
|
||||
|
||||
// Update the user's setting
|
||||
@ -214,7 +214,7 @@ require_once( 'admin-header.php' );
|
||||
<?php
|
||||
foreach ( $nav_menus as $_nav_menu ) {
|
||||
$sep = end( $nav_menus ) == $_nav_menu ? '' : ' | ';
|
||||
|
||||
|
||||
if ( $nav_menu_selected_id == $_nav_menu->term_id )
|
||||
echo '<li><a href="'. admin_url( 'nav-menus.php?action=edit&menu=' . esc_attr($_nav_menu->term_id) ) .'" class="current">'. esc_html( $_nav_menu->name ) .'</a>'. $sep .'</li>';
|
||||
else
|
||||
@ -232,16 +232,16 @@ require_once( 'admin-header.php' );
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="li-count" id="li-count" value="0" />
|
||||
<input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
|
||||
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
<?php if ( is_nav_menu($nav_menu_selected_id) ) : ?>
|
||||
<div id="menu-container" class="postbox">
|
||||
<h3 class="hndle"><?php echo esc_html( $nav_menu_selected_title ); ?></h3>
|
||||
<div class="inside">
|
||||
|
||||
|
||||
<?php echo wp_get_nav_menu( array( 'context' => 'backend', 'menu' => $nav_menu_selected_id ) ); ?>
|
||||
|
||||
|
||||
</div><!-- /.inside -->
|
||||
<!-- /#nav-menu-canvas .postbox-->
|
||||
</div>
|
||||
@ -252,9 +252,9 @@ require_once( 'admin-header.php' );
|
||||
</div><!-- /#post-body-content-->
|
||||
</div><!--- /#post-body -->
|
||||
<div id="menu-settings-column" class="inner-sidebar">
|
||||
|
||||
|
||||
<?php do_meta_boxes( 'menus', 'side', null ); ?>
|
||||
|
||||
|
||||
</div><!-- /#menu-settings-column -->
|
||||
</form><!--/#update-nav-menu-->
|
||||
<br class="clear" />
|
||||
|
@ -278,7 +278,7 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>
|
||||
echo "\ndefine( '$c', '$v' );";
|
||||
}
|
||||
?></textarea>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
|
@ -29,7 +29,7 @@ if ( empty($option_page) ) // This is for back compat and will eventually be rem
|
||||
|
||||
if ( !current_user_can('manage_options') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
|
||||
if ( is_multisite() && !is_super_admin() && 'update' != $action )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
|
@ -96,21 +96,21 @@ if ( !empty($action) ) {
|
||||
exit;
|
||||
break;
|
||||
case 'update-selected' :
|
||||
|
||||
|
||||
check_admin_referer( 'bulk-manage-plugins' );
|
||||
|
||||
|
||||
if ( isset( $_GET['plugins'] ) )
|
||||
$plugins = explode( ',', $_GET['plugins'] );
|
||||
elseif ( isset( $_POST['checked'] ) )
|
||||
$plugins = (array) $_POST['checked'];
|
||||
else
|
||||
$plugins = array();
|
||||
|
||||
|
||||
$title = __( 'Upgrade Plugins' );
|
||||
$parent_file = 'plugins.php';
|
||||
|
||||
require_once( 'admin-header.php' );
|
||||
|
||||
|
||||
echo '<div class="wrap">';
|
||||
screen_icon();
|
||||
echo '<h2>' . esc_html( $title ) . '</h2>';
|
||||
|
@ -90,13 +90,13 @@ endif;
|
||||
$cats = get_taxonomy('category');
|
||||
$tags = get_taxonomy('post_tag');
|
||||
|
||||
if ( current_user_can($cats->manage_cap) || current_user_can($tags->manage_cap) ) : ?>
|
||||
<div class="tool-box">
|
||||
if ( current_user_can($cats->manage_cap) || current_user_can($tags->manage_cap) ) : ?>
|
||||
<div class="tool-box">
|
||||
<h3 class="title"><?php _e('Category/Tag Conversion') ?></h3>
|
||||
<p><?php printf(__('Use this to convert <a href="%s">categories to tags</a>, or <a href="%s">tags to categories</a>.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&step=3'); ?></p>
|
||||
</div>
|
||||
<p><?php printf(__('Use this to convert <a href="%s">categories to tags</a>, or <a href="%s">tags to categories</a>.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&step=3'); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
|
||||
do_action( 'tool_box' );
|
||||
?>
|
||||
|
@ -267,7 +267,7 @@ function list_theme_updates() {
|
||||
<?php
|
||||
foreach ( (array) $themes as $stylesheet => $theme_data) {
|
||||
$screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot;
|
||||
|
||||
|
||||
echo "
|
||||
<tr class='active'>
|
||||
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($stylesheet) . "' /></th>
|
||||
|
@ -42,7 +42,7 @@ if ( isset($_GET['action']) ) {
|
||||
$upgrader->bulk_upgrade( $plugins );
|
||||
|
||||
iframe_footer();
|
||||
|
||||
|
||||
} elseif ( 'upgrade-plugin' == $action ) {
|
||||
if ( ! current_user_can('update_plugins') )
|
||||
wp_die(__('You do not have sufficient permissions to update plugins for this blog.'));
|
||||
|
@ -396,7 +396,7 @@ if ( isset($_GET['detached']) ) { ?>
|
||||
if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
|
||||
echo esc_html( strtoupper( $matches[1] ) );
|
||||
else
|
||||
echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
|
||||
echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
|
||||
?>
|
||||
|
||||
<div class="row-actions">
|
||||
|
@ -86,7 +86,7 @@ foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description',
|
||||
add_filter( $filter, 'esc_html' );
|
||||
}
|
||||
|
||||
// Format titles
|
||||
// Format titles
|
||||
foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) {
|
||||
add_filter( $filter, 'wptexturize' );
|
||||
add_filter( $filter, 'strip_tags' );
|
||||
|
@ -1029,7 +1029,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
}
|
||||
|
||||
function _get_current_taxonomy($instance) {
|
||||
if ( !empty($instance['taxonomy']) && is_taxonomy($instance['taxonomy']) )
|
||||
if ( !empty($instance['taxonomy']) && is_taxonomy($instance['taxonomy']) )
|
||||
return $instance['taxonomy'];
|
||||
|
||||
return 'post_tag';
|
||||
@ -1047,21 +1047,21 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
$widget_ops = array( 'description' => __('Use this widget to add one of your navigation menus as a widget.') );
|
||||
parent::WP_Widget( 'nav_menu', __('Navigation Menu'), $widget_ops );
|
||||
}
|
||||
|
||||
|
||||
function widget($args, $instance) {
|
||||
// Get menu
|
||||
$nav_menu = wp_get_nav_menu_object( $instance['nav_menu'] );
|
||||
|
||||
|
||||
if ( !$nav_menu )
|
||||
return;
|
||||
|
||||
return;
|
||||
|
||||
echo $args['before_widget'];
|
||||
|
||||
|
||||
if ( isset($instance['title']) )
|
||||
echo $args['before_title'] . $instance['title'] . $args['after_title'];
|
||||
|
||||
|
||||
wp_nav_menu( array( 'menu' => $nav_menu ) );
|
||||
|
||||
|
||||
echo $args['after_widget'];
|
||||
}
|
||||
|
||||
@ -1074,10 +1074,10 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
function form( $instance ) {
|
||||
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
||||
$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
|
||||
|
||||
|
||||
// Get menus
|
||||
$menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );
|
||||
|
||||
|
||||
// If no menus exists, direct the user to go and create some.
|
||||
if ( !$menus ) {
|
||||
echo '<p>'. sprintf( __('No menus have been created yet. <a href="%s">Create some</a>.'), admin_url('nav-menus.php') ) .'</p>';
|
||||
|
@ -756,7 +756,7 @@ function sanitize_user( $username, $strict = false ) {
|
||||
* Keys are used as internal identifiers. They should be lowercase ASCII. Dashes and underscores are allowed.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
*
|
||||
* @param string $key String key
|
||||
* @return string Sanitized key
|
||||
*/
|
||||
|
@ -1825,7 +1825,7 @@ function is_blog_installed() {
|
||||
if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table )
|
||||
continue;
|
||||
if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table )
|
||||
continue;
|
||||
continue;
|
||||
|
||||
// If visiting repair.php, return true and let it take over.
|
||||
if ( defined('WP_REPAIRING') )
|
||||
|
@ -316,7 +316,7 @@ function load_textdomain( $domain, $mofile ) {
|
||||
|
||||
/**
|
||||
* Unloads translations for a domain
|
||||
*
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $domain Textdomain to be unloaded
|
||||
* @return bool Whether textdomain was unloaded
|
||||
|
@ -2059,7 +2059,7 @@ function wp_ajaxurl() {
|
||||
* via the get_shortlink filter.
|
||||
*
|
||||
* @since 3.0.0.
|
||||
*
|
||||
*
|
||||
* @param int $id A post or blog id. Default is 0, which means the current post or blog.
|
||||
* @param string $contex Whether the id is a 'blog' id, 'post' id, or 'media' id. If 'post', the post_type of the post is consulted. If 'query', the current query is consulted to determine the id and context. Default is 'post'.
|
||||
* @param bool $allow_slugs Whether to allow post slugs in the shortlink. It is up to the plugin how and whether to honor this.
|
||||
|
@ -25,14 +25,14 @@
|
||||
function wp_nav_menu( $args = array() ) {
|
||||
$defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true,
|
||||
'fallback_cb' => 'wp_page_menu', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', );
|
||||
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
$args = apply_filters( 'wp_nav_menu_args', $args );
|
||||
$args = (object) $args;
|
||||
|
||||
// Get the nav menu
|
||||
$menu = wp_get_nav_menu_object( $args->menu );
|
||||
|
||||
|
||||
// If we couldn't find a menu based off the name, id or slug,
|
||||
// get the first menu that has items.
|
||||
if ( !$menu ) {
|
||||
@ -51,7 +51,7 @@ function wp_nav_menu( $args = array() ) {
|
||||
|
||||
if ( 'div' == $args->container ) {
|
||||
$class = $args->container_class ? ' class="' . esc_attr($args->container_class) . '"' : '';
|
||||
|
||||
|
||||
if ( is_nav_menu($menu) ) {
|
||||
$nav_menu .= '<div id="menu-' . $menu->slug . '"'. $class .'>';
|
||||
} else {
|
||||
@ -63,7 +63,7 @@ function wp_nav_menu( $args = array() ) {
|
||||
|
||||
if ( 'div' == $args->container )
|
||||
$nav_menu .= '</div>';
|
||||
|
||||
|
||||
$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );
|
||||
|
||||
if ( $args->echo )
|
||||
@ -85,25 +85,25 @@ function wp_nav_menu( $args = array() ) {
|
||||
function wp_get_nav_menu( $args = array() ) {
|
||||
$defaults = array( 'menu' => '', 'menu_class' => 'menu', 'context' => 'frontend',
|
||||
'fallback_cb' => '', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', );
|
||||
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
$args = apply_filters( 'wp_get_nav_menu_args', $args );
|
||||
$args = (object) $args;
|
||||
|
||||
|
||||
// Variable setup
|
||||
$nav_menu = '';
|
||||
$items = '';
|
||||
$current_parent = 0;
|
||||
$parent_stack = array();
|
||||
$parent_menu_order = array();
|
||||
|
||||
|
||||
// Get the menu object
|
||||
$menu = wp_get_nav_menu_object( $args->menu );
|
||||
|
||||
|
||||
// If the menu exists, get it's items.
|
||||
if ( $menu && !is_wp_error($menu) )
|
||||
$menu_items = wp_get_nav_menu_items( $menu->term_id, 'backend' );
|
||||
|
||||
|
||||
// If no menu was found or if the menu has no items, call the fallback_cb
|
||||
if ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) ) {
|
||||
if ( function_exists($args->fallback_cb) ) {
|
||||
@ -111,7 +111,7 @@ function wp_get_nav_menu( $args = array() ) {
|
||||
return call_user_func( $args->fallback_cb, $_args );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ( $menu_items as $key => $menu_item ) {
|
||||
// Set up the $menu_item variables
|
||||
$menu_item = wp_setup_nav_menu_item( $menu_item, 'frontend' );
|
||||
@ -119,10 +119,10 @@ function wp_get_nav_menu( $args = array() ) {
|
||||
$type = $menu_item->append;
|
||||
$maybe_value = 'frontend' == $args->context ? '' : ' value="'. $menu_item->ID .'"';
|
||||
$classes = 'frontend' == $args->context ? ' class="menu-item-type-'. $type . $menu_item->li_class .'"' : '';
|
||||
|
||||
|
||||
$items .= '<li id="menu-item-'. $menu_item->ID .'"'. $maybe_value . $classes .'>';
|
||||
$items .= wp_get_nav_menu_item( $menu_item, $args->context, $args );
|
||||
|
||||
|
||||
// Indent children
|
||||
$last_item = ( count( $menu_items ) == $menu_item->menu_order );
|
||||
if ( $last_item || $current_parent != $menu_items[$key + 1]->post_parent ) {
|
||||
@ -141,11 +141,11 @@ function wp_get_nav_menu( $args = array() ) {
|
||||
$items .= '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// CSS class
|
||||
$ul_class = $args->menu_class ? ' class="'. $args->menu_class .'"' : '';
|
||||
$nav_menu .= '<ul'. $ul_class .'>';
|
||||
|
||||
|
||||
// Allow plugins to hook into the menu to add their own <li>'s
|
||||
if ( 'frontend' == $args->context ) {
|
||||
$items = apply_filters( 'wp_nav_menu_items', $items, $args );
|
||||
@ -154,9 +154,9 @@ function wp_get_nav_menu( $args = array() ) {
|
||||
} else {
|
||||
$nav_menu .= $items;
|
||||
}
|
||||
|
||||
|
||||
$nav_menu .= '</ul>';
|
||||
|
||||
|
||||
return apply_filters( 'wp_get_nav_menu', $nav_menu );
|
||||
}
|
||||
|
||||
@ -179,15 +179,15 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array(
|
||||
$attributes .= ( isset($menu_item->classes) && '' != $menu_item->classes ) ? ' class="'. esc_attr($menu_item->classes) .'"' : '';
|
||||
$attributes .= ( isset($menu_item->xfn) && '' != $menu_item->xfn ) ? ' rel="'. esc_attr($menu_item->xfn) .'"' : '';
|
||||
$attributes .= ( isset($menu_item->url) && '' != $menu_item->url ) ? ' href="'. esc_attr($menu_item->url) .'"' : '';
|
||||
|
||||
|
||||
$output .= esc_html( $args->before_link );
|
||||
$output .= '<a'. $attributes .'>';
|
||||
$output .= esc_html( $args->before_title . $menu_item->title . $args->after_title );
|
||||
$output .= '</a>';
|
||||
$output .= esc_html( $args->after_link );
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'backend':
|
||||
$output .= '<dl><dt>';
|
||||
$output .= '<span class="item-title">'. esc_html($menu_item->title) .'</span>';
|
||||
@ -204,13 +204,13 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array(
|
||||
$label = $menu_item->append;
|
||||
}
|
||||
$output .= '<span class="item-type">'. esc_html($label) .'</span>';
|
||||
|
||||
|
||||
// Actions
|
||||
$output .= '<a class="item-edit thickbox" id="edit'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'" title="'. __('Edit Menu Item') .'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'. __('Edit') .'</a> | ';
|
||||
$output .= '<a class="item-delete" id="delete'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'">'. __('Delete') .'</a>';
|
||||
|
||||
|
||||
$output .= '</dt></dl>';
|
||||
|
||||
|
||||
// Menu Item Settings
|
||||
$output .= '<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->ID ) .'" />';
|
||||
$output .= '<input type="hidden" name="menu-item-object-id[]" id="menu-item-object-id'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->object_id ) .'" />';
|
||||
@ -226,11 +226,11 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array(
|
||||
$output .= '<input type="hidden" name="menu-item-attr-title[]" id="menu-item-attr-title'. esc_attr( $menu_item->menu_order ) .'" value="'.esc_attr( $menu_item->post_excerpt ) .'" />';
|
||||
$output .= '<input type="hidden" name="menu-item-target[]" id="menu-item-target'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->target ) .'" />';
|
||||
break;
|
||||
|
||||
|
||||
case 'custom':
|
||||
$menu_id = 'menu-item-' . $menu_item->db_id;
|
||||
$output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( $menu_id ) .'" name="'. esc_attr( $menu_item->title ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>';
|
||||
|
||||
|
||||
// Menu item hidden fields
|
||||
$output .= '<input type="hidden" class="menu-item-db-id" value="'. esc_attr( $menu_item->db_id ) .'" />';
|
||||
$output .= '<input type="hidden" class="menu-item-object-id" value="'. esc_attr( $menu_item->object_id ) .'" />';
|
||||
@ -245,12 +245,12 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array(
|
||||
$output .= '<input type="hidden" class="menu-item-classes" value="'. esc_attr( $menu_item->classes ) .'" />';
|
||||
$output .= '<input type="hidden" class="menu-item-xfn" value="'. esc_attr( $menu_item->xfn ) .'" />';
|
||||
break;
|
||||
|
||||
|
||||
case 'taxonomy':
|
||||
case 'post_type':
|
||||
$menu_id = 'menu-item-' . $menu_item->db_id;
|
||||
$output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( $menu_id ) .'" name="'. esc_attr( $menu_item->title ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>';
|
||||
|
||||
|
||||
// Menu item hidden fields
|
||||
$output .= '<input type="hidden" class="menu-item-db-id" value="0" />';
|
||||
$output .= '<input type="hidden" class="menu-item-object-id" value="'. esc_attr( $menu_item->object_id ) .'" />';
|
||||
@ -262,7 +262,7 @@ function wp_get_nav_menu_item( $menu_item, $context = 'frontend', $args = array(
|
||||
$output .= '<input type="hidden" class="menu-item-append" value="'. esc_attr( $menu_item->append ) .'" />';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
?>
|
@ -118,21 +118,21 @@ function wp_get_nav_menus() {
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $menu menu name, id, or slug
|
||||
* @param string $args
|
||||
* @param string $args
|
||||
* @return mixed $items array of menu items, else false.
|
||||
*/
|
||||
function wp_get_nav_menu_items( $menu, $args = array() ) {
|
||||
$menu = wp_get_nav_menu_object( $menu );
|
||||
|
||||
|
||||
if ( !$menu )
|
||||
return false;
|
||||
|
||||
|
||||
$items = get_objects_in_term( $menu->term_id, 'nav_menu' );
|
||||
|
||||
if ( ! empty( $items ) ) {
|
||||
$defaults = array( 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order' );
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
if ( count( $items ) > 1 )
|
||||
if ( count( $items ) > 1 )
|
||||
$args['include'] = implode( ',', $items );
|
||||
else
|
||||
$args['include'] = $items[0];
|
||||
@ -164,7 +164,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
|
||||
*/
|
||||
function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_object = '' ) {
|
||||
global $wp_query;
|
||||
|
||||
|
||||
switch ( $menu_item_type ) {
|
||||
case 'frontend':
|
||||
$menu_item->db_id = (int) $menu_item->ID;
|
||||
@ -173,26 +173,26 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_
|
||||
$menu_item->type = get_post_meta( $menu_item->ID, 'menu_item_type', true );
|
||||
|
||||
$menu_item->append = get_post_meta( $menu_item->ID, 'menu_item_append', true );
|
||||
|
||||
|
||||
$menu_item->title = $menu_item->post_title;
|
||||
$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->attr_title = strip_tags( $menu_item->post_excerpt );
|
||||
$menu_item->description = strip_tags( $menu_item->post_content );
|
||||
|
||||
|
||||
$menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );;
|
||||
$menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true );
|
||||
$menu_item->li_class = ( $menu_item->object_id == $wp_query->get_queried_object_id() ) ? ' current_page_item' : '';
|
||||
break;
|
||||
|
||||
|
||||
case 'custom':
|
||||
$menu_item->db_id = (int) $menu_item->ID;
|
||||
$menu_item->object_id = (int) $menu_item->ID;
|
||||
$menu_item->parent_id = (int) $menu_item->post_parent;
|
||||
$menu_item->type = 'custom'; //$menu_item_type
|
||||
$menu_item->append = 'custom';
|
||||
|
||||
|
||||
$menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
|
||||
$menu_item->description = strip_tags( $menu_item->post_content );
|
||||
|
||||
@ -200,31 +200,31 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_
|
||||
$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 );
|
||||
break;
|
||||
|
||||
|
||||
case 'post_type':
|
||||
$menu_item->db_id = 0;
|
||||
$menu_item->object_id = (int) $menu_item->ID;
|
||||
$menu_item->parent_id = (int) $menu_item->post_parent;
|
||||
$menu_item->type = $menu_item_type;
|
||||
|
||||
|
||||
$object = get_post_type_object( $menu_item_object );
|
||||
$menu_item->append = $object->name;
|
||||
|
||||
$menu_item->title = $menu_item->post_title;
|
||||
$menu_item->url = get_permalink( $menu_item->ID );
|
||||
$menu_item->target = '_self';
|
||||
|
||||
|
||||
$menu_item->attr_title = '';
|
||||
$menu_item->description = strip_tags( $menu_item->post_content );
|
||||
break;
|
||||
|
||||
|
||||
case 'taxonomy':
|
||||
$menu_item->ID = $menu_item->term_id;
|
||||
$menu_item->db_id = 0;
|
||||
$menu_item->object_id = (int) $menu_item->term_id;
|
||||
$menu_item->parent_id = (int) $menu_item->parent;
|
||||
$menu_item->type = $menu_item_type;
|
||||
|
||||
|
||||
$object = get_taxonomy( $menu_item_object );
|
||||
$menu_item->append = $object->name;
|
||||
|
||||
@ -238,7 +238,7 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_
|
||||
|
||||
$menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );
|
||||
$menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true );
|
||||
|
||||
|
||||
return $menu_item;
|
||||
}
|
||||
?>
|
@ -166,7 +166,7 @@ function cache_users( $users ) {
|
||||
$list = implode(',', $clean);
|
||||
|
||||
$results = $wpdb->get_results("SELECT * FROM $wpdb->users WHERE ID IN ($list)");
|
||||
|
||||
|
||||
_fill_many_users($results);
|
||||
}
|
||||
endif;
|
||||
|
@ -2930,12 +2930,12 @@ function &get_pages($args = '') {
|
||||
extract( $r, EXTR_SKIP );
|
||||
$number = (int) $number;
|
||||
$offset = (int) $offset;
|
||||
|
||||
|
||||
// Make sure the post type is hierarchical
|
||||
$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
|
||||
if ( !in_array( $post_type, $hierarchical_post_types ) )
|
||||
return false;
|
||||
|
||||
|
||||
// Make sure we have a valid post status
|
||||
if ( !in_array($post_status, get_post_stati()) )
|
||||
return false;
|
||||
@ -3031,7 +3031,7 @@ function &get_pages($args = '') {
|
||||
|
||||
if ( $parent >= 0 )
|
||||
$where .= $wpdb->prepare(' AND post_parent = %d ', $parent);
|
||||
|
||||
|
||||
$where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status );
|
||||
|
||||
$query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where ";
|
||||
@ -3178,7 +3178,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) {
|
||||
$post_category = array( get_option('default_category') );
|
||||
else
|
||||
$post_category = array();
|
||||
}
|
||||
}
|
||||
|
||||
// Are we updating or creating?
|
||||
if ( !empty($ID) ) {
|
||||
@ -3814,7 +3814,7 @@ function get_lastpostmodified($timezone = 'server') {
|
||||
$lastpostmodified = wp_cache_get( "lastpostmodified:$timezone", 'timeinfo' );
|
||||
if ( $lastpostmodified )
|
||||
return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
|
||||
|
||||
|
||||
switch ( strtolower($timezone) ) {
|
||||
case 'gmt':
|
||||
$lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1");
|
||||
@ -3826,13 +3826,13 @@ function get_lastpostmodified($timezone = 'server') {
|
||||
$lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$lastpostdate = get_lastpostdate($timezone);
|
||||
if ( $lastpostdate > $lastpostmodified )
|
||||
$lastpostmodified = $lastpostdate;
|
||||
|
||||
if ( $lastpostmodified )
|
||||
wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' );
|
||||
if ( $lastpostmodified )
|
||||
wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' );
|
||||
|
||||
return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
|
||||
}
|
||||
|
@ -224,9 +224,9 @@ function is_tag( $slug = '' ) {
|
||||
* Whether the current query is for the given taxonomy and/or term.
|
||||
*
|
||||
* If no taxonomy argument is set, returns true if any taxonomy is queried.
|
||||
* If the taxonomy argument is passed but no term argument, returns true
|
||||
* If the taxonomy argument is passed but no term argument, returns true
|
||||
* if the taxonomy or taxonomies in the argument are being queried.
|
||||
* If both taxonomy and term arguments are passed, returns true
|
||||
* If both taxonomy and term arguments are passed, returns true
|
||||
* if the current query is for a term contained in the terms argument
|
||||
* which has a taxonomy contained in the taxonomy argument.
|
||||
*
|
||||
@ -253,9 +253,9 @@ function is_tax( $taxonomy = '', $term = '' ) {
|
||||
if ( empty( $term ) ) // Only a Taxonomy provided
|
||||
return isset($queried_object->taxonomy) && count( $tax_array ) && in_array($queried_object->taxonomy, $tax_array);
|
||||
|
||||
return isset($queried_object->term_id) &&
|
||||
return isset($queried_object->term_id) &&
|
||||
count(array_intersect(
|
||||
array($queried_object->term_id, $queried_object->name, $queried_object->slug),
|
||||
array($queried_object->term_id, $queried_object->name, $queried_object->slug),
|
||||
$term_array
|
||||
));
|
||||
}
|
||||
|
@ -1780,10 +1780,10 @@ class WP_Rewrite {
|
||||
} else {
|
||||
$siteurl = get_option( 'siteurl' );
|
||||
$siteurl_len = strlen( $siteurl );
|
||||
if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len )
|
||||
if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len )
|
||||
$content_path = substr( WP_CONTENT_URL, $siteurl_len + 1 );
|
||||
else
|
||||
$content_path = 'wp-content';
|
||||
$content_path = 'wp-content';
|
||||
$rules = '<rule name="wordpress - strip index.php" stopProcessing="false">
|
||||
<match url="^index.php/(.*)$" />
|
||||
<action type="Rewrite" url="{R:1}" />
|
||||
|
@ -160,7 +160,7 @@ function get_taxonomy( $taxonomy ) {
|
||||
*/
|
||||
function is_taxonomy( $taxonomy ) {
|
||||
global $wp_taxonomies;
|
||||
|
||||
|
||||
return isset($wp_taxonomies[$taxonomy]);
|
||||
}
|
||||
|
||||
@ -261,12 +261,12 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
||||
}
|
||||
|
||||
if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) {
|
||||
$args['rewrite'] = wp_parse_args($args['rewrite'], array(
|
||||
'slug' => sanitize_title_with_dashes($taxonomy),
|
||||
'with_front' => true,
|
||||
));
|
||||
$wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
|
||||
$wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
|
||||
$args['rewrite'] = wp_parse_args($args['rewrite'], array(
|
||||
'slug' => sanitize_title_with_dashes($taxonomy),
|
||||
'with_front' => true,
|
||||
));
|
||||
$wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
|
||||
$wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
|
||||
}
|
||||
|
||||
if ( is_null($args['show_ui']) )
|
||||
|
@ -235,7 +235,7 @@ function signup_user($user_name = '', $user_email = '', $errors = '') {
|
||||
$signup[ esc_html( $_POST[ 'signup_for' ] ) ] = 'checked="checked"';
|
||||
else
|
||||
$signup[ 'blog' ] = 'checked="checked"';
|
||||
|
||||
|
||||
//TODO - This doesn't seem to do anything do we really need it?
|
||||
$signup['user'] = isset( $signup['user'] ) ? $signup['user'] : '';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user