mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-20 15:13:55 +09:00
- reviewed #1256;
This commit is contained in:
@@ -1062,7 +1062,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
|||||||
do_action( 'um_admin_custom_login_metaboxes' );
|
do_action( 'um_admin_custom_login_metaboxes' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save directory metabox
|
* Save directory metabox
|
||||||
*
|
*
|
||||||
@@ -1089,11 +1088,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$where = array( 'ID' => $post_id );
|
|
||||||
|
|
||||||
if ( empty( $_POST['post_title'] ) ) {
|
if ( empty( $_POST['post_title'] ) ) {
|
||||||
|
$where = array( 'ID' => $post_id );
|
||||||
// translators: %s: Directory id.
|
// translators: %s: Directory id.
|
||||||
$_POST['post_title'] = sprintf( __( 'Directory #%s', 'ultimate-member' ), $post_id );
|
$_POST['post_title'] = sprintf( __( 'Directory #%s', 'ultimate-member' ), $post_id );
|
||||||
|
$wpdb->update( $wpdb->posts, array( 'post_title' => sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) ), $where );
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'um_before_member_directory_save', $post_id );
|
do_action( 'um_before_member_directory_save', $post_id );
|
||||||
@@ -1156,14 +1155,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
|||||||
update_post_meta( $post_id, '_um_search_filters_gmt', (int) $_POST['um-gmt-offset'] );
|
update_post_meta( $post_id, '_um_search_filters_gmt', (int) $_POST['um-gmt-offset'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save form metabox
|
* Save form metabox
|
||||||
*
|
*
|
||||||
* @param $post_id
|
* @param $post_id
|
||||||
* @param $post
|
* @param $post
|
||||||
*/
|
*/
|
||||||
function save_metabox_form( $post_id, $post ) {
|
public function save_metabox_form( $post_id, $post ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
// validate nonce
|
// validate nonce
|
||||||
@@ -1173,7 +1171,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// validate post type
|
// validate post type
|
||||||
if ( $post->post_type != 'um_form' ) {
|
if ( 'um_form' !== $post->post_type ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1183,10 +1181,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$where = array( 'ID' => $post_id );
|
|
||||||
if ( empty( $_POST['post_title'] ) ) {
|
if ( empty( $_POST['post_title'] ) ) {
|
||||||
|
$where = array( 'ID' => $post_id );
|
||||||
// translators: %s: Form id.
|
// translators: %s: Form id.
|
||||||
$_POST['post_title'] = sprintf( __( 'Form #%s', 'ultimate-member' ), $post_id );
|
$_POST['post_title'] = sprintf( __( 'Form #%s', 'ultimate-member' ), $post_id );
|
||||||
|
$wpdb->update( $wpdb->posts, array( 'post_title' => sanitize_text_field( wp_unslash( $_POST['post_title'] ) ) ), $where );
|
||||||
}
|
}
|
||||||
|
|
||||||
// save
|
// save
|
||||||
|
|||||||
Reference in New Issue
Block a user