Support » Plugin: WPAdverts - Classifieds Plugin » Always create a new account when posting a new ad

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

    (@gwin)

    Hi,
    one way to do that is to use the [adverts_add] shortcode as

    
    [adverts_add requires="read"]
    

    Then only the logged in users will be able to see the Create Advert form.

    Dear Greg,

    I would also appreciate the possibility to always create a new account permanently when adding a new ad.

    When using your suggested option by setting requires="read", the additional step of a separate registration will cost a lot of users!

    It would be great to have an option to always create a new account for new ads.

    Thanks, Roland

    Plugin Author Greg Winiarski

    (@gwin)

    Ohh sorry i misunderstood what you would like to do. Automatically registering everyone is not possible out of box, but please get back to me by the end of next week i should have then some code snippet that will allow doing this.

    Thanks Greg – appreciate the quick response! Will check in with you late next week.

    Plugin Author Greg Winiarski

    (@gwin)

    One way to do that would be to add the code below to your theme functions.php

    
    add_action( "init", "customize_adverts_account" );
    function customize_adverts_account() {
        adverts_form_add_field("adverts_field_account", array(
            "renderer" => "customize_adverts_field_account",
            "callback_save" => "adverts_save_multi",
            "callback_bind" => "adverts_bind_multi",
        ));
    }
    function customize_adverts_field_account( $field ) {
        ob_start();
        adverts_field_account($field);
        $content = ob_get_clean();
        echo str_replace( 'id="_adverts_account_1"', 'id="_adverts_account_1" checked="checked" style="display:none"', $content );
    }
    

    This is a code which requires the least interference in the WPAdverts code, it will basically force the checkbox to be checked and will hide the checkbox itself (users will not be able to see it and uncheck).

    If you would additionally like to customize the “Create an account for me so … text then you can do that using a plugin like Say What? for example.

    Hope this helps.

    Thanks – that code does the trick and I was able to change the message using Say What.

    For anyone else wanting to do the same, here are the settings for Say What:

    Original string (needs to be exact): Create an account for me so I can manage all my ads from one place (password will be emailed to you) or Sign In

    Text domain: adverts

    Text context: (leave blank)

    Replacement String (whatever you want but here’s mine): An account will be created for you to manage your advert (password will be emailed to you) or Sign In

    Plugin Author Greg Winiarski

    (@gwin)

    Ok great, thanks for the feedback, i am closing the thread then :).

    BTW. If you are finding the plugin useful i would be thankful if you could write a short one or two sentence review here https://wordpress.org/support/view/plugin-reviews/wpadverts

    I tried the snippet to force account registration, but received a fatal error?

    Plugin Author Greg Winiarski

    (@gwin)

    What does the fatal error message say? Can you paste it here?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Always create a new account when posting a new ad’ is closed to new replies.