From b0cd9c98c3bd50eb9c9747d198454838233f8f26 Mon Sep 17 00:00:00 2001 From: Yurii Nalivaiko Date: Fri, 30 Nov 2018 11:32:57 +0200 Subject: [PATCH] - small fixes --- includes/admin/core/class-admin-enqueue.php | 2 -- includes/admin/core/class-admin-forms.php | 17 +++++------------ includes/admin/core/class-admin-menu.php | 3 +-- includes/admin/core/class-admin-metabox.php | 3 --- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index bf934363..e59e5ac4 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -30,8 +30,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { * Admin_Enqueue constructor. */ function __construct() { - $this->slug = 'ultimatemember'; - $this->js_url = um_url . 'includes/admin/assets/js/'; $this->css_url = um_url . 'includes/admin/assets/css/'; diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index d59f7cec..e8cb65e4 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -55,11 +55,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { ob_start(); foreach ( $this->form_data['fields'] as $field_data ) { - if ( isset( $field_data['type'] ) && 'hidden' == $field_data['type'] ) - echo $this->render_form_row( $field_data ); + if ( isset( $field_data['type'] ) && 'hidden' == $field_data['type'] ) { + echo $this->render_form_row( $field_data ); + } } - if ( empty( $this->form_data['without_wrapper'] ) ) { ?> > @@ -248,14 +248,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { } } else { - if ( method_exists( $this, 'render_' . $data['type'] ) ) { - - $html .= call_user_func( array( &$this, 'render_' . $data['type'] ), $data ); - - } else { - $html .= $this->render_field_by_hook( $data ); - - } + $html .= $this->render_hidden( $data ); } return $html; @@ -326,7 +319,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { function render_hidden( $field_data ) { if ( empty( $field_data['id'] ) ) - return false; + return ''; $id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id']; $id_attr = ' id="' . $id . '" '; diff --git a/includes/admin/core/class-admin-menu.php b/includes/admin/core/class-admin-menu.php index 88abb645..03058af9 100644 --- a/includes/admin/core/class-admin-menu.php +++ b/includes/admin/core/class-admin-menu.php @@ -20,14 +20,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) { * @var string */ var $pagehook; + var $slug = 'ultimatemember'; /** * Admin_Menu constructor. */ function __construct() { - $this->slug = 'ultimatemember'; - add_action( 'admin_menu', array( &$this, 'primary_admin_menu' ), 0 ); add_action( 'admin_menu', array( &$this, 'secondary_menu_items' ), 1000 ); add_action( 'admin_menu', array( &$this, 'extension_menu' ), 9999 ); diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php index f9440548..cb9da294 100644 --- a/includes/admin/core/class-admin-metabox.php +++ b/includes/admin/core/class-admin-metabox.php @@ -24,9 +24,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { * Admin_Metabox constructor. */ function __construct() { - - $this->slug = 'ultimatemember'; - $this->in_edit = false; $this->edit_mode_value = null;