Required arguments can't follow optional arguments.

Make required arguments optional in confirm_blog_signup().

Mark arguments as required in _future_post_hook(), the walker method display_element(), get_author_link() (deprecated), and the WP_Widget constructor.

props rlerdorf.
see #24210.



git-svn-id: http://core.svn.wordpress.org/trunk@24126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-04-29 13:26:31 +00:00
parent 17ddaa8de0
commit 92b4636e17
6 changed files with 9 additions and 9 deletions

View File

@ -115,7 +115,7 @@ class Walker {
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @return null Null on failure with no changes to parameters. * @return null Null on failure with no changes to parameters.
*/ */
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( !$element ) if ( !$element )
return; return;

View File

@ -1295,7 +1295,7 @@ class Walker_Comment extends Walker {
* 2.2 * 2.2
* *
*/ */
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( !$element ) if ( !$element )
return; return;

View File

@ -794,12 +794,12 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
* @deprecated Use get_author_posts_url() * @deprecated Use get_author_posts_url()
* @see get_author_posts_url() * @see get_author_posts_url()
* *
* @param bool $echo Optional. * @param bool $echo
* @param int $author_id Required. * @param int $author_id
* @param string $author_nicename Optional. * @param string $author_nicename Optional.
* @return string|null * @return string|null
*/ */
function get_author_link($echo = false, $author_id, $author_nicename = '') { function get_author_link($echo, $author_id, $author_nicename = '') {
_deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' ); _deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' );
$link = get_author_posts_url($author_id, $author_nicename); $link = get_author_posts_url($author_id, $author_nicename);

View File

@ -4786,7 +4786,7 @@ function _transition_post_status($new_status, $old_status, $post) {
* wp_transition_post_status() and the default filter for _future_post_hook(). * wp_transition_post_status() and the default filter for _future_post_hook().
* @param object $post Object type containing the post information * @param object $post Object type containing the post information
*/ */
function _future_post_hook( $deprecated = '', $post ) { function _future_post_hook( $deprecated, $post ) {
wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );
wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT') , 'publish_future_post', array( $post->ID ) ); wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT') , 'publish_future_post', array( $post->ID ) );
} }

View File

@ -73,7 +73,7 @@ class WP_Widget {
/** /**
* PHP4 constructor * PHP4 constructor
*/ */
function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) { function WP_Widget( $id_base, $name, $widget_options = array(), $control_options = array() ) {
WP_Widget::__construct( $id_base, $name, $widget_options, $control_options ); WP_Widget::__construct( $id_base, $name, $widget_options, $control_options );
} }
@ -90,7 +90,7 @@ class WP_Widget {
* - width: required if more than 250px * - width: required if more than 250px
* - height: currently not used but may be needed in the future * - height: currently not used but may be needed in the future
*/ */
function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) { function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
$this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base); $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
$this->name = $name; $this->name = $name;
$this->option_name = 'widget_' . $this->id_base; $this->option_name = 'widget_' . $this->id_base;

View File

@ -490,7 +490,7 @@ function validate_blog_signup() {
* @param string $user_email The user's email address * @param string $user_email The user's email address
* @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
*/ */
function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) { function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
?> ?>
<h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>