Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#62518 closed enhancement (fixed)

HTML Processor state "context_node" is redundant

Reported by: jonsurrell's profile jonsurrell Owned by: gziolo's profile gziolo
Milestone: 6.8 Priority: normal
Severity: normal Version: 6.6
Component: HTML API Keywords: has-patch
Focuses: Cc:

Description

The HTML Processor State context_node is redundant. The property has been superseded by WP_HTML_Processor->context_node since [58304].

The property does not need to be created and can be removed. WP_HTML_Processor_State is an internal class marked with @access private.

the WP_HTML_Processor->state property (where WP_HTML_Processor_State is used) is private, so any subclasses should not be affected.

Change History (4)

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


6 months ago
#1

  • Keywords has-patch added

The processor state context_node property is unused and redundant. Remove it.
The processor uses a context_node property on itself.

The $state property is private, so it should not be accessible to subclasses.
The class itself is marked with access private so should also be unused.

See https://github.com/WordPress/wordpress-develop/pull/7348#discussion_r1851827222.

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

#2 @gziolo
6 months ago

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

In 59463:

HTML API: Remove unused processor state context_node property

The HTML Processor State context_node is redundant and can be deprecated. The property has been superseded by WP_HTML_Processor->context_node since [58304].

Props jonsurrell, gziolo.
Fixes #62518.

@Bernhard Reiter commented on PR #7861:


6 months ago
#4

Ah, thanks for that! I was actually briefly confused by this when reviewing #7348 but forgot to flag it 😊

Note: See TracTickets for help on using tickets.