Clean way of making changes to login widget function?

This topic contains 3 replies, has 2 voices, and was last updated by  Paolo 8 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #354894

    Marc Mathys
    Expired Member
    Post count: 216

    Hi,

    What’s a clean way of a making simple changes to the function geodir_loginwidget_output from the file general_functions.php line 3225 ?

    All I need to do is move the line

    <?php do_action( 'login_form' ); ?>

    up 14 lines or so to go above the form between 3223 and 3224.

    I noticed that the function geodir_loginwidget_output wasn’t being called by add_action, which is the only way I would have known to remove the action and add a new one.

    I’d appreciate a tip on how to go about customizing this.

    Best,
    Marc

    #354927

    Paolo
    Site Admin
    Post count: 31211

    I believe the only way is to create a new widget, by copying the entire class (rename and so on), making it call a different geodir_loginwidget_output, for example my_geodir_loginwidget_output where that action is 14 lines before.

    At that point you can register the new widget and unregister the default one.

    Let me know if that helps.

    I also asked to Stiofan to let us know if there is a better way.

    Thanks

    #355340

    Marc Mathys
    Expired Member
    Post count: 216

    Hi Paolo,

    Good call. I made a new shortcode with my custom function and I’m just calling the shortcode in a text widget.

    I customized a few other things, so you can remove the call to Stiofan. I’m happy with this solution.

    Thanks,
    Marc

    #355996

    Paolo
    Site Admin
    Post count: 31211

    Ok great, thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount