-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.php
55 lines (47 loc) · 1.22 KB
/
common.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
if ( ! class_exists( 'ATGPB' ) ) {
die();
}
/**
* Class ATGPBCommon
*
* Includes common methods accessed throughout ATG Plugin Boilerplate.
*/
class ATGPBCommon {
//Returns the url of the plugin's root folder
public static function get_base_url() {
return plugins_url( '', __FILE__ );
}
//Returns the physical path of the plugin's root folder
public static function get_base_path() {
return dirname( __FILE__ );
}
/**
* Outputs the page header
*
* @access public
* @static
*
* @param string $title Optional. The page title to be used. Defaults to an empty string.
* @param string $message Optional. The message to display in the header. Defaults to empty string.
*/
public static function page_header( $title = '', $message = '' ) { ?>
<div class="wrap">
<?php if ( $message ) { ?>
<div id="message" class="updated fade"><p><strong><?php echo $message; ?></strong></p></div>
<?php } ?>
<h1><?php echo esc_html( $title ) ?></h1>
<?php
}
/**
* Outputs the page footer
*
* @access public
* @static
*/
public static function page_footer() { ?>
<br class="clear" style="clear: both;" />
</div> <!-- / wrap -->
<?php
}
}