• Resolved Shmoo

    (@macpresss)


    Just a question,

    Would it be a lot of work and editing to make the Report button show up through some do_action hook?

    For topics:

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

    For replies:

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

    I’ve moved my admin_links to the footer of each topic and reply and now this button also shows up at the bottom of the content.

    I understand a little bit what’s happening inside the plugin code by using a add_filter function but I was just wondering if you could also make that an add_action or something.

    https://www.ads-software.com/plugins/bbpress-report-content/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Josh Eaton

    (@jjeaton)

    I’ll take a look. It wouldn’t be straightforward but will see if there’s a solution.

    Thread Starter Shmoo

    (@macpresss)

    Cool thanks already for looking into this,

    If we could also use the get_topic_report_link() + get_reply_report_link() functions directly inside or page templates it would solve everything.

    bbPress’s admin_links can be used like that, you can copy-/paste the bbp_get_topic_edit_link() function ( which is part of the admin_links) in your page template and the Edit topic button shows up where you paste it.

    I saw you made your report button almost the same style bbPress makes their buttons, so hopefully it’s possible.
    Right now when I echo the get_topic_report_link() function in my page template is says function undefined while the plugin is 100% sure activated and working.

    This is what I made: screenshot

    Plugin Author Josh Eaton

    (@jjeaton)

    @shmoo, check out this gist: https://gist.github.com/jjeaton/8668560

    It works for topics, but not for replies, I will need to make a small change to the main plugin to allow that to work. Will try to get it in within the next week or so.

    I’ve namespaced these functions specific to you, I may add helper functions directly to the plugin in the future so I don’t want it to conflict when/if that happens.

    Thread Starter Shmoo

    (@macpresss)

    Super great!

    Really appreciate this, maybe it’s better for me to wait at the next plugin update in general else it will have conflicts for sure when I update your plugin.

    Thanks again.

    Plugin Author Josh Eaton

    (@jjeaton)

    1.0.2 has been released today which includes the small fix which will make the gist I wrote for you work with replies as well, you’ll just need to uncomment line 51.

    It’s safe to go ahead and use that for now, in a future version (possibly 1.1, when I get some more free time) I’ll add actual public functions for this but those will not conflict with the ones I’ve given you here.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Move the report button?’ is closed to new replies.