PluginProbe
WPCargo Track & Trace / trunk
WPCargo Track & Trace vtrunk
8.0.5 8.0.3 8.0.4 trunk 6.10.0 6.10.1 6.10.2 6.10.3 6.10.4 6.10.5 6.10.6 6.10.8 6.11.0 6.12.2 6.13.0 6.13.1 6.13.3 6.13.4 6.13.5 6.13.6 6.9.0 6.9.1 6.9.2 6.9.3 6.9.4 All 38 releases
wpcargo / admin / classes / class-wpc-admin.php

class-wpc-admin.php in WPCargo Track & Trace trunk, at admin/classes/class-wpc-admin.php

54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class WPC_Admin{
3 public static function add_user_role() {
4 add_role('cargo_agent', 'WPCargo Agent', array(
5 'read' => true,
6 ));
7
8 add_role('wpcargo_employee', 'WPCargo Employee', array(
9 'read' => true,
10 ));
11 add_role('wpcargo_client', 'WPCargo Client', array(
12 'read' => true,
13 ));
14 }
15 public static function remove_user_role() {
16 remove_role( 'cargo_agent' );
17 remove_role( 'wpcargo_employee' );
18 remove_role( 'wpcargo_client' );
19 }
20 public static function add_wpc_custom_pages() {
21 if (post_exists('Track') == false) {
22 $form = array(
23 'comment_status' => 'closed',
24 'ping_status' => 'closed',
25 'post_author' => 1,
26 'post_date' => date('Y-m-d H:i:s'),
27 'post_name' => 'track-form',
28 'post_status' => 'publish',
29 'post_title' => 'Track',
30 'post_type' => 'page',
31 'post_content' => '[wpcargo_trackform]'
32 );
33 $trackf = wp_insert_post($form, false);
34 }
35 if (post_exists('Account') == false) {
36 $form = array(
37 'comment_status' => 'closed',
38 'ping_status' => 'closed',
39 'post_author' => 1,
40 'post_date' => date('Y-m-d H:i:s'),
41 'post_name' => 'my-account',
42 'post_status' => 'publish',
43 'post_title' => 'Account',
44 'post_type' => 'page',
45 'post_content' => '[wpcargo_account]'
46 );
47 $account = wp_insert_post($form, false);
48 }
49 }
50 static function wpcargo_load_textdomain() {
51 load_plugin_textdomain( 'wpcargo', false, '/wpcargo/languages' );
52
53 }
54 }