WP_HTML_Processor::add_class
Adds a new class name to the currently matched tag.
Method of the class: WP_HTML_Processor{}
No Hooks.
Returns
true|false. Whether the class was set to be added.
Usage
$WP_HTML_Processor = new WP_HTML_Processor(); $WP_HTML_Processor->add_class( $class_name ): bool;
- $class_name(string) (required)
- The class name to add.
Changelog
| Since 6.6.0 | Introduced. |
| Since 6.6.0 | Subclassed for the HTML Processor. |
WP_HTML_Processor::add_class() WP HTML Processor::add class code WP 7.0
public function add_class( $class_name ): bool {
return $this->is_virtual() ? false : parent::add_class( $class_name );
}