]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-terms-list-table.php
WordPress 4.2
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-terms-list-table.php
index 743dfde45a8994b99dc6914775162cf144c9ccf2..5eda18691c326f13e499f8cfae6b1e052b1b3c31 100644 (file)
@@ -11,6 +11,8 @@ class WP_Terms_List_Table extends WP_List_Table {
 
        public $callback_args;
 
+       private $level;
+
        /**
         * Constructor.
         *
@@ -112,6 +114,10 @@ class WP_Terms_List_Table extends WP_List_Table {
                return true;
        }
 
+       public function no_items() {
+               echo get_taxonomy( $this->screen->taxonomy )->labels->not_found;
+       }
+
        protected function get_bulk_actions() {
                $actions = array();
                $actions['delete'] = __( 'Delete' );
@@ -202,6 +208,16 @@ class WP_Terms_List_Table extends WP_List_Table {
                }
        }
 
+       /**
+        * @param string $taxonomy
+        * @param array $terms
+        * @param array $children
+        * @param int $start
+        * @param int $per_page
+        * @param int $count
+        * @param int $parent
+        * @param int $level
+        */
        private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
 
                $end = $start + $per_page;
@@ -250,20 +266,26 @@ class WP_Terms_List_Table extends WP_List_Table {
                }
        }
 
+       /**
+        * @global string $taxonomy
+        * @param object $tag
+        * @param int $level
+        */
        public function single_row( $tag, $level = 0 ) {
                global $taxonomy;
                $tag = sanitize_term( $tag, $taxonomy );
 
-               static $row_class = '';
-               $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
-
                $this->level = $level;
 
-               echo '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
+               echo '<tr id="tag-' . $tag->term_id . '">';
                $this->single_row_columns( $tag );
                echo '</tr>';
        }
 
+       /**
+        * @param object $tag
+        * @return string
+        */
        public function column_cb( $tag ) {
                $default_term = get_option( 'default_' . $this->screen->taxonomy );
 
@@ -274,6 +296,10 @@ class WP_Terms_List_Table extends WP_List_Table {
                return '&nbsp;';
        }
 
+       /**
+        * @param object $tag
+        * @return string
+        */
        public function column_name( $tag ) {
                $taxonomy = $this->screen->taxonomy;
                $tax = get_taxonomy( $taxonomy );
@@ -327,7 +353,7 @@ class WP_Terms_List_Table extends WP_List_Table {
                /**
                 * Filter the action links displayed for each term in the terms list table.
                 *
-                * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
+                * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
                 *
                 * @since 3.0.0
                 *
@@ -348,15 +374,27 @@ class WP_Terms_List_Table extends WP_List_Table {
                return $out;
        }
 
+       /**
+        * @param object $tag
+        * @return string
+        */
        public function column_description( $tag ) {
                return $tag->description;
        }
 
+       /**
+        * @param object $tag
+        * @return string
+        */
        public function column_slug( $tag ) {
                /** This filter is documented in wp-admin/edit-tag-form.php */
                return apply_filters( 'editable_slug', $tag->slug );
        }
 
+       /**
+        * @param object $tag
+        * @return string
+        */
        public function column_posts( $tag ) {
                $count = number_format_i18n( $tag->count );
 
@@ -381,6 +419,10 @@ class WP_Terms_List_Table extends WP_List_Table {
                return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
        }
 
+       /**
+        * @param object $tag
+        * @return string
+        */
        public function column_links( $tag ) {
                $count = number_format_i18n( $tag->count );
                if ( $count )
@@ -388,11 +430,16 @@ class WP_Terms_List_Table extends WP_List_Table {
                return $count;
        }
 
+       /**
+        * @param object $tag
+        * @param string $column_name
+        * @return string
+        */
        public function column_default( $tag, $column_name ) {
                /**
                 * Filter the displayed columns in the terms list table.
                 *
-                * The dynamic portion of the hook name, $this->screen->taxonomy,
+                * The dynamic portion of the hook name, `$this->screen->taxonomy`,
                 * refers to the slug of the current taxonomy.
                 *
                 * @since 2.8.0
@@ -416,7 +463,7 @@ class WP_Terms_List_Table extends WP_List_Table {
                        return;
 ?>
 
-       <form method="get" action=""><table style="display: none"><tbody id="inlineedit">
+       <form method="get"><table style="display: none"><tbody id="inlineedit">
                <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
 
                        <fieldset><div class="inline-edit-col">
@@ -450,8 +497,8 @@ class WP_Terms_List_Table extends WP_List_Table {
        ?>
 
                <p class="inline-edit-save submit">
-                       <a accesskey="c" href="#inline-edit" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
-                       <a accesskey="s" href="#inline-edit" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></a>
+                       <a href="#inline-edit" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
+                       <a href="#inline-edit" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></a>
                        <span class="spinner"></span>
                        <span class="error" style="display:none;"></span>
                        <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>