Skip to content

Commit 2526ce2

Browse files
authored
Merge pull request #37 from justcoded/develop
Add support to load row/widget class by direct name
2 parents 6cdc4bd + a38349a commit 2526ce2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

framework/Page_Builder/v25/Traits/Row_Layouts_Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function add_row_options( $fields ) {
7878
* @param string $title optional. to rewrite row layout title.
7979
*/
8080
public function register_row_layout( $class_name, $title = '' ) {
81-
if ( strpos( $class_name, '\\' ) !== 0 ) {
81+
if ( ! class_exists( $class_name ) && strpos( $class_name, '\\' ) !== 0 ) {
8282
$class_name = $this->default_layout_namespace . '\\' . $class_name;
8383
}
8484

framework/Page_Builder/v25/Traits/Widget_Layouts_Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function add_widget_options( $fields ) {
7878
* @param string $title optional. to rewrite row layout title.
7979
*/
8080
public function register_widget_layout( $class_name, $title = '' ) {
81-
if ( strpos( $class_name, '\\' ) !== 0 ) {
81+
if ( ! class_exists( $class_name ) && strpos( $class_name, '\\' ) !== 0 ) {
8282
$class_name = $this->default_layout_namespace . '\\' . $class_name;
8383
}
8484

0 commit comments

Comments
 (0)