-
Notifications
You must be signed in to change notification settings - Fork 1
/
titan-post-options.php
executable file
·55 lines (49 loc) · 1.93 KB
/
titan-post-options.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
<?php
// Initialize options, called only when Titan Framework exists.
function create_wordpress_leiki_api_plugins_options() {
$titan = TitanFramework::getInstance( 'wp-leiki-api' );
// Creates the Admin panel.
$admin_panel = $titan->createAdminPanel( array(
'name' => 'Leiki API',
'id' => 'leiki-api',
'parent' => 'options-general.php',
) );
// Allows text entry.
$admin_panel->createOption( array(
'name' => 'API Key',
'id' => 'api_key',
'type' => 'text',
'desc' => 'Enter leiki API key. If you do not have one, please visit <a href="https://www.leiki.com/register-for-api-key" target="_blank">https://www.leiki.com/register-for-api-key</a> and signup for your key. It might take 2 days to get activated!'
) );
// Save or reset.
$admin_panel->createOption( array(
'type' => 'save',
) );
$panel = $titan->createMetaBox( array(
'name' => 'Leiki API',
'post_type' => ['post']
) );
$panel->createOption( array(
'name' => 'Blog Post URL',
'id' => 'blog_post_url',
'size' => 'large',
'default' => 'http://plug.direct/audience-data-strip-miners-are-failing-to-deliver-local-advertising-markets/',
'placeholder' => 'http://'
) );
$panel->createOption( array(
'name' => ' ',
'type' => 'custom',
'custom' => '<input type="button" name="get_leiki_data" id="get_leiki_data" value="Get Leiki Data" class="button button-primary button-large">',
) );
$panel->createOption( array(
'name' => 'Leiki Data(Leiki High Def)',
'id' => 'leiki_preview_content_focus100k',
'type' => 'textarea'
) );
$panel->createOption( array(
'name' => 'Leiki Data(IAB Tier 2)',
'id' => 'leiki_preview_content_iabtier2',
'type' => 'textarea'
) );
}
add_action( 'tf_create_options', 'create_wordpress_leiki_api_plugins_options' );