In Customizer classes:

* `public final function` methods should be `final public function` - confusing Hack and aligns with PSR2
* Some methods were missing access modifiers

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31083


git-svn-id: http://core.svn.wordpress.org/trunk@31064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-01-08 06:02:24 +00:00
parent 80915aaf16
commit 905f35f289
6 changed files with 20 additions and 20 deletions

View File

@ -272,7 +272,7 @@ class WP_oEmbed {
* @param array $args Optional arguments. Usually passed from a shortcode.
* @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
*/
function get_html( $url, $args = '' ) {
public function get_html( $url, $args = '' ) {
$provider = $this->get_provider( $url, $args );
if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) )

View File

@ -183,7 +183,7 @@ class WP_Customize_Control {
*
* @return bool Whether the control is active to the current preview.
*/
public final function active() {
final public function active() {
$control = $this;
$active = call_user_func( $this->active_callback, $this );
@ -224,7 +224,7 @@ class WP_Customize_Control {
* @param string $setting_key
* @return mixed The requested setting's value, if the setting exists.
*/
public final function value( $setting_key = 'default' ) {
final public function value( $setting_key = 'default' ) {
if ( isset( $this->settings[ $setting_key ] ) ) {
return $this->settings[ $setting_key ]->value();
}
@ -270,7 +270,7 @@ class WP_Customize_Control {
*
* @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.
*/
public final function check_capabilities() {
final public function check_capabilities() {
foreach ( $this->settings as $setting ) {
if ( ! $setting->check_capabilities() )
return false;
@ -290,7 +290,7 @@ class WP_Customize_Control {
*
* @return string Contents of the control.
*/
public final function get_content() {
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
@ -304,7 +304,7 @@ class WP_Customize_Control {
* @since 3.4.0
* @uses WP_Customize_Control::render()
*/
public final function maybe_render() {
final public function maybe_render() {
if ( ! $this->check_capabilities() )
return;
@ -975,7 +975,7 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
$this->uploaded_headers = $custom_image_header->get_uploaded_header_images();
}
function print_header_image_template() {
public function print_header_image_template() {
?>
<script type="text/template" id="tmpl-header-choice">
<# if (data.random) { #>
@ -1185,7 +1185,7 @@ class WP_Widget_Form_Customize_Control extends WP_Customize_Control {
*
* @return bool Whether the widget is rendered.
*/
function active_callback() {
public function active_callback() {
return $this->manager->widgets->is_widget_rendered( $this->widget_id );
}
}

View File

@ -166,7 +166,7 @@ class WP_Customize_Panel {
*
* @return bool Whether the panel is active to the current preview.
*/
public final function active() {
final public function active() {
$panel = $this;
$active = call_user_func( $this->active_callback, $this );
@ -221,7 +221,7 @@ class WP_Customize_Panel {
*
* @return bool False if theme doesn't support the panel or the user doesn't have the capability.
*/
public final function check_capabilities() {
final public function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
return false;
}
@ -240,7 +240,7 @@ class WP_Customize_Panel {
*
* @return string Content for the panel.
*/
public final function get_content() {
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
@ -253,7 +253,7 @@ class WP_Customize_Panel {
*
* @since 4.0.0
*/
public final function maybe_render() {
final public function maybe_render() {
if ( ! $this->check_capabilities() ) {
return;
}

View File

@ -175,7 +175,7 @@ class WP_Customize_Section {
*
* @return bool Whether the section is active to the current preview.
*/
public final function active() {
final public function active() {
$section = $this;
$active = call_user_func( $this->active_callback, $this );
@ -230,7 +230,7 @@ class WP_Customize_Section {
*
* @return bool False if theme doesn't support the section or user doesn't have the capability.
*/
public final function check_capabilities() {
final public function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
return false;
}
@ -249,7 +249,7 @@ class WP_Customize_Section {
*
* @return string Contents of the section.
*/
public final function get_content() {
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
@ -262,7 +262,7 @@ class WP_Customize_Section {
*
* @since 3.4.0
*/
public final function maybe_render() {
final public function maybe_render() {
if ( ! $this->check_capabilities() ) {
return;
}

View File

@ -170,7 +170,7 @@ class WP_Customize_Setting {
*
* @return false|null False if cap check fails or value isn't set.
*/
public final function save() {
final public function save() {
$value = $this->post_value();
if ( ! $this->check_capabilities() || ! isset( $value ) )
@ -199,7 +199,7 @@ class WP_Customize_Setting {
* @param mixed $default A default value which is used as a fallback. Default is null.
* @return mixed The default value on failure, otherwise the sanitized value.
*/
public final function post_value( $default = null ) {
final public function post_value( $default = null ) {
// Check for a cached value
if ( isset( $this->_post_value ) )
return $this->_post_value;
@ -385,7 +385,7 @@ class WP_Customize_Setting {
*
* @return bool False if theme doesn't support the setting or user can't change setting, otherwise true.
*/
public final function check_capabilities() {
final public function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
return false;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31081';
$wp_version = '4.2-alpha-31083';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.