Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 23 months ago

#57863 closed defect (bug) (fixed)

HTML API: Document the shorthand usage of the next_tag() function

Reported by: zieladam's profile zieladam Owned by: hellofromtonya's profile hellofromTonya
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch commit
Focuses: docs Cc:

Description

In WP_HTML_Tag_Processor, the next_tag() method may be used with a query:

$this->next_tag( array( 'tag_name' => 'img' ) )

But it may also be used with just a tag name:

$this->next_tag( 'img' )

Both forms are valid, but only the former one is covered in the docstrings.

Change History (11)

This ticket was mentioned in PR #4168 on WordPress/wordpress-develop by @zieladam.


2 years ago
#1

  • Keywords has-patch added

## Description

The docstrings in WP_HTML_Tag_Processor don't mention the shorthand usage $this->next_tag( 'img' ). They only cover the long form of $this->next_tag( array( 'tag_name' => 'img' ) ). This PR adjusts a few examples to cover both.

cc @poena @dmsnell @hellofromtonya

Trac ticket: https://core.trac.wordpress.org/ticket/57863

#2 @poena
2 years ago

  • Focuses docs added
  • Keywords commit added

Looks good to me, this will help reduce confusion about differences between the documentation and the code that is already in use.

#3 @hellofromTonya
2 years ago

  • Owner set to hellofromTonya
  • Status changed from new to reviewing

Self-assigning for commit review.

#4 @hellofromTonya
2 years ago

  • Keywords changes-requested added; commit removed

Removing commit as discussion is still happening in PR 4168.

Note: This is docs only. So it can go up to RC1.

Last edited 2 years ago by hellofromTonya (previous) (diff)

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 years ago

#6 @hellofromTonya
2 years ago

  • Keywords commit added; changes-requested removed

Patch: https://github.com/WordPress/wordpress-develop/pull/4168

Ready for commit. Prepping commit now ahead of Beta 5.

#8 @hellofromTonya
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 55477:

HTML API: Document shorthand usage of the next_tag().

Documents the shorthand usage, i.e. $this->next_tag( 'img' ), of WP_HTML_Tag_Processor::next_tag().

Also includes table alignments and formatting adjustments in the class docs.

Follow-up to [55203], [55206].

Props zieladam, poena, dmsnell, costdev, hellofromTonya.
Fixes #57863.
See #57575.

@dmsnell commented on PR #4168:


2 years ago
#9

Thanks for fixing the alignment all! Helps for people using plaintext editors like vim and emacs

@dmsnell commented on PR #4168:


2 years ago
#10

Thanks for fixing the alignment all! Helps for people using plaintext editors like vim and emacs

#11 @SergeyBiryukov
23 months ago

  • Component changed from General to HTML API
Note: See TracTickets for help on using tickets.