Skip to content

Commit

Permalink
Merge pull request #37 from justcoded/develop
Browse files Browse the repository at this point in the history
Add support to load row/widget class by direct name
  • Loading branch information
aprokopenko authored Aug 27, 2018
2 parents 6cdc4bd + a38349a commit 2526ce2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion framework/Page_Builder/v25/Traits/Row_Layouts_Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function add_row_options( $fields ) {
* @param string $title optional. to rewrite row layout title.
*/
public function register_row_layout( $class_name, $title = '' ) {
if ( strpos( $class_name, '\\' ) !== 0 ) {
if ( ! class_exists( $class_name ) && strpos( $class_name, '\\' ) !== 0 ) {
$class_name = $this->default_layout_namespace . '\\' . $class_name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function add_widget_options( $fields ) {
* @param string $title optional. to rewrite row layout title.
*/
public function register_widget_layout( $class_name, $title = '' ) {
if ( strpos( $class_name, '\\' ) !== 0 ) {
if ( ! class_exists( $class_name ) && strpos( $class_name, '\\' ) !== 0 ) {
$class_name = $this->default_layout_namespace . '\\' . $class_name;
}

Expand Down

0 comments on commit 2526ce2

Please sign in to comment.