• Resolved Kendel

    (@kendel)


    Hi,
    I’m trying to deactivate the possibility to register as a user. It’s already not possible to manage ads and to register for my WordPress-Installation, but I still have the link in the Add-Form. Could anyone tell me how to deactivate this? I already checked for similar threads but couldn’t find anything.
    Thanks for answers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi, you can do that by adding following code to your theme functions.php file, it will remove the “Account” field from [adverts_add].

    
    add_filter( "adverts_form_load", "remove_account_field", 10, 2 );
    
    function remove_account_field( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
    
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "_adverts_account" ) {
            unset( $form["field"][$key] );
        }
      }
    
      return $form;
    }
    
    

    I have added this snippet as well as the “limit file uploads” snippet to my Child Functions and neither of them are working. Are these snippets still applicable to the current AdVerts version? Any suggestions as to why they might not be working for me?

    Doh! Please ignore my above comment. I am embarrassed to admit it, but we recently moved our site to a new server and my child theme got deactivated. Code snippets are working fine now that I’ve activated the correct theme. Sorry!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Deactivate User-Registration’ is closed to new replies.