-
Notifications
You must be signed in to change notification settings - Fork 0
/
interview-project-fullstack.php
executable file
·76 lines (66 loc) · 1.66 KB
/
interview-project-fullstack.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
<?php
/**
* Plugin Name: Yums Interview Project
* Plugin URI: https://github.com/UniversalYumsLLC
* Description: Description goes here.
* Version: 1.0.0
* Author: Universal Yums
* Author URI: https://github.com/UniversalYumsLLC
* Developer: Developer Name
* Developer URI: https://example.com
*
* WC requires at least: 5.6.0
* WC tested up to: 5.8.0
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
/**
* Class InterviewProjectFullstack
* @package InterviewProjectFullstack
*/
class InterviewProjectFullstack {
/**
* The single instance of the class.
*
* @var mixed $instance
*/
protected static $instance;
/**
* Main InterviewProjectFullstack Instance.
*
* Ensures only one instance of the InterviewProjectFullstack is loaded or can be loaded.
*
* @return InterviewProjectFullstack - Main instance.
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor.
*/
public function __construct() {
add_action( 'wp_dashboard_setup', [ $this, 'add_widgets' ], 100 );
}
public function add_widgets() {
if ( current_user_can( 'edit_posts' ) ) {
wp_add_dashboard_widget( 'ipf_order_search', 'Order Search by Email', [ $this, 'order_search' ] );
}
}
/**
* Widget allows a shop admin to search for orders by email address.
*/
public function order_search() { ?>
<h3>{ Placeholder for search field and button. }</h3>
<?php }
/**
* Example method that returns a value.
*/
public static function example_method() {
return 5;
}
}
InterviewProjectFullstack::instance();