X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/76aea3697c6043c1613370f172395b4f65ee71f0..7f1521bf193b382565eb753043c161f4cb3fcda7:/wp-admin/includes/template.php
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index e132733e..03ff4e7d 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -1,252 +1,319 @@
'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 );
-
- // convert it to table rows
- $out = '';
- $class = '';
- $count = 0;
- foreach( $tags as $tag )
- $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '' );
-
- // filter and send to screen
- $out = apply_filters('tag_rows', $out);
- echo $out;
- return $count;
-}
-
-// define the columns to display, the syntax is 'internal name' => 'display name'
-function wp_manage_posts_columns() {
- $posts_columns = array();
- $posts_columns['cb'] = '
';
- if ( 'draft' === $_GET['post_status'] )
- $posts_columns['modified'] = __('Modified');
- elseif ( 'pending' === $_GET['post_status'] )
- $posts_columns['modified'] = __('Submitted');
- else
- $posts_columns['date'] = __('Date');
- $posts_columns['title'] = __('Title');
- $posts_columns['author'] = __('Author');
- $posts_columns['categories'] = __('Categories');
- $posts_columns['tags'] = __('Tags');
- if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
- $posts_columns['comments'] = '
';
- $posts_columns['status'] = __('Status');
- $posts_columns = apply_filters('manage_posts_columns', $posts_columns);
-
- return $posts_columns;
-}
+ if ( !$post_type_object->hierarchical )
+ echo '
' . (is_sticky($post->ID) ? 'sticky' : '') . '
';
-// define the columns to display, the syntax is 'internal name' => 'display name'
-function wp_manage_media_columns() {
- $posts_columns = array();
- $posts_columns['cb'] = '
';
- $posts_columns['icon'] = '';
- $posts_columns['media'] = _c('Media|media column header');
- $posts_columns['desc'] = _c('Description|media column header');
- $posts_columns['date'] = _c('Date Added|media column header');
- $posts_columns['parent'] = _c('Appears with|media column header');
- $posts_columns['comments'] = '
';
- $posts_columns['location'] = _c('Location|media column header');
- $posts_columns = apply_filters('manage_media_columns', $posts_columns);
-
- return $posts_columns;
-}
+ if ( post_type_supports( $post->post_type, 'post-formats' ) )
+ echo '
' . esc_html( get_post_format( $post->ID ) ) . '
';
-function wp_manage_pages_columns() {
- $posts_columns = array();
- $posts_columns['cb'] = '
';
- if ( 'draft' === $_GET['post_status'] )
- $posts_columns['modified'] = __('Modified');
- elseif ( 'pending' === $_GET['post_status'] )
- $posts_columns['modified'] = __('Submitted');
- else
- $posts_columns['date'] = __('Date');
- $posts_columns['title'] = __('Title');
- $posts_columns['author'] = __('Author');
- if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
- $posts_columns['comments'] = '
';
- $posts_columns['status'] = __('Status');
- $posts_columns = apply_filters('manage_pages_columns', $posts_columns);
-
- return $posts_columns;
+ echo '
';
}
-/*
- * display one row if the page doesn't have any children
- * otherwise, display the row and its children in subsequent rows
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since 2.7.0
+ *
+ * @param int $position
+ * @param bool $checkbox
+ * @param string $mode
+ * @param bool $table_row
*/
-function display_page_row( $page, $level = 0 ) {
- global $post;
- static $class;
-
- $post = $page;
- setup_postdata($page);
-
- $page->post_title = wp_specialchars( $page->post_title );
- $pad = str_repeat( '— ', $level );
- $id = (int) $page->ID;
- $class = ('alternate' == $class ) ? '' : 'alternate';
- $posts_columns = wp_manage_pages_columns();
- $title = get_the_title();
- if ( empty($title) )
- $title = __('(no title)');
-?>
-