accidentally created an infinite loop

This commit is contained in:
2026-02-19 15:54:24 +01:00
parent 40f924c5dd
commit 3663766e2c
2 changed files with 9 additions and 21 deletions

View File

@@ -10,7 +10,14 @@
* @author Juhász Levente <juhasz.levente@rendszerepito.hu>
*/
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( 'edit_user_profile', [$this, 'add_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' ] ?? '' ) );
}
}
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;
}
}