Completed
Push — master ( d89f38...8e85f2 )
by Scott Kingsley
02:23
created
wordpress-fields-api.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * The absolute server path to the fields API directory.
24 24
  */
25
-define( 'WP_FIELDS_API_DIR', plugin_dir_path( __FILE__ ) );
25
+define('WP_FIELDS_API_DIR', plugin_dir_path(__FILE__));
26 26
 
27 27
 /**
28 28
  * On `plugins_loaded`, create an instance of the Fields API manager class.
@@ -30,33 +30,33 @@  discard block
 block discarded – undo
30 30
 function _wp_fields_api_include() {
31 31
 
32 32
 	// Bail if we're already in WP core (depending on the name used)
33
-	if ( class_exists( 'WP_Fields_API' ) || class_exists( 'Fields_API' ) ) {
33
+	if (class_exists('WP_Fields_API') || class_exists('Fields_API')) {
34 34
 		return;
35 35
 	}
36 36
 
37
-	if ( ! defined( 'WP_FIELDS_API_EXAMPLES' ) ) {
38
-		define( 'WP_FIELDS_API_EXAMPLES', false );
37
+	if ( ! defined('WP_FIELDS_API_EXAMPLES')) {
38
+		define('WP_FIELDS_API_EXAMPLES', false);
39 39
 	}
40 40
 
41
-	require_once( WP_FIELDS_API_DIR . 'implementation/wp-includes/fields-api/class-wp-fields-api.php' );
41
+	require_once(WP_FIELDS_API_DIR.'implementation/wp-includes/fields-api/class-wp-fields-api.php');
42 42
 
43 43
 	// Init Fields API class
44 44
 	$GLOBALS['wp_fields'] = WP_Fields_API::get_instance();
45 45
 
46 46
 }
47 47
 
48
-add_action( 'plugins_loaded', '_wp_fields_api_include', 8 );
48
+add_action('plugins_loaded', '_wp_fields_api_include', 8);
49 49
 
50 50
 /**
51 51
  * Implement Fields API Customizer instead of WP Core Customizer.
52 52
  */
53 53
 function _wp_fields_api_customize_include() {
54 54
 
55
-	if ( ! ( ( isset( $_REQUEST['wp_customize'] ) && 'on' == $_REQUEST['wp_customize'] ) || ( is_admin() && 'customize.php' == basename( $_SERVER['PHP_SELF'] ) ) ) ) {
55
+	if ( ! ((isset($_REQUEST['wp_customize']) && 'on' == $_REQUEST['wp_customize']) || (is_admin() && 'customize.php' == basename($_SERVER['PHP_SELF'])))) {
56 56
 		return;
57 57
 	}
58 58
 
59
-	require_once( WP_FIELDS_API_DIR . 'implementation/wp-includes/class-wp-customize-manager.php' );
59
+	require_once(WP_FIELDS_API_DIR.'implementation/wp-includes/class-wp-customize-manager.php');
60 60
 
61 61
 	// Init Customize class
62 62
 	$GLOBALS['wp_customize'] = new WP_Customize_Manager;
@@ -71,44 +71,44 @@  discard block
 block discarded – undo
71 71
  */
72 72
 function _wp_fields_api_implementations() {
73 73
 
74
-	$implementation_dir = WP_FIELDS_API_DIR . 'implementation/wp-includes/fields-api/forms/';
74
+	$implementation_dir = WP_FIELDS_API_DIR.'implementation/wp-includes/fields-api/forms/';
75 75
 
76 76
 	// User
77
-	require_once( $implementation_dir . 'class-wp-fields-api-form-user-edit.php' );
77
+	require_once($implementation_dir.'class-wp-fields-api-form-user-edit.php');
78 78
 
79
-	WP_Fields_API_Form_User_Edit::register( 'user', 'user-edit' );
79
+	WP_Fields_API_Form_User_Edit::register('user', 'user-edit');
80 80
 
81 81
 	// Term
82
-	require_once( $implementation_dir . 'class-wp-fields-api-form-term.php' );
83
-	require_once( $implementation_dir . 'class-wp-fields-api-form-term-add.php' );
82
+	require_once($implementation_dir.'class-wp-fields-api-form-term.php');
83
+	require_once($implementation_dir.'class-wp-fields-api-form-term-add.php');
84 84
 
85
-	WP_Fields_API_Form_Term::register( 'term', 'term-edit' );
86
-	WP_Fields_API_Form_Term_Add::register( 'term', 'term-add' );
85
+	WP_Fields_API_Form_Term::register('term', 'term-edit');
86
+	WP_Fields_API_Form_Term_Add::register('term', 'term-add');
87 87
 
88 88
 	// Settings
89
-	require_once( $implementation_dir . 'settings/class-wp-fields-api-form-settings.php' );
90
-	require_once( $implementation_dir . 'settings/class-wp-fields-api-form-settings-general.php' );
89
+	require_once($implementation_dir.'settings/class-wp-fields-api-form-settings.php');
90
+	require_once($implementation_dir.'settings/class-wp-fields-api-form-settings-general.php');
91 91
 
92
-	WP_Fields_API_Form_Settings_General::register( 'settings', 'general' );
92
+	WP_Fields_API_Form_Settings_General::register('settings', 'general');
93 93
 
94 94
 	// Settings API compatibility
95
-	require_once( $implementation_dir . 'settings/class-wp-fields-api-settings-api.php' );
95
+	require_once($implementation_dir.'settings/class-wp-fields-api-settings-api.php');
96 96
 
97 97
 	// Run Settings API compatibility (has it's own hooks)
98 98
 	new WP_Fields_API_Settings_API;
99 99
 
100 100
 	// Post / comment editor support for meta boxes
101
-	add_action( 'add_meta_boxes', array( 'WP_Fields_API_Meta_Box_Section', 'add_meta_boxes' ), 10, 2 );
101
+	add_action('add_meta_boxes', array('WP_Fields_API_Meta_Box_Section', 'add_meta_boxes'), 10, 2);
102 102
 
103 103
 	// Post types
104
-	WP_Fields_API_Table_Form::register( 'post', 'post-edit', 'post' );
105
-	WP_Fields_API_Table_Form::register( 'post', 'post-edit', 'page' );
104
+	WP_Fields_API_Table_Form::register('post', 'post-edit', 'post');
105
+	WP_Fields_API_Table_Form::register('post', 'post-edit', 'page');
106 106
 
107 107
 	// Comment types
108
-	WP_Fields_API_Table_Form::register( 'comment', 'comment-edit', 'comment' );
108
+	WP_Fields_API_Table_Form::register('comment', 'comment-edit', 'comment');
109 109
 
110 110
 }
111
-add_action( 'fields_register', '_wp_fields_api_implementations', 5 );
111
+add_action('fields_register', '_wp_fields_api_implementations', 5);
112 112
 
113 113
 /**
114 114
  * Implement Fields API User edit to override WP Core.
@@ -117,20 +117,20 @@  discard block
 block discarded – undo
117 117
 
118 118
 	static $overridden;
119 119
 
120
-	if ( empty( $overridden ) ) {
120
+	if (empty($overridden)) {
121 121
 		$overridden = true;
122 122
 
123 123
 		// Load our overrides
124 124
 		//require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/includes/user.php' );
125
-		require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/user-edit.php' );
125
+		require_once(WP_FIELDS_API_DIR.'implementation/wp-admin/user-edit.php');
126 126
 
127 127
 		// Bail on original core file, don't run the rest
128 128
 		exit;
129 129
 	}
130 130
 
131 131
 }
132
-add_action( 'load-user-edit.php', '_wp_fields_api_user_edit_include' );
133
-add_action( 'load-profile.php', '_wp_fields_api_user_edit_include' );
132
+add_action('load-user-edit.php', '_wp_fields_api_user_edit_include');
133
+add_action('load-profile.php', '_wp_fields_api_user_edit_include');
134 134
 
135 135
 
136 136
 /**
@@ -140,18 +140,18 @@  discard block
 block discarded – undo
140 140
 
141 141
 	static $overridden;
142 142
 
143
-	if ( empty( $overridden ) ) {
143
+	if (empty($overridden)) {
144 144
 		$overridden = true;
145 145
 
146 146
 		// Load our overrides
147
-		require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/edit-tags.php' );
147
+		require_once(WP_FIELDS_API_DIR.'implementation/wp-admin/edit-tags.php');
148 148
 
149 149
 		// Bail on original core file, don't run the rest
150 150
 		exit;
151 151
 	}
152 152
 
153 153
 }
154
-add_action( 'load-edit-tags.php', '_wp_fields_api_term_include' );
154
+add_action('load-edit-tags.php', '_wp_fields_api_term_include');
155 155
 
156 156
 /**
157 157
  * Implement Fields API Term to override WP Core.
@@ -160,15 +160,15 @@  discard block
 block discarded – undo
160 160
 
161 161
 	static $overridden;
162 162
 
163
-	if ( empty( $overridden ) ) {
163
+	if (empty($overridden)) {
164 164
 		$overridden = true;
165 165
 
166 166
 		// Load our overrides
167
-		require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/settings-general.php' );
167
+		require_once(WP_FIELDS_API_DIR.'implementation/wp-admin/settings-general.php');
168 168
 
169 169
 		// Bail on original core file, don't run the rest
170 170
 		exit;
171 171
 	}
172 172
 
173 173
 }
174
-add_action( 'load-options-general.php', '_wp_fields_api_settings_general_include' );
175 174
\ No newline at end of file
175
+add_action('load-options-general.php', '_wp_fields_api_settings_general_include');
176 176
\ No newline at end of file
Please login to merge, or discard this patch.