This commit is contained in:
Hoang Huu 2020-01-13 10:13:32 +07:00
parent bd4f899268
commit 9272ebfe32
2 changed files with 11 additions and 15 deletions

View File

@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class Opalestate_User_MetaBox { class Opalestate_User_MetaBox {
public function get_front_base_field( $prefix ) { public function get_front_base_field( $prefix ) {
$management = [ $fields = [
[ [
'name' => esc_html__( 'Avatar Picture', 'opalestate-pro' ), 'name' => esc_html__( 'Avatar Picture', 'opalestate-pro' ),
'desc' => esc_html__( 'This image will display in user detail and profile box information', 'opalestate-pro' ), 'desc' => esc_html__( 'This image will display in user detail and profile box information', 'opalestate-pro' ),
@ -27,7 +27,6 @@ class Opalestate_User_MetaBox {
'single' => 1, 'single' => 1,
'limit' => 1, 'limit' => 1,
], ],
[ [
'name' => esc_html__( 'Avatar Picture', 'opalestate-pro' ), 'name' => esc_html__( 'Avatar Picture', 'opalestate-pro' ),
'desc' => esc_html__( 'This image will display in user detail and profile box information', 'opalestate-pro' ), 'desc' => esc_html__( 'This image will display in user detail and profile box information', 'opalestate-pro' ),
@ -37,7 +36,6 @@ class Opalestate_User_MetaBox {
'limit' => 1, 'limit' => 1,
], ],
[ [
'id' => 'first_name', 'id' => 'first_name',
'name' => esc_html__( 'First Name', 'opalestate-pro' ), 'name' => esc_html__( 'First Name', 'opalestate-pro' ),
@ -63,8 +61,7 @@ class Opalestate_User_MetaBox {
], ],
]; ];
return apply_filters( 'opalestate_get_user_meta_front_base_field', $fields, $prefix );
return $management;
} }
public function get_avatar_fields( $prefix ) { public function get_avatar_fields( $prefix ) {
@ -118,7 +115,7 @@ class Opalestate_User_MetaBox {
'sanitization_cb' => 'opal_map_sanitise', 'sanitization_cb' => 'opal_map_sanitise',
'split_values' => true, 'split_values' => true,
], ],
] ); ], $prefix );
} }
public function get_job_fields( $prefix ) { public function get_job_fields( $prefix ) {
@ -175,7 +172,7 @@ class Opalestate_User_MetaBox {
} }
public function get_base_fields( $prefix ) { public function get_base_fields( $prefix ) {
return [ return apply_filters( 'opalestate_get_user_meta_base_fields', [
[ [
'id' => "{$prefix}featured", 'id' => "{$prefix}featured",
'name' => esc_html__( 'Is Featured', 'opalestate-pro' ), 'name' => esc_html__( 'Is Featured', 'opalestate-pro' ),
@ -232,11 +229,11 @@ class Opalestate_User_MetaBox {
'type' => 'text', 'type' => 'text',
'after_row' => '</div>', 'after_row' => '</div>',
], ],
]; ], $prefix );
} }
public function get_social_fields( $prefix ) { public function get_social_fields( $prefix ) {
return [ return apply_filters( 'opalestate_get_user_meta_social_fields', [
[ [
'name' => esc_html__( 'Twitter', 'opalestate-pro' ), 'name' => esc_html__( 'Twitter', 'opalestate-pro' ),
'id' => "{$prefix}twitter", 'id' => "{$prefix}twitter",
@ -273,6 +270,6 @@ class Opalestate_User_MetaBox {
'type' => 'text_url', 'type' => 'text_url',
'after_row' => '</div>', 'after_row' => '</div>',
], ],
]; ], $prefix );
} }
} }

View File

@ -297,11 +297,10 @@ class OpalEstate_User {
global $current_user; global $current_user;
// Verify Nonce // Verify Nonce
$user_id = get_current_user_id(); $user_id = get_current_user_id();
$check = $this->is_blocked();
$key = 'nonce_CMB2phpopalestate_user_front'; $key = 'nonce_CMB2phpopalestate_user_front';
if ( ! isset( $_POST[ $key ] ) || empty( $_POST[ $key ] ) || ! is_user_logged_in() || $check ) { if ( ! isset( $_POST[ $key ] ) || empty( $_POST[ $key ] ) || ! is_user_logged_in() ) {
return; return;
} }