added comments shortcode and form for it
This commit is contained in:
@@ -25,6 +25,7 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
|
||||
$this->loader->add_action( 'user_register', $this, 'add_value_after_reg' );
|
||||
$this->loader->add_action( 'register_form', $this, 'registration_form' );
|
||||
$this->loader->add_filter( 'registration_errors', $this, 'registration_errors', 10, 3 );
|
||||
$this->loader->add_filter( 'comment_post', $this, 'validate_comment' );
|
||||
}
|
||||
|
||||
public function add_custom_user_fields( $user ) {
|
||||
@@ -76,4 +77,11 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
function validate_comment( $id ) {
|
||||
if ( empty( $_POST['company'] ) || ! empty( $_POST['company'] ) && trim( $_POST['company'] ) == '' ) {
|
||||
wp_delete_comment( $id, true );
|
||||
wp_die( sprintf('<strong>%s</strong>: %s',__( 'Error', 'partnerexpo-core' ),__( 'Cég megadása kötelező!', 'partnerexpo-core' ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user