-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRothco.php
More file actions
65 lines (42 loc) · 1.87 KB
/
Rothco.php
File metadata and controls
65 lines (42 loc) · 1.87 KB
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
<?php
/*
Plugin Name: Rothco
Plugin URI: https://facebook.com/ultimatemahbub
Description: This plugin can sync product from Rothco to woocommerce.
Version: 1.1
Author: Mahbubur Rahman
Author URI: http://facebook.com/ultimatemahbub
License: GPL2
*/
if (! defined('ABSPATH')) {
exit;
}
//require_once($_SERVER['DOCUMENT_ROOT'] .'/wp-config.php');
//require_once($_SERVER['DOCUMENT_ROOT'] .'/wp-load.php');
include_once( plugin_dir_path( __FILE__ ) . 'get_categories.php' );
include_once( plugin_dir_path( __FILE__ ) . 'rothco_sync.php' );
include_once( plugin_dir_path( __FILE__ ) . 'homepage.php' );
add_action( 'admin_menu', 'rothco_menu' );
function rothco_menu() {
// add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
add_menu_page( 'Rothco Sync', 'Rothco Sync', 'manage_options', 'Rothco', 'homepage', 'dashicons-screenoptions', 90 );
}
function rothco_admin_enqueue_scripts(){
global $pagenow;
if ($pagenow=='admin.php') {
// register AngularJS
wp_register_script('angular-core', '//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js', array(), null, false);
wp_enqueue_script('angular-core');
// JS
wp_register_script('prefix_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js');
wp_enqueue_script('prefix_bootstrap');
// CSS
wp_register_style('prefix_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');
wp_enqueue_style('prefix_bootstrap');
wp_enqueue_script('jquery');
wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery' ) );
wp_register_style('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css');
wp_enqueue_style( 'jquery-ui' );
}
}
add_action('admin_enqueue_scripts','rothco_admin_enqueue_scripts');