-
Notifications
You must be signed in to change notification settings - Fork 0
/
mathilda_developer.php
138 lines (106 loc) · 5.55 KB
/
mathilda_developer.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
/*
Security
*/
if (!defined('ABSPATH')) { exit; }
/*
Is Developer
*/
$mathilda_developer=get_option('mathilda_developer');
if ($mathilda_developer == 1)
{add_action( 'admin_menu', 'mathilda_developer_options_menu');}
/*
Developer Options Menu
*/
function mathilda_developer_options_menu() {
add_options_page('Mathilda Developer', 'Mathilda Developer', 'manage_options', 'mathilda-developer-options', "mathilda_developer_options_content");
}
/*
Developer Options Page
*/
function mathilda_developer_options_content() {
echo '<div class="wrap">
<h1>Options › Mathilda Developer</h1>
<p class="mathilda_settings">Internal Process Options<br/> </p>
<form method="post" action="options.php">';
do_settings_sections( 'mathilda-developer-options' );
settings_fields( 'mathilda_developer_settings' );
submit_button();
echo '</form></div><div class="clear"></div>';
}
/*
Fields
#*/
function mathilda_options_display_num_tweets_fetch_call()
{
echo '<input type="text" name="mathilda_num_tweets_fetch_call" id="mathilda_num_tweets_fetch_call" value="'. get_option('mathilda_num_tweets_fetch_call') .'"/>';
}
function mathilda_options_display_num_fetches()
{
echo '<input type="text" name="mathilda_num_fetches" id="mathilda_num_fetches" value="'. get_option('mathilda_num_fetches') .'"/>';
}
function mathilda_options_display_initial_load()
{
echo '<input type="text" name="mathilda_initial_load" id="mathilda_initial_load" value="'. get_option('mathilda_initial_load') .'"/>';
}
function mathilda_options_display_latest_tweet()
{
echo '<input type="text" name="mathilda_latest_tweet" id="mathilda_latest_tweet" value="'. get_option('mathilda_latest_tweet') .'"/>';
}
function mathilda_options_display_database_version()
{
echo '<input type="text" name="mathilda_database_version" id="mathilda_database_version" value="'. get_option('mathilda_database_version') .'"/>';
}
function mathilda_options_display_import()
{
echo '<input type="text" name="mathilda_import" id="mathilda_import" value="'. get_option('mathilda_import') .'"/>';
}
function mathilda_options_display_plugin_version()
{
echo '<input type="text" name="mathilda_plugin_version" id="mathilda_plugin_version" value="'. get_option('mathilda_plugin_version') .'"/>';
}
function mathilda_options_display_cron_period_seconds()
{
echo '<input type="text" name="mathilda_cron_period" id="mathilda_cron_period" value="'. get_option('mathilda_cron_period') .'" disabled/>';
}
function mathilda_options_display_tweets_count()
{
echo '<input type="text" name="mathilda_tweets_count" id="mathilda_tweets_count" value="'. get_option('mathilda_tweets_count') .'"/>';
}
function mathilda_options_display_highest_tweet()
{
echo '<input type="text" name="mathilda_highest_imported_tweet" id="mathilda_highest_imported_tweet" value="'. get_option('mathilda_highest_imported_tweet') .'"/>';
}
/*
Sections
*/
function mathilda_options_display_developer_description()
{ echo '<p>Database Values</p>'; }
/*
Definitions
*/
function mathilda_options_developer_display()
{
add_settings_section("developer_settings_section", "Read / Manipulate", "mathilda_options_display_developer_description", "mathilda-developer-options");
add_settings_field("mathilda_num_tweets_fetch_call", "Number Tweets @ Call", "mathilda_options_display_num_tweets_fetch_call", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_num_fetches", "Fetches", "mathilda_options_display_num_fetches", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_initial_load", "Initial Load", "mathilda_options_display_initial_load", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_latest_tweet", "Latest Tweet", "mathilda_options_display_latest_tweet", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_database_version", "Database Version", "mathilda_options_display_database_version", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_import", "Import", "mathilda_options_display_import", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_plugin_version", "Plugin Version", "mathilda_options_display_plugin_version", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_cron_period_seconds", "Cron Period Seconds", "mathilda_options_display_cron_period_seconds", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_tweets_count", "Tweet Counter", "mathilda_options_display_tweets_count", "mathilda-developer-options", "developer_settings_section");
add_settings_field("mathilda_highest_imported_tweet", "Highest Imported Tweet", "mathilda_options_display_highest_tweet", "mathilda-developer-options", "developer_settings_section");
register_setting("mathilda_developer_settings", "mathilda_num_tweets_fetch_call");
register_setting("mathilda_developer_settings", "mathilda_num_fetches");
register_setting("mathilda_developer_settings", "mathilda_initial_load");
register_setting("mathilda_developer_settings", "mathilda_latest_tweet");
register_setting("mathilda_developer_settings", "mathilda_database_version");
register_setting("mathilda_developer_settings", "mathilda_import");
register_setting("mathilda_developer_settings", "mathilda_plugin_version");
register_setting("mathilda_developer_settings", "mathilda_tweets_count");
register_setting("mathilda_developer_settings", "mathilda_highest_imported_tweet");
}
add_action("admin_init", "mathilda_options_developer_display");
?>