| 543 | | public function single_row( $post, $level = 0 ) { |
| | 552 | /** |
| | 553 | * Display the Checkbox column, only if the user can edit the post |
| | 554 | * |
| | 555 | * @todo Check the classname check-column / column-check |
| | 556 | * |
| | 557 | * @param WP_Post $post |
| | 558 | * @return null |
| | 559 | */ |
| | 560 | public function column_cb( $post ) { |
| | 561 | |
| | 562 | if ( ! current_user_can( 'edit_post', $post->ID ) ) { |
| | 563 | return ''; |
| | 564 | } |
| | 565 | |
| | 566 | ?> |
| | 567 | <label class="screen-reader-text" for="cb-select-<?php echo esc_attr( $post->ID ); ?>"><?php printf( __( 'Select %s' ), _draft_or_post_title( $post ) ); ?></label> |
| | 568 | <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php echo esc_attr( $post->ID ); ?>" /> |
| | 569 | <div class="locked-indicator"></div> |
| | 570 | <?php |
| | 571 | } |
| | 572 | |
| | 573 | /** |
| | 574 | * Display the title column for a post |
| | 575 | * |
| | 576 | * @todo classes on column |
| | 577 | * |
| | 578 | * @param WP_Post $post |
| | 579 | * @return null |
| | 580 | */ |
| | 581 | public function column_title( $post ) { |
| | 582 | |
| 556 | | $alternate = 'alternate' == $alternate ? '' : 'alternate'; |
| 557 | | $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); |
| | 592 | if ( $this->hierarchical_display ) { |
| | 593 | if ( 0 == $level && (int) $post->post_parent > 0 ) { |
| | 594 | // Sent level 0 by accident, by default, or because we don't know the actual level. |
| | 595 | $find_main_page = (int) $post->post_parent; |
| | 596 | while ( $find_main_page > 0 ) { |
| | 597 | $parent = get_post( $find_main_page ); |
| 559 | | $lock_holder = wp_check_post_lock( $post->ID ); |
| 560 | | if ( $lock_holder ) { |
| 561 | | $classes .= ' wp-locked'; |
| 562 | | $lock_holder = get_userdata( $lock_holder ); |
| | 599 | if ( is_null( $parent ) ) |
| | 600 | break; |
| | 601 | |
| | 602 | $level++; |
| | 603 | $find_main_page = (int) $parent->post_parent; |
| | 604 | |
| | 605 | if ( !isset( $parent_name ) ) { |
| | 606 | /** This filter is documented in wp-includes/post-template.php */ |
| | 607 | $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID ); |
| | 608 | } |
| | 609 | } |
| | 610 | } |
| 565 | | if ( $post->post_parent ) { |
| 566 | | $count = count( get_post_ancestors( $post->ID ) ); |
| 567 | | $classes .= ' level-'. $count; |
| | 613 | $pad = str_repeat( '— ', $level ); |
| | 614 | |
| | 615 | if ( $format = get_post_format( $post->ID ) ) { |
| | 616 | $label = get_post_format_string( $format ); |
| | 617 | |
| | 618 | echo '<a href="' . esc_url( add_query_arg( array( 'post_format' => $format, 'post_type' => $post->post_type ), 'edit.php' ) ) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> "; |
| | 619 | } |
| | 620 | |
| | 621 | if ( $can_edit_post && $post->post_status != 'trash' ) { |
| | 622 | echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>'; |
| 588 | | case 'cb': |
| 589 | | ?> |
| 590 | | <th scope="row" class="check-column"> |
| 591 | | <?php |
| | 648 | $actions = array(); |
| | 649 | if ( $can_edit_post && 'trash' != $post->post_status ) { |
| | 650 | $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>'; |
| | 651 | $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; |
| | 652 | } |
| | 653 | if ( current_user_can( 'delete_post', $post->ID ) ) { |
| | 654 | if ( 'trash' == $post->post_status ) |
| | 655 | $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>"; |
| | 656 | elseif ( EMPTY_TRASH_DAYS ) |
| | 657 | $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>"; |
| | 658 | if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) |
| | 659 | $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; |
| | 660 | } |
| | 661 | if ( $post_type_object->public ) { |
| | 662 | if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { |
| 593 | | |
| 594 | | ?> |
| 595 | | <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label> |
| 596 | | <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" /> |
| 597 | | <div class="locked-indicator"></div> |
| 598 | | <?php |
| | 664 | $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
| | 665 | /** This filter is documented in wp-admin/includes/meta-boxes.php */ |
| | 666 | $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); |
| | 667 | $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; |
| 605 | | case 'title': |
| 606 | | $attributes = 'class="post-title page-title column-title"' . $style; |
| 607 | | if ( $this->hierarchical_display ) { |
| 608 | | if ( 0 == $level && (int) $post->post_parent > 0 ) { |
| 609 | | // Sent level 0 by accident, by default, or because we don't know the actual level. |
| 610 | | $find_main_page = (int) $post->post_parent; |
| 611 | | while ( $find_main_page > 0 ) { |
| 612 | | $parent = get_post( $find_main_page ); |
| | 674 | if ( is_post_type_hierarchical( $post->post_type ) ) { |
| 614 | | if ( is_null( $parent ) ) |
| 615 | | break; |
| | 676 | /** |
| | 677 | * Filter the array of row action links on the Pages list table. |
| | 678 | * |
| | 679 | * The filter is evaluated only for hierarchical post types. |
| | 680 | * |
| | 681 | * @since 2.8.0 |
| | 682 | * |
| | 683 | * @param array $actions An array of row action links. Defaults are |
| | 684 | * 'Edit', 'Quick Edit', 'Restore, 'Trash', |
| | 685 | * 'Delete Permanently', 'Preview', and 'View'. |
| | 686 | * @param WP_Post $post The post object. |
| | 687 | */ |
| | 688 | $actions = apply_filters( 'page_row_actions', $actions, $post ); |
| | 689 | } else { |
| 617 | | $level++; |
| 618 | | $find_main_page = (int) $parent->post_parent; |
| | 691 | /** |
| | 692 | * Filter the array of row action links on the Posts list table. |
| | 693 | * |
| | 694 | * The filter is evaluated only for non-hierarchical post types. |
| | 695 | * |
| | 696 | * @since 2.8.0 |
| | 697 | * |
| | 698 | * @param array $actions An array of row action links. Defaults are |
| | 699 | * 'Edit', 'Quick Edit', 'Restore, 'Trash', |
| | 700 | * 'Delete Permanently', 'Preview', and 'View'. |
| | 701 | * @param WP_Post $post The post object. |
| | 702 | */ |
| | 703 | $actions = apply_filters( 'post_row_actions', $actions, $post ); |
| | 704 | } |
| 637 | | if ( $can_edit_post && $post->post_status != 'trash' ) { |
| 638 | | echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>'; |
| 639 | | } else { |
| 640 | | echo $pad . $title; |
| 641 | | } |
| 642 | | _post_states( $post ); |
| | 722 | if ( '0000-00-00 00:00:00' == $post->post_date ) { |
| | 723 | $t_time = $h_time = __( 'Unpublished' ); |
| | 724 | $time_diff = 0; |
| | 725 | } else { |
| | 726 | $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) ); |
| | 727 | $m_time = $post->post_date; |
| | 728 | $time = get_post_time( 'G', true, $post ); |
| 657 | | echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n"; |
| 658 | | } |
| | 740 | /** |
| | 741 | * Filter the published time of the post. |
| | 742 | * |
| | 743 | * If $mode equals 'excerpt', the published time and date are both displayed. |
| | 744 | * If $mode equals 'list' (default), the publish date is displayed, with the |
| | 745 | * time and date together available as an abbreviation definition. |
| | 746 | * |
| | 747 | * @since 2.5.1 |
| | 748 | * |
| | 749 | * @param array $t_time The published time. |
| | 750 | * @param WP_Post $post Post object. |
| | 751 | * @param string $column_name The column name. |
| | 752 | * @param string $mode The list display mode ('excerpt' or 'list'). |
| | 753 | */ |
| | 754 | echo apply_filters( 'post_date_column_time', $t_time, $post, $column_name, $mode ); |
| | 755 | } else { |
| 660 | | if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) |
| 661 | | the_excerpt(); |
| | 757 | /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ |
| | 758 | echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>'; |
| | 759 | } |
| | 760 | echo '<br />'; |
| | 761 | if ( 'publish' == $post->post_status ) { |
| | 762 | _e( 'Published' ); |
| | 763 | } elseif ( 'future' == $post->post_status ) { |
| | 764 | if ( $time_diff > 0 ) |
| | 765 | echo '<strong class="attention">' . __( 'Missed schedule' ) . '</strong>'; |
| | 766 | else |
| | 767 | _e( 'Scheduled' ); |
| | 768 | } else { |
| | 769 | _e( 'Last Modified' ); |
| | 770 | } |
| | 771 | } |
| 663 | | $actions = array(); |
| 664 | | if ( $can_edit_post && 'trash' != $post->post_status ) { |
| 665 | | $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>'; |
| 666 | | $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; |
| 667 | | } |
| 668 | | if ( current_user_can( 'delete_post', $post->ID ) ) { |
| 669 | | if ( 'trash' == $post->post_status ) |
| 670 | | $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>"; |
| 671 | | elseif ( EMPTY_TRASH_DAYS ) |
| 672 | | $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>"; |
| 673 | | if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) |
| 674 | | $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; |
| 675 | | } |
| 676 | | if ( $post_type_object->public ) { |
| 677 | | if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { |
| 678 | | if ( $can_edit_post ) { |
| 679 | | $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
| 680 | | /** This filter is documented in wp-admin/includes/meta-boxes.php */ |
| 681 | | $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); |
| 682 | | $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; |
| 683 | | } |
| 684 | | } elseif ( 'trash' != $post->post_status ) { |
| 685 | | $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; |
| 686 | | } |
| 687 | | } |
| | 773 | /** |
| | 774 | * Display the comment count column for a post |
| | 775 | * |
| | 776 | * @param WP_Post $post |
| | 777 | * @return null |
| | 778 | */ |
| | 779 | public function column_comments( $post ) { |
| 691 | | /** |
| 692 | | * Filter the array of row action links on the Pages list table. |
| 693 | | * |
| 694 | | * The filter is evaluated only for hierarchical post types. |
| 695 | | * |
| 696 | | * @since 2.8.0 |
| 697 | | * |
| 698 | | * @param array $actions An array of row action links. Defaults are |
| 699 | | * 'Edit', 'Quick Edit', 'Restore, 'Trash', |
| 700 | | * 'Delete Permanently', 'Preview', and 'View'. |
| 701 | | * @param WP_Post $post The post object. |
| 702 | | */ |
| 703 | | $actions = apply_filters( 'page_row_actions', $actions, $post ); |
| 704 | | } else { |
| | 783 | ?> |
| | 784 | <div class="post-com-count-wrapper"> |
| | 785 | <?php $this->comments_bubble( $post->ID, $pending_comments ); ?> |
| | 786 | </div> |
| | 787 | <?php |
| | 788 | } |
| 706 | | /** |
| 707 | | * Filter the array of row action links on the Posts list table. |
| 708 | | * |
| 709 | | * The filter is evaluated only for non-hierarchical post types. |
| 710 | | * |
| 711 | | * @since 2.8.0 |
| 712 | | * |
| 713 | | * @param array $actions An array of row action links. Defaults are |
| 714 | | * 'Edit', 'Quick Edit', 'Restore, 'Trash', |
| 715 | | * 'Delete Permanently', 'Preview', and 'View'. |
| 716 | | * @param WP_Post $post The post object. |
| 717 | | */ |
| 718 | | $actions = apply_filters( 'post_row_actions', $actions, $post ); |
| 719 | | } |
| | 790 | /** |
| | 791 | * Display the post author column for the post |
| | 792 | * |
| | 793 | * @todo get_the_author needs global authordata |
| | 794 | * |
| | 795 | * @param WP_Post $post |
| | 796 | * @return null |
| | 797 | */ |
| | 798 | public function column_author( $post ) { |
| | 799 | printf( '<a href="%s">%s</a>', |
| | 800 | esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => $post->post_author ), 'edit.php' ) ), |
| | 801 | get_the_author() |
| | 802 | ); |
| | 803 | } |
| 727 | | case 'date': |
| 728 | | if ( '0000-00-00 00:00:00' == $post->post_date ) { |
| 729 | | $t_time = $h_time = __( 'Unpublished' ); |
| 730 | | $time_diff = 0; |
| 731 | | } else { |
| 732 | | $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) ); |
| 733 | | $m_time = $post->post_date; |
| 734 | | $time = get_post_time( 'G', true, $post ); |
| | 825 | /** |
| | 826 | * Display a taxonomy's column for the post |
| | 827 | * |
| | 828 | * @param WP_Post $post |
| | 829 | * @param string $taxonomy |
| | 830 | * @return null |
| | 831 | */ |
| | 832 | public function column_taxonomy( $post, $taxonomy ) { |
| 738 | | if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) |
| 739 | | $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); |
| 740 | | else |
| 741 | | $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); |
| | 836 | if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) { |
| | 837 | $out = array(); |
| | 838 | foreach ( $terms as $t ) { |
| | 839 | $posts_in_term_qv = array(); |
| | 840 | if ( 'post' != $post->post_type ) |
| | 841 | $posts_in_term_qv['post_type'] = $post->post_type; |
| | 842 | if ( $taxonomy_object->query_var ) { |
| | 843 | $posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug; |
| | 844 | } else { |
| | 845 | $posts_in_term_qv['taxonomy'] = $taxonomy; |
| | 846 | $posts_in_term_qv['term'] = $t->slug; |
| 744 | | echo '<td ' . $attributes . '>'; |
| 745 | | if ( 'excerpt' == $mode ) { |
| | 849 | $out[] = sprintf( '<a href="%s">%s</a>', |
| | 850 | esc_url( add_query_arg( $posts_in_term_qv, 'edit.php' ) ), |
| | 851 | esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) ) |
| | 852 | ); |
| | 853 | } |
| | 854 | /* translators: used between list items, there is a space after the comma */ |
| | 855 | echo join( __( ', ' ), $out ); |
| | 856 | } else { |
| | 857 | echo '—'; |
| | 858 | } |
| | 859 | } |
| 747 | | /** |
| 748 | | * Filter the published time of the post. |
| 749 | | * |
| 750 | | * If $mode equals 'excerpt', the published time and date are both displayed. |
| 751 | | * If $mode equals 'list' (default), the publish date is displayed, with the |
| 752 | | * time and date together available as an abbreviation definition. |
| 753 | | * |
| 754 | | * @since 2.5.1 |
| 755 | | * |
| 756 | | * @param array $t_time The published time. |
| 757 | | * @param WP_Post $post Post object. |
| 758 | | * @param string $column_name The column name. |
| 759 | | * @param string $mode The list display mode ('excerpt' or 'list'). |
| 760 | | */ |
| 761 | | echo apply_filters( 'post_date_column_time', $t_time, $post, $column_name, $mode ); |
| 762 | | } else { |
| | 861 | /** |
| | 862 | * Display a custom column for the post |
| | 863 | * |
| | 864 | * In the event of a taxonomy column in the form of "taxonomy-$taxonomy", column_taxonomy() is called. |
| | 865 | * |
| | 866 | * @param WP_Post $post |
| | 867 | * @param string $column_name |
| | 868 | * @return null |
| | 869 | */ |
| | 870 | public function column_default( $post, $column_name ) { |
| 764 | | /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ |
| 765 | | echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>'; |
| 766 | | } |
| 767 | | echo '<br />'; |
| 768 | | if ( 'publish' == $post->post_status ) { |
| 769 | | _e( 'Published' ); |
| 770 | | } elseif ( 'future' == $post->post_status ) { |
| 771 | | if ( $time_diff > 0 ) |
| 772 | | echo '<strong class="attention">' . __( 'Missed schedule' ) . '</strong>'; |
| 773 | | else |
| 774 | | _e( 'Scheduled' ); |
| 775 | | } else { |
| 776 | | _e( 'Last Modified' ); |
| 777 | | } |
| 778 | | echo '</td>'; |
| 779 | | break; |
| | 872 | if ( 0 === strpos( $column_name, 'taxonomy-' ) ) { |
| | 873 | return $this->column_taxonomy( $post, substr( $column_name, 9 ) ); |
| | 874 | } |
| 793 | | case 'author': |
| 794 | | ?> |
| 795 | | <td <?php echo $attributes ?>><?php |
| 796 | | printf( '<a href="%s">%s</a>', |
| 797 | | esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => get_the_author_meta( 'ID' ) ), 'edit.php' )), |
| 798 | | get_the_author() |
| 799 | | ); |
| 800 | | ?></td> |
| 801 | | <?php |
| 802 | | break; |
| | 892 | /** |
| | 893 | * Fires in each custom column in the Posts list table. |
| | 894 | * |
| | 895 | * This hook only fires if the current post type is non-hierarchical, |
| | 896 | * such as posts. |
| | 897 | * |
| | 898 | * @since 1.5.0 |
| | 899 | * |
| | 900 | * @param string $column_name The name of the column to display. |
| | 901 | * @param int $post_id The current post ID. |
| | 902 | */ |
| | 903 | do_action( 'manage_posts_custom_column', $column_name, $post->ID ); |
| | 904 | } |
| 804 | | default: |
| 805 | | if ( 'categories' == $column_name ) |
| 806 | | $taxonomy = 'category'; |
| 807 | | elseif ( 'tags' == $column_name ) |
| 808 | | $taxonomy = 'post_tag'; |
| 809 | | elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) |
| 810 | | $taxonomy = substr( $column_name, 9 ); |
| 811 | | else |
| 812 | | $taxonomy = false; |
| | 906 | /** |
| | 907 | * Fires for each custom column of a specific post type in the Posts list table. |
| | 908 | * |
| | 909 | * The dynamic portion of the hook name, $post->post_type, refers to the post type. |
| | 910 | * |
| | 911 | * @since 3.1.0 |
| | 912 | * |
| | 913 | * @param string $column_name The name of the column to display. |
| | 914 | * @param int $post_id The current post ID. |
| | 915 | */ |
| | 916 | do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); |
| | 917 | } |
| 814 | | if ( $taxonomy ) { |
| 815 | | $taxonomy_object = get_taxonomy( $taxonomy ); |
| 816 | | echo '<td ' . $attributes . '>'; |
| 817 | | if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) { |
| 818 | | $out = array(); |
| 819 | | foreach ( $terms as $t ) { |
| 820 | | $posts_in_term_qv = array(); |
| 821 | | if ( 'post' != $post->post_type ) |
| 822 | | $posts_in_term_qv['post_type'] = $post->post_type; |
| 823 | | if ( $taxonomy_object->query_var ) { |
| 824 | | $posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug; |
| 825 | | } else { |
| 826 | | $posts_in_term_qv['taxonomy'] = $taxonomy; |
| 827 | | $posts_in_term_qv['term'] = $t->slug; |
| 828 | | } |
| | 919 | public function single_row( $post, $level = 0 ) { |
| | 920 | global $mode; |
| | 921 | static $alternate; |
| 830 | | $out[] = sprintf( '<a href="%s">%s</a>', |
| 831 | | esc_url( add_query_arg( $posts_in_term_qv, 'edit.php' ) ), |
| 832 | | esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) ) |
| 833 | | ); |
| 834 | | } |
| 835 | | /* translators: used between list items, there is a space after the comma */ |
| 836 | | echo join( __( ', ' ), $out ); |
| 837 | | } else { |
| 838 | | echo '—'; |
| 839 | | } |
| 840 | | echo '</td>'; |
| 841 | | break; |
| 842 | | } |
| 843 | | ?> |
| 844 | | <td <?php echo $attributes ?>><?php |
| 845 | | if ( is_post_type_hierarchical( $post->post_type ) ) { |
| | 923 | $this->row_level = $level; |
| 847 | | /** |
| 848 | | * Fires in each custom column on the Posts list table. |
| 849 | | * |
| 850 | | * This hook only fires if the current post type is hierarchical, |
| 851 | | * such as pages. |
| 852 | | * |
| 853 | | * @since 2.5.0 |
| 854 | | * |
| 855 | | * @param string $column_name The name of the column to display. |
| 856 | | * @param int $post_id The current post ID. |
| 857 | | */ |
| 858 | | do_action( 'manage_pages_custom_column', $column_name, $post->ID ); |
| 859 | | } else { |
| | 925 | $global_post = get_post(); |
| | 926 | $GLOBALS['post'] = $post; |
| | 927 | setup_postdata( $post ); |
| 861 | | /** |
| 862 | | * Fires in each custom column in the Posts list table. |
| 863 | | * |
| 864 | | * This hook only fires if the current post type is non-hierarchical, |
| 865 | | * such as posts. |
| 866 | | * |
| 867 | | * @since 1.5.0 |
| 868 | | * |
| 869 | | * @param string $column_name The name of the column to display. |
| 870 | | * @param int $post_id The current post ID. |
| 871 | | */ |
| 872 | | do_action( 'manage_posts_custom_column', $column_name, $post->ID ); |
| 873 | | } |
| | 929 | $edit_link = get_edit_post_link( $post->ID ); |
| | 930 | $title = _draft_or_post_title(); |
| | 931 | $post_type_object = get_post_type_object( $post->post_type ); |
| | 932 | $can_edit_post = current_user_can( 'edit_post', $post->ID ); |
| 875 | | /** |
| 876 | | * Fires for each custom column of a specific post type in the Posts list table. |
| 877 | | * |
| 878 | | * The dynamic portion of the hook name, $post->post_type, refers to the post type. |
| 879 | | * |
| 880 | | * @since 3.1.0 |
| 881 | | * |
| 882 | | * @param string $column_name The name of the column to display. |
| 883 | | * @param int $post_id The current post ID. |
| 884 | | */ |
| 885 | | do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); |
| 886 | | ?></td> |
| 887 | | <?php |
| 888 | | break; |
| 889 | | } |
| | 934 | $alternate = 'alternate' == $alternate ? '' : 'alternate'; |
| | 935 | $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); |
| | 936 | |
| | 937 | $lock_holder = wp_check_post_lock( $post->ID ); |
| | 938 | if ( $lock_holder ) { |
| | 939 | $classes .= ' wp-locked'; |
| | 940 | $lock_holder = get_userdata( $lock_holder ); |