@@ -13,8 +13,8 @@ |
||
13 | 13 | if ( ! class_exists( 'PLUGIN_TABLE' ) ) { |
14 | 14 | |
15 | 15 | if ( ! class_exists( 'WP_List_Table' ) ) { |
16 | - require_once( ABSPATH . 'wp-admin/includes/screen.php' ); |
|
17 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
|
16 | + require_once( ABSPATH . 'wp-admin/includes/screen.php' ); |
|
17 | + require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | final class PLUGIN_TABLE extends WP_List_Table { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | break; |
165 | 165 | } |
166 | 166 | |
167 | - if ( $output ) return $output; // Related to PLUGIN_TABLE() |
|
167 | + if ( $output ) return $output; // Related to PLUGIN_TABLE() |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | echo '<textarea name="settings_field_name" id="settings_field_name" value="' . get_option('settings_field_name') . '>'. __( 'Enter Value', 'textdomain' ) . '</textarea>'; |
280 | 280 | echo '<select name="settings_field_name" id="settings_field_name"><option value="value" ' . selected( 'value', get_option('settings_field_name'), false) . '>Value</option></select>'; |
281 | 281 | echo '<input type="checkbox" id="settings_field_name" name="settings_field_name" value="1"' . checked( 1, get_option('settings_field_name'), false ) . '/>'; |
282 | - */ |
|
282 | + */ |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | } ?> |
@@ -40,12 +40,12 @@ |
||
40 | 40 | /** |
41 | 41 | $user_args = $this->user_args($paged); |
42 | 42 | $the_query = new WP_User_Query( $user_args ); |
43 | - */ |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | // The Loop |
46 | 46 | if ( $the_query->have_posts() ) { |
47 | 47 | while ( $the_query->have_posts() ) { |
48 | - $the_query->the_post(); |
|
48 | + $the_query->the_post(); |
|
49 | 49 | // Do Stuff |
50 | 50 | } // end while |
51 | 51 | } // endif |
@@ -64,12 +64,12 @@ |
||
64 | 64 | |
65 | 65 | |
66 | 66 | /** |
67 | - * Save the Metabox post data |
|
68 | - * |
|
69 | - * @param Array $atts |
|
70 | - * |
|
71 | - * @return Html |
|
72 | - */ |
|
67 | + * Save the Metabox post data |
|
68 | + * |
|
69 | + * @param Array $atts |
|
70 | + * |
|
71 | + * @return Html |
|
72 | + */ |
|
73 | 73 | function save( $post_id, $post ) { |
74 | 74 | |
75 | 75 | //Check if doing autosave |
@@ -44,13 +44,13 @@ |
||
44 | 44 | global $wpdb; |
45 | 45 | $wpdb->hide_errors(); |
46 | 46 | $collate = ""; |
47 | - if ( $wpdb->has_cap( 'collation' ) ) { |
|
47 | + if ( $wpdb->has_cap( 'collation' ) ) { |
|
48 | 48 | if( ! empty($wpdb->charset ) ) |
49 | 49 | $collate .= "DEFAULT CHARACTER SET $wpdb->charset"; |
50 | 50 | if( ! empty($wpdb->collate ) ) |
51 | 51 | $collate .= " COLLATE $wpdb->collate"; |
52 | - } |
|
53 | - require_once( $this->up_path ); |
|
52 | + } |
|
53 | + require_once( $this->up_path ); |
|
54 | 54 | return $collate; |
55 | 55 | } |
56 | 56 |
@@ -24,11 +24,11 @@ |
||
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Shortcode callback |
27 | - * |
|
28 | - * @param Array $atts |
|
29 | - * |
|
30 | - * @return Html |
|
31 | - */ |
|
27 | + * |
|
28 | + * @param Array $atts |
|
29 | + * |
|
30 | + * @return Html |
|
31 | + */ |
|
32 | 32 | public function cb($atts) { |
33 | 33 | |
34 | 34 | $data = shortcode_atts( array( |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | public function register_routes() { |
22 | 22 | |
23 | 23 | $version = '1'; |
24 | - $namespace = 'vendor/v' . $version; |
|
25 | - $base = 'route'; |
|
24 | + $namespace = 'vendor/v' . $version; |
|
25 | + $base = 'route'; |
|
26 | 26 | |
27 | 27 | //Available options for methods are CREATABLE, READABLE, EDITABLE, DELETABLE |
28 | 28 | register_rest_route( $namespace, '/' . $base, array( |
29 | - 'methods' => WP_REST_Server::READABLE, |
|
30 | - 'callback' => array( $this, 'callback' ), |
|
31 | - 'permission_callback' => array( $this, 'permission' ), |
|
32 | - 'args' => array('sample', 'list', 'of', 'args'), |
|
33 | - ), |
|
29 | + 'methods' => WP_REST_Server::READABLE, |
|
30 | + 'callback' => array( $this, 'callback' ), |
|
31 | + 'permission_callback' => array( $this, 'permission' ), |
|
32 | + 'args' => array('sample', 'list', 'of', 'args'), |
|
33 | + ), |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function callback() { |
43 | 43 | |
44 | - $params = $request->get_params(); |
|
45 | - $items = array(); |
|
46 | - $data = $this->prepare_item_for_response( $items, $request ); |
|
44 | + $params = $request->get_params(); |
|
45 | + $items = array(); |
|
46 | + $data = $this->prepare_item_for_response( $items, $request ); |
|
47 | 47 | |
48 | - if ( $data ) { |
|
49 | - return new WP_REST_Response( $data, 200 ); |
|
50 | - } else { |
|
48 | + if ( $data ) { |
|
49 | + return new WP_REST_Response( $data, 200 ); |
|
50 | + } else { |
|
51 | 51 | return new WP_Error( 'status_code', __( 'message', 'text-domain' ) ); |
52 | 52 | } |
53 | 53 | } |
@@ -49,24 +49,24 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function labels() { |
51 | 51 | |
52 | - $labels = array( |
|
53 | - 'name' => _x( '', 'Post Type General Name', 'textdomain' ), |
|
54 | - 'singular_name' => _x( '', 'Post Type Singular Name', 'textdomain' ), |
|
55 | - 'menu_name' => __( '', 'textdomain' ), |
|
56 | - 'parent_item_colon' => __( '', 'textdomain' ), |
|
57 | - 'all_items' => __( '', 'textdomain' ), |
|
58 | - 'view_item' => __( '', 'textdomain' ), |
|
59 | - 'add_new_item' => __( '', 'textdomain' ), |
|
60 | - 'add_new' => __( '', 'textdomain' ), |
|
61 | - 'edit_item' => __( '', 'textdomain' ), |
|
62 | - 'update_item' => __( '', 'textdomain' ), |
|
63 | - 'search_items' => __( '', 'textdomain' ), |
|
64 | - 'not_found' => __( '', 'textdomain' ), |
|
65 | - 'not_found_in_trash' => __( '', 'textdomain' ), |
|
66 | - ); |
|
67 | - |
|
68 | - return $labels; |
|
69 | - } |
|
52 | + $labels = array( |
|
53 | + 'name' => _x( '', 'Post Type General Name', 'textdomain' ), |
|
54 | + 'singular_name' => _x( '', 'Post Type Singular Name', 'textdomain' ), |
|
55 | + 'menu_name' => __( '', 'textdomain' ), |
|
56 | + 'parent_item_colon' => __( '', 'textdomain' ), |
|
57 | + 'all_items' => __( '', 'textdomain' ), |
|
58 | + 'view_item' => __( '', 'textdomain' ), |
|
59 | + 'add_new_item' => __( '', 'textdomain' ), |
|
60 | + 'add_new' => __( '', 'textdomain' ), |
|
61 | + 'edit_item' => __( '', 'textdomain' ), |
|
62 | + 'update_item' => __( '', 'textdomain' ), |
|
63 | + 'search_items' => __( '', 'textdomain' ), |
|
64 | + 'not_found' => __( '', 'textdomain' ), |
|
65 | + 'not_found_in_trash' => __( '', 'textdomain' ), |
|
66 | + ); |
|
67 | + |
|
68 | + return $labels; |
|
69 | + } |
|
70 | 70 | |
71 | 71 | |
72 | 72 | /** |
@@ -76,44 +76,44 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return Array |
78 | 78 | */ |
79 | - public function args( $labels ) { |
|
80 | - |
|
81 | - $args = array( |
|
82 | - 'label' => __( '', 'textdomain' ), |
|
83 | - 'description' => __( '', 'textdomain' ), |
|
84 | - 'labels' => $labels, |
|
85 | - 'supports' => array( 'title', 'editor', 'thumbnail' ), |
|
86 | - 'taxonomies' => array( 'topics', 'post_tag' ), |
|
87 | - 'hierarchical' => true, |
|
88 | - 'public' => true, |
|
79 | + public function args( $labels ) { |
|
80 | + |
|
81 | + $args = array( |
|
82 | + 'label' => __( '', 'textdomain' ), |
|
83 | + 'description' => __( '', 'textdomain' ), |
|
84 | + 'labels' => $labels, |
|
85 | + 'supports' => array( 'title', 'editor', 'thumbnail' ), |
|
86 | + 'taxonomies' => array( 'topics', 'post_tag' ), |
|
87 | + 'hierarchical' => true, |
|
88 | + 'public' => true, |
|
89 | 89 | 'rewrite' => array( 'slug' => 'slug_name' ), |
90 | - 'show_ui' => true, |
|
91 | - 'show_in_menu' => true, |
|
90 | + 'show_ui' => true, |
|
91 | + 'show_in_menu' => true, |
|
92 | 92 | 'menu_icon' => 'data:image/svg+xml;base64,' . self::$menu_svg, |
93 | - 'show_in_nav_menus' => true, |
|
94 | - 'show_in_admin_bar' => true, |
|
95 | - 'menu_position' => 5, |
|
96 | - 'can_export' => true, |
|
97 | - 'has_archive' => true, |
|
98 | - 'exclude_from_search' => false, |
|
99 | - 'publicly_queryable' => true, |
|
100 | - 'capability_type' => 'post', |
|
101 | - 'show_in_rest' => true, |
|
93 | + 'show_in_nav_menus' => true, |
|
94 | + 'show_in_admin_bar' => true, |
|
95 | + 'menu_position' => 5, |
|
96 | + 'can_export' => true, |
|
97 | + 'has_archive' => true, |
|
98 | + 'exclude_from_search' => false, |
|
99 | + 'publicly_queryable' => true, |
|
100 | + 'capability_type' => 'post', |
|
101 | + 'show_in_rest' => true, |
|
102 | 102 | //Controls WP REST API behaviour |
103 | 103 | 'rest_controller_class' => 'WP_REST_Terms_Controller', |
104 | - ); |
|
104 | + ); |
|
105 | 105 | |
106 | - return $args; |
|
107 | - } |
|
106 | + return $args; |
|
107 | + } |
|
108 | 108 | |
109 | 109 | |
110 | 110 | /** |
111 | - * Modify the cpt messages |
|
111 | + * Modify the cpt messages |
|
112 | 112 | * |
113 | 113 | * @param Array $messages |
114 | 114 | * |
115 | 115 | * @return Array |
116 | - */ |
|
116 | + */ |
|
117 | 117 | public function cpt_updated_messages( $messages ) { |
118 | 118 | |
119 | 119 | global $post, $post_ID; |