WordPress at Your Fingertips
function is not described

WP_Posts_List_Table::single_row() public WP 1.0

{} It's a method of the class: WP_Posts_List_Table{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Posts_List_Table = new WP_Posts_List_Table();
$WP_Posts_List_Table->single_row( $post, $level );
$post *(int WP_Post) (required)*
$level(int)
-

Notes

  • Global. WP_Post. $post Global post object.

Code of WP_Posts_List_Table::single_row() WP 5.8.2

<?php
public function single_row( $post, $level = 0 ) {
	$global_post = get_post();

	$post                = get_post( $post );
	$this->current_level = $level;

	$GLOBALS['post'] = $post;
	setup_postdata( $post );

	$classes = 'iedit author-' . ( get_current_user_id() === (int) $post->post_author ? 'self' : 'other' );

	$lock_holder = wp_check_post_lock( $post->ID );

	if ( $lock_holder ) {
		$classes .= ' wp-locked';
	}

	if ( $post->post_parent ) {
		$count    = count( get_post_ancestors( $post->ID ) );
		$classes .= ' level-' . $count;
	} else {
		$classes .= ' level-0';
	}
	?>
	<tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>">
		<?php $this->single_row_columns( $post ); ?>
	</tr>
	<?php
	$GLOBALS['post'] = $global_post;
}