%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/cwg/wp-content/plugins/codepress-admin-columns/classes/Column/Post/
Upload File :
Create Path :
Current File : //var/www/cwg/wp-content/plugins/codepress-admin-columns/classes/Column/Post/Depth.php

<?php

namespace AC\Column\Post;

use AC\Column;

/**
 * Depth of the current page (number of ancestors + 1)
 * @since 2.3.4
 */
class Depth extends Column {

	public function __construct() {
		$this->set_type( 'column-depth' )->set_label( __( 'Depth', 'codepress-admin-columns' ) );
	}

	public function get_value( $post_id ) {
		return $this->get_raw_value( $post_id );
	}

	public function get_raw_value( $post_id ) {
		return count( get_post_ancestors( $post_id ) ) + 1;
	}

	public function is_valid() {
		return is_post_type_hierarchical( $this->get_post_type() );
	}

}

Zerion Mini Shell 1.0