Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#35553 closed defect (bug) (fixed)

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

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

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 11 years ago.
Diff file which resolves the issue.
ticket_35553.2.diff (588 bytes ) - added by dotancohen 11 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
11 years ago

Diff file which resolves the issue.

@dotancohen
11 years ago

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

#1 @voldemortensen
11 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review4.5

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

#2 @SergeyBiryukov
11 years ago

  • Description modified (diff)

#3 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 36377:

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

Props dotancohen.
Fixes #35553.

#4 @johnbillion
11 years ago

  • Version trunk4.1
Note: See TracTickets for help on using tickets.