+
@@ -2392,40 +389,7 @@ function wp_comment_trashnotice() {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
- *
- * @param unknown_type $currentcat
- * @param unknown_type $currentparent
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $categories
- * @return unknown
- */
-function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
- if (!$categories )
- $categories = get_categories( array('hide_empty' => 0) );
-
- if ( $categories ) {
- foreach ( $categories as $category ) {
- if ( $currentcat != $category->term_id && $parent == $category->parent) {
- $pad = str_repeat( '– ', $level );
- $category->name = esc_html( $category->name );
- echo "\n\tterm_id )
- echo " selected='selected'";
- echo ">$pad$category->name ";
- wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
- }
- }
- } else {
- return false;
- }
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
+ * @since 1.2.0
*
* @param unknown_type $meta
*/
@@ -2436,7 +400,7 @@ function list_meta( $meta ) {
- ' . __( 'Name' ) . '
+ ' . _x( 'Name', 'meta name' ) . '
' . __( 'Value' ) . '
@@ -2451,7 +415,7 @@ function list_meta( $meta ) {
-
+
@@ -2468,7 +432,7 @@ function list_meta( $meta ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $entry
* @param unknown_type $count
@@ -2476,6 +440,10 @@ function list_meta( $meta ) {
*/
function _list_meta_row( $entry, &$count ) {
static $update_nonce = false;
+
+ if ( is_protected_meta( $entry['meta_key'], 'post' ) )
+ return;
+
if ( !$update_nonce )
$update_nonce = wp_create_nonce( 'add-meta' );
@@ -2485,8 +453,6 @@ function _list_meta_row( $entry, &$count ) {
$style = 'alternate';
else
$style = '';
- if ('_' == $entry['meta_key'] { 0 } )
- $style .= ' hidden';
if ( is_serialized( $entry['meta_value'] ) ) {
if ( is_serialized_string( $entry['meta_value'] ) ) {
@@ -2500,7 +466,7 @@ function _list_meta_row( $entry, &$count ) {
}
$entry['meta_key'] = esc_attr($entry['meta_key']);
- $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a
+ $entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // using a
$entry['meta_id'] = (int) $entry['meta_id'];
$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
@@ -2508,9 +474,11 @@ function _list_meta_row( $entry, &$count ) {
$r .= "\n\t";
$r .= "\n\t\t" . __( 'Key' ) . " ";
- $r .= "\n\t\t ";
- $r .= "\n\t\t
";
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Delete' ), "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta", "deletemeta[{$entry['meta_id']}]", false, array( 'tabindex' => '6' ) );
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta" , 'updatemeta', false, array( 'tabindex' => '6' ) );
+ $r .= "
";
$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
$r .= " ";
@@ -2521,7 +489,7 @@ function _list_meta_row( $entry, &$count ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
*/
function meta_form() {
global $wpdb;
@@ -2531,16 +499,16 @@ function meta_form() {
FROM $wpdb->postmeta
GROUP BY meta_key
HAVING meta_key NOT LIKE '\_%'
- ORDER BY LOWER(meta_key)
+ ORDER BY meta_key
LIMIT $limit" );
if ( $keys )
natcasesort($keys);
?>
-
+
@@ -2583,7 +550,7 @@ function meta_form() {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 0.71
*
* @param unknown_type $edit
* @param unknown_type $for_post
@@ -2594,7 +561,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
global $wp_locale, $post, $comment;
if ( $for_post )
- $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true;
+ $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
$tab_index_attribute = '';
if ( (int) $tab_index > 0 )
@@ -2602,7 +569,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
// echo ' '.__( 'Edit timestamp' ).' ';
- $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
+ $time_adj = current_time('timestamp');
$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
$jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
$mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );
@@ -2619,10 +586,11 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$month = "\n";
for ( $i = 1; $i < 13; $i = $i +1 ) {
- $month .= "\t\t\t" . 'get_month_abbrev( $wp_locale->get_month( $i ) ) . " \n";
+ $month .= '>' . $monthnum . '-' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "\n";
}
$month .= ' ';
@@ -2657,7 +625,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $default
*/
@@ -2676,7 +644,7 @@ function page_template_dropdown( $default = '' ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $default
* @param unknown_type $parent
@@ -2712,19 +680,7 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
- */
-function browse_happy() {
- $getit = __( 'WordPress recommends a better browser' );
- echo '
-
-';
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $id
* @return unknown
@@ -2736,7 +692,7 @@ function the_attachment_links( $id = false ) {
if ( $post->post_type != 'attachment' )
return false;
- $icon = get_attachment_icon( $post->ID );
+ $icon = wp_get_attachment_image( $post->ID, 'thumbnail', true );
$attachment_data = wp_get_attachment_metadata( $id );
$thumb = isset( $attachment_data['thumb'] );
?>
@@ -2746,7 +702,7 @@ function the_attachment_links( $id = false ) {
-
+
@@ -2774,25 +730,21 @@ function the_attachment_links( $id = false ) {
/**
- * Print out html elements for role selectors based on $wp_roles
+ * Print out html elements for role selectors
*
- * @package WordPress
- * @subpackage Administration
- * @since 2.1
+ * @since 2.1.0
*
- * @uses $wp_roles
- * @param string $default slug for the role that should be already selected
+ * @param string $selected slug for the role that should be already selected
*/
function wp_dropdown_roles( $selected = false ) {
- global $wp_roles;
$p = '';
$r = '';
$editable_roles = get_editable_roles();
- foreach( $editable_roles as $role => $details ) {
+ foreach ( $editable_roles as $role => $details ) {
$name = translate_user_role($details['name'] );
- if ( $selected == $role ) // Make default first in list
+ if ( $selected == $role ) // preselect specified role
$p = "\n\t $name ";
else
$r .= "\n\t$name ";
@@ -2803,7 +755,7 @@ function wp_dropdown_roles( $selected = false ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.3.0
*
* @param unknown_type $size
* @return unknown
@@ -2823,7 +775,7 @@ function wp_convert_hr_to_bytes( $size ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.3.0
*
* @param unknown_type $bytes
* @return unknown
@@ -2839,7 +791,7 @@ function wp_convert_bytes_to_hr( $bytes ) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
@@ -2853,7 +805,7 @@ function wp_max_upload_size() {
/**
* Outputs the form used by the importers to accept the data to be imported
*
- * @since 2.0
+ * @since 2.0.0
*
* @param string $action The action attribute for the form.
*/
@@ -2873,26 +825,12 @@ function wp_import_upload_form( $action ) {
-
-
-
+
post_name); // just in case
- if ( strlen($name) )
- echo ' ';
-}
-
/**
* Add a meta box to an edit form.
*
@@ -2901,13 +839,20 @@ function wp_remember_old_slug() {
* @param string $id String for use in the 'id' attribute of tags.
* @param string $title Title of the meta box.
* @param string $callback Function that fills the box with the desired content. The function should echo its output.
- * @param string $page The type of edit page on which to show the box (post, page, link).
- * @param string $context The context within the page where the boxes should show ('normal', 'advanced').
- * @param string $priority The priority within the context where the boxes should show ('high', 'low').
+ * @param string|object $screen Optional. The screen on which to show the box (post, page, link). Defaults to current screen.
+ * @param string $context Optional. The context within the page where the boxes should show ('normal', 'advanced').
+ * @param string $priority Optional. The priority within the context where the boxes should show ('high', 'low').
*/
-function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) {
+function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
global $wp_meta_boxes;
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
+
if ( !isset($wp_meta_boxes) )
$wp_meta_boxes = array();
if ( !isset($wp_meta_boxes[$page]) )
@@ -2916,35 +861,35 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri
$wp_meta_boxes[$page][$context] = array();
foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) {
- foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
- if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
- continue;
-
- // If a core box was previously added or removed by a plugin, don't add.
- if ( 'core' == $priority ) {
- // If core box previously deleted, don't add
- if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
+ foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
+ if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
+ continue;
+
+ // If a core box was previously added or removed by a plugin, don't add.
+ if ( 'core' == $priority ) {
+ // If core box previously deleted, don't add
+ if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
+ return;
+ // If box was added with default priority, give it core priority to maintain sort order
+ if ( 'default' == $a_priority ) {
+ $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
+ unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
+ }
return;
- // If box was added with default priority, give it core priority to maintain sort order
- if ( 'default' == $a_priority ) {
- $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
- unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
}
- return;
- }
- // If no priority given and id already present, use existing priority
- if ( empty($priority) ) {
- $priority = $a_priority;
- // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
- } elseif ( 'sorted' == $priority ) {
- $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
- $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
- $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
+ // If no priority given and id already present, use existing priority
+ if ( empty($priority) ) {
+ $priority = $a_priority;
+ // else if we're adding to the sorted priority, we don't know the title or callback. Grab them from the previously added context/priority.
+ } elseif ( 'sorted' == $priority ) {
+ $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
+ $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
+ $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
+ }
+ // An id can be in only one priority and one context
+ if ( $priority != $a_priority || $context != $a_context )
+ unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
}
- // An id can be in only one priority and one context
- if ( $priority != $a_priority || $context != $a_context )
- unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
- }
}
if ( empty($priority) )
@@ -2957,33 +902,40 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri
}
/**
- * {@internal Missing Short Description}}
+ * Meta-Box template function
*
- * @since unknown
+ * @since 2.5.0
*
- * @param unknown_type $page
- * @param unknown_type $context
- * @param unknown_type $object
+ * @param string|object $screen Screen identifier
+ * @param string $context box context
+ * @param mixed $object gets passed to the box callback function as first parameter
* @return int number of meta_boxes
*/
-function do_meta_boxes($page, $context, $object) {
+function do_meta_boxes( $screen, $context, $object ) {
global $wp_meta_boxes;
static $already_sorted = false;
- //do_action('do_meta_boxes', $page, $context, $object);
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
- $hidden = get_hidden_meta_boxes($page);
+ $hidden = get_hidden_meta_boxes( $screen );
- echo "