• Resolved supernaut510

    (@supernaut510)


    I would like to add some content & features to the Board Members list page. I have code inserted directly in the “nonprofit-board-management.php” file and it works great. I would like to move this code to a custom extension/plugin and extend the WI_Board_Management class, so that the additions are not overwritten by future WIBM updates.

    Is there a hook or function I can tie into, to add content at the bottom of this page, above or below “do_action( ‘winbm_after_members_table’ );”? Any info or documentation you can provide would be much appreciated. Thanks!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jonathan Goldford

    (@jg-visual)

    I’m happy to help @supernaut510. It sounds like you’re trying to add content into the admin where each board member is shown in a table. Is that correct? If so, then you actually nailed the best approach within your question. The code do_action( 'winbm_after_members_table' ); is actually there for exactly the purpose you’re looking for. By using the add_action() WordPress function, you can hook into that location to add content or run other code from either a custom plugin or your theme. I’d recommend taking a look at the WordPress documentation at https://developer.www.ads-software.com/plugins/hooks/actions/ for some additional information.

    If you have any other questions, don’t hesitate to let us know.

    Plugin Author Jonathan Goldford

    (@jg-visual)

    Since we haven’t heard from you in a little bit we’re going to mark this as resolved. Don’t hesitate to reach out if any other questions come up.

    Thread Starter supernaut510

    (@supernaut510)

    Hi Jonathan.

    I apologize, I didn’t see the notice about your original reply. I appreciate your help!

    As I mentioned, I have the code working perfectly in your “nonprofit-board-management.php” plugin file. But if I try to move that code snippet into a separate plugin, extending the WI_Board_Management class, I have 3 issues:
    1) I get two instances of the “Board Management” plugin in my admin bar.
    2) I get two Board Members list tables on the Board Members page.
    3) My button doesn’t appear after the Board Members table, but appears as if it were positioned absolutely, in the upper left corner of the admin page (covered by the admin menu).

    I’m afraid I’m a bit of a hack — I assume I’m just not calling the class extension function properly. Where/how should I refer to the class extension, for this code to behave the same as when it’s part of your original plugin file? Any guidance you can provide would be greatly appreciated. Thanks again.

    Plugin Author Jonathan Goldford

    (@jg-visual)

    No problem @supernaut510. Unfortunately, providing custom development support is beyond the scope of what we offer here. How you would approach the code also really depends on the content and features you’re adding to the plugin, so it would be tough to provide incredibly specific guidance without a lot more details.

    WordPress works on a hooks system, allowing you to “hook” into code at given points in the execution to either modify the existing output or run entirely separate code at that time. Your best bet is to spend some time reading https://developer.www.ads-software.com/plugins/hooks/ and https://developer.www.ads-software.com/plugins/hooks/actions/ to get a feel for how this system works. You can also use a search engine to lookup something like “wordpress how do hooks work”. There are tons of articles that will help you get set up.

    In general though, you wouldn’t extend the class at all. Instead, you would use a PHP function that’s called from a line of code that looks like add_action( 'winbm_after_members_table', 'name_of_your_function' );. That code essentially tells WordPress to “hook” in and run your function at exactly that point in time within the plugin’s code execution.

    I’m sorry I can’t be more helpful than that. Hopefully those resources are a good place to start.

    Thread Starter supernaut510

    (@supernaut510)

    After a bit of trial and error, I did get it working using the “winbm_after_members_table” hook. Just wanted to circle back to thank you for your help and guidance!

    Plugin Author Jonathan Goldford

    (@jg-visual)

    That’s great to hear! Thanks for keeping us in the loop and don’t hesitate to reach out if you have any other questions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add content to the Board Members page’ is closed to new replies.