-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathapiclient.php
More file actions
37 lines (32 loc) · 778 Bytes
/
apiclient.php
File metadata and controls
37 lines (32 loc) · 778 Bytes
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
<?php
/*
Plugin Name: API Client
Plugin URI: http://localhost
Description: fill this in
Version: 0.1
Author: Ben Lobaugh
Author URI: http://ben.lobaugh.net
*/
/**
* TODO:
*
* Prettify with WordPress styles
* Sanitize db inputs
* Possibly add listing of endpoints to form
*/
add_action( 'init', 'api_client_includes', 1 );
function api_client_includes() {
require_once( 'ApiRequest.class.php' );
}
add_action( 'init', 'my_plugin_load_first' );
function my_plugin_load_first()
{
$path = str_replace( WP_PLUGIN_DIR . '/', '', __FILE__ );
if ( $plugins = get_option( 'active_plugins' ) ) {
if ( $key = array_search( $path, $plugins ) ) {
array_splice( $plugins, $key, 1 );
array_unshift( $plugins, $path );
update_option( 'active_plugins', $plugins );
}
}
}