";
foreach ( $meta as $entry ) {
++ $count;
if ( $count % 2 )
$style = 'alternate';
else
$style = '';
if ('_' == $entry['meta_key'] { 0 } )
$style .= ' hidden';
if ( is_serialized( $entry['meta_value'] ) ) {
if ( is_serialized_string( $entry['meta_value'] ) ) {
// this is a serialized string, so we should display it
$entry['meta_value'] = maybe_unserialize( $entry['meta_value'] );
} else {
// this is a serialized array/object so we should NOT display it
--$count;
continue;
}
}
$key_js = js_escape( $entry['meta_key'] );
$entry['meta_key'] = attribute_escape($entry['meta_key']);
$entry['meta_value'] = attribute_escape($entry['meta_value']);
$entry['meta_id'] = (int) $entry['meta_id'];
$r .= "\n\t
";
$r .= "\n\t\t
";
$r .= "\n\t\t
";
$r .= "\n\t\t
";
$r .= "\n\t\t
";
$r .= "\n\t
";
}
echo $r;
echo "\n\t";
}
function meta_form() {
global $wpdb;
$limit = (int) apply_filters( 'postmeta_form_limit', 30 );
$keys = $wpdb->get_col( "
SELECT meta_key
FROM $wpdb->postmeta
WHERE meta_key NOT LIKE '\_%'
GROUP BY meta_key
ORDER BY meta_id DESC
LIMIT $limit" );
if ( $keys )
natcasesort($keys);
?>
post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
echo '
$template";
endforeach;
}
function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
global $wpdb, $post_ID;
$items = $wpdb->get_results( "SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_type = 'page' ORDER BY menu_order" );
if ( $items ) {
foreach ( $items as $item ) {
// A page cannot be its own parent.
if (!empty ( $post_ID ) ) {
if ( $item->ID == $post_ID ) {
continue;
}
}
$pad = str_repeat( ' ', $level * 3 );
if ( $item->ID == $default)
$current = ' selected="selected"';
else
$current = '';
echo "\n\t";
parent_dropdown( $default, $item->ID, $level +1 );
}
} else {
return false;
}
}
function browse_happy() {
$getit = __( 'WordPress recommends a better browser' );
echo '
';
}
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
add_action( 'admin_footer', 'browse_happy' );
function the_attachment_links( $id = false ) {
$id = (int) $id;
$post = & get_post( $id );
if ( $post->post_type != 'attachment' )
return false;
$icon = get_attachment_icon( $post->ID );
$attachment_data = wp_get_attachment_metadata( $id );
$thumb = isset( $attachment_data['thumb'] );
?>
role_names as $role => $name )
if ( $default == $role ) // Make default first in list
$p = "\n\t";
else
$r .= "\n\t";
echo $p . $r;
}
function wp_import_upload_form( $action ) {
$size = strtolower( ini_get( 'upload_max_filesize' ) );
$bytes = 0;
if (strpos($size, 'k') !== false)
$bytes = $size * 1024;
if (strpos($size, 'm') !== false)
$bytes = $size * 1024 * 1024;
if (strpos($size, 'g') !== false)
$bytes = $size * 1024 * 1024 * 1024;
$size = apply_filters( 'import_upload_size_limit', $size );
?>
post_name); // just in case
if ( strlen($name) )
echo '';
}
?>