-
Notifications
You must be signed in to change notification settings - Fork 0
/
session_authors.php
91 lines (55 loc) · 2.93 KB
/
session_authors.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
require_once 'knobs.php';
require_once 'header_cli.php';
define('WP_USE_THEMES', false);
/** Loads the WordPress Environment and Template */
require($WP_BLOG_HEADER_PATH);
header("HTTP/1.1 200 OK");
$query = new WP_Query( array( "cat" => $THIS_BCB_CATEGORY) );
if ($query->have_posts())
{
$arraybuilder = array();
while ($query->have_posts())
{
$query->the_post();
$mypost = array();
// $mypost['id'] = get_the_ID();
$mypost['title'] = get_the_title();
$userobj = get_user_by("login", get_the_author_meta("user_login"));
$mypost['user_name'] = $userobj->data->user_login;
$mypost['user_email'] = $userobj->data->user_email;
// print_r($mypost);
array_push($arraybuilder, $mypost);
}
echo "STRUCTURED INFO\n\n\n";
print_r($arraybuilder);
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n\n\n COMMA SEPARATED EMAILS \n\n\n";
foreach ($arraybuilder as $item)
{
echo $item['user_email'].", ";
}
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n\n\n VERTICAL LIST OF USERNAMES \n\n\n";
foreach ($arraybuilder as $item)
{
echo $item['user_name']."\n";
}
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n\n\n VERTICAL LIST OF EMAILS \n\n\n";
foreach ($arraybuilder as $item)
{
echo $item['user_email']."\n";
}
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n////////////////////////////////////////////////////////////////////////////////////\n";
echo "\n\n\n COMMA SEPARATED USERNAMES\n\n\n";
foreach ($arraybuilder as $item)
{
echo $item['user_name'].", ";
}
}
?>