@@ -193,20 +193,20 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
193193/**
194194 * Retrieves a list of the most popular terms from the specified taxonomy.
195195 *
196- * If the $echo argument is true then the elements for a list of checkbox
196+ * If the `$display` argument is true then the elements for a list of checkbox
197197 * `<input>` elements labelled with the names of the selected terms is output.
198- * If the $post_ID global is not empty then the terms associated with that
198+ * If the ` $post_ID` global is not empty then the terms associated with that
199199 * post will be marked as checked.
200200 *
201201 * @since 2.5.0
202202 *
203- * @param string $taxonomy Taxonomy to retrieve terms from.
204- * @param int $default Not used.
205- * @param int $number Number of terms to retrieve. Defaults to 10.
206- * @param bool $echo Optionally output the list as well. Defaults to true.
203+ * @param string $taxonomy Taxonomy to retrieve terms from.
204+ * @param int $default_term Optional. Not used.
205+ * @param int $number Optional. Number of terms to retrieve. Default 10.
206+ * @param bool $display Optional. Whether to display the list as well. Default true.
207207 * @return int[] Array of popular term IDs.
208208 */
209- function wp_popular_terms_checklist ( $ taxonomy , $ default = 0 , $ number = 10 , $ echo = true ) {
209+ function wp_popular_terms_checklist ( $ taxonomy , $ default_term = 0 , $ number = 10 , $ display = true ) {
210210 $ post = get_post ();
211211
212212 if ( $ post && $ post ->ID ) {
@@ -231,9 +231,11 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
231231
232232 foreach ( (array ) $ terms as $ term ) {
233233 $ popular_ids [] = $ term ->term_id ;
234- if ( ! $ echo ) { // Hack for Ajax use.
234+
235+ if ( ! $ display ) { // Hack for Ajax use.
235236 continue ;
236237 }
238+
237239 $ id = "popular- $ taxonomy- $ term ->term_id " ;
238240 $ checked = in_array ( $ term ->term_id , $ checked_terms , true ) ? 'checked="checked" ' : '' ;
239241 ?>
@@ -874,16 +876,16 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
874876 * @since 1.5.0
875877 * @since 4.7.0 Added the `$post_type` parameter.
876878 *
877- * @param string $default Optional. The template file name. Default empty.
878- * @param string $post_type Optional. Post type to get templates for. Default 'post'.
879+ * @param string $default_template Optional. The template file name. Default empty.
880+ * @param string $post_type Optional. Post type to get templates for. Default 'post'.
879881 */
880- function page_template_dropdown ( $ default = '' , $ post_type = 'page ' ) {
882+ function page_template_dropdown ( $ default_template = '' , $ post_type = 'page ' ) {
881883 $ templates = get_page_templates ( null , $ post_type );
882884
883885 ksort ( $ templates );
884886
885887 foreach ( array_keys ( $ templates ) as $ template ) {
886- $ selected = selected ( $ default , $ templates [ $ template ], false );
888+ $ selected = selected ( $ default_template , $ templates [ $ template ], false );
887889 echo "\n\t<option value=' " . esc_attr ( $ templates [ $ template ] ) . "' $ selected> " . esc_html ( $ template ) . '</option> ' ;
888890 }
889891}
@@ -896,13 +898,13 @@ function page_template_dropdown( $default = '', $post_type = 'page' ) {
896898 *
897899 * @global wpdb $wpdb WordPress database abstraction object.
898900 *
899- * @param int $default Optional. The default page ID to be pre-selected. Default 0.
900- * @param int $parent Optional. The parent page ID. Default 0.
901- * @param int $level Optional. Page depth level. Default 0.
902- * @param int|WP_Post $post Post ID or WP_Post object.
901+ * @param int $default_page Optional. The default page ID to be pre-selected. Default 0.
902+ * @param int $parent Optional. The parent page ID. Default 0.
903+ * @param int $level Optional. Page depth level. Default 0.
904+ * @param int|WP_Post $post Post ID or WP_Post object.
903905 * @return void|false Void on success, false if the page has no children.
904906 */
905- function parent_dropdown ( $ default = 0 , $ parent = 0 , $ level = 0 , $ post = null ) {
907+ function parent_dropdown ( $ default_page = 0 , $ parent = 0 , $ level = 0 , $ post = null ) {
906908 global $ wpdb ;
907909
908910 $ post = get_post ( $ post );
@@ -916,10 +918,10 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null )
916918 }
917919
918920 $ pad = str_repeat ( ' ' , $ level * 3 );
919- $ selected = selected ( $ default , $ item ->ID , false );
921+ $ selected = selected ( $ default_page , $ item ->ID , false );
920922
921923 echo "\n\t<option class='level- $ level' value=' $ item ->ID ' $ selected> $ pad " . esc_html ( $ item ->post_title ) . '</option> ' ;
922- parent_dropdown ( $ default , $ item ->ID , $ level + 1 );
924+ parent_dropdown ( $ default_page , $ item ->ID , $ level + 1 );
923925 }
924926 } else {
925927 return false ;
@@ -1128,8 +1130,8 @@ function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan
11281130 *
11291131 * @since 5.0.0
11301132 *
1131- * @param mixed $object The data object being rendered on this screen.
1132- * @param array $box {
1133+ * @param mixed $data_object The data object being rendered on this screen.
1134+ * @param array $box {
11331135 * Custom formats meta box arguments.
11341136 *
11351137 * @type string $id Meta box 'id' attribute.
@@ -1138,7 +1140,7 @@ function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan
11381140 * @type array $args Extra meta box arguments.
11391141 * }
11401142 */
1141- function do_block_editor_incompatible_meta_box ( $ object , $ box ) {
1143+ function do_block_editor_incompatible_meta_box ( $ data_object , $ box ) {
11421144 $ plugin = _get_plugin_from_callback ( $ box ['old_callback ' ] );
11431145 $ plugins = get_plugins ();
11441146 echo '<p> ' ;
@@ -1174,13 +1176,13 @@ function do_block_editor_incompatible_meta_box( $object, $box ) {
11741176 printf ( __ ( 'Please activate the <a href="%s">Classic Editor plugin</a> to use this meta box. ' ), esc_url ( $ activate_url ) );
11751177 echo '</p> ' ;
11761178 }
1177- } elseif ( $ object instanceof WP_Post ) {
1179+ } elseif ( $ data_object instanceof WP_Post ) {
11781180 $ edit_url = add_query_arg (
11791181 array (
11801182 'classic-editor ' => '' ,
11811183 'classic-editor__forget ' => '' ,
11821184 ),
1183- get_edit_post_link ( $ object )
1185+ get_edit_post_link ( $ data_object )
11841186 );
11851187 echo '<p> ' ;
11861188 /* translators: %s: A link to use the Classic Editor plugin. */
@@ -1244,17 +1246,17 @@ function _get_plugin_from_callback( $callback ) {
12441246 *
12451247 * @global array $wp_meta_boxes
12461248 *
1247- * @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or
1248- * add_submenu_page() to create a new screen (and hence screen_id)
1249- * make sure your menu slug conforms to the limits of sanitize_key()
1250- * otherwise the 'screen' menu may not correctly render on your page.
1251- * @param string $context The screen context for which to display meta boxes.
1252- * @param mixed $object Gets passed to the meta box callback function as the first parameter.
1253- * Often this is the object that's the focus of the current screen, for
1254- * example a `WP_Post` or `WP_Comment` object.
1249+ * @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or
1250+ * add_submenu_page() to create a new screen (and hence screen_id)
1251+ * make sure your menu slug conforms to the limits of sanitize_key()
1252+ * otherwise the 'screen' menu may not correctly render on your page.
1253+ * @param string $context The screen context for which to display meta boxes.
1254+ * @param mixed $data_object Gets passed to the meta box callback function as the first parameter.
1255+ * Often this is the object that's the focus of the current screen,
1256+ * for example a `WP_Post` or `WP_Comment` object.
12551257 * @return int Number of meta_boxes.
12561258 */
1257- function do_meta_boxes ( $ screen , $ context , $ object ) {
1259+ function do_meta_boxes ( $ screen , $ context , $ data_object ) {
12581260 global $ wp_meta_boxes ;
12591261 static $ already_sorted = false ;
12601262
@@ -1396,7 +1398,7 @@ function do_meta_boxes( $screen, $context, $object ) {
13961398 }
13971399 }
13981400
1399- call_user_func ( $ box ['callback ' ], $ object , $ box );
1401+ call_user_func ( $ box ['callback ' ], $ data_object , $ box );
14001402 echo "</div> \n" ;
14011403 echo "</div> \n" ;
14021404 }
@@ -1473,12 +1475,12 @@ function remove_meta_box( $id, $screen, $context ) {
14731475 *
14741476 * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
14751477 *
1476- * @param string|object $screen The screen identifier.
1477- * @param string $context The screen context for which to display accordion sections.
1478- * @param mixed $object Gets passed to the section callback function as the first parameter.
1478+ * @param string|object $screen The screen identifier.
1479+ * @param string $context The screen context for which to display accordion sections.
1480+ * @param mixed $data_object Gets passed to the section callback function as the first parameter.
14791481 * @return int Number of meta boxes as accordion sections.
14801482 */
1481- function do_accordion_sections ( $ screen , $ context , $ object ) {
1483+ function do_accordion_sections ( $ screen , $ context , $ data_object ) {
14821484 global $ wp_meta_boxes ;
14831485
14841486 wp_enqueue_script ( 'accordion ' );
@@ -1523,7 +1525,7 @@ function do_accordion_sections( $screen, $context, $object ) {
15231525 </h3>
15241526 <div class="accordion-section-content <?php postbox_classes ( $ box ['id ' ], $ page ); ?> ">
15251527 <div class="inside">
1526- <?php call_user_func ( $ box ['callback ' ], $ object , $ box ); ?>
1528+ <?php call_user_func ( $ box ['callback ' ], $ data_object , $ box ); ?>
15271529 </div><!-- .inside -->
15281530 </div><!-- .accordion-section-content -->
15291531 </li><!-- .accordion-section -->
@@ -2135,15 +2137,16 @@ function iframe_footer() {
21352137 * Echoes or returns the post states as HTML.
21362138 *
21372139 * @since 2.7.0
2138- * @since 5.3.0 Added the `$echo ` parameter and a return value.
2140+ * @since 5.3.0 Added the `$display ` parameter and a return value.
21392141 *
21402142 * @see get_post_states()
21412143 *
2142- * @param WP_Post $post The post to retrieve states for.
2143- * @param bool $echo Optional. Whether to echo the post states as an HTML string. Default true.
2144+ * @param WP_Post $post The post to retrieve states for.
2145+ * @param bool $display Optional. Whether to display the post states as an HTML string.
2146+ * Default true.
21442147 * @return string Post states string.
21452148 */
2146- function _post_states ( $ post , $ echo = true ) {
2149+ function _post_states ( $ post , $ display = true ) {
21472150 $ post_states = get_post_states ( $ post );
21482151 $ post_states_string = '' ;
21492152
@@ -2163,7 +2166,7 @@ function _post_states( $post, $echo = true ) {
21632166 }
21642167 }
21652168
2166- if ( $ echo ) {
2169+ if ( $ display ) {
21672170 echo $ post_states_string ;
21682171 }
21692172
@@ -2250,13 +2253,14 @@ function get_post_states( $post ) {
22502253 * Outputs the attachment media states as HTML.
22512254 *
22522255 * @since 3.2.0
2253- * @since 5.6.0 Added the `$echo ` parameter and a return value.
2256+ * @since 5.6.0 Added the `$display ` parameter and a return value.
22542257 *
2255- * @param WP_Post $post The attachment post to retrieve states for.
2256- * @param bool $echo Optional. Whether to echo the post states as an HTML string. Default true.
2258+ * @param WP_Post $post The attachment post to retrieve states for.
2259+ * @param bool $display Optional. Whether to display the post states as an HTML string.
2260+ * Default true.
22572261 * @return string Media states string.
22582262 */
2259- function _media_states ( $ post , $ echo = true ) {
2263+ function _media_states ( $ post , $ display = true ) {
22602264 $ media_states = get_media_states ( $ post );
22612265 $ media_states_string = '' ;
22622266
@@ -2276,7 +2280,7 @@ function _media_states( $post, $echo = true ) {
22762280 }
22772281 }
22782282
2279- if ( $ echo ) {
2283+ if ( $ display ) {
22802284 echo $ media_states_string ;
22812285 }
22822286
0 commit comments