Skip to content

Commit 3b7d216

Browse files
Twenty Fourteen: Add missing documentation for some global variables.
Props sabernhardt, upadalavipul, shailu25, rajinsharwar, audrasjb, viralsampat, noruzzaman, huzaifaalmesbah, SergeyBiryukov. See #58715. git-svn-id: https://develop.svn.wordpress.org/trunk@62465 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bb91d77 commit 3b7d216

4 files changed

Lines changed: 27 additions & 2 deletions

File tree

src/wp-content/themes/twentyfourteen/functions.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
/**
4040
* Twenty Fourteen only works in WordPress 3.6 or later.
41+
*
42+
* @global string $wp_version The WordPress version string.
4143
*/
4244
if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) {
4345
require get_template_directory() . '/inc/back-compat.php';
@@ -54,6 +56,8 @@
5456
* as indicating support post thumbnails.
5557
*
5658
* @since Twenty Fourteen 1.0
59+
*
60+
* @global string $wp_version The WordPress version string.
5761
*/
5862
function twentyfourteen_setup() {
5963

@@ -226,6 +230,8 @@ function twentyfourteen_setup() {
226230
* Adjusts content_width value for image attachment template.
227231
*
228232
* @since Twenty Fourteen 1.0
233+
*
234+
* @global int $content_width Content width.
229235
*/
230236
function twentyfourteen_content_width() {
231237
if ( is_attachment() && wp_attachment_is_image() ) {
@@ -416,6 +422,8 @@ function twentyfourteen_admin_fonts() {
416422
* @since Twenty Fourteen 1.9
417423
* @deprecated Twenty Fourteen 3.6 Disabled filter because, by default, fonts are self-hosted.
418424
*
425+
* @global string $wp_version The WordPress version string.
426+
*
419427
* @param array $urls URLs to print for resource hints.
420428
* @param string $relation_type The relation type the URLs are printed.
421429
* @return array URLs to print for resource hints.
@@ -523,6 +531,8 @@ function twentyfourteen_the_attached_image() {
523531
* Prints a list of all site contributors who published at least one post.
524532
*
525533
* @since Twenty Fourteen 1.0
534+
*
535+
* @global string $wp_version The WordPress version string.
526536
*/
527537
function twentyfourteen_list_authors() {
528538
$args = array(
@@ -595,6 +605,8 @@ function twentyfourteen_list_authors() {
595605
*
596606
* @since Twenty Fourteen 1.0
597607
*
608+
* @global string $pagenow The filename of the current screen.
609+
*
598610
* @param array $classes A list of existing body class values.
599611
* @return array The filtered body class list.
600612
*/
@@ -664,8 +676,8 @@ function twentyfourteen_post_classes( $classes ) {
664676
*
665677
* @since Twenty Fourteen 1.0
666678
*
667-
* @global int $paged WordPress archive pagination page count.
668-
* @global int $page WordPress paginated post page count.
679+
* @global int $paged Page number of a list of posts.
680+
* @global int $page Page number of a single post.
669681
*
670682
* @param string $title Default title text for current view.
671683
* @param string $sep Optional separator.
@@ -743,6 +755,8 @@ function twentyfourteen_register_block_patterns() {
743755
*
744756
* To overwrite in a plugin, define your own Featured_Content class on or
745757
* before the 'setup_theme' hook.
758+
*
759+
* @global string $pagenow The filename of the current screen.
746760
*/
747761
if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {
748762
require get_template_directory() . '/inc/featured-content.php';

src/wp-content/themes/twentyfourteen/inc/back-compat.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ function twentyfourteen_switch_theme() {
3232
* Twenty Fourteen on WordPress versions prior to 3.6.
3333
*
3434
* @since Twenty Fourteen 1.0
35+
*
36+
* @global string $wp_version The WordPress version string.
3537
*/
3638
function twentyfourteen_upgrade_notice() {
3739
printf(
@@ -48,6 +50,8 @@ function twentyfourteen_upgrade_notice() {
4850
* Prevents the Customizer from being loaded on WordPress versions prior to 3.6.
4951
*
5052
* @since Twenty Fourteen 1.0
53+
*
54+
* @global string $wp_version The WordPress version string.
5155
*/
5256
function twentyfourteen_customize() {
5357
wp_die(
@@ -68,6 +72,8 @@ function twentyfourteen_customize() {
6872
* Prevents the Theme Preview from being loaded on WordPress versions prior to 3.4.
6973
*
7074
* @since Twenty Fourteen 1.0
75+
*
76+
* @global string $wp_version The WordPress version string.
7177
*/
7278
function twentyfourteen_preview() {
7379
if ( isset( $_GET['preview'] ) ) {

src/wp-content/themes/twentyfourteen/inc/customizer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ function twentyfourteen_customize_preview_js() {
150150
* Adds contextual help to the Themes and Post edit screens.
151151
*
152152
* @since Twenty Fourteen 1.0
153+
*
154+
* @global string $typenow The post type of the current screen.
153155
*/
154156
function twentyfourteen_contextual_help() {
155157
if ( 'admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow'] ) {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public function enqueue_scripts() {
6666
*
6767
* @since Twenty Fourteen 1.0
6868
*
69+
* @global int $content_width Content width.
70+
* @global int $more
71+
*
6972
* @param array $args An array of standard parameters for widgets in this theme.
7073
* @param array $instance An array of settings for this widget instance.
7174
*/

0 commit comments

Comments
 (0)