-
Notifications
You must be signed in to change notification settings - Fork 3
/
page-my-admin.php
74 lines (59 loc) · 1.45 KB
/
page-my-admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Template Name: Custom Admin Views
*
* This page displays some custom admin
* views, and is only accessible when
* logged into WP.
*
* @package MIT_Libraries_Parent
* @since 1.2.1
*/
$pageRoot = getRoot( $post );
$section = get_post( $pageRoot );
$isRoot = $section->ID == $post->ID;
get_header(); ?>
<?php
$template_page_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-full.php',
'depth' => -1,
'hierarchical' => 0,
);
$template_pages = get_pages( $template_page_args );
$template_query_args = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-full.php',
);
$template_queries = get_pages( $template_query_args );
?>
<?php
if ( ! current_user_can( 'manage_options' ) ) {
include( get_query_template( '404' ) );
exit();
} else {
?>
<h1>Admin Views</h1>
<h2>Template Pages List</h2>
<ul>
<?php
foreach ( $template_pages as $template_page ) {
echo '<li><a href="' . get_permalink( $template_page->ID ) . '">' . $template_page->post_title . '</a></li>';
}
?>
</ul>
<h2>Blog IDs</h2>
<ul>
<?php
for ( $i = 1; $i <= 30; $i++ ) {
$blog_details = get_blog_details( $i );
if ( $blog_details == '' ) {
echo '<li>There is no blog ' . $i . '</li>';
} else {
echo '<li>Blog ' . $blog_details->blog_id . ' is called ' . $blog_details->blogname . '.</li>';
}
}
?>
</ul>
<?php } ?>
<?php get_footer(); ?>