Skip to content

Commit ac72547

Browse files
committed
New method to add props in Blocks
1 parent 16760eb commit ac72547

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

includes/Block.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,21 @@ public function add_classes( $classes = '' )
508508

509509
}
510510

511+
/**
512+
* Add classes to the main HTML element.
513+
*
514+
* @param array $props block props
515+
*
516+
*/
517+
public function add_props( $props )
518+
{
519+
if (is_array($props)) {
520+
foreach ($props as $key => $value) {
521+
$this->props[$key] = $value;
522+
}
523+
}
524+
}
525+
511526
/**
512527
* Obtain a list of parsed classes for the main HTML element.
513528
*

0 commit comments

Comments
 (0)