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 *
@@ -75,6 +75,8 @@ function twentyeleven_theme_options_init() {
7575 * By default, only administrators have either of these capabilities, but the desire here is
7676 * to allow for finer-grained control for roles and users.
7777 *
78+ * @since Twenty Eleven 1.1
79+ *
7880 * @param string $capability The capability used for the page, which is manage_options by default.
7981 * @return string The capability to actually use.
8082 */
@@ -84,7 +86,7 @@ function twentyeleven_option_page_capability( $capability ) {
8486add_filter ( 'option_page_capability_twentyeleven_options ' , 'twentyeleven_option_page_capability ' );
8587
8688/**
87- * Adds a theme options page to the admin menu, including some help documentation.
89+ * Adds the theme options page to the admin menu, including help documentation.
8890 *
8991 * This function is attached to the admin_menu action hook.
9092 *
@@ -107,6 +109,11 @@ function twentyeleven_theme_options_add_page() {
107109}
108110add_action ( 'admin_menu ' , 'twentyeleven_theme_options_add_page ' );
109111
112+ /**
113+ * Adds help documentation to the theme options page.
114+ *
115+ * @since Twenty Eleven 1.3
116+ */
110117function twentyeleven_theme_options_help () {
111118
112119 $ 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 +151,8 @@ function twentyeleven_theme_options_help() {
144151 * Returns an array of color schemes registered for Twenty Eleven.
145152 *
146153 * @since Twenty Eleven 1.0
154+ *
155+ * @return array<string, array<string, string>> An associative array of color scheme options.
147156 */
148157function twentyeleven_color_schemes () {
149158 $ color_scheme_options = array (
@@ -166,7 +175,7 @@ function twentyeleven_color_schemes() {
166175 *
167176 * @since Twenty Eleven 1.0
168177 *
169- * @param array $color_scheme_options An associative array of color scheme options.
178+ * @param array<string, array<string, string>> $color_scheme_options An associative array of color scheme options.
170179 */
171180 return apply_filters ( 'twentyeleven_color_schemes ' , $ color_scheme_options );
172181}
@@ -175,6 +184,8 @@ function twentyeleven_color_schemes() {
175184 * Returns an array of layout options registered for Twenty Eleven.
176185 *
177186 * @since Twenty Eleven 1.0
187+ *
188+ * @return array<string, array<string, string>> An associative array of layout options.
178189 */
179190function twentyeleven_layouts () {
180191 $ layout_options = array (
@@ -200,7 +211,7 @@ function twentyeleven_layouts() {
200211 *
201212 * @since Twenty Eleven 1.0
202213 *
203- * @param array $layout_options An associative array of layout options.
214+ * @param array<string, array<string, string>> $layout_options An associative array of layout options.
204215 */
205216 return apply_filters ( 'twentyeleven_layouts ' , $ layout_options );
206217}
@@ -210,7 +221,7 @@ function twentyeleven_layouts() {
210221 *
211222 * @since Twenty Eleven 1.0
212223 *
213- * @return array An array of default theme options.
224+ * @return array<string, string> An array of default theme options.
214225 */
215226function twentyeleven_get_default_theme_options () {
216227 $ default_theme_options = array (
@@ -228,7 +239,7 @@ function twentyeleven_get_default_theme_options() {
228239 *
229240 * @since Twenty Eleven 1.0
230241 *
231- * @param array $default_theme_options An array of default theme options.
242+ * @param array<string, string> $default_theme_options An array of default theme options.
232243 */
233244 return apply_filters ( 'twentyeleven_default_theme_options ' , $ default_theme_options );
234245}
@@ -240,7 +251,7 @@ function twentyeleven_get_default_theme_options() {
240251 *
241252 * @param string $color_scheme Optional. Color scheme.
242253 * Default null (or the active color scheme).
243- * @return string The default link color.
254+ * @return string|false The default link color, or false if not set .
244255 */
245256function twentyeleven_get_default_link_color ( $ color_scheme = null ) {
246257 if ( null === $ color_scheme ) {
@@ -260,6 +271,8 @@ function twentyeleven_get_default_link_color( $color_scheme = null ) {
260271 * Returns the options array for Twenty Eleven.
261272 *
262273 * @since Twenty Eleven 1.0
274+ *
275+ * @return array<string, string> The theme options array.
263276 */
264277function twentyeleven_get_theme_options () {
265278 return get_option ( 'twentyeleven_theme_options ' , twentyeleven_get_default_theme_options () );
@@ -372,6 +385,7 @@ function twentyeleven_theme_options_render_page() {
372385 * @since Twenty Eleven 1.0
373386 *
374387 * @param array $input An array of form input.
388+ * @return array<string, string> An array of sanitized and validated form output.
375389 */
376390function twentyeleven_theme_options_validate ( $ input ) {
377391 $ defaults = twentyeleven_get_default_theme_options ();
@@ -401,9 +415,9 @@ function twentyeleven_theme_options_validate( $input ) {
401415 *
402416 * @since Twenty Eleven 1.0
403417 *
404- * @param array $output An array of sanitized form output.
405- * @param array $input An array of un-sanitized form input.
406- * @param array $defaults An array of default theme options.
418+ * @param array<string, string> $output An array of sanitized form output.
419+ * @param array $input An array of un-sanitized form input.
420+ * @param array<string, string> $defaults An array of default theme options.
407421 */
408422 return apply_filters ( 'twentyeleven_theme_options_validate ' , $ output , $ input , $ defaults );
409423}
@@ -486,7 +500,8 @@ function twentyeleven_print_link_color_style() {
486500 *
487501 * @since Twenty Eleven 1.0
488502 *
489- * @param array $existing_classes An array of existing body classes.
503+ * @param string[] $existing_classes An array of existing body classes.
504+ * @return string[] The filtered array of body classes.
490505 */
491506function twentyeleven_layout_classes ( $ existing_classes ) {
492507 $ options = twentyeleven_get_theme_options ();
@@ -511,8 +526,8 @@ function twentyeleven_layout_classes( $existing_classes ) {
511526 *
512527 * @since Twenty Eleven 1.0
513528 *
514- * @param array $classes An array of body classes.
515- * @param string $current_layout The current theme layout.
529+ * @param string[] $classes An array of body classes.
530+ * @param string $current_layout The current theme layout.
516531 */
517532 $ classes = apply_filters ( 'twentyeleven_layout_classes ' , $ classes , $ current_layout );
518533
@@ -521,7 +536,7 @@ function twentyeleven_layout_classes( $existing_classes ) {
521536add_filter ( 'body_class ' , 'twentyeleven_layout_classes ' );
522537
523538/**
524- * Implements Twenty Eleven theme options into Customizer
539+ * Implements Twenty Eleven theme options into Customizer.
525540 *
526541 * @since Twenty Eleven 1.3
527542 *
0 commit comments