Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: quick_edit_show_taxonomy

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2125      if ( empty( $data['ping_status'] ) ) {
2126           $data['ping_status'] = 'closed';
2127      }
2128
2129      // Exclude terms from taxonomies that are not supposed to appear in Quick Edit.
2130      if ( ! empty( $data['tax_input'] ) ) {
2131           foreach ( $data['tax_input'] as $taxonomy => $terms ) {
2132                $tax_object = get_taxonomy( $taxonomy );
2133                /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */
2134                if ( ! apply_filters( 'quick_edit_show_taxonomy', $tax_object->show_in_quick_edit, $taxonomy, $post['post_type'] ) ) {
2135                     unset( $data['tax_input'][ $taxonomy ] );
2136                }
2137           }
2138      }
2139
2140      // Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published.
2141      if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ), true ) ) {
2142           $post['post_status'] = 'publish';
2143           $data['post_name']   = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] );