wp/wp-admin/includes/class-wp-terms-list-table.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
     7  * @since 3.1.0
     7  * @since 3.1.0
     8  * @access private
     8  * @access private
     9  */
     9  */
    10 class WP_Terms_List_Table extends WP_List_Table {
    10 class WP_Terms_List_Table extends WP_List_Table {
    11 
    11 
    12 	var $callback_args;
    12 	public $callback_args;
    13 
    13 
    14 	function __construct( $args = array() ) {
    14 	private $level;
       
    15 
       
    16 	/**
       
    17 	 * Constructor.
       
    18 	 *
       
    19 	 * @since 3.1.0
       
    20 	 * @access public
       
    21 	 *
       
    22 	 * @see WP_List_Table::__construct() for more information on default arguments.
       
    23 	 *
       
    24 	 * @param array $args An associative array of arguments.
       
    25 	 */
       
    26 	public function __construct( $args = array() ) {
    15 		global $post_type, $taxonomy, $action, $tax;
    27 		global $post_type, $taxonomy, $action, $tax;
    16 
    28 
    17 		parent::__construct( array(
    29 		parent::__construct( array(
    18 			'plural' => 'tags',
    30 			'plural' => 'tags',
    19 			'singular' => 'tag',
    31 			'singular' => 'tag',
    36 		if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'show_ui' => true ) ) ) )
    48 		if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'show_ui' => true ) ) ) )
    37 			$post_type = 'post';
    49 			$post_type = 'post';
    38 
    50 
    39 	}
    51 	}
    40 
    52 
    41 	function ajax_user_can() {
    53 	public function ajax_user_can() {
    42 		return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
    54 		return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
    43 	}
    55 	}
    44 
    56 
    45 	function prepare_items() {
    57 	public function prepare_items() {
    46 		$tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
    58 		$tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
    47 
    59 
    48 		if ( 'post_tag' == $this->screen->taxonomy ) {
    60 		if ( 'post_tag' == $this->screen->taxonomy ) {
       
    61 			/**
       
    62 			 * Filter the number of terms displayed per page for the Tags list table.
       
    63 			 *
       
    64 			 * @since 2.8.0
       
    65 			 *
       
    66 			 * @param int $tags_per_page Number of tags to be displayed. Default 20.
       
    67 			 */
    49 			$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
    68 			$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
    50 			$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
    69 
       
    70 			/**
       
    71 			 * Filter the number of terms displayed per page for the Tags list table.
       
    72 			 *
       
    73 			 * @since 2.7.0
       
    74 			 * @deprecated 2.8.0 Use edit_tags_per_page instead.
       
    75 			 *
       
    76 			 * @param int $tags_per_page Number of tags to be displayed. Default 20.
       
    77 			 */
       
    78 			$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page );
    51 		} elseif ( 'category' == $this->screen->taxonomy ) {
    79 		} elseif ( 'category' == $this->screen->taxonomy ) {
    52 			$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
    80 			/**
       
    81 			 * Filter the number of terms displayed per page for the Categories list table.
       
    82 			 *
       
    83 			 * @since 2.8.0
       
    84 			 *
       
    85 			 * @param int $tags_per_page Number of categories to be displayed. Default 20.
       
    86 			 */
       
    87 			$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
    53 		}
    88 		}
    54 
    89 
    55 		$search = !empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
    90 		$search = !empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
    56 
    91 
    57 		$args = array(
    92 		$args = array(
    72 			'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),
   107 			'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),
    73 			'per_page' => $tags_per_page,
   108 			'per_page' => $tags_per_page,
    74 		) );
   109 		) );
    75 	}
   110 	}
    76 
   111 
    77 	function has_items() {
   112 	public function has_items() {
    78 		// todo: populate $this->items in prepare_items()
   113 		// todo: populate $this->items in prepare_items()
    79 		return true;
   114 		return true;
    80 	}
   115 	}
    81 
   116 
    82 	function get_bulk_actions() {
   117 	public function no_items() {
       
   118 		echo get_taxonomy( $this->screen->taxonomy )->labels->not_found;
       
   119 	}
       
   120 
       
   121 	protected function get_bulk_actions() {
    83 		$actions = array();
   122 		$actions = array();
    84 		$actions['delete'] = __( 'Delete' );
   123 		$actions['delete'] = __( 'Delete' );
    85 
   124 
    86 		return $actions;
   125 		return $actions;
    87 	}
   126 	}
    88 
   127 
    89 	function current_action() {
   128 	public function current_action() {
    90 		if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] || 'delete' == $_REQUEST['action2'] ) )
   129 		if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] || 'delete' == $_REQUEST['action2'] ) )
    91 			return 'bulk-delete';
   130 			return 'bulk-delete';
    92 
   131 
    93 		return parent::current_action();
   132 		return parent::current_action();
    94 	}
   133 	}
    95 
   134 
    96 	function get_columns() {
   135 	public function get_columns() {
    97 		$columns = array(
   136 		$columns = array(
    98 			'cb'          => '<input type="checkbox" />',
   137 			'cb'          => '<input type="checkbox" />',
    99 			'name'        => _x( 'Name', 'term name' ),
   138 			'name'        => _x( 'Name', 'term name' ),
   100 			'description' => __( 'Description' ),
   139 			'description' => __( 'Description' ),
   101 			'slug'        => __( 'Slug' ),
   140 			'slug'        => __( 'Slug' ),
   102 		);
   141 		);
   103 
   142 
   104 		if ( 'link_category' == $this->screen->taxonomy ) {
   143 		if ( 'link_category' == $this->screen->taxonomy ) {
   105 			$columns['links'] = __( 'Links' );
   144 			$columns['links'] = __( 'Links' );
   106 		} else {
   145 		} else {
   107 			$post_type_object = get_post_type_object( $this->screen->post_type );
   146 			$columns['posts'] = _x( 'Count', 'Number/count of items' );
   108 			$columns['posts'] = $post_type_object ? $post_type_object->labels->name : __( 'Posts' );
       
   109 		}
   147 		}
   110 
   148 
   111 		return $columns;
   149 		return $columns;
   112 	}
   150 	}
   113 
   151 
   114 	function get_sortable_columns() {
   152 	protected function get_sortable_columns() {
   115 		return array(
   153 		return array(
   116 			'name'        => 'name',
   154 			'name'        => 'name',
   117 			'description' => 'description',
   155 			'description' => 'description',
   118 			'slug'        => 'slug',
   156 			'slug'        => 'slug',
   119 			'posts'       => 'count',
   157 			'posts'       => 'count',
   120 			'links'       => 'count'
   158 			'links'       => 'count'
   121 		);
   159 		);
   122 	}
   160 	}
   123 
   161 
   124 	function display_rows_or_placeholder() {
   162 	public function display_rows_or_placeholder() {
   125 		$taxonomy = $this->screen->taxonomy;
   163 		$taxonomy = $this->screen->taxonomy;
   126 
   164 
   127 		$args = wp_parse_args( $this->callback_args, array(
   165 		$args = wp_parse_args( $this->callback_args, array(
   128 			'page' => 1,
   166 			'page' => 1,
   129 			'number' => 20,
   167 			'number' => 20,
   130 			'search' => '',
   168 			'search' => '',
   131 			'hide_empty' => 0
   169 			'hide_empty' => 0
   132 		) );
   170 		) );
   133 
   171 
   134 		extract( $args, EXTR_SKIP );
   172 		$page = $args['page'];
       
   173 
       
   174 		// Set variable because $args['number'] can be subsequently overridden.
       
   175 		$number = $args['number'];
   135 
   176 
   136 		$args['offset'] = $offset = ( $page - 1 ) * $number;
   177 		$args['offset'] = $offset = ( $page - 1 ) * $number;
   137 
   178 
   138 		// convert it to table rows
   179 		// Convert it to table rows.
   139 		$count = 0;
   180 		$count = 0;
   140 
   181 
   141 		$terms = array();
   182 		if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
   142 
       
   143 		if ( is_taxonomy_hierarchical( $taxonomy ) && !isset( $orderby ) ) {
       
   144 			// We'll need the full set of terms then.
   183 			// We'll need the full set of terms then.
   145 			$args['number'] = $args['offset'] = 0;
   184 			$args['number'] = $args['offset'] = 0;
   146 		}
   185 		}
   147 		$terms = get_terms( $taxonomy, $args );
   186 		$terms = get_terms( $taxonomy, $args );
   148 
   187 
   149 		if ( empty( $terms ) ) {
   188 		if ( empty( $terms ) ) {
   150 			list( $columns, $hidden ) = $this->get_column_info();
       
   151 			echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
   189 			echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
   152 			$this->no_items();
   190 			$this->no_items();
   153 			echo '</td></tr>';
   191 			echo '</td></tr>';
   154 			return;
   192 			return;
   155 		}
   193 		}
   156 
   194 
   157 		if ( is_taxonomy_hierarchical( $taxonomy ) && !isset( $orderby ) ) {
   195 		if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
   158 			if ( !empty( $search ) ) // Ignore children on searches.
   196 			if ( ! empty( $args['search'] ) ) {// Ignore children on searches.
   159 				$children = array();
   197 				$children = array();
   160 			else
   198 			} else {
   161 				$children = _get_term_hierarchy( $taxonomy );
   199 				$children = _get_term_hierarchy( $taxonomy );
   162 
   200 			}
   163 			// Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
   201 			// Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
   164 			$this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
   202 			$this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
   165 		} else {
   203 		} else {
   166 			$terms = get_terms( $taxonomy, $args );
   204 			$terms = get_terms( $taxonomy, $args );
   167 			foreach ( $terms as $term )
   205 			foreach ( $terms as $term ) {
   168 				$this->single_row( $term );
   206 				$this->single_row( $term );
   169 			$count = $number; // Only displaying a single page.
   207 			}
   170 		}
   208 		}
   171 	}
   209 	}
   172 
   210 
   173 	function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
   211 	/**
       
   212 	 * @param string $taxonomy
       
   213 	 * @param array $terms
       
   214 	 * @param array $children
       
   215 	 * @param int $start
       
   216 	 * @param int $per_page
       
   217 	 * @param int $count
       
   218 	 * @param int $parent
       
   219 	 * @param int $level
       
   220 	 */
       
   221 	private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
   174 
   222 
   175 		$end = $start + $per_page;
   223 		$end = $start + $per_page;
   176 
   224 
   177 		foreach ( $terms as $key => $term ) {
   225 		foreach ( $terms as $key => $term ) {
   178 
   226 
   216 			if ( isset( $children[$term->term_id] ) && empty( $_REQUEST['s'] ) )
   264 			if ( isset( $children[$term->term_id] ) && empty( $_REQUEST['s'] ) )
   217 				$this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
   265 				$this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
   218 		}
   266 		}
   219 	}
   267 	}
   220 
   268 
   221 	function single_row( $tag, $level = 0 ) {
   269 	/**
   222 		static $row_class = '';
   270 	 * @global string $taxonomy
   223 		$row_class = ( $row_class == '' ? ' class="alternate"' : '' );
   271 	 * @param object $tag
       
   272 	 * @param int $level
       
   273 	 */
       
   274 	public function single_row( $tag, $level = 0 ) {
       
   275 		global $taxonomy;
       
   276  		$tag = sanitize_term( $tag, $taxonomy );
   224 
   277 
   225 		$this->level = $level;
   278 		$this->level = $level;
   226 
   279 
   227 		echo '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
   280 		echo '<tr id="tag-' . $tag->term_id . '">';
   228 		$this->single_row_columns( $tag );
   281 		$this->single_row_columns( $tag );
   229 		echo '</tr>';
   282 		echo '</tr>';
   230 	}
   283 	}
   231 
   284 
   232 	function column_cb( $tag ) {
   285 	/**
       
   286 	 * @param object $tag
       
   287 	 * @return string
       
   288 	 */
       
   289 	public function column_cb( $tag ) {
   233 		$default_term = get_option( 'default_' . $this->screen->taxonomy );
   290 		$default_term = get_option( 'default_' . $this->screen->taxonomy );
   234 
   291 
   235 		if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) && $tag->term_id != $default_term )
   292 		if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) && $tag->term_id != $default_term )
   236 			return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>'
   293 			return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>'
   237 				. '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
   294 				. '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
   238 
   295 
   239 		return '&nbsp;';
   296 		return '&nbsp;';
   240 	}
   297 	}
   241 
   298 
   242 	function column_name( $tag ) {
   299 	/**
       
   300 	 * @param object $tag
       
   301 	 * @return string
       
   302 	 */
       
   303 	public function column_name( $tag ) {
   243 		$taxonomy = $this->screen->taxonomy;
   304 		$taxonomy = $this->screen->taxonomy;
   244 		$tax = get_taxonomy( $taxonomy );
   305 		$tax = get_taxonomy( $taxonomy );
   245 
   306 
   246 		$default_term = get_option( 'default_' . $taxonomy );
   307 		$default_term = get_option( 'default_' . $taxonomy );
   247 
   308 
   248 		$pad = str_repeat( '&#8212; ', max( 0, $this->level ) );
   309 		$pad = str_repeat( '&#8212; ', max( 0, $this->level ) );
       
   310 
       
   311 		/**
       
   312 		 * Filter display of the term name in the terms list table.
       
   313 		 *
       
   314 		 * The default output may include padding due to the term's
       
   315 		 * current level in the term hierarchy.
       
   316 		 *
       
   317 		 * @since 2.5.0
       
   318 		 *
       
   319 		 * @see WP_Terms_List_Table::column_name()
       
   320 		 *
       
   321 		 * @param string $pad_tag_name The term name, padded if not top-level.
       
   322 		 * @param object $tag          Term object.
       
   323 		 */
   249 		$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
   324 		$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
       
   325 
   250 		$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
   326 		$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
   251 		$edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) );
   327 		$edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) );
   252 
   328 
   253 		$out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $name ) ) . '">' . $name . '</a></strong><br />';
   329 		$out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $name ) ) . '">' . $name . '</a></strong><br />';
   254 
   330 
   260 		if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
   336 		if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
   261 			$actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";
   337 			$actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";
   262 		if ( $tax->public )
   338 		if ( $tax->public )
   263 			$actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';
   339 			$actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';
   264 
   340 
       
   341 		/**
       
   342 		 * Filter the action links displayed for each term in the Tags list table.
       
   343 		 *
       
   344 		 * @since 2.8.0
       
   345 		 * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
       
   346 		 *
       
   347 		 * @param array  $actions An array of action links to be displayed. Default
       
   348 		 *                        'Edit', 'Quick Edit', 'Delete', and 'View'.
       
   349 		 * @param object $tag     Term object.
       
   350 		 */
   265 		$actions = apply_filters( 'tag_row_actions', $actions, $tag );
   351 		$actions = apply_filters( 'tag_row_actions', $actions, $tag );
       
   352 
       
   353 		/**
       
   354 		 * Filter the action links displayed for each term in the terms list table.
       
   355 		 *
       
   356 		 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
       
   357 		 *
       
   358 		 * @since 3.0.0
       
   359 		 *
       
   360 		 * @param array  $actions An array of action links to be displayed. Default
       
   361 		 *                        'Edit', 'Quick Edit', 'Delete', and 'View'.
       
   362 		 * @param object $tag     Term object.
       
   363 		 */
   266 		$actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
   364 		$actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
   267 
   365 
   268 		$out .= $this->row_actions( $actions );
   366 		$out .= $this->row_actions( $actions );
   269 		$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
   367 		$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
   270 		$out .= '<div class="name">' . $qe_data->name . '</div>';
   368 		$out .= '<div class="name">' . $qe_data->name . '</div>';
       
   369 
       
   370 		/** This filter is documented in wp-admin/edit-tag-form.php */
   271 		$out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';
   371 		$out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';
   272 		$out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
   372 		$out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
   273 
   373 
   274 		return $out;
   374 		return $out;
   275 	}
   375 	}
   276 
   376 
   277 	function column_description( $tag ) {
   377 	/**
       
   378 	 * @param object $tag
       
   379 	 * @return string
       
   380 	 */
       
   381 	public function column_description( $tag ) {
   278 		return $tag->description;
   382 		return $tag->description;
   279 	}
   383 	}
   280 
   384 
   281 	function column_slug( $tag ) {
   385 	/**
       
   386 	 * @param object $tag
       
   387 	 * @return string
       
   388 	 */
       
   389 	public function column_slug( $tag ) {
       
   390 		/** This filter is documented in wp-admin/edit-tag-form.php */
   282 		return apply_filters( 'editable_slug', $tag->slug );
   391 		return apply_filters( 'editable_slug', $tag->slug );
   283 	}
   392 	}
   284 
   393 
   285 	function column_posts( $tag ) {
   394 	/**
       
   395 	 * @param object $tag
       
   396 	 * @return string
       
   397 	 */
       
   398 	public function column_posts( $tag ) {
   286 		$count = number_format_i18n( $tag->count );
   399 		$count = number_format_i18n( $tag->count );
   287 
   400 
   288 		$tax = get_taxonomy( $this->screen->taxonomy );
   401 		$tax = get_taxonomy( $this->screen->taxonomy );
   289 
   402 
   290 		$ptype_object = get_post_type_object( $this->screen->post_type );
   403 		$ptype_object = get_post_type_object( $this->screen->post_type );
   304 			return "<a href='" . esc_url ( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
   417 			return "<a href='" . esc_url ( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
   305 
   418 
   306 		return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
   419 		return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
   307 	}
   420 	}
   308 
   421 
   309 	function column_links( $tag ) {
   422 	/**
       
   423 	 * @param object $tag
       
   424 	 * @return string
       
   425 	 */
       
   426 	public function column_links( $tag ) {
   310 		$count = number_format_i18n( $tag->count );
   427 		$count = number_format_i18n( $tag->count );
   311 		if ( $count )
   428 		if ( $count )
   312 			$count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
   429 			$count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
   313 		return $count;
   430 		return $count;
   314 	}
   431 	}
   315 
   432 
   316 	function column_default( $tag, $column_name ) {
   433 	/**
       
   434 	 * @param object $tag
       
   435 	 * @param string $column_name
       
   436 	 * @return string
       
   437 	 */
       
   438 	public function column_default( $tag, $column_name ) {
       
   439 		/**
       
   440 		 * Filter the displayed columns in the terms list table.
       
   441 		 *
       
   442 		 * The dynamic portion of the hook name, `$this->screen->taxonomy`,
       
   443 		 * refers to the slug of the current taxonomy.
       
   444 		 *
       
   445 		 * @since 2.8.0
       
   446 		 *
       
   447 		 * @param string $string      Blank string.
       
   448 		 * @param string $column_name Name of the column.
       
   449 		 * @param int    $term_id     Term ID.
       
   450 		 */
   317 		return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
   451 		return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
   318 	}
   452 	}
   319 
   453 
   320 	/**
   454 	/**
   321 	 * Outputs the hidden row displayed when inline editing
   455 	 * Outputs the hidden row displayed when inline editing
   322 	 *
   456 	 *
   323 	 * @since 3.1.0
   457 	 * @since 3.1.0
   324 	 */
   458 	 */
   325 	function inline_edit() {
   459 	public function inline_edit() {
   326 		$tax = get_taxonomy( $this->screen->taxonomy );
   460 		$tax = get_taxonomy( $this->screen->taxonomy );
   327 
   461 
   328 		if ( ! current_user_can( $tax->cap->edit_terms ) )
   462 		if ( ! current_user_can( $tax->cap->edit_terms ) )
   329 			return;
   463 			return;
   330 ?>
   464 ?>
   331 
   465 
   332 	<form method="get" action=""><table style="display: none"><tbody id="inlineedit">
   466 	<form method="get"><table style="display: none"><tbody id="inlineedit">
   333 		<tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
   467 		<tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
   334 
   468 
   335 			<fieldset><div class="inline-edit-col">
   469 			<fieldset><div class="inline-edit-col">
   336 				<h4><?php _e( 'Quick Edit' ); ?></h4>
   470 				<h4><?php _e( 'Quick Edit' ); ?></h4>
   337 
   471 
   354 
   488 
   355 		foreach ( $columns as $column_name => $column_display_name ) {
   489 		foreach ( $columns as $column_name => $column_display_name ) {
   356 			if ( isset( $core_columns[$column_name] ) )
   490 			if ( isset( $core_columns[$column_name] ) )
   357 				continue;
   491 				continue;
   358 
   492 
       
   493 			/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
   359 			do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
   494 			do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
   360 		}
   495 		}
   361 
   496 
   362 	?>
   497 	?>
   363 
   498 
   364 		<p class="inline-edit-save submit">
   499 		<p class="inline-edit-save submit">
   365 			<a accesskey="c" href="#inline-edit" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
   500 			<a href="#inline-edit" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
   366 			<a accesskey="s" href="#inline-edit" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></a>
   501 			<a href="#inline-edit" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></a>
   367 			<span class="spinner"></span>
   502 			<span class="spinner"></span>
   368 			<span class="error" style="display:none;"></span>
   503 			<span class="error" style="display:none;"></span>
   369 			<?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
   504 			<?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
   370 			<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
   505 			<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
   371 			<input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />
   506 			<input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />