Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35553 closed defect (bug) (fixed)

Wrap documentation PHP code snippets in backticks, not PHP tags.

Reported by: dotancohen's profile dotancohen Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.1
Component: Comments Keywords: has-patch
Focuses: docs Cc:

Description (last modified by SergeyBiryukov)

The src/wp-includes/taxonomy.php file contains a PHPDoc comment with the following PHP snippet:

    `<?php $taxonomies = get_object_taxonomies('post'); ?>`

To be in consistency with other PHP snippets, this should be changed to:

    `$taxonomies = get_object_taxonomies('post')`

I have searched for other similar instances in the WP code, but found only this single example, the other two hits are different contexts:

    $ grep -rP "\*.*\?php" *
    src/wp-includes/js/customize-loader.js:	 *     e.g. <a class="load-customize" href="<?php echo wp_customize_url(); ?>">Open Customizer</a>
    src/wp-includes/taxonomy.php: * `<?php $taxonomies = get_object_taxonomies('post'); ?>` Should
    src/wp-admin/includes/file.php:		<input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> />

Note that this change is not simply academic. The redundant PHP tags break VIM PHPDoc processing.

Find patch attached to ticket. Thank you.

Attachments (2)

ticket_35553.diff (418 bytes) - added by dotancohen 9 years ago.
Diff file which resolves the issue.
ticket_35553.2.diff (588 bytes) - added by dotancohen 9 years ago.
Same patch, but uses the WP filenames and paths so it may apply easier.

Download all attachments as: .zip

Change History (6)

@dotancohen
9 years ago

Diff file which resolves the issue.

@dotancohen
9 years ago

Same patch, but uses the WP filenames and paths so it may apply easier.

#1 @voldemortensen
9 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.5

I especially love this because I'm a vim user.

#2 @SergeyBiryukov
9 years ago

  • Description modified (diff)

#3 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 36377:

Docs: Remove redundant PHP tags from get_object_taxonomies() description.

Props dotancohen.
Fixes #35553.

#4 @johnbillion
9 years ago

  • Version changed from trunk to 4.1
Note: See TracTickets for help on using tickets.