[wp-trac] [WordPress Trac] #35553: Wrap documentation PHP code snippets in backticks, not PHP tags.

WordPress Trac noreply at wordpress.org
Fri Jan 22 02:33:49 UTC 2016


#35553: Wrap documentation PHP code snippets in backticks, not PHP tags.
--------------------------+--------------------
 Reporter:  dotancohen    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.5
Component:  Comments      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+--------------------
Description changed by SergeyBiryukov:

Old description:

> 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.

New description:

 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.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35553#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list