Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#62518 closed enhancement (fixed)

HTML Processor state "context_node" is redundant

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

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.


2 years 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
2 years ago

  • Owner set to gziolo
  • Resolution → fixed
  • Status new → 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:


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