Code Duplication    Length = 9-11 lines in 3 locations

wp-includes/class-wp-customize-panel.php 1 location

@@ 233-243 (lines=11) @@
230
	 *
231
	 * @return bool False if theme doesn't support the panel or the user doesn't have the capability.
232
	 */
233
	final public function check_capabilities() {
234
		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
235
			return false;
236
		}
237
238
		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
239
			return false;
240
		}
241
242
		return true;
243
	}
244
245
	/**
246
	 * Get the panel's content template for insertion into the Customizer pane.

wp-includes/class-wp-customize-section.php 1 location

@@ 250-260 (lines=11) @@
247
	 *
248
	 * @return bool False if theme doesn't support the section or user doesn't have the capability.
249
	 */
250
	final public function check_capabilities() {
251
		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
252
			return false;
253
		}
254
255
		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
256
			return false;
257
		}
258
259
		return true;
260
	}
261
262
	/**
263
	 * Get the section's content for insertion into the Customizer pane.

wp-includes/class-wp-customize-setting.php 1 location

@@ 780-788 (lines=9) @@
777
	 *
778
	 * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true.
779
	 */
780
	final public function check_capabilities() {
781
		if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
782
			return false;
783
784
		if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) )
785
			return false;
786
787
		return true;
788
	}
789
790
	/**
791
	 * Multidimensional helper function.