-
Notifications
You must be signed in to change notification settings - Fork 2
/
future-code.txt
executable file
·45 lines (34 loc) · 1.02 KB
/
future-code.txt
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
/**
* Grabs list of all authors.
*/
private function index_authors() {
$users = get_users();
foreach ( $users as $key => $user ) {
$user_id = absint( $user->data->ID );
if ( 0 < count_user_posts( $user_id ) ) {
$authors[] = array(
'id' => $user_id,
'display_name' => esc_html( $user->data->display_name ),
'path' => esc_url( str_replace( home_url(), '', get_author_posts_url( $user->data->ID ) ) ),
);
}
}
return $authors;
}
/**
* Grabs list of all URL bases.
*
* @global object $wp_rewrite The WordPress rewrite object.
*/
private function index_bases() {
global $wp_rewrite;
$bases = array(
'author' => $wp_rewrite->author_base,
'search' => $wp_rewrite->search_base,
'comments' => $wp_rewrite->comments_base,
'pagination' => $wp_rewrite->pagination_base,
'comments_pagination' => $wp_rewrite->comments_pagination_base,
'feed' => $wp_rewrite->feed_base,
);
return $bases;
}