accidentally created an infinite loop
This commit is contained in:
@@ -10,7 +10,14 @@
|
|||||||
* @author Juhász Levente <juhasz.levente@rendszerepito.hu>
|
* @author Juhász Levente <juhasz.levente@rendszerepito.hu>
|
||||||
*/
|
*/
|
||||||
class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
|
class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
|
||||||
public function activate_fields() {
|
protected $loader;
|
||||||
|
|
||||||
|
public function __construct( $loader ) {
|
||||||
|
$this->loader = $loader;
|
||||||
|
$this->activate_fields();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function activate_fields() {
|
||||||
$this->loader->add_action( 'show_user_profile', [$this, 'add_custom_user_fields'] );
|
$this->loader->add_action( 'show_user_profile', [$this, 'add_custom_user_fields'] );
|
||||||
$this->loader->add_action( 'edit_user_profile', [$this, 'add_custom_user_fields'] );
|
$this->loader->add_action( 'edit_user_profile', [$this, 'add_custom_user_fields'] );
|
||||||
$this->loader->add_action( 'personal_options_update', [$this, 'save_custom_user_fields'] );
|
$this->loader->add_action( 'personal_options_update', [$this, 'save_custom_user_fields'] );
|
||||||
@@ -52,21 +59,4 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
|
|||||||
update_user_meta( $user_id, 'company', sanitize_text_field( $_POST[ 'company' ] ?? '' ) );
|
update_user_meta( $user_id, 'company', sanitize_text_field( $_POST[ 'company' ] ?? '' ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function registration_form() {
|
|
||||||
$your_content = ob_get_contents();
|
|
||||||
$your_content = preg_replace( '/\<label for="user_login"\>(.*?)\<br/', 'Usernumia: ', $content );
|
|
||||||
$your_content = preg_replace( '/\<label for="user_email"\>(.*?)\<br/', 'Email Sior:', $content );
|
|
||||||
|
|
||||||
ob_get_clean();
|
|
||||||
echo $your_content;
|
|
||||||
}
|
|
||||||
|
|
||||||
function registration_errors( $errors, $sanitized_user_login, $user_email ) {
|
|
||||||
if ( empty( $_POST['company'] ) || ! empty( $_POST['company'] ) && trim( $_POST['company'] ) == '' ) {
|
|
||||||
$errors->add( 'company_error', sprintf('<strong>%s</strong>: %s',__( 'ERROR', 'partnerexpo-core' ),__( 'You must include a company name.', 'partnerexpo-core' ) ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return $errors;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,9 +132,7 @@ class Partnerexpo_Core {
|
|||||||
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-partnerexpo-core-user-fields.php';
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-partnerexpo-core-user-fields.php';
|
||||||
|
|
||||||
$this->loader = new Partnerexpo_Core_Loader();
|
$this->loader = new Partnerexpo_Core_Loader();
|
||||||
$user_fields = new Partnerexpo_Core_User_Fields();
|
$user_fields = new Partnerexpo_Core_User_Fields( $this->loader );
|
||||||
$user_fields->activate_fields();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user