Skip to content

Commit e7f332f

Browse files
Twenty Eleven: Improve PHP DocBlock compliance with documentation standards
Updates PHP DocBlocks in Twenty Eleven theme to better align with WordPress PHP Documentation Standards. Changes include: - Use third-person singular verbs in function summaries - Add missing @return tags for better type documentation - Complete @param documentation for widget methods - Ensure proper sentence structure with punctuation - Add missing DocBlock for twentyeleven_theme_options_help()
1 parent be6a610 commit e7f332f

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/wp-content/themes/twentyeleven/inc/theme-options.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
/**
11-
* Properly enqueues styles and scripts for our theme options page.
11+
* Enqueues styles and scripts for the theme options page.
1212
*
1313
* This function is attached to the admin_enqueue_scripts action hook.
1414
*
@@ -84,7 +84,7 @@ function twentyeleven_option_page_capability( $capability ) {
8484
add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' );
8585

8686
/**
87-
* Adds a theme options page to the admin menu, including some help documentation.
87+
* Adds the theme options page to the admin menu, including help documentation.
8888
*
8989
* This function is attached to the admin_menu action hook.
9090
*
@@ -107,6 +107,11 @@ function twentyeleven_theme_options_add_page() {
107107
}
108108
add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
109109

110+
/**
111+
* Adds help documentation to the theme options page.
112+
*
113+
* @since Twenty Eleven 1.0
114+
*/
110115
function twentyeleven_theme_options_help() {
111116

112117
$help = '<p>' . __( 'Some themes provide customization options that are grouped together on a Theme Options screen. If you change themes, options may change or disappear, as they are theme-specific. Your current theme, Twenty Eleven, provides the following Theme Options:', 'twentyeleven' ) . '</p>' .
@@ -144,6 +149,8 @@ function twentyeleven_theme_options_help() {
144149
* Returns an array of color schemes registered for Twenty Eleven.
145150
*
146151
* @since Twenty Eleven 1.0
152+
*
153+
* @return array An associative array of color scheme options.
147154
*/
148155
function twentyeleven_color_schemes() {
149156
$color_scheme_options = array(
@@ -175,6 +182,8 @@ function twentyeleven_color_schemes() {
175182
* Returns an array of layout options registered for Twenty Eleven.
176183
*
177184
* @since Twenty Eleven 1.0
185+
*
186+
* @return array An associative array of layout options.
178187
*/
179188
function twentyeleven_layouts() {
180189
$layout_options = array(
@@ -260,6 +269,8 @@ function twentyeleven_get_default_link_color( $color_scheme = null ) {
260269
* Returns the options array for Twenty Eleven.
261270
*
262271
* @since Twenty Eleven 1.0
272+
*
273+
* @return array The theme options array.
263274
*/
264275
function twentyeleven_get_theme_options() {
265276
return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() );
@@ -372,6 +383,7 @@ function twentyeleven_theme_options_render_page() {
372383
* @since Twenty Eleven 1.0
373384
*
374385
* @param array $input An array of form input.
386+
* @return array An array of sanitized and validated form output.
375387
*/
376388
function twentyeleven_theme_options_validate( $input ) {
377389
$defaults = twentyeleven_get_default_theme_options();
@@ -487,6 +499,7 @@ function twentyeleven_print_link_color_style() {
487499
* @since Twenty Eleven 1.0
488500
*
489501
* @param array $existing_classes An array of existing body classes.
502+
* @return array The filtered array of body classes.
490503
*/
491504
function twentyeleven_layout_classes( $existing_classes ) {
492505
$options = twentyeleven_get_theme_options();
@@ -521,7 +534,7 @@ function twentyeleven_layout_classes( $existing_classes ) {
521534
add_filter( 'body_class', 'twentyeleven_layout_classes' );
522535

523536
/**
524-
* Implements Twenty Eleven theme options into Customizer
537+
* Implements Twenty Eleven theme options into Customizer.
525538
*
526539
* @since Twenty Eleven 1.3
527540
*

src/wp-content/themes/twentyeleven/inc/widgets.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public function widget( $args, $instance ) {
156156
* where any validation should be dealt with.
157157
*
158158
* @since Twenty Eleven 1.0
159+
*
160+
* @param array $new_instance New settings for this instance as input by the user.
161+
* @param array $old_instance Old settings for this instance.
162+
* @return array Updated settings to save.
159163
*/
160164
public function update( $new_instance, $old_instance ) {
161165
$instance = $old_instance;

0 commit comments

Comments
 (0)