WordPress.org

Ready to get started?Download WordPress

Forums

Business Directory Plugin
[resolved] Extending Business Directory Plugin (4 posts)

  1. JohnC28
    Member
    Posted 1 year ago #

    Has anyone found a neat way to add a custom field to the Business Directory Plugin?

    From looking through the code, there doesn't seem to be any hooks or filters or classes that would let me do that and I want to avoid a hack.

    Anyone?

    Thanks

    John

    http://wordpress.org/extend/plugins/business-directory-plugin/

  2. businessdirectoryplugin
    Member
    Plugin Author

    Posted 1 year ago #

    Hi John,

    I'm not sure what you mean by "custom fields" here--are you talking about just adding additional fields to the form? Have you looked under Directory Admin->Manage Form Fields? There you can add or change fields as you wish.

    If that's not right, what kind of custom field are you trying to add here?

  3. JohnC28
    Member
    Posted 1 year ago #

    Hi

    I want to add a completely different type of field (one that calculates and confirms the form users' lat/lon).

    The code to do that I have, but I can't find a neat way of slotting it into your plugin.

    In views.php (line 496) you call this:

    return wpbdp_render('listing-form-fields', array(
                                'validation_errors' => $validation_errors,
                                'listing_id' => $this->_listing_data['listing_id'],
                                'fields' => $fields,
                                'recaptcha' => $recaptcha
                                ), false);

    ...the false preventing any override. That's fine, but it would be nice to stick a few hooks in your code so that it can be extended.

    All the field types (checkbox, text etc) are hard coded to render.

    I want to do something else (in this case a hidden field with a Google Map).

    JC

  4. JohnC28
    Member
    Posted 1 year ago #

    That's fine, but it would be nice to stick a few hooks in your code so that it can be extended.

    I should have said "That's understandable" - in my case it's not fine as I want to override without messing up the plugin!!! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic