@@ -3,7 +3,9 @@ |
||
3 | 3 | * Doing AJAX the WordPress way. |
4 | 4 | * Use this class in admin or user side |
5 | 5 | */ |
6 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
6 | +if ( ! defined( 'ABSPATH' ) ) { |
|
7 | + exit; |
|
8 | +} |
|
7 | 9 | |
8 | 10 | //AJAX helper class |
9 | 11 | if ( ! class_exists( 'PLUGIN_AJAX' ) ) { |
@@ -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 | * Plugin upload for WordPress front end or backend |
@@ -2,7 +2,9 @@ |
||
2 | 2 | /** |
3 | 3 | * Add scripts to the plugin. CSS and JS. |
4 | 4 | */ |
5 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
5 | +if ( ! defined( 'ABSPATH' ) ) { |
|
6 | + exit; |
|
7 | +} |
|
6 | 8 | |
7 | 9 | if ( ! class_exists( 'PLUGIN_SCRIPT' ) ) { |
8 | 10 |
@@ -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 | * |
@@ -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 | * DB installation class |
@@ -45,10 +47,12 @@ discard block |
||
45 | 47 | $wpdb->hide_errors(); |
46 | 48 | $collate = ""; |
47 | 49 | if ( $wpdb->has_cap( 'collation' ) ) { |
48 | - if( ! empty($wpdb->charset ) ) |
|
49 | - $collate .= "DEFAULT CHARACTER SET $wpdb->charset"; |
|
50 | - if( ! empty($wpdb->collate ) ) |
|
51 | - $collate .= " COLLATE $wpdb->collate"; |
|
50 | + if( ! empty($wpdb->charset ) ) { |
|
51 | + $collate .= "DEFAULT CHARACTER SET $wpdb->charset"; |
|
52 | + } |
|
53 | + if( ! empty($wpdb->collate ) ) { |
|
54 | + $collate .= " COLLATE $wpdb->collate"; |
|
55 | + } |
|
52 | 56 | } |
53 | 57 | require_once( $this->up_path ); |
54 | 58 | return $collate; |
@@ -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 | * Shortcode class for rendering in front end |
@@ -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,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,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 |