mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 06:52:19 +01:00
Strip trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@14924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
15d96a96b9
commit
1a552dd029
@ -1071,7 +1071,7 @@ table.widefat .spam a:hover,
|
|||||||
|
|
||||||
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
|
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
|
||||||
#adminmenu li.current a.menu-top {
|
#adminmenu li.current a.menu-top {
|
||||||
background: #aaa url(../images/menu-bits.gif) top left repeat-x;
|
background: #aaa url(../images/menu-bits.gif) top left repeat-x;
|
||||||
border: #aaa 1px solid;
|
border: #aaa 1px solid;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,6 @@ textarea {
|
|||||||
.message {
|
.message {
|
||||||
border: 1px solid #e6db55;
|
border: 1px solid #e6db55;
|
||||||
padding: 0.3em 0.6em;
|
padding: 0.3em 0.6em;
|
||||||
margin: 5px 0 15px;
|
margin: 5px 0 15px;
|
||||||
background-color: #ffffe0;
|
background-color: #ffffe0;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
}
|
}
|
||||||
#side-sortables .potential-menu-item ul {
|
#side-sortables .potential-menu-item ul {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button Primary Actions */
|
/* Button Primary Actions */
|
||||||
|
@ -213,7 +213,7 @@ body {
|
|||||||
#menu-container .submit { margin: 0px 0px 10px; padding: 0px; }
|
#menu-container .submit { margin: 0px 0px 10px; padding: 0px; }
|
||||||
|
|
||||||
.meta-sep,
|
.meta-sep,
|
||||||
.submitdelete,
|
.submitdelete,
|
||||||
.submitcancel {
|
.submitcancel {
|
||||||
display:block;
|
display:block;
|
||||||
float:left;
|
float:left;
|
||||||
@ -239,7 +239,7 @@ body {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-controls {
|
.button-controls {
|
||||||
clear:both;
|
clear:both;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ body {
|
|||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu ul {
|
.menu ul {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.menu ul.sub-menu {
|
.menu ul.sub-menu {
|
||||||
@ -525,18 +525,18 @@ clear:both;
|
|||||||
|
|
||||||
/* Clearfix */
|
/* Clearfix */
|
||||||
#menu-item-name-wrap:after,
|
#menu-item-name-wrap:after,
|
||||||
#menu-item-url-wrap:after,
|
#menu-item-url-wrap:after,
|
||||||
#menu-name-label:after,
|
#menu-name-label:after,
|
||||||
#menu-settings-column .inside:after,
|
#menu-settings-column .inside:after,
|
||||||
#nav-menus-frame:after,
|
#nav-menus-frame:after,
|
||||||
#post-body-content:after,
|
#post-body-content:after,
|
||||||
.button-controls:after,
|
.button-controls:after,
|
||||||
.major-publishing-actions:after,
|
.major-publishing-actions:after,
|
||||||
.menu-item-settings:after {
|
.menu-item-settings:after {
|
||||||
clear: both;
|
clear: both;
|
||||||
content: ".";
|
content: ".";
|
||||||
display: block;
|
display: block;
|
||||||
height: 0;
|
height: 0;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
#nav-menus-frame, .button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; }
|
#nav-menus-frame, .button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; }
|
||||||
|
@ -1175,14 +1175,14 @@ div.comment-item:hover .row-actions {
|
|||||||
#sidemenu li a span.update-plugins {
|
#sidemenu li a span.update-plugins {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
font-family: Helvetica, Arial, sans-serif;
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
line-height: 17px;
|
line-height: 17px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
-moz-border-radius: 10px;
|
-moz-border-radius: 10px;
|
||||||
-khtml-border-radius: 10px;
|
-khtml-border-radius: 10px;
|
||||||
-webkit-border-radius: 10px;
|
-webkit-border-radius: 10px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ class Custom_Image_Header {
|
|||||||
elseif ( 2 == $step )
|
elseif ( 2 == $step )
|
||||||
wp_enqueue_style('imgareaselect');
|
wp_enqueue_style('imgareaselect');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if header text is allowed
|
* Check if header text is allowed
|
||||||
*
|
*
|
||||||
@ -272,7 +272,7 @@ class Custom_Image_Header {
|
|||||||
jQuery('#text-color').val(old_color);
|
jQuery('#text-color').val(old_color);
|
||||||
jQuery('#name').css('color', old_color);
|
jQuery('#name').css('color', old_color);
|
||||||
jQuery('#desc').css('color', old_color);
|
jQuery('#desc').css('color', old_color);
|
||||||
pickColor(old_color);
|
pickColor(old_color);
|
||||||
} else {
|
} else {
|
||||||
//Hide text
|
//Hide text
|
||||||
jQuery( text_objects.toString() ).hide();
|
jQuery( text_objects.toString() ).hide();
|
||||||
@ -371,7 +371,7 @@ class Custom_Image_Header {
|
|||||||
y2: yinit,
|
y2: yinit,
|
||||||
maxHeight: <?php echo HEADER_IMAGE_HEIGHT; ?>,
|
maxHeight: <?php echo HEADER_IMAGE_HEIGHT; ?>,
|
||||||
maxWidth: <?php echo HEADER_IMAGE_WIDTH; ?>,
|
maxWidth: <?php echo HEADER_IMAGE_WIDTH; ?>,
|
||||||
onInit: function () {
|
onInit: function () {
|
||||||
jQuery('#width').val(xinit);
|
jQuery('#width').val(xinit);
|
||||||
jQuery('#height').val(yinit);
|
jQuery('#height').val(yinit);
|
||||||
},
|
},
|
||||||
|
@ -48,7 +48,7 @@ $stati = "'" . implode("', '", get_post_stati( array( 'internal' => false ), 'na
|
|||||||
if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) {
|
if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) {
|
||||||
foreach ( $monthyears as $k => $monthyear )
|
foreach ( $monthyears as $k => $monthyear )
|
||||||
$monthyears[$k]->lmonth = $wp_locale->get_month( $monthyear->month, 2 );
|
$monthyears[$k]->lmonth = $wp_locale->get_month( $monthyear->month, 2 );
|
||||||
for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) {
|
for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) {
|
||||||
$dateoptions .= "\t<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n";
|
$dateoptions .= "\t<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n";
|
||||||
$edateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise( $monthyears[$e]->emonth, 2 ) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n";
|
$edateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise( $monthyears[$e]->emonth, 2 ) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n";
|
||||||
}
|
}
|
||||||
|
@ -1266,7 +1266,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
|
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
|
||||||
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
|
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
|
||||||
|
|
||||||
if ( $this->type == 'web' )
|
if ( $this->type == 'web' )
|
||||||
$install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
|
$install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
|
||||||
|
@ -25,65 +25,65 @@ define('WXR_VERSION', '1.0');
|
|||||||
*/
|
*/
|
||||||
function export_wp( $args = array() ) {
|
function export_wp( $args = array() ) {
|
||||||
global $wpdb, $post_ids, $post, $wp_taxonomies;
|
global $wpdb, $post_ids, $post, $wp_taxonomies;
|
||||||
|
|
||||||
if ( ! is_array( $args ) )
|
if ( ! is_array( $args ) )
|
||||||
$args = array( 'author' => $args );
|
$args = array( 'author' => $args );
|
||||||
|
|
||||||
$defaults = array( 'author' => null, 'taxonomy' => null, 'post_type' => null, 'post_status' => null, 'start_date' => null, 'end_date' => null );
|
$defaults = array( 'author' => null, 'taxonomy' => null, 'post_type' => null, 'post_status' => null, 'start_date' => null, 'end_date' => null );
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
extract($args);
|
extract($args);
|
||||||
|
|
||||||
do_action('export_wp');
|
do_action('export_wp');
|
||||||
|
|
||||||
if( strlen( $start_date ) > 4 && strlen( $end_date ) > 4 )
|
if( strlen( $start_date ) > 4 && strlen( $end_date ) > 4 )
|
||||||
$filename = 'wordpress.' . $start_date . '.' . $end_date . '.xml';
|
$filename = 'wordpress.' . $start_date . '.' . $end_date . '.xml';
|
||||||
else
|
else
|
||||||
$filename = 'wordpress.' . date( 'Y-m-d' ) . '.xml';
|
$filename = 'wordpress.' . date( 'Y-m-d' ) . '.xml';
|
||||||
|
|
||||||
header( 'Content-Description: File Transfer' );
|
header( 'Content-Description: File Transfer' );
|
||||||
header( 'Content-Disposition: attachment; filename=' . $filename );
|
header( 'Content-Disposition: attachment; filename=' . $filename );
|
||||||
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
|
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
|
||||||
|
|
||||||
if ( $post_type && $post_type != 'all' )
|
if ( $post_type && $post_type != 'all' )
|
||||||
$where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
|
$where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
|
||||||
else
|
else
|
||||||
$where = "WHERE post_type != 'revision' ";
|
$where = "WHERE post_type != 'revision' ";
|
||||||
|
|
||||||
if ( $author && $author != 'all' ) {
|
if ( $author && $author != 'all' ) {
|
||||||
$author_id = (int) $author;
|
$author_id = (int) $author;
|
||||||
$where .= $wpdb->prepare( "AND post_author = %d ", $author_id );
|
$where .= $wpdb->prepare( "AND post_author = %d ", $author_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $start_date && $start_date != 'all' )
|
if ( $start_date && $start_date != 'all' )
|
||||||
$where .= $wpdb->prepare( "AND post_date >= %s ", $start_date );
|
$where .= $wpdb->prepare( "AND post_date >= %s ", $start_date );
|
||||||
|
|
||||||
if ( $end_date && $end_date != 'all' )
|
if ( $end_date && $end_date != 'all' )
|
||||||
$where .= $wpdb->prepare( "AND post_date < %s ", $end_date );
|
$where .= $wpdb->prepare( "AND post_date < %s ", $end_date );
|
||||||
|
|
||||||
if ( $taxonomy && is_array( $taxonomy ) ) {
|
if ( $taxonomy && is_array( $taxonomy ) ) {
|
||||||
foreach ( $taxonomy as $term_id ) {
|
foreach ( $taxonomy as $term_id ) {
|
||||||
if ( $term_id != 'all' )
|
if ( $term_id != 'all' )
|
||||||
$where .= $wpdb->prepare( "AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d) ", $term_id );
|
$where .= $wpdb->prepare( "AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d) ", $term_id );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $post_status && $post_status != 'all' )
|
if ( $post_status && $post_status != 'all' )
|
||||||
$where .= $wpdb->prepare( "AND post_status = %s", $status );
|
$where .= $wpdb->prepare( "AND post_status = %s", $status );
|
||||||
|
|
||||||
// grab a snapshot of post IDs, just in case it changes during the export
|
// 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" );
|
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" );
|
||||||
|
|
||||||
$categories = (array) get_categories( array( 'get' => 'all' ) );
|
$categories = (array) get_categories( array( 'get' => 'all' ) );
|
||||||
$tags = (array) get_tags( array( 'get' => 'all' ) );
|
$tags = (array) get_tags( array( 'get' => 'all' ) );
|
||||||
|
|
||||||
$custom_taxonomies = $wp_taxonomies;
|
$custom_taxonomies = $wp_taxonomies;
|
||||||
unset( $custom_taxonomies['category'] );
|
unset( $custom_taxonomies['category'] );
|
||||||
unset( $custom_taxonomies['post_tag'] );
|
unset( $custom_taxonomies['post_tag'] );
|
||||||
unset( $custom_taxonomies['link_category'] );
|
unset( $custom_taxonomies['link_category'] );
|
||||||
$custom_taxonomies = array_keys( $custom_taxonomies );
|
$custom_taxonomies = array_keys( $custom_taxonomies );
|
||||||
$terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
|
$terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -94,19 +94,19 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_missing_parents( $categories ) {
|
function wxr_missing_parents( $categories ) {
|
||||||
if ( ! is_array( $categories ) || empty( $categories ) )
|
if ( ! is_array( $categories ) || empty( $categories ) )
|
||||||
return array();
|
return array();
|
||||||
|
|
||||||
foreach ( $categories as $category ){
|
foreach ( $categories as $category ){
|
||||||
$parents[$category->term_id] = $category->parent;
|
$parents[$category->term_id] = $category->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
$parents = array_unique( array_diff( $parents, array_keys( $parents ) ) );
|
$parents = array_unique( array_diff( $parents, array_keys( $parents ) ) );
|
||||||
|
|
||||||
if ( $zero = array_search( '0', $parents ) )
|
if ( $zero = array_search( '0', $parents ) )
|
||||||
unset( $parents[$zero] );
|
unset( $parents[$zero] );
|
||||||
|
|
||||||
return $parents;
|
return $parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ( $parents = wxr_missing_parents( $categories ) ) {
|
while ( $parents = wxr_missing_parents( $categories ) ) {
|
||||||
$found_parents = get_categories( array( 'include' => join( ', ', $parents) ) );
|
$found_parents = get_categories( array( 'include' => join( ', ', $parents) ) );
|
||||||
if ( is_array( $found_parents ) && count( $found_parents ) )
|
if ( is_array( $found_parents ) && count( $found_parents ) )
|
||||||
@ -114,7 +114,7 @@ function export_wp( $args = array() ) {
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put them in order to be inserted with no child going before its parent
|
// Put them in order to be inserted with no child going before its parent
|
||||||
$pass = 0;
|
$pass = 0;
|
||||||
$passes = 1000 + count( $categories );
|
$passes = 1000 + count( $categories );
|
||||||
@ -125,7 +125,7 @@ function export_wp( $args = array() ) {
|
|||||||
$categories[] = $cat;
|
$categories[] = $cat;
|
||||||
}
|
}
|
||||||
unset( $categories );
|
unset( $categories );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place string in CDATA tag.
|
* Place string in CDATA tag.
|
||||||
*
|
*
|
||||||
@ -136,13 +136,13 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_cdata( $str ) {
|
function wxr_cdata( $str ) {
|
||||||
if ( seems_utf8( $str ) == false )
|
if ( seems_utf8( $str ) == false )
|
||||||
$str = utf8_encode( $str );
|
$str = utf8_encode( $str );
|
||||||
|
|
||||||
// $str = ent2ncr(esc_html($str));
|
// $str = ent2ncr(esc_html($str));
|
||||||
$str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>";
|
$str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>";
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -152,7 +152,7 @@ function export_wp( $args = array() ) {
|
|||||||
*/
|
*/
|
||||||
function wxr_site_url() {
|
function wxr_site_url() {
|
||||||
global $current_site;
|
global $current_site;
|
||||||
|
|
||||||
// mu: the base url
|
// mu: the base url
|
||||||
if ( isset( $current_site->domain ) )
|
if ( isset( $current_site->domain ) )
|
||||||
return network_home_url();
|
return network_home_url();
|
||||||
@ -160,7 +160,7 @@ function export_wp( $args = array() ) {
|
|||||||
else
|
else
|
||||||
return get_bloginfo_rss( 'url' );
|
return get_bloginfo_rss( 'url' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -171,10 +171,10 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_cat_name( $c ) {
|
function wxr_cat_name( $c ) {
|
||||||
if ( empty( $c->name ) )
|
if ( empty( $c->name ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<wp:cat_name>' . wxr_cdata( $c->name ) . '</wp:cat_name>';
|
echo '<wp:cat_name>' . wxr_cdata( $c->name ) . '</wp:cat_name>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -185,10 +185,10 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_category_description( $c ) {
|
function wxr_category_description( $c ) {
|
||||||
if ( empty( $c->description ) )
|
if ( empty( $c->description ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>';
|
echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -199,10 +199,10 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_tag_name( $t ) {
|
function wxr_tag_name( $t ) {
|
||||||
if ( empty( $t->name ) )
|
if ( empty( $t->name ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>';
|
echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -213,10 +213,10 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_tag_description( $t ) {
|
function wxr_tag_description( $t ) {
|
||||||
if ( empty( $t->description ) )
|
if ( empty( $t->description ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
|
echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -227,10 +227,10 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_term_name( $t ) {
|
function wxr_term_name( $t ) {
|
||||||
if ( empty( $t->name ) )
|
if ( empty( $t->name ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<wp:term_name>' . wxr_cdata($t->name) . '</wp:term_name>';
|
echo '<wp:term_name>' . wxr_cdata($t->name) . '</wp:term_name>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -241,10 +241,10 @@ function export_wp( $args = array() ) {
|
|||||||
function wxr_term_description( $t ) {
|
function wxr_term_description( $t ) {
|
||||||
if ( empty( $t->description ) )
|
if ( empty( $t->description ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<wp:term_description>' . wxr_cdata($t->description) . '</wp:term_description>';
|
echo '<wp:term_description>' . wxr_cdata($t->description) . '</wp:term_description>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@internal Missing Short Description}}
|
* {@internal Missing Short Description}}
|
||||||
*
|
*
|
||||||
@ -252,10 +252,10 @@ function export_wp( $args = array() ) {
|
|||||||
*/
|
*/
|
||||||
function wxr_post_taxonomy() {
|
function wxr_post_taxonomy() {
|
||||||
global $post;
|
global $post;
|
||||||
|
|
||||||
$the_list = '';
|
$the_list = '';
|
||||||
$filter = 'rss';
|
$filter = 'rss';
|
||||||
|
|
||||||
$taxonomies = get_object_taxonomies( 'post' );
|
$taxonomies = get_object_taxonomies( 'post' );
|
||||||
$terms = wp_get_post_terms( $post->ID, $taxonomies );
|
$terms = wp_get_post_terms( $post->ID, $taxonomies );
|
||||||
foreach ( (array) $terms as $term ) {
|
foreach ( (array) $terms as $term ) {
|
||||||
@ -271,9 +271,9 @@ function export_wp( $args = array() ) {
|
|||||||
}
|
}
|
||||||
echo $the_list;
|
echo $the_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
|
echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
|
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
|
||||||
<!-- It contains information about your blog's posts, comments, and categories. -->
|
<!-- It contains information about your blog's posts, comments, and categories. -->
|
||||||
@ -319,18 +319,18 @@ function export_wp( $args = array() ) {
|
|||||||
<?php if ( $terms ) : foreach ( $terms as $t ) : ?>
|
<?php if ( $terms ) : foreach ( $terms as $t ) : ?>
|
||||||
<wp:term><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $custom_taxonomies[$t->parent]->name : ''; ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
|
<wp:term><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $custom_taxonomies[$t->parent]->name : ''; ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
|
||||||
<?php endforeach; endif; ?>
|
<?php endforeach; endif; ?>
|
||||||
|
|
||||||
<?php do_action( 'rss2_head' ); ?>
|
<?php do_action( 'rss2_head' ); ?>
|
||||||
|
|
||||||
<?php if ( $post_ids ) {
|
<?php if ( $post_ids ) {
|
||||||
global $wp_query;
|
global $wp_query;
|
||||||
$wp_query->in_the_loop = true; // Fake being in the loop.
|
$wp_query->in_the_loop = true; // Fake being in the loop.
|
||||||
|
|
||||||
// fetch 20 posts at a time rather than loading the entire table into memory
|
// fetch 20 posts at a time rather than loading the entire table into memory
|
||||||
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
|
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
|
||||||
$where = "WHERE ID IN (" . join( ',', $next_posts ) . ")";
|
$where = "WHERE ID IN (" . join( ',', $next_posts ) . ")";
|
||||||
$posts = $wpdb->get_results( "SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" );
|
$posts = $wpdb->get_results( "SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" );
|
||||||
|
|
||||||
// Begin Loop
|
// Begin Loop
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
setup_postdata( $post );
|
setup_postdata( $post );
|
||||||
@ -346,7 +346,7 @@ function export_wp( $args = array() ) {
|
|||||||
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
|
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
|
||||||
<dc:creator><?php echo wxr_cdata( get_the_author() ); ?></dc:creator>
|
<dc:creator><?php echo wxr_cdata( get_the_author() ); ?></dc:creator>
|
||||||
<?php wxr_post_taxonomy() ?>
|
<?php wxr_post_taxonomy() ?>
|
||||||
|
|
||||||
<guid isPermaLink="false"><?php the_guid(); ?></guid>
|
<guid isPermaLink="false"><?php the_guid(); ?></guid>
|
||||||
<description></description>
|
<description></description>
|
||||||
<content:encoded><?php echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) ); ?></content:encoded>
|
<content:encoded><?php echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) ); ?></content:encoded>
|
||||||
@ -397,8 +397,8 @@ function export_wp( $args = array() ) {
|
|||||||
</wp:comment>
|
</wp:comment>
|
||||||
<?php } } ?>
|
<?php } } ?>
|
||||||
</item>
|
</item>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
</channel>
|
</channel>
|
||||||
|
@ -603,7 +603,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
|||||||
|
|
||||||
$needed_dirs = array_unique($needed_dirs);
|
$needed_dirs = array_unique($needed_dirs);
|
||||||
foreach ( $needed_dirs as $dir ) {
|
foreach ( $needed_dirs as $dir ) {
|
||||||
// Check the parent folders of the folders all exist within the creation array.
|
// Check the parent folders of the folders all exist within the creation array.
|
||||||
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
|
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -682,7 +682,7 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
|||||||
|
|
||||||
$needed_dirs = array_unique($needed_dirs);
|
$needed_dirs = array_unique($needed_dirs);
|
||||||
foreach ( $needed_dirs as $dir ) {
|
foreach ( $needed_dirs as $dir ) {
|
||||||
// Check the parent folders of the folders all exist within the creation array.
|
// Check the parent folders of the folders all exist within the creation array.
|
||||||
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
|
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -680,7 +680,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
|
|||||||
*/
|
*/
|
||||||
function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
|
function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
|
||||||
$taxonomy_name = $taxonomy['args']->name;
|
$taxonomy_name = $taxonomy['args']->name;
|
||||||
|
|
||||||
// paginate browsing for large numbers of objects
|
// paginate browsing for large numbers of objects
|
||||||
$per_page = 50;
|
$per_page = 50;
|
||||||
$pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
|
$pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
|
||||||
@ -966,7 +966,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
|
|||||||
$result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">';
|
$result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">';
|
||||||
$result .= __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.');
|
$result .= __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.');
|
||||||
$result .= '</div>';
|
$result .= '</div>';
|
||||||
|
|
||||||
if( empty($menu_items) )
|
if( empty($menu_items) )
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
|
@ -315,9 +315,9 @@ function bulk_edit_posts( $post_data = null ) {
|
|||||||
$taxonomy_obj = get_taxonomy($tax_name);
|
$taxonomy_obj = get_taxonomy($tax_name);
|
||||||
if ( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->cap->assign_terms ) )
|
if ( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->cap->assign_terms ) )
|
||||||
$new_terms = $tax_input[$tax_name];
|
$new_terms = $tax_input[$tax_name];
|
||||||
else
|
else
|
||||||
$new_terms = array();
|
$new_terms = array();
|
||||||
|
|
||||||
if ( $taxonomy_obj->hierarchical )
|
if ( $taxonomy_obj->hierarchical )
|
||||||
$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') );
|
$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') );
|
||||||
else
|
else
|
||||||
@ -325,7 +325,7 @@ function bulk_edit_posts( $post_data = null ) {
|
|||||||
|
|
||||||
$post_data['tax_input'][$tax_name] = array_merge( $current_terms, $new_terms );
|
$post_data['tax_input'][$tax_name] = array_merge( $current_terms, $new_terms );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($new_cats) && in_array( 'category', $tax_names ) ) {
|
if ( isset($new_cats) && in_array( 'category', $tax_names ) ) {
|
||||||
$cats = (array) wp_get_post_categories($post_ID);
|
$cats = (array) wp_get_post_categories($post_ID);
|
||||||
$post_data['post_category'] = array_unique( array_merge($cats, $new_cats) );
|
$post_data['post_category'] = array_unique( array_merge($cats, $new_cats) );
|
||||||
|
@ -709,7 +709,7 @@ Thanks!
|
|||||||
'subdomain_install' => intval( $subdomain_install ),
|
'subdomain_install' => intval( $subdomain_install ),
|
||||||
'global_terms_enabled' => global_terms_enabled() ? '1' : '0'
|
'global_terms_enabled' => global_terms_enabled() ? '1' : '0'
|
||||||
);
|
);
|
||||||
if ( !intval( $subdomain_install ) )
|
if ( !intval( $subdomain_install ) )
|
||||||
$sitemeta['illegal_names'][] = 'blog';
|
$sitemeta['illegal_names'][] = 'blog';
|
||||||
|
|
||||||
$insert = '';
|
$insert = '';
|
||||||
|
@ -2837,7 +2837,7 @@ function do_meta_boxes($page, $context, $object) {
|
|||||||
|
|
||||||
$hidden = get_hidden_meta_boxes($page);
|
$hidden = get_hidden_meta_boxes($page);
|
||||||
|
|
||||||
printf('<div id="%s-sortables" class="meta-box-sortables">', htmlspecialchars($context));
|
printf('<div id="%s-sortables" class="meta-box-sortables">', htmlspecialchars($context));
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
do {
|
do {
|
||||||
@ -3233,7 +3233,7 @@ function settings_errors ( $setting = '', $sanitize = FALSE, $hide_on_update = F
|
|||||||
*/
|
*/
|
||||||
function manage_columns_prefs( $page ) {
|
function manage_columns_prefs( $page ) {
|
||||||
$columns = get_column_headers( $page );
|
$columns = get_column_headers( $page );
|
||||||
$hidden = get_hidden_columns( $page );
|
$hidden = get_hidden_columns( $page );
|
||||||
$special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username');
|
$special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username');
|
||||||
|
|
||||||
foreach ( $columns as $column => $title ) {
|
foreach ( $columns as $column => $title ) {
|
||||||
@ -3545,9 +3545,9 @@ function _post_states($post) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a screen string to a screen object
|
* Convert a screen string to a screen object
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param string $screen The name of the screen
|
* @param string $screen The name of the screen
|
||||||
* @return object An object containing the safe screen name and id
|
* @return object An object containing the safe screen name and id
|
||||||
*/
|
*/
|
||||||
@ -3615,11 +3615,11 @@ function screen_meta($screen) {
|
|||||||
echo screen_layout($screen);
|
echo screen_layout($screen);
|
||||||
|
|
||||||
if ( !empty( $screen_options ) ) {
|
if ( !empty( $screen_options ) ) {
|
||||||
?>
|
?>
|
||||||
<h5><?php _ex('Show on screen', 'Screen Options') ?></h5>
|
<h5><?php _ex('Show on screen', 'Screen Options') ?></h5>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $screen_options;
|
echo $screen_options;
|
||||||
echo $settings; ?>
|
echo $settings; ?>
|
||||||
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
|
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
|
||||||
|
@ -32,7 +32,7 @@ case 'dashboard_secondary' :
|
|||||||
case 'dashboard_plugins' :
|
case 'dashboard_plugins' :
|
||||||
wp_dashboard_plugins_output();
|
wp_dashboard_plugins_output();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'dashboard_quick_press' :
|
case 'dashboard_quick_press' :
|
||||||
wp_dashboard_quick_press_output();
|
wp_dashboard_quick_press_output();
|
||||||
break;
|
break;
|
||||||
|
@ -147,7 +147,7 @@ var wpNavMenu;
|
|||||||
},
|
},
|
||||||
getItemData : function( itemType, id ) {
|
getItemData : function( itemType, id ) {
|
||||||
itemType = itemType || 'menu-item';
|
itemType = itemType || 'menu-item';
|
||||||
|
|
||||||
var itemData = {}, i,
|
var itemData = {}, i,
|
||||||
fields = [
|
fields = [
|
||||||
'menu-item-db-id',
|
'menu-item-db-id',
|
||||||
@ -164,13 +164,13 @@ var wpNavMenu;
|
|||||||
'menu-item-classes',
|
'menu-item-classes',
|
||||||
'menu-item-xfn'
|
'menu-item-xfn'
|
||||||
];
|
];
|
||||||
|
|
||||||
if( !id && itemType == 'menu-item' ) {
|
if( !id && itemType == 'menu-item' ) {
|
||||||
id = this.find('.menu-item-data-db-id').val();
|
id = this.find('.menu-item-data-db-id').val();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !id ) return itemData;
|
if( !id ) return itemData;
|
||||||
|
|
||||||
this.find('input').each(function() {
|
this.find('input').each(function() {
|
||||||
var field;
|
var field;
|
||||||
i = fields.length;
|
i = fields.length;
|
||||||
@ -179,7 +179,7 @@ var wpNavMenu;
|
|||||||
field = fields[i] + '[' + id + ']';
|
field = fields[i] + '[' + id + ']';
|
||||||
else if( itemType == 'add-menu-item' )
|
else if( itemType == 'add-menu-item' )
|
||||||
field = 'menu-item[' + id + '][' + fields[i] + ']';
|
field = 'menu-item[' + id + '][' + fields[i] + ']';
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.name &&
|
this.name &&
|
||||||
field == this.name
|
field == this.name
|
||||||
@ -188,18 +188,18 @@ var wpNavMenu;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return itemData;
|
return itemData;
|
||||||
},
|
},
|
||||||
setItemData : function( itemData, itemType, id ) { // Can take a type, such as 'menu-item', or an id.
|
setItemData : function( itemData, itemType, id ) { // Can take a type, such as 'menu-item', or an id.
|
||||||
itemType = itemType || 'menu-item';
|
itemType = itemType || 'menu-item';
|
||||||
|
|
||||||
if( !id && itemType == 'menu-item' ) {
|
if( !id && itemType == 'menu-item' ) {
|
||||||
id = $('.menu-item-data-db-id', this).val();
|
id = $('.menu-item-data-db-id', this).val();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !id ) return this;
|
if( !id ) return this;
|
||||||
|
|
||||||
this.find('input').each(function() {
|
this.find('input').each(function() {
|
||||||
var t = $(this), field;
|
var t = $(this), field;
|
||||||
$.each( itemData, function( attr, val ) {
|
$.each( itemData, function( attr, val ) {
|
||||||
@ -207,7 +207,7 @@ var wpNavMenu;
|
|||||||
field = attr + '[' + id + ']';
|
field = attr + '[' + id + ']';
|
||||||
else if( itemType == 'add-menu-item' )
|
else if( itemType == 'add-menu-item' )
|
||||||
field = 'menu-item[' + id + '][' + attr + ']';
|
field = 'menu-item[' + id + '][' + attr + ']';
|
||||||
|
|
||||||
if ( field == t.attr('name') ) {
|
if ( field == t.attr('name') ) {
|
||||||
t.val( val );
|
t.val( val );
|
||||||
}
|
}
|
||||||
|
@ -83,14 +83,14 @@ switch ( $action ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get next in order
|
// get next in order
|
||||||
if (
|
if (
|
||||||
isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1] )
|
isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1] )
|
||||||
) {
|
) {
|
||||||
$next_item_id = $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1];
|
$next_item_id = $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1];
|
||||||
$next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) );
|
$next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) );
|
||||||
|
|
||||||
// if not siblings of same parent, bubble menu item up but keep order
|
// if not siblings of same parent, bubble menu item up but keep order
|
||||||
if (
|
if (
|
||||||
! empty( $menu_item_data['menu_item_parent'] ) &&
|
! empty( $menu_item_data['menu_item_parent'] ) &&
|
||||||
(
|
(
|
||||||
empty( $next_item_data['menu_item_parent'] ) ||
|
empty( $next_item_data['menu_item_parent'] ) ||
|
||||||
@ -99,12 +99,12 @@ switch ( $action ) {
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
$parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
|
$parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
|
||||||
|
|
||||||
$parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
|
$parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
|
||||||
|
|
||||||
if ( ! is_wp_error( $parent_object ) ) {
|
if ( ! is_wp_error( $parent_object ) ) {
|
||||||
$parent_data = (array) $parent_object;
|
$parent_data = (array) $parent_object;
|
||||||
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
|
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
|
||||||
update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
|
update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -114,16 +114,16 @@ switch ( $action ) {
|
|||||||
$next_item_data['menu_order'] = $next_item_data['menu_order'] - 1;
|
$next_item_data['menu_order'] = $next_item_data['menu_order'] - 1;
|
||||||
$menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1;
|
$menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1;
|
||||||
|
|
||||||
$menu_item_data['menu_item_parent'] = $next_item_data['ID'];
|
$menu_item_data['menu_item_parent'] = $next_item_data['ID'];
|
||||||
update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
|
update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
|
||||||
|
|
||||||
wp_update_post($menu_item_data);
|
wp_update_post($menu_item_data);
|
||||||
wp_update_post($next_item_data);
|
wp_update_post($next_item_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// the item is last but still has a parent, so bubble up
|
// the item is last but still has a parent, so bubble up
|
||||||
} elseif (
|
} elseif (
|
||||||
! empty( $menu_item_data['menu_item_parent'] ) &&
|
! empty( $menu_item_data['menu_item_parent'] ) &&
|
||||||
in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids )
|
in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids )
|
||||||
) {
|
) {
|
||||||
@ -174,16 +174,16 @@ switch ( $action ) {
|
|||||||
$parent_data = (array) $parent_object;
|
$parent_data = (array) $parent_object;
|
||||||
|
|
||||||
// if there is something before the parent and parent a child of it, make menu item a child also of it
|
// if there is something before the parent and parent a child of it, make menu item a child also of it
|
||||||
if (
|
if (
|
||||||
! empty( $dbids_to_orders[$parent_db_id] ) &&
|
! empty( $dbids_to_orders[$parent_db_id] ) &&
|
||||||
! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) &&
|
! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) &&
|
||||||
! empty( $parent_data['menu_item_parent'] )
|
! empty( $parent_data['menu_item_parent'] )
|
||||||
) {
|
) {
|
||||||
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
|
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
|
||||||
|
|
||||||
// else if there is something before parent and parent not a child of it, make menu item a child of that something's parent
|
// else if there is something before parent and parent not a child of it, make menu item a child of that something's parent
|
||||||
} elseif (
|
} elseif (
|
||||||
! empty( $dbids_to_orders[$parent_db_id] ) &&
|
! empty( $dbids_to_orders[$parent_db_id] ) &&
|
||||||
! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] )
|
! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] )
|
||||||
) {
|
) {
|
||||||
$_possible_parent_id = (int) get_post_meta( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1], '_menu_item_menu_item_parent', true);
|
$_possible_parent_id = (int) get_post_meta( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1], '_menu_item_menu_item_parent', true);
|
||||||
@ -210,12 +210,12 @@ switch ( $action ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// else this menu item is not a child of the previous
|
// else this menu item is not a child of the previous
|
||||||
} elseif (
|
} elseif (
|
||||||
empty( $menu_item_data['menu_order'] ) ||
|
empty( $menu_item_data['menu_order'] ) ||
|
||||||
empty( $menu_item_data['menu_item_parent'] ) ||
|
empty( $menu_item_data['menu_item_parent'] ) ||
|
||||||
! in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) ||
|
! in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) ||
|
||||||
empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ||
|
empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ||
|
||||||
$orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] != $menu_item_data['menu_item_parent']
|
$orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] != $menu_item_data['menu_item_parent']
|
||||||
) {
|
) {
|
||||||
// just make it a child of the previous; keep the order
|
// just make it a child of the previous; keep the order
|
||||||
$menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1];
|
$menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1];
|
||||||
@ -533,7 +533,7 @@ require_once( 'admin-header.php' );
|
|||||||
$auto_add = true;
|
$auto_add = true;
|
||||||
else
|
else
|
||||||
$auto_add = false;
|
$auto_add = false;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="auto-add-pages">
|
<div class="auto-add-pages">
|
||||||
<label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
|
<label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
|
||||||
|
@ -225,7 +225,7 @@ function network_step1( $errors = false ) {
|
|||||||
_e( 'Because your install is in a directory, the sites in your WordPress network must use sub-directories.' );
|
_e( 'Because your install is in a directory, the sites in your WordPress network must use sub-directories.' );
|
||||||
// Uh oh:
|
// Uh oh:
|
||||||
if ( !allow_subdirectory_install() )
|
if ( !allow_subdirectory_install() )
|
||||||
echo ' <strong>' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
|
echo ' <strong>' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
|
||||||
?></td>
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php elseif ( !allow_subdirectory_install() ) : ?>
|
<?php elseif ( !allow_subdirectory_install() ) : ?>
|
||||||
@ -348,9 +348,9 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>
|
|||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
if (iis7_supports_permalinks()) {
|
if (iis7_supports_permalinks()) {
|
||||||
if (is_subdomain_install()) {
|
if (is_subdomain_install()) {
|
||||||
$web_config_file =
|
$web_config_file =
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>
|
'<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
@ -381,7 +381,7 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>
|
|||||||
</system.webServer>
|
</system.webServer>
|
||||||
</configuration>';
|
</configuration>';
|
||||||
} else {
|
} else {
|
||||||
$web_config_file =
|
$web_config_file =
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>
|
'<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
@ -438,24 +438,24 @@ RewriteRule ^index\.php$ - [L]
|
|||||||
|
|
||||||
# uploaded files
|
# uploaded files
|
||||||
RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
|
RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
|
||||||
|
|
||||||
if ( ! $subdomain_install )
|
if ( ! $subdomain_install )
|
||||||
$htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n";
|
$htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n";
|
||||||
|
|
||||||
$htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR]
|
$htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||||
RewriteCond %{REQUEST_FILENAME} -d
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
RewriteRule ^ - [L]';
|
RewriteRule ^ - [L]';
|
||||||
|
|
||||||
// @todo custom content dir.
|
// @todo custom content dir.
|
||||||
if ( ! $subdomain_install )
|
if ( ! $subdomain_install )
|
||||||
$htaccess_file .= "\nRewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]";
|
$htaccess_file .= "\nRewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]";
|
||||||
|
|
||||||
$htaccess_file .= "\nRewriteRule . index.php [L]";
|
$htaccess_file .= "\nRewriteRule . index.php [L]";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
|
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
|
||||||
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
|
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
|
||||||
echo wp_htmledit_pre( $htaccess_file );
|
echo wp_htmledit_pre( $htaccess_file );
|
||||||
?>
|
?>
|
||||||
</textarea></li>
|
</textarea></li>
|
||||||
</ol>
|
</ol>
|
||||||
|
@ -21,7 +21,7 @@ if ( isset($_GET['find_detached']) ) {
|
|||||||
wp_die( __('You are not allowed to scan for lost attachments.') );
|
wp_die( __('You are not allowed to scan for lost attachments.') );
|
||||||
|
|
||||||
$lost = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent > '0' and post_parent NOT IN ( SELECT ID FROM $wpdb->posts WHERE post_type NOT IN ('attachment', '" . join("', '", get_post_types( array( 'public' => false ) ) ) . "') )");
|
$lost = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent > '0' and post_parent NOT IN ( SELECT ID FROM $wpdb->posts WHERE post_type NOT IN ('attachment', '" . join("', '", get_post_types( array( 'public' => false ) ) ) . "') )");
|
||||||
|
|
||||||
$_GET['detached'] = 1;
|
$_GET['detached'] = 1;
|
||||||
|
|
||||||
} elseif ( isset($_GET['found_post_id']) && isset($_GET['media']) ) {
|
} elseif ( isset($_GET['found_post_id']) && isset($_GET['media']) ) {
|
||||||
@ -168,7 +168,7 @@ add_contextual_help( $current_screen,
|
|||||||
'<p>' . __('You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.') . '</p>' .
|
'<p>' . __('You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.') . '</p>' .
|
||||||
'<p>' . __('Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file. ') . '</p>' .
|
'<p>' . __('Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file. ') . '</p>' .
|
||||||
'<p>' . __('If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.') . '</p>' .
|
'<p>' . __('If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.') . '</p>' .
|
||||||
'<p>' . __('For more information:<br />
|
'<p>' . __('For more information:<br />
|
||||||
<a href="http://codex.wordpress.org/Media_Library_SubPanel">Media Library Documentation</a> <br />
|
<a href="http://codex.wordpress.org/Media_Library_SubPanel">Media Library Documentation</a> <br />
|
||||||
<a href="http://wordpress.org/support/">Support Forums</a>') . '</p>'
|
<a href="http://wordpress.org/support/">Support Forums</a>') . '</p>'
|
||||||
);
|
);
|
||||||
|
@ -286,7 +286,7 @@ function wp_templating_constants( ) {
|
|||||||
/**
|
/**
|
||||||
* Slug of the default theme for this install.
|
* Slug of the default theme for this install.
|
||||||
* Used as the default theme when installing new sites.
|
* Used as the default theme when installing new sites.
|
||||||
* Will be used as the fallback if the current theme doesn't exist.
|
* Will be used as the fallback if the current theme doesn't exist.
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
if ( !defined('WP_DEFAULT_THEME') )
|
if ( !defined('WP_DEFAULT_THEME') )
|
||||||
|
@ -624,12 +624,12 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
|||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
global $comments, $comment;
|
global $comments, $comment;
|
||||||
|
|
||||||
$cache = wp_cache_get('widget_recent_comments', 'widget');
|
$cache = wp_cache_get('widget_recent_comments', 'widget');
|
||||||
|
|
||||||
if ( ! is_array( $cache ) )
|
if ( ! is_array( $cache ) )
|
||||||
$cache = array();
|
$cache = array();
|
||||||
|
|
||||||
if ( isset( $cache[$args['widget_id']] ) ) {
|
if ( isset( $cache[$args['widget_id']] ) ) {
|
||||||
echo $cache[$args['widget_id']];
|
echo $cache[$args['widget_id']];
|
||||||
return;
|
return;
|
||||||
@ -646,11 +646,11 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
|||||||
|
|
||||||
$comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) );
|
$comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) );
|
||||||
$output .= $before_widget;
|
$output .= $before_widget;
|
||||||
if ( $title )
|
if ( $title )
|
||||||
$output .= $before_title . $title . $after_title;
|
$output .= $before_title . $title . $after_title;
|
||||||
|
|
||||||
$output .= '<ul id="recentcomments">';
|
$output .= '<ul id="recentcomments">';
|
||||||
if ( $comments ) {
|
if ( $comments ) {
|
||||||
foreach ( (array) $comments as $comment) {
|
foreach ( (array) $comments as $comment) {
|
||||||
$output .= '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
|
$output .= '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ function _x( $single, $context, $domain = 'default' ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays translated string with gettext context
|
* Displays translated string with gettext context
|
||||||
*
|
*
|
||||||
* @see _x
|
* @see _x
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
@ -506,13 +506,13 @@ function translate_user_role( $name ) {
|
|||||||
* @return array Array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names.
|
* @return array Array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names.
|
||||||
*/
|
*/
|
||||||
function get_available_languages( $dir = null ) {
|
function get_available_languages( $dir = null ) {
|
||||||
$languages = array();
|
$languages = array();
|
||||||
|
|
||||||
foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {
|
foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {
|
||||||
if ( false === strpos( $lang_file, 'continents-cities' ) ) {
|
if ( false === strpos( $lang_file, 'continents-cities' ) ) {
|
||||||
$languages[] = basename($lang_file, '.mo');
|
$languages[] = basename($lang_file, '.mo');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $languages;
|
return $languages;
|
||||||
}
|
}
|
@ -586,11 +586,11 @@ function get_category_feed_link($cat_id, $feed = '') {
|
|||||||
*/
|
*/
|
||||||
function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
|
function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
|
||||||
global $wp_rewrite;
|
global $wp_rewrite;
|
||||||
|
|
||||||
$term_id = ( int ) $term_id;
|
$term_id = ( int ) $term_id;
|
||||||
|
|
||||||
$term = get_term( $term_id, $taxonomy );
|
$term = get_term( $term_id, $taxonomy );
|
||||||
|
|
||||||
if ( empty( $term ) || is_wp_error( $term ) )
|
if ( empty( $term ) || is_wp_error( $term ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -601,10 +601,10 @@ function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
|
|||||||
|
|
||||||
if ( '' == $permalink_structure ) {
|
if ( '' == $permalink_structure ) {
|
||||||
if ( 'category' == $taxonomy ) {
|
if ( 'category' == $taxonomy ) {
|
||||||
$link = home_url("?feed=$feed&cat=$term_id");
|
$link = home_url("?feed=$feed&cat=$term_id");
|
||||||
}
|
}
|
||||||
elseif ( 'post_tag' == $taxonomy ) {
|
elseif ( 'post_tag' == $taxonomy ) {
|
||||||
$link = home_url("?feed=$feed&tag=$term->slug");
|
$link = home_url("?feed=$feed&tag=$term->slug");
|
||||||
} else {
|
} else {
|
||||||
$t = get_taxonomy( $taxonomy );
|
$t = get_taxonomy( $taxonomy );
|
||||||
$link = home_url("?feed=$feed&$t->query_var=$term->slug");
|
$link = home_url("?feed=$feed&$t->query_var=$term->slug");
|
||||||
@ -625,7 +625,7 @@ function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
|
|||||||
$link = apply_filters( 'category_feed_link', $link, $feed );
|
$link = apply_filters( 'category_feed_link', $link, $feed );
|
||||||
else
|
else
|
||||||
$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
|
$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
|
||||||
|
|
||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
@ -2185,7 +2185,7 @@ function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) {
|
|||||||
$post_id = $wp_query->get_queried_object_id();
|
$post_id = $wp_query->get_queried_object_id();
|
||||||
} elseif ( 'post' == $context ) {
|
} elseif ( 'post' == $context ) {
|
||||||
$post = get_post($id);
|
$post = get_post($id);
|
||||||
$post_id = $post->ID;
|
$post_id = $post->ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
$shortlink = '';
|
$shortlink = '';
|
||||||
|
@ -105,7 +105,7 @@ function ms_file_constants( ) {
|
|||||||
function ms_subdomain_constants() {
|
function ms_subdomain_constants() {
|
||||||
static $error = null;
|
static $error = null;
|
||||||
static $error_warn = false;
|
static $error_warn = false;
|
||||||
|
|
||||||
if ( false === $error )
|
if ( false === $error )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ function ms_subdomain_constants() {
|
|||||||
} elseif ( defined( 'VHOST' ) ) {
|
} elseif ( defined( 'VHOST' ) ) {
|
||||||
$error = true;
|
$error = true;
|
||||||
define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST );
|
define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST );
|
||||||
} else {
|
} else {
|
||||||
define( 'SUBDOMAIN_INSTALL', false );
|
define( 'SUBDOMAIN_INSTALL', false );
|
||||||
define( 'VHOST', 'no' );
|
define( 'VHOST', 'no' );
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ function wp_nav_menu( $args = array() ) {
|
|||||||
$sorted_menu_items = array();
|
$sorted_menu_items = array();
|
||||||
foreach ( (array) $menu_items as $key => $menu_item )
|
foreach ( (array) $menu_items as $key => $menu_item )
|
||||||
$sorted_menu_items[$menu_item->menu_order] = $menu_item;
|
$sorted_menu_items[$menu_item->menu_order] = $menu_item;
|
||||||
|
|
||||||
unset($menu_items);
|
unset($menu_items);
|
||||||
|
|
||||||
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
|
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
|
||||||
@ -307,7 +307,7 @@ function _wp_menu_item_classes_by_context( &$menu_items = array() ) {
|
|||||||
$active_parent_object_ids = array();
|
$active_parent_object_ids = array();
|
||||||
$possible_object_parents = array();
|
$possible_object_parents = array();
|
||||||
$home_page_id = (int) get_option( 'page_for_posts' );
|
$home_page_id = (int) get_option( 'page_for_posts' );
|
||||||
|
|
||||||
if ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) {
|
if ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) {
|
||||||
foreach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) {
|
foreach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) {
|
||||||
if ( is_taxonomy_hierarchical( $taxonomy ) ) {
|
if ( is_taxonomy_hierarchical( $taxonomy ) ) {
|
||||||
@ -328,15 +328,15 @@ function _wp_menu_item_classes_by_context( &$menu_items = array() ) {
|
|||||||
$active_parent_object_ids[] = (int) $menu_item->object_id;
|
$active_parent_object_ids[] = (int) $menu_item->object_id;
|
||||||
$active_parent_item_ids[] = (int) $menu_item->db_id;
|
$active_parent_item_ids[] = (int) $menu_item->db_id;
|
||||||
$active_object = $queried_object->post_type;
|
$active_object = $queried_object->post_type;
|
||||||
|
|
||||||
// if the menu item corresponds to the currently-queried post or taxonomy object
|
// if the menu item corresponds to the currently-queried post or taxonomy object
|
||||||
} elseif (
|
} elseif (
|
||||||
$menu_item->object_id == $queried_object_id &&
|
$menu_item->object_id == $queried_object_id &&
|
||||||
(
|
(
|
||||||
( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id = $menu_item->object_id ) ||
|
( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id = $menu_item->object_id ) ||
|
||||||
( 'post_type' == $menu_item->type && $wp_query->is_singular ) ||
|
( 'post_type' == $menu_item->type && $wp_query->is_singular ) ||
|
||||||
( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) )
|
( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) )
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$menu_items[$key]->classes = trim( $menu_item->classes . ' ' . 'current-menu-item' );
|
$menu_items[$key]->classes = trim( $menu_item->classes . ' ' . 'current-menu-item' );
|
||||||
$active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
|
$active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
|
||||||
@ -363,11 +363,11 @@ function _wp_menu_item_classes_by_context( &$menu_items = array() ) {
|
|||||||
|
|
||||||
// set parent's class
|
// set parent's class
|
||||||
foreach ( (array) $menu_items as $key => $parent_item ) {
|
foreach ( (array) $menu_items as $key => $parent_item ) {
|
||||||
if (
|
if (
|
||||||
isset( $parent_item->type ) &&
|
isset( $parent_item->type ) &&
|
||||||
'post_type' == $parent_item->type &&
|
'post_type' == $parent_item->type &&
|
||||||
! empty( $queried_object->post_type ) &&
|
! empty( $queried_object->post_type ) &&
|
||||||
is_post_type_hierarchical( $queried_object->post_type ) &&
|
is_post_type_hierarchical( $queried_object->post_type ) &&
|
||||||
in_array( $parent_item->object_id, $queried_object->ancestors )
|
in_array( $parent_item->object_id, $queried_object->ancestors )
|
||||||
)
|
)
|
||||||
$menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $queried_object->post_type . '-ancestor current-menu-ancestor' );
|
$menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $queried_object->post_type . '-ancestor current-menu-ancestor' );
|
||||||
|
@ -763,7 +763,7 @@ function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
|
|||||||
'menu-item-object' => $post->post_type,
|
'menu-item-object' => $post->post_type,
|
||||||
'menu-item-type' => 'post_type',
|
'menu-item-type' => 'post_type',
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ( $auto_add as $menu_id ) {
|
foreach ( $auto_add as $menu_id ) {
|
||||||
$items = (array) wp_get_nav_menu_items( $menu_id );
|
$items = (array) wp_get_nav_menu_items( $menu_id );
|
||||||
foreach ( $items as $item ) {
|
foreach ( $items as $item ) {
|
||||||
|
@ -105,11 +105,11 @@ function get_userdata( $user_id ) {
|
|||||||
|
|
||||||
if ( ! is_numeric( $user_id ) )
|
if ( ! is_numeric( $user_id ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$user_id = absint( $user_id );
|
$user_id = absint( $user_id );
|
||||||
if ( ! $user_id )
|
if ( ! $user_id )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$user = wp_cache_get( $user_id, 'users' );
|
$user = wp_cache_get( $user_id, 'users' );
|
||||||
|
|
||||||
if ( $user )
|
if ( $user )
|
||||||
|
@ -743,7 +743,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
|
|||||||
} else {
|
} else {
|
||||||
$function = (array) $function;
|
$function = (array) $function;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($function[0]) ) {
|
if (is_object($function[0]) ) {
|
||||||
// Object Class Calling
|
// Object Class Calling
|
||||||
if ( function_exists('spl_object_hash') ) {
|
if ( function_exists('spl_object_hash') ) {
|
||||||
|
@ -783,13 +783,13 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
|
|||||||
* - register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
|
* - register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
|
||||||
* - taxonomies - An array of taxonomy identifiers that will be registered for the post type. Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
|
* - taxonomies - An array of taxonomy identifiers that will be registered for the post type. Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
|
||||||
* - labels - An array of labels for this post type. You can see accepted values in {@link get_post_type_labels()}. By default post labels are used for non-hierarchical types and page labels for hierarchical ones.
|
* - labels - An array of labels for this post type. You can see accepted values in {@link get_post_type_labels()}. By default post labels are used for non-hierarchical types and page labels for hierarchical ones.
|
||||||
* - permalink_epmask - The default rewrite endpoint bitmasks.
|
* - permalink_epmask - The default rewrite endpoint bitmasks.
|
||||||
* - rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize permastruct; default will use $taxonomy as slug.
|
* - rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize permastruct; default will use $taxonomy as slug.
|
||||||
* - query_var - false to prevent queries, or string to value of the query var to use for this post type
|
* - query_var - false to prevent queries, or string to value of the query var to use for this post type
|
||||||
* - can_export - true allows this post type to be exported.
|
* - can_export - true allows this post type to be exported.
|
||||||
* - show_in_nav_menus - true makes this post type available for selection in navigation menus.
|
* - show_in_nav_menus - true makes this post type available for selection in navigation menus.
|
||||||
* - _builtin - true if this post type is a native or "built-in" post_type. THIS IS FOR INTERNAL USE ONLY!
|
* - _builtin - true if this post type is a native or "built-in" post_type. THIS IS FOR INTERNAL USE ONLY!
|
||||||
* - _edit_link - URL segement to use for edit link of this post type. Set to 'post.php?post=%d'. THIS IS FOR INTERNAL USE ONLY!
|
* - _edit_link - URL segement to use for edit link of this post type. Set to 'post.php?post=%d'. THIS IS FOR INTERNAL USE ONLY!
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
* @uses $wp_post_types Inserts new post type object into the list
|
* @uses $wp_post_types Inserts new post type object into the list
|
||||||
@ -888,7 +888,7 @@ function register_post_type($post_type, $args = array()) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an object with all post type capabilities out of a post type object
|
* Builds an object with all post type capabilities out of a post type object
|
||||||
*
|
*
|
||||||
* Accepted keys of the capabilities array in the post type object:
|
* Accepted keys of the capabilities array in the post type object:
|
||||||
* - edit_post - The meta capability that controls editing a particular object of this post type. Defaults to "edit_$capability_type" (edit_post).
|
* - edit_post - The meta capability that controls editing a particular object of this post type. Defaults to "edit_$capability_type" (edit_post).
|
||||||
* - edit_posts - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts).
|
* - edit_posts - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts).
|
||||||
@ -897,7 +897,7 @@ function register_post_type($post_type, $args = array()) {
|
|||||||
* - read_post - The meta capability that controls reading a particular object of this post type. Defaults to "read_$capability_type" (read_post).
|
* - read_post - The meta capability that controls reading a particular object of this post type. Defaults to "read_$capability_type" (read_post).
|
||||||
* - read_private_posts - The capability that controls reading private posts. Defaults to "read_ . $capability_type . s" (read_private_posts).
|
* - read_private_posts - The capability that controls reading private posts. Defaults to "read_ . $capability_type . s" (read_private_posts).
|
||||||
* - delete_post - The meta capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post).
|
* - delete_post - The meta capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post).
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @param object $args
|
* @param object $args
|
||||||
* @return object object with all the capabilities as member variables
|
* @return object object with all the capabilities as member variables
|
||||||
@ -918,7 +918,7 @@ function get_post_type_capabilities( $args ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an object with all post type labels out of a post type object
|
* Builds an object with all post type labels out of a post type object
|
||||||
*
|
*
|
||||||
* Accepted keys of the label array in the post type object:
|
* Accepted keys of the label array in the post type object:
|
||||||
* - name - general name for the post type, usually plural. The same and overriden by $post_type_object->label. Default is Posts/Pages
|
* - name - general name for the post type, usually plural. The same and overriden by $post_type_object->label. Default is Posts/Pages
|
||||||
* - singular_name - name for one object of this post type. Default is Post/Page
|
* - singular_name - name for one object of this post type. Default is Post/Page
|
||||||
@ -932,9 +932,9 @@ function get_post_type_capabilities( $args ) {
|
|||||||
* - not_found - Default is No posts found/No pages found
|
* - not_found - Default is No posts found/No pages found
|
||||||
* - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
|
* - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
|
||||||
* - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
|
* - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
|
||||||
*
|
*
|
||||||
* Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.)
|
* Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.)
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @param object $post_type_object
|
* @param object $post_type_object
|
||||||
* @return object object with all the labels as member variables
|
* @return object object with all the labels as member variables
|
||||||
@ -958,22 +958,22 @@ function get_post_type_labels( $post_type_object ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object
|
* Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
|
function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
|
||||||
|
|
||||||
if ( isset( $object->label ) ) {
|
if ( isset( $object->label ) ) {
|
||||||
$object->labels['name'] = $object->label;
|
$object->labels['name'] = $object->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) {
|
if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) {
|
||||||
$object->labels['singular_name'] = $object->labels['name'];
|
$object->labels['singular_name'] = $object->labels['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
|
$defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
|
||||||
$labels = array_merge( $defaults, $object->labels );
|
$labels = array_merge( $defaults, $object->labels );
|
||||||
return (object)$labels;
|
return (object)$labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1864,7 +1864,7 @@ class WP_Query {
|
|||||||
$search .= " AND ($wpdb->posts.post_password = '') ";
|
$search .= " AND ($wpdb->posts.post_password = '') ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow plugins to contextually add/remove/modify the search section of the database query
|
// Allow plugins to contextually add/remove/modify the search section of the database query
|
||||||
$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
|
$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
|
||||||
|
|
||||||
|
@ -1775,7 +1775,7 @@ class WP_Rewrite {
|
|||||||
<rules>
|
<rules>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
$rules .= '
|
$rules .= '
|
||||||
<rule name="wordpress" patternSyntax="Wildcard">
|
<rule name="wordpress" patternSyntax="Wildcard">
|
||||||
<match url="*" />
|
<match url="*" />
|
||||||
|
@ -211,7 +211,7 @@ function is_taxonomy_hierarchical($taxonomy) {
|
|||||||
* whether taxonomy exists.
|
* whether taxonomy exists.
|
||||||
*
|
*
|
||||||
* Optional $args contents:
|
* Optional $args contents:
|
||||||
*
|
*
|
||||||
* label - Name of the taxonomy shown in the menu. Usually plural. If not set, labels['name'] will be used.
|
* label - Name of the taxonomy shown in the menu. Usually plural. If not set, labels['name'] will be used.
|
||||||
*
|
*
|
||||||
* hierarchical - has some defined purpose at other parts of the API and is a
|
* hierarchical - has some defined purpose at other parts of the API and is a
|
||||||
@ -234,7 +234,7 @@ function is_taxonomy_hierarchical($taxonomy) {
|
|||||||
*
|
*
|
||||||
* show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget;
|
* show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget;
|
||||||
* defaults to show_ui which defalts to public.
|
* defaults to show_ui which defalts to public.
|
||||||
*
|
*
|
||||||
* labels - An array of labels for this taxonomy. You can see accepted values in {@link get_taxonomy_labels()}. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones.
|
* labels - An array of labels for this taxonomy. You can see accepted values in {@link get_taxonomy_labels()}. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones.
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
@ -303,7 +303,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
|
|
||||||
$args['labels'] = get_taxonomy_labels( (object) $args );
|
$args['labels'] = get_taxonomy_labels( (object) $args );
|
||||||
$args['label'] = $args['labels']->name;
|
$args['label'] = $args['labels']->name;
|
||||||
|
|
||||||
$wp_taxonomies[$taxonomy] = (object) $args;
|
$wp_taxonomies[$taxonomy] = (object) $args;
|
||||||
|
|
||||||
// register callback handling for metabox
|
// register callback handling for metabox
|
||||||
@ -312,7 +312,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an object with all taxonomy labels out of a taxonomy object
|
* Builds an object with all taxonomy labels out of a taxonomy object
|
||||||
*
|
*
|
||||||
* Accepted keys of the label array in the taxonomy object:
|
* Accepted keys of the label array in the taxonomy object:
|
||||||
* - name - general name for the taxonomy, usually plural. The same as and overriden by $tax->label. Default is Post Tags/Categories
|
* - name - general name for the taxonomy, usually plural. The same as and overriden by $tax->label. Default is Post Tags/Categories
|
||||||
* - singular_name - name for one object of this taxonomy. Default is Post Tag/Category
|
* - singular_name - name for one object of this taxonomy. Default is Post Tag/Category
|
||||||
@ -325,9 +325,9 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
* - update_item - Default is Update Tag/Update Category
|
* - update_item - Default is Update Tag/Update Category
|
||||||
* - add_new_item - Default is Add New Tag/Add New Category
|
* - add_new_item - Default is Add New Tag/Add New Category
|
||||||
* - new_item_name - Default is New Tag Name/New Category Name
|
* - new_item_name - Default is New Tag Name/New Category Name
|
||||||
*
|
*
|
||||||
* Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories.)
|
* Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories.)
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @param object $tax Taxonomy object
|
* @param object $tax Taxonomy object
|
||||||
* @return object object with all the labels as member variables
|
* @return object object with all the labels as member variables
|
||||||
|
@ -1716,7 +1716,7 @@ function require_if_theme_supports( $feature, $include) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks an attachment being deleted to see if it's a header or background image.
|
* Checks an attachment being deleted to see if it's a header or background image.
|
||||||
*
|
*
|
||||||
* If true it removes the theme modification which would be pointing at the deleted
|
* If true it removes the theme modification which would be pointing at the deleted
|
||||||
* attachment
|
* attachment
|
||||||
*
|
*
|
||||||
@ -1728,7 +1728,7 @@ function _delete_attachment_theme_mod( $id ) {
|
|||||||
$attachment_image = wp_get_attachment_url( $id );
|
$attachment_image = wp_get_attachment_url( $id );
|
||||||
$header_image = get_header_image();
|
$header_image = get_header_image();
|
||||||
$background_image = get_background_image();
|
$background_image = get_background_image();
|
||||||
|
|
||||||
if ( $header_image && $header_image == $attachment_image )
|
if ( $header_image && $header_image == $attachment_image )
|
||||||
remove_theme_mod( 'header_image' );
|
remove_theme_mod( 'header_image' );
|
||||||
|
|
||||||
|
@ -36,14 +36,14 @@ $phone_delim = '::';
|
|||||||
|
|
||||||
$pop3 = new POP3();
|
$pop3 = new POP3();
|
||||||
|
|
||||||
if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) )
|
if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) )
|
||||||
wp_die( esc_html( $pop3->ERROR ) );
|
wp_die( esc_html( $pop3->ERROR ) );
|
||||||
|
|
||||||
$count = $pop3->pass( get_option('mailserver_pass') );
|
$count = $pop3->pass( get_option('mailserver_pass') );
|
||||||
|
|
||||||
if( false === $count )
|
if( false === $count )
|
||||||
wp_die( esc_html( $pop3->ERROR ) );
|
wp_die( esc_html( $pop3->ERROR ) );
|
||||||
|
|
||||||
if( 0 === $count ) {
|
if( 0 === $count ) {
|
||||||
$pop3->quit();
|
$pop3->quit();
|
||||||
wp_die( __('There doesn’t seem to be any new mail.') );
|
wp_die( __('There doesn’t seem to be any new mail.') );
|
||||||
|
Loading…
Reference in New Issue
Block a user