wordpress/wp-content/plugins/cms-tree-page-view/functions.php
/**
 * Pages page
 * A page with the tree. Good stuff.
 */
Pages page
A page with the tree. Good stuff.
Pages page A page with the tree . Good stuff .
function cms_tpv_pages_page() {
	$post_type = cms_tpv_get_selected_post_type();
	$post_type_object = get_post_type_object($post_type);
	if ( 'post' != $post_type ) {
		$post_new_file = "post-new.php?post_type=$post_type";
	} else {
		$post_new_file = 'post-new.php';
	}
	?>
	<div class="wrap">
		<h2><?php
			$page_title = sprintf(_x('%1$s Tree View', "headline of page with tree", "cms-tree-page-view"), $post_type_object->labels->name);
			echo $page_title;
			if ( current_user_can( $post_type_object->cap->create_posts ) ) {
				echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
			}
		?></h2>
		<?php
		cms_tpv_print_common_tree_stuff($post_type);
		?>
	</div>
	<?php
}
function cms_tpv_pages_page ( ) { $ post_type = cms_tpv_get_selected_post_type ( ) ; $ post_type_object = get_post_type_object ( $ post_type ) ; if ( 'post' != $ post_type ) { $ post_new_file = " post-new.php?post_type= $ post_type " ; } else { $ post_new_file = 'post-new.php' ; } ?> <div class="wrap">
		<h2> <?php $ page_title = sprintf ( _x ( '%1$s Tree View' , " headline of page with tree " , " cms-tree-page-view " ) , $ post_type_object -> labels -> name ) ; echo $ page_title ; if ( current_user_can ( $ post_type_object -> cap -> create_posts ) ) { echo ' <a href="' . esc_url ( $ post_new_file ) . '" class="add-new-h2">' . esc_html ( $ post_type_object -> labels -> add_new ) . '</a>' ; } ?> </h2>

		 <?php cms_tpv_print_common_tree_stuff ( $ post_type ) ; ?> </div>
	 <?php }
Pages page
 A page with the tree.
Pages page A page with the tree .
// Add "add new" link the same way as the regular post page has