X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/76aea3697c6043c1613370f172395b4f65ee71f0..refs/tags/wordpress-4.0:/wp-admin/includes/template.php
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index e132733e..30dcf0fc 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -1,252 +1,281 @@
0);
- if ( !empty($_GET['s']) )
- $args['search'] = $_GET['s'];
- $categories = get_categories( $args );
+/**
+ * Walker to output an unordered list of category checkbox elements.
+ *
+ * @see Walker
+ * @see wp_category_checklist()
+ * @see wp_terms_checklist()
+ * @since 2.5.1
+ */
+class Walker_Category_Checklist extends Walker {
+ public $tree_type = 'category';
+ public $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
+
+ /**
+ * Starts the list before the elements are added.
+ *
+ * @see Walker:start_lvl()
+ *
+ * @since 2.5.1
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param int $depth Depth of category. Used for tab indentation.
+ * @param array $args An array of arguments. @see wp_terms_checklist()
+ */
+ public function start_lvl( &$output, $depth = 0, $args = array() ) {
+ $indent = str_repeat("\t", $depth);
+ $output .= "$indent
+
' . $title . '
+
' . apply_filters( 'editable_slug', $post->post_name ) . '
+
' . $post->post_author . '
+
+
' . esc_html( $post->ping_status ) . '
+
' . esc_html( $post->post_status ) . '
+
' . mysql2date( 'd', $post->post_date, false ) . '
+
' . mysql2date( 'm', $post->post_date, false ) . '
+
' . mysql2date( 'Y', $post->post_date, false ) . '
+
' . mysql2date( 'H', $post->post_date, false ) . '
+
' . mysql2date( 'i', $post->post_date, false ) . '
+
' . mysql2date( 's', $post->post_date, false ) . '
+
' . esc_html( $post->post_password ) . '
';
+
+ if ( $post_type_object->hierarchical )
+ echo '
' . $post->post_parent . '
';
+
+ if ( $post->post_type == 'page' )
+ echo '
' . esc_html( get_post_meta( $post->ID, '_wp_page_template', true ) ) . '
';
+
+ if ( post_type_supports( $post->post_type, 'page-attributes' ) )
+ echo '';
+
+ $taxonomy_names = get_object_taxonomies( $post->post_type );
+ foreach ( $taxonomy_names as $taxonomy_name) {
+ $taxonomy = get_taxonomy( $taxonomy_name );
+
+ if ( $taxonomy->hierarchical && $taxonomy->show_ui ) {
+
+ $terms = get_object_term_cache( $post->ID, $taxonomy_name );
+ if ( false === $terms ) {
+ $terms = wp_get_object_terms( $post->ID, $taxonomy_name );
+ wp_cache_add( $post->ID, $terms, $taxonomy_name . '_relationships' );
+ }
+ $term_ids = empty( $terms ) ? array() : wp_list_pluck( $terms, 'term_id' );
-// Outputs appropriate rows for the Nth page of the Tag Management screen,
-// assuming M tags displayed at a time on the page
-// Returns the number of tags displayed
-function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
+ echo '
' . implode( ',', $term_ids ) . '
';
- // Get a page worth of tags
- $start = ($page - 1) * $pagesize;
+ } elseif ( $taxonomy->show_ui ) {
- $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);
+ echo '
'
+ . esc_html( str_replace( ',', ', ', get_terms_to_edit( $post->ID, $taxonomy_name ) ) ) . '
';
- if ( !empty( $searchterms ) ) {
- $args['search'] = $searchterms;
+ }
}
- $tags = get_terms( 'post_tag', $args );
+ if ( !$post_type_object->hierarchical )
+ echo '
' . (is_sticky($post->ID) ? 'sticky' : '') . '
';
- // convert it to table rows
- $out = '';
- $class = '';
- $count = 0;
- foreach( $tags as $tag )
- $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '' );
+ if ( post_type_supports( $post->post_type, 'post-formats' ) )
+ echo '
' . esc_html( get_post_format( $post->ID ) ) . '
';
- // filter and send to screen
- $out = apply_filters('tag_rows', $out);
- echo $out;
- return $count;
+ echo '
';
}
-// define the columns to display, the syntax is 'internal name' => 'display name'
-function wp_manage_posts_columns() {
- $posts_columns = array();
- $posts_columns['cb'] = '";
+ $r .= get_submit_button( __( 'Delete' ), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array( 'data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce" ) );
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Update' ), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array( 'data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce" ) );
+ $r .= "
";
+ $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
+ $r .= "";
-