Completed
Push — master ( 9cf38f...ba822c )
by Scott Kingsley
02:10
created
wordpress-fields-api.php 1 patch
Spacing   +32 added lines, -32 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,29 +30,29 @@  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
-	require_once( WP_FIELDS_API_DIR . 'implementation/wp-includes/fields-api/class-wp-fields-api.php' );
37
+	require_once(WP_FIELDS_API_DIR.'implementation/wp-includes/fields-api/class-wp-fields-api.php');
38 38
 
39 39
 	// Init Fields API class
40 40
 	$GLOBALS['wp_fields'] = WP_Fields_API::get_instance();
41 41
 
42 42
 }
43 43
 
44
-add_action( 'plugins_loaded', '_wp_fields_api_include', 8 );
44
+add_action('plugins_loaded', '_wp_fields_api_include', 8);
45 45
 
46 46
 /**
47 47
  * Implement Fields API Customizer instead of WP Core Customizer.
48 48
  */
49 49
 function _wp_fields_api_customize_include() {
50 50
 
51
-	if ( ! ( ( isset( $_REQUEST['wp_customize'] ) && 'on' == $_REQUEST['wp_customize'] ) || ( is_admin() && 'customize.php' == basename( $_SERVER['PHP_SELF'] ) ) ) ) {
51
+	if ( ! ((isset($_REQUEST['wp_customize']) && 'on' == $_REQUEST['wp_customize']) || (is_admin() && 'customize.php' == basename($_SERVER['PHP_SELF'])))) {
52 52
 		return;
53 53
 	}
54 54
 
55
-	require_once( WP_FIELDS_API_DIR . 'implementation/wp-includes/class-wp-customize-manager.php' );
55
+	require_once(WP_FIELDS_API_DIR.'implementation/wp-includes/class-wp-customize-manager.php');
56 56
 
57 57
 	// Init Customize class
58 58
 	$GLOBALS['wp_customize'] = new WP_Customize_Manager;
@@ -67,44 +67,44 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function _wp_fields_api_implementations() {
69 69
 
70
-	$implementation_dir = WP_FIELDS_API_DIR . 'implementation/wp-includes/fields-api/forms/';
70
+	$implementation_dir = WP_FIELDS_API_DIR.'implementation/wp-includes/fields-api/forms/';
71 71
 
72 72
 	// User
73
-	require_once( $implementation_dir . 'class-wp-fields-api-form-user-edit.php' );
73
+	require_once($implementation_dir.'class-wp-fields-api-form-user-edit.php');
74 74
 
75
-	WP_Fields_API_Form_User_Edit::register( 'user', 'user-edit' );
75
+	WP_Fields_API_Form_User_Edit::register('user', 'user-edit');
76 76
 
77 77
 	// Term
78
-	require_once( $implementation_dir . 'class-wp-fields-api-form-term.php' );
79
-	require_once( $implementation_dir . 'class-wp-fields-api-form-term-add.php' );
78
+	require_once($implementation_dir.'class-wp-fields-api-form-term.php');
79
+	require_once($implementation_dir.'class-wp-fields-api-form-term-add.php');
80 80
 
81
-	WP_Fields_API_Form_Term::register( 'term', 'term-edit' );
82
-	WP_Fields_API_Form_Term_Add::register( 'term', 'term-add' );
81
+	WP_Fields_API_Form_Term::register('term', 'term-edit');
82
+	WP_Fields_API_Form_Term_Add::register('term', 'term-add');
83 83
 
84 84
 	// Settings
85
-	require_once( $implementation_dir . 'settings/class-wp-fields-api-form-settings.php' );
86
-	require_once( $implementation_dir . 'settings/class-wp-fields-api-form-settings-general.php' );
85
+	require_once($implementation_dir.'settings/class-wp-fields-api-form-settings.php');
86
+	require_once($implementation_dir.'settings/class-wp-fields-api-form-settings-general.php');
87 87
 
88
-	WP_Fields_API_Form_Settings_General::register( 'settings', 'general' );
88
+	WP_Fields_API_Form_Settings_General::register('settings', 'general');
89 89
 
90 90
 	// Settings API compatibility
91
-	require_once( $implementation_dir . 'settings/class-wp-fields-api-settings-api.php' );
91
+	require_once($implementation_dir.'settings/class-wp-fields-api-settings-api.php');
92 92
 
93 93
 	// Run Settings API compatibility (has it's own hooks)
94 94
 	new WP_Fields_API_Settings_API;
95 95
 
96 96
 	// Post / comment editor support for meta boxes
97
-	add_action( 'add_meta_boxes', array( 'WP_Fields_API_Meta_Box_Section', 'add_meta_boxes' ), 10, 2 );
97
+	add_action('add_meta_boxes', array('WP_Fields_API_Meta_Box_Section', 'add_meta_boxes'), 10, 2);
98 98
 
99 99
 	// Post types
100
-	WP_Fields_API_Table_Form::register( 'post', 'post-edit', 'post' );
101
-	WP_Fields_API_Table_Form::register( 'post', 'post-edit', 'page' );
100
+	WP_Fields_API_Table_Form::register('post', 'post-edit', 'post');
101
+	WP_Fields_API_Table_Form::register('post', 'post-edit', 'page');
102 102
 
103 103
 	// Comment types
104
-	WP_Fields_API_Table_Form::register( 'comment', 'comment-edit', 'comment' );
104
+	WP_Fields_API_Table_Form::register('comment', 'comment-edit', 'comment');
105 105
 
106 106
 }
107
-add_action( 'fields_register', '_wp_fields_api_implementations', 5 );
107
+add_action('fields_register', '_wp_fields_api_implementations', 5);
108 108
 
109 109
 /**
110 110
  * Implement Fields API User edit to override WP Core.
@@ -113,20 +113,20 @@  discard block
 block discarded – undo
113 113
 
114 114
 	static $overridden;
115 115
 
116
-	if ( empty( $overridden ) ) {
116
+	if (empty($overridden)) {
117 117
 		$overridden = true;
118 118
 
119 119
 		// Load our overrides
120 120
 		//require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/includes/user.php' );
121
-		require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/user-edit.php' );
121
+		require_once(WP_FIELDS_API_DIR.'implementation/wp-admin/user-edit.php');
122 122
 
123 123
 		// Bail on original core file, don't run the rest
124 124
 		exit;
125 125
 	}
126 126
 
127 127
 }
128
-add_action( 'load-user-edit.php', '_wp_fields_api_user_edit_include' );
129
-add_action( 'load-profile.php', '_wp_fields_api_user_edit_include' );
128
+add_action('load-user-edit.php', '_wp_fields_api_user_edit_include');
129
+add_action('load-profile.php', '_wp_fields_api_user_edit_include');
130 130
 
131 131
 
132 132
 /**
@@ -136,18 +136,18 @@  discard block
 block discarded – undo
136 136
 
137 137
 	static $overridden;
138 138
 
139
-	if ( empty( $overridden ) ) {
139
+	if (empty($overridden)) {
140 140
 		$overridden = true;
141 141
 
142 142
 		// Load our overrides
143
-		require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/edit-tags.php' );
143
+		require_once(WP_FIELDS_API_DIR.'implementation/wp-admin/edit-tags.php');
144 144
 
145 145
 		// Bail on original core file, don't run the rest
146 146
 		exit;
147 147
 	}
148 148
 
149 149
 }
150
-add_action( 'load-edit-tags.php', '_wp_fields_api_term_include' );
150
+add_action('load-edit-tags.php', '_wp_fields_api_term_include');
151 151
 
152 152
 /**
153 153
  * Implement Fields API Term to override WP Core.
@@ -156,15 +156,15 @@  discard block
 block discarded – undo
156 156
 
157 157
 	static $overridden;
158 158
 
159
-	if ( empty( $overridden ) ) {
159
+	if (empty($overridden)) {
160 160
 		$overridden = true;
161 161
 
162 162
 		// Load our overrides
163
-		require_once( WP_FIELDS_API_DIR . 'implementation/wp-admin/settings-general.php' );
163
+		require_once(WP_FIELDS_API_DIR.'implementation/wp-admin/settings-general.php');
164 164
 
165 165
 		// Bail on original core file, don't run the rest
166 166
 		exit;
167 167
 	}
168 168
 
169 169
 }
170
-add_action( 'load-options-general.php', '_wp_fields_api_settings_general_include' );
171 170
\ No newline at end of file
171
+add_action('load-options-general.php', '_wp_fields_api_settings_general_include');
172 172
\ No newline at end of file
Please login to merge, or discard this patch.