Skip to content

Commit 9345c25

Browse files
committed
Added title parameter to register widget layout method
1 parent be79406 commit 9345c25

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

framework/Page_Builder/v25/Traits/Widget_Layouts_Loader.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,18 @@ public function add_widget_options( $fields ) {
7575
* Register widget layouts available
7676
*
7777
* @param string $class_name relative or absolute class name of Widget Layout to be registered.
78+
* @param string $title optional. to rewrite row layout title.
7879
*/
79-
public function register_widget_layout( $class_name ) {
80+
public function register_widget_layout( $class_name, $title = '' ) {
8081
if ( strpos( $class_name, '\\' ) !== 0 ) {
8182
$class_name = $this->default_layout_namespace . '\\' . $class_name;
8283
}
8384

84-
$widget_layout = new $class_name();
85+
$widget_layout = new $class_name();
86+
if ( ! empty( $title ) ) {
87+
$widget_layout::$TITLE = $title;
88+
}
89+
8590
$this->widgets[ $widget_layout::$ID ] = $widget_layout;
8691
}
8792

0 commit comments

Comments
 (0)