@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Widget class |
6 | 6 | */ |
7 | -if ( ! class_exists( 'PLUGIN_WIDGET' ) ) { |
|
7 | +if ( ! class_exists('PLUGIN_WIDGET')) { |
|
8 | 8 | |
9 | 9 | final class PLUGIN_WIDGET extends WP_WIDGET { |
10 | 10 | |
@@ -15,33 +15,33 @@ discard block |
||
15 | 15 | |
16 | 16 | $widget_ops = array( |
17 | 17 | 'classname' => 'plugin_widget', |
18 | - 'description' => __( 'Plugin widget', 'textdomain' ), |
|
18 | + 'description' => __('Plugin widget', 'textdomain'), |
|
19 | 19 | ); |
20 | - parent::__construct( 'my_widget_id', __( 'Plugin widget', 'textdomain' ), $widget_ops ); |
|
20 | + parent::__construct('my_widget_id', __('Plugin widget', 'textdomain'), $widget_ops); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | |
25 | 25 | //Outputs the content of the widget |
26 | - public function widget( $args, $instance ) { |
|
26 | + public function widget($args, $instance) { |
|
27 | 27 | |
28 | 28 | echo $args['before_widget']; |
29 | - if ( ! empty( $instance['title'] ) ) { |
|
30 | - echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; |
|
29 | + if ( ! empty($instance['title'])) { |
|
30 | + echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title']; |
|
31 | 31 | } |
32 | - echo esc_html__( 'Hello, World!', 'textdomain' ); |
|
32 | + echo esc_html__('Hello, World!', 'textdomain'); |
|
33 | 33 | echo $args['after_widget']; |
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | 38 | //Outputs the options form on admin |
39 | - public function form( $instance ) { |
|
39 | + public function form($instance) { |
|
40 | 40 | |
41 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'Internal Link Master', 'textdomain' ); ?> |
|
41 | + $title = ! empty($instance['title']) ? $instance['title'] : esc_html__('Internal Link Master', 'textdomain'); ?> |
|
42 | 42 | <p> |
43 | - <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'textdomain' ); ?></label> |
|
44 | - <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>"> |
|
43 | + <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'textdomain'); ?></label> |
|
44 | + <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>"> |
|
45 | 45 | </p> |
46 | 46 | <?php |
47 | 47 | } |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | |
50 | 50 | |
51 | 51 | //Processing widget options on save |
52 | - public function update( $new_instance, $old_instance ) { |
|
52 | + public function update($new_instance, $old_instance) { |
|
53 | 53 | |
54 | 54 | $instance = array(); |
55 | - $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; |
|
55 | + $instance['title'] = ( ! empty($new_instance['title'])) ? strip_tags($new_instance['title']) : ''; |
|
56 | 56 | return $instance; |
57 | 57 | } |
58 | 58 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
3 | 5 | |
4 | 6 | /** |
5 | 7 | * Widget class |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Build a sample metabox in editor screen |
6 | 6 | */ |
7 | -if ( ! class_exists( 'PLUGIN_METABOX' ) ) { |
|
7 | +if ( ! class_exists('PLUGIN_METABOX')) { |
|
8 | 8 | |
9 | 9 | final class PLUGIN_METABOX { |
10 | 10 | |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | public function __construct() { |
14 | 14 | |
15 | 15 | //Adding the metabox. For custom post type use "add_meta_boxes_posttype" action |
16 | - add_action( 'add_meta_boxes', array( $this, 'register' ) ); |
|
17 | - add_action( 'save_post', array( $this, 'save' ), 10, 2 ); |
|
16 | + add_action('add_meta_boxes', array($this, 'register')); |
|
17 | + add_action('save_post', array($this, 'save'), 10, 2); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | |
24 | 24 | add_meta_box( |
25 | 25 | 'meta-box-id', |
26 | - esc_html__( 'MetaBox Title', 'textdomain' ), |
|
27 | - array( $this, 'render' ), |
|
26 | + esc_html__('MetaBox Title', 'textdomain'), |
|
27 | + array($this, 'render'), |
|
28 | 28 | // Declare the post type to show meta box |
29 | 29 | 'post_type', |
30 | 30 | 'normal', |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | |
37 | 37 | public function render() { |
38 | 38 | |
39 | - wp_nonce_field( basename( __FILE__ ), 'metaBoxName_nonce' ); ?> |
|
39 | + wp_nonce_field(basename(__FILE__), 'metaBoxName_nonce'); ?> |
|
40 | 40 | |
41 | 41 | <p> |
42 | - <label for="metaBoxName"><?php _e( "Custom Text", 'myPlugintextDomain' ); ?></label> |
|
42 | + <label for="metaBoxName"><?php _e("Custom Text", 'myPlugintextDomain'); ?></label> |
|
43 | 43 | <br /> |
44 | - <input class="widefat" type="text" name="metaBoxFieldName" id="metaBoxFieldName" value="<?php echo esc_attr( get_post_meta( $object->ID, 'metaBoxName', true ) ); ?>" /> |
|
44 | + <input class="widefat" type="text" name="metaBoxFieldName" id="metaBoxFieldName" value="<?php echo esc_attr(get_post_meta($object->ID, 'metaBoxName', true)); ?>" /> |
|
45 | 45 | </p> |
46 | 46 | <?php |
47 | 47 | } |
@@ -49,35 +49,35 @@ discard block |
||
49 | 49 | |
50 | 50 | |
51 | 51 | //Save the post data |
52 | - function save( $post_id, $post ) { |
|
52 | + function save($post_id, $post) { |
|
53 | 53 | |
54 | 54 | //Verify the nonce before proceeding. |
55 | - if ( !isset( $_POST['metaBoxName_nonce'] ) || !wp_verify_nonce( $_POST['metaBoxName_nonce'], basename( __FILE__ ) ) ) |
|
55 | + if ( ! isset($_POST['metaBoxName_nonce']) || ! wp_verify_nonce($_POST['metaBoxName_nonce'], basename(__FILE__))) |
|
56 | 56 | return $post_id; |
57 | 57 | |
58 | 58 | //Get the post type object. |
59 | - $post_type = get_post_type_object( $post->post_type ); |
|
59 | + $post_type = get_post_type_object($post->post_type); |
|
60 | 60 | |
61 | 61 | //Check if the current user has permission to edit the post. |
62 | - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) |
|
62 | + if ( ! current_user_can($post_type->cap->edit_post, $post_id)) |
|
63 | 63 | return $post_id; |
64 | 64 | |
65 | 65 | //Get the posted data and sanitize it for use as an HTML class. |
66 | - $new_meta_value = ( isset( $_POST['metaBoxName'] ) ? sanitize_html_class( $_POST['metaBoxName'] ) : '' ); |
|
66 | + $new_meta_value = (isset($_POST['metaBoxName']) ? sanitize_html_class($_POST['metaBoxName']) : ''); |
|
67 | 67 | |
68 | 68 | //Get the meta key. |
69 | 69 | $meta_key = 'metaBoxName'; |
70 | 70 | |
71 | 71 | //Get the meta value of the custom field key. |
72 | - $meta_value = get_post_meta( $post_id, $meta_key, true ); |
|
72 | + $meta_value = get_post_meta($post_id, $meta_key, true); |
|
73 | 73 | |
74 | 74 | //If a new meta value was added and there was no previous value, add it. |
75 | - if ( $new_meta_value && '' == $meta_value ) { |
|
76 | - add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
77 | - } elseif ( $new_meta_value && $new_meta_value != $meta_value ) { |
|
78 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
79 | - } elseif ( '' == $new_meta_value && $meta_value ) { |
|
80 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
75 | + if ($new_meta_value && '' == $meta_value) { |
|
76 | + add_post_meta($post_id, $meta_key, $new_meta_value, true); |
|
77 | + } elseif ($new_meta_value && $new_meta_value != $meta_value) { |
|
78 | + update_post_meta($post_id, $meta_key, $new_meta_value); |
|
79 | + } elseif ('' == $new_meta_value && $meta_value) { |
|
80 | + delete_post_meta($post_id, $meta_key, $meta_value); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
3 | 5 | |
4 | 6 | /** |
5 | 7 | * Build a sample metabox in editor screen |
@@ -52,15 +54,17 @@ discard block |
||
52 | 54 | function save( $post_id, $post ) { |
53 | 55 | |
54 | 56 | //Verify the nonce before proceeding. |
55 | - if ( !isset( $_POST['metaBoxName_nonce'] ) || !wp_verify_nonce( $_POST['metaBoxName_nonce'], basename( __FILE__ ) ) ) |
|
56 | - return $post_id; |
|
57 | + if ( !isset( $_POST['metaBoxName_nonce'] ) || !wp_verify_nonce( $_POST['metaBoxName_nonce'], basename( __FILE__ ) ) ) { |
|
58 | + return $post_id; |
|
59 | + } |
|
57 | 60 | |
58 | 61 | //Get the post type object. |
59 | 62 | $post_type = get_post_type_object( $post->post_type ); |
60 | 63 | |
61 | 64 | //Check if the current user has permission to edit the post. |
62 | - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) |
|
63 | - return $post_id; |
|
65 | + if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) { |
|
66 | + return $post_id; |
|
67 | + } |
|
64 | 68 | |
65 | 69 | //Get the posted data and sanitize it for use as an HTML class. |
66 | 70 | $new_meta_value = ( isset( $_POST['metaBoxName'] ) ? sanitize_html_class( $_POST['metaBoxName'] ) : '' ); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | License: GPLv2 |
12 | 12 | License URI: http://www.gnu.org/licenses/gpl-3.0.html |
13 | 13 | */ |
14 | -if (!defined('ABSPATH')) exit; |
|
14 | +if ( ! defined('ABSPATH')) exit; |
|
15 | 15 | |
16 | 16 | |
17 | 17 | //Define basic names |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | defined('PLUGIN_PATH') or define('PLUGIN_PATH', plugin_dir_path(__FILE__)); |
22 | 22 | defined('PLUGIN_FILE') or define('PLUGIN_FILE', plugin_basename(__FILE__)); |
23 | 23 | |
24 | -defined('PLUGIN_EXECUTE') or define('PLUGIN_EXECUTE', plugin_dir_path(__FILE__).'src/'); |
|
25 | -defined('PLUGIN_HELPER') or define('PLUGIN_HELPER', plugin_dir_path(__FILE__).'helper/'); |
|
26 | -defined('PLUGIN_TRANSLATE') or define('PLUGIN_TRANSLATE', plugin_basename( plugin_dir_path(__FILE__).'asset/ln/')); |
|
24 | +defined('PLUGIN_EXECUTE') or define('PLUGIN_EXECUTE', plugin_dir_path(__FILE__) . 'src/'); |
|
25 | +defined('PLUGIN_HELPER') or define('PLUGIN_HELPER', plugin_dir_path(__FILE__) . 'helper/'); |
|
26 | +defined('PLUGIN_TRANSLATE') or define('PLUGIN_TRANSLATE', plugin_basename(plugin_dir_path(__FILE__) . 'asset/ln/')); |
|
27 | 27 | |
28 | 28 | //change /wp-plugin-framework/ with your /plugin-name/ |
29 | -defined('PLUGIN_JS') or define('PLUGIN_JS', plugins_url().'/wp-plugin-framework/asset/js/'); |
|
30 | -defined('PLUGIN_CSS') or define('PLUGIN_CSS', plugins_url().'/wp-plugin-framework/asset/css/'); |
|
31 | -defined('PLUGIN_IMAGE') or define('PLUGIN_IMAGE', plugins_url().'/wp-plugin-framework/asset/img/'); |
|
29 | +defined('PLUGIN_JS') or define('PLUGIN_JS', plugins_url() . '/wp-plugin-framework/asset/js/'); |
|
30 | +defined('PLUGIN_CSS') or define('PLUGIN_CSS', plugins_url() . '/wp-plugin-framework/asset/css/'); |
|
31 | +defined('PLUGIN_IMAGE') or define('PLUGIN_IMAGE', plugins_url() . '/wp-plugin-framework/asset/img/'); |
|
32 | 32 | |
33 | 33 | |
34 | 34 | //The Plugin |
35 | 35 | require_once('autoload.php'); |
36 | -if ( class_exists( 'PLUGIN_BUILD' ) ) new PLUGIN_BUILD(); ?> |
|
37 | 36 | \ No newline at end of file |
37 | +if (class_exists('PLUGIN_BUILD')) new PLUGIN_BUILD(); ?> |
|
38 | 38 | \ No newline at end of file |
@@ -11,7 +11,9 @@ discard block |
||
11 | 11 | License: GPLv2 |
12 | 12 | License URI: http://www.gnu.org/licenses/gpl-3.0.html |
13 | 13 | */ |
14 | -if (!defined('ABSPATH')) exit; |
|
14 | +if (!defined('ABSPATH')) { |
|
15 | + exit; |
|
16 | +} |
|
15 | 17 | |
16 | 18 | |
17 | 19 | //Define basic names |
@@ -33,4 +35,7 @@ discard block |
||
33 | 35 | |
34 | 36 | //The Plugin |
35 | 37 | require_once('autoload.php'); |
36 | -if ( class_exists( 'PLUGIN_BUILD' ) ) new PLUGIN_BUILD(); ?> |
|
37 | 38 | \ No newline at end of file |
39 | +if ( class_exists( 'PLUGIN_BUILD' ) ) { |
|
40 | + new PLUGIN_BUILD(); |
|
41 | +} |
|
42 | +?> |
|
38 | 43 | \ No newline at end of file |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | public function installation() { |
12 | 12 | |
13 | 13 | /** |
14 | - * |
|
15 | - * Plugin installation |
|
16 | - * |
|
14 | + * |
|
15 | + * Plugin installation |
|
16 | + * |
|
17 | 17 | if (class_exists('PLUGIN_INSTALL')) { |
18 | 18 | |
19 | 19 | $install = new PLUGIN_INSTALL(); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | $this->corn(); |
32 | - * |
|
33 | - */ |
|
32 | + * |
|
33 | + */ |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | public function db_install() { |
57 | 57 | |
58 | 58 | /** |
59 | - * |
|
60 | - * Install database by defining your SQL |
|
61 | - * |
|
59 | + * |
|
60 | + * Install database by defining your SQL |
|
61 | + * |
|
62 | 62 | if ( class_exists( 'PLUGIN_DB' ) ) { |
63 | 63 | $db = new PLUGIN_DB(); |
64 | 64 | $db->table = 'plugin_db_table_name'; |
@@ -67,28 +67,28 @@ discard block |
||
67 | 67 | UNIQUE KEY ID (ID)"; |
68 | 68 | $db->build(); |
69 | 69 | } |
70 | - * |
|
71 | - * |
|
72 | - * Optionally check if the DB table is installed correctly |
|
73 | - * |
|
70 | + * |
|
71 | + * |
|
72 | + * Optionally check if the DB table is installed correctly |
|
73 | + * |
|
74 | 74 | if (get_option('_plugin_db_exist') == '0') { |
75 | 75 | add_action( 'admin_notices', 'db_error_msg' ); |
76 | 76 | } |
77 | - * |
|
78 | - */ |
|
77 | + * |
|
78 | + */ |
|
79 | 79 | |
80 | 80 | /** |
81 | - * |
|
82 | - * Install DB options |
|
83 | - * |
|
81 | + * |
|
82 | + * Install DB options |
|
83 | + * |
|
84 | 84 | $options = array( |
85 | 85 | array( 'option_name', '__value__' ), |
86 | 86 | ); |
87 | 87 | foreach ($options as $value) { |
88 | 88 | update_option( $value[0], $value[1] ); |
89 | 89 | } |
90 | - * |
|
91 | - */ |
|
90 | + * |
|
91 | + */ |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | public function db_uninstall() { |
108 | 108 | |
109 | 109 | /** |
110 | - * |
|
111 | - * Important table name declarition |
|
112 | - * |
|
110 | + * |
|
111 | + * Important table name declarition |
|
112 | + * |
|
113 | 113 | $tableName = 'plugin_db_table'; |
114 | 114 | |
115 | 115 | global $wpdb; |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | foreach ($options as $value) { |
121 | 121 | delete_option($value); |
122 | 122 | } |
123 | - * |
|
124 | - */ |
|
123 | + * |
|
124 | + */ |
|
125 | 125 | } |
126 | 126 | |
127 | 127 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined('ABSPATH')) exit; |
|
3 | 3 | |
4 | 4 | //Main plugin object to define the plugin |
5 | -if ( ! class_exists( 'PLUGIN_BUILD' ) ) { |
|
5 | +if ( ! class_exists('PLUGIN_BUILD')) { |
|
6 | 6 | |
7 | 7 | final class PLUGIN_BUILD { |
8 | 8 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | //Custom corn class, register it while activation |
39 | 39 | public function corn() { |
40 | 40 | |
41 | - if ( class_exists( 'PLUGIN_CRON' ) ) { |
|
41 | + if (class_exists('PLUGIN_CRON')) { |
|
42 | 42 | $cron = new PLUGIN_CRON(); |
43 | 43 | $schedule = $cron->schedule_task( |
44 | 44 | array( |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public function db_error_msg() { ?> |
98 | 98 | |
99 | 99 | <div class="notice notice-error is-dismissible"> |
100 | - <p><?php _e( 'Database table Not installed correctly.', 'textdomain' ); ?></p> |
|
100 | + <p><?php _e('Database table Not installed correctly.', 'textdomain'); ?></p> |
|
101 | 101 | </div> |
102 | 102 | <?php |
103 | 103 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | //Include scripts |
130 | 130 | public function scripts() { |
131 | 131 | |
132 | - if ( class_exists( 'CGSS_SCRIPT' ) ) new CGSS_SCRIPT(); |
|
132 | + if (class_exists('CGSS_SCRIPT')) new CGSS_SCRIPT(); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | //Include settings pages |
138 | 138 | public function settings() { |
139 | 139 | |
140 | - if ( class_exists( 'PLUGIN_SETTINGS' ) ) new PLUGIN_SETTINGS(); |
|
140 | + if (class_exists('PLUGIN_SETTINGS')) new PLUGIN_SETTINGS(); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
144 | 144 | //Include widget classes |
145 | 145 | public function widgets() { |
146 | 146 | |
147 | - if ( class_exists( 'PLUGIN_WIDGET' ) ) new PLUGIN_WIDGET(); |
|
147 | + if (class_exists('PLUGIN_WIDGET')) new PLUGIN_WIDGET(); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | //Include metabox classes |
153 | 153 | public function metabox() { |
154 | 154 | |
155 | - if ( class_exists( 'PLUGIN_METABOX' ) ) new PLUGIN_METABOX(); |
|
155 | + if (class_exists('PLUGIN_METABOX')) new PLUGIN_METABOX(); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | //Include shortcode classes |
161 | 161 | public function shortcode() { |
162 | 162 | |
163 | - if ( class_exists( 'PLUGIN_SHORTCODE' ) ) new PLUGIN_SHORTCODE(); |
|
163 | + if (class_exists('PLUGIN_SHORTCODE')) new PLUGIN_SHORTCODE(); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | $this->helpers(); |
203 | 203 | $this->functionality(); |
204 | 204 | |
205 | - register_activation_hook( PLUGIN_FILE, array( $this, 'db_install' ) ); |
|
205 | + register_activation_hook(PLUGIN_FILE, array($this, 'db_install')); |
|
206 | 206 | |
207 | 207 | //remove the DB upon uninstallation |
208 | - register_uninstall_hook( PLUGIN_FILE, array( 'PLUGIN_BUILD', 'db_uninstall' ) ); //$this won't work here. |
|
208 | + register_uninstall_hook(PLUGIN_FILE, array('PLUGIN_BUILD', 'db_uninstall')); //$this won't work here. |
|
209 | 209 | |
210 | 210 | add_action('init', array($this, 'installation')); |
211 | 211 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
3 | 5 | |
4 | 6 | //Main plugin object to define the plugin |
5 | 7 | if ( ! class_exists( 'PLUGIN_BUILD' ) ) { |
@@ -129,7 +131,9 @@ discard block |
||
129 | 131 | //Include scripts |
130 | 132 | public function scripts() { |
131 | 133 | |
132 | - if ( class_exists( 'CGSS_SCRIPT' ) ) new CGSS_SCRIPT(); |
|
134 | + if ( class_exists( 'CGSS_SCRIPT' ) ) { |
|
135 | + new CGSS_SCRIPT(); |
|
136 | + } |
|
133 | 137 | } |
134 | 138 | |
135 | 139 | |
@@ -137,14 +141,18 @@ discard block |
||
137 | 141 | //Include settings pages |
138 | 142 | public function settings() { |
139 | 143 | |
140 | - if ( class_exists( 'PLUGIN_SETTINGS' ) ) new PLUGIN_SETTINGS(); |
|
144 | + if ( class_exists( 'PLUGIN_SETTINGS' ) ) { |
|
145 | + new PLUGIN_SETTINGS(); |
|
146 | + } |
|
141 | 147 | } |
142 | 148 | |
143 | 149 | |
144 | 150 | //Include widget classes |
145 | 151 | public function widgets() { |
146 | 152 | |
147 | - if ( class_exists( 'PLUGIN_WIDGET' ) ) new PLUGIN_WIDGET(); |
|
153 | + if ( class_exists( 'PLUGIN_WIDGET' ) ) { |
|
154 | + new PLUGIN_WIDGET(); |
|
155 | + } |
|
148 | 156 | } |
149 | 157 | |
150 | 158 | |
@@ -152,7 +160,9 @@ discard block |
||
152 | 160 | //Include metabox classes |
153 | 161 | public function metabox() { |
154 | 162 | |
155 | - if ( class_exists( 'PLUGIN_METABOX' ) ) new PLUGIN_METABOX(); |
|
163 | + if ( class_exists( 'PLUGIN_METABOX' ) ) { |
|
164 | + new PLUGIN_METABOX(); |
|
165 | + } |
|
156 | 166 | } |
157 | 167 | |
158 | 168 | |
@@ -160,7 +170,9 @@ discard block |
||
160 | 170 | //Include shortcode classes |
161 | 171 | public function shortcode() { |
162 | 172 | |
163 | - if ( class_exists( 'PLUGIN_SHORTCODE' ) ) new PLUGIN_SHORTCODE(); |
|
173 | + if ( class_exists( 'PLUGIN_SHORTCODE' ) ) { |
|
174 | + new PLUGIN_SHORTCODE(); |
|
175 | + } |
|
164 | 176 | } |
165 | 177 | |
166 | 178 |