Hooks in 1.3.6

This topic contains 5 replies, has 3 voices, and was last updated by  viguursthijs 9 years, 9 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #29535

    viguursthijs
    Buyer
    Post count: 273

    Hi Guys,

    could you please provide a basic tutorial with some examples on how (according to your vision) the new added hook-possibilities are best used?
    Ideally with some showcase-examples.

    THANKS IN ADVANCE!

    keep up the good work!

    #29540

    Simone
    Expired Member
    Post count: 3515

    Hello, here you can read about hooks and how to use them
    http://docs.wpgeodirectory.com/category/dev/core-docs/

    New hooks are for signup form submit link, new user from link, add listing, my listings & my favorites listings in GeoDirectory user dashboard widget.

    (so you can edit/add functions in these new spots)

    #29547

    viguursthijs
    Buyer
    Post count: 273

    Hi Simone, thanks!
    But for someone with my intelligence, that’s just a bit too summarized.

    My problem is that my right side of my brain tells me that this is really useful (wow!), but that the other half only signals “syntax-error (in a loop;-)” (how?).

    If you don’t know leave it, but what would you recommend for dummies to read on this?

    #29555

    Simone
    Expired Member
    Post count: 3515

    There isn’t a “best use” for an hook, it just come handy if you need to edit something, and you can edit it without touching the core files.
    You can use hooks in your functions.php and you can choose the hook based on the location you want to edit, for example, if you want to edit or change or add something just after the social sharing buttons, on the sidebar, you take the hook geodir_after_social_sharing_buttons and you can add an action like this:

    
    
    add_action('geodir_after_social_sharing_buttons' , 'custom_text', 10);
    function custom_text() {
    
    echo "some text";
      }

    Hooks are a WordPress-thing, it’s not GD-related, GD offers its own hooks, but you can find many tutorials or example on the web, like here
    http://wpcandy.com/teaches/how-to-use-wordpress-hooks/

    #29594

    Guust
    Moderator
    Post count: 29970

    And here is a GD introduction.
    For the rest it is up to your imagination and coding skills, like Simone says.
    http://docs.wpgeodirectory.com/understanding-hooks-actions-and-filters/

    #29690

    viguursthijs
    Buyer
    Post count: 273

    Those are great! Thanks!

Viewing 6 posts - 1 through 6 (of 6 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