Skip to:
Content
Pages
Categories
Search
Top
Bottom

Shortcodes

  • Avatar of James
    James
    Participant

    @janismo

    hi,

    first of all, thanks for the great plugin!
    one of plugin options is to add “flag” possibility to blog posts, when link is displayed below the post content.
    wanted to ask whether is it possible to use some shortcode to make/add this link/flag to the date box or postmetadata of the post or not?

    I’ve seen that there were some explanations in the faq, but for “skilled” people like me, some shortcode like would help a lot.

    thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of francescolaffi
    francescolaffi
    Participant

    @francescolaffi

    hi @janismo,
    by default it place under the content because it’s the only hook I can be sure it’s in every theme.
    How to move it depends on the theme and you’ll need either to:
    -remove the content hook from content and use another hook you like(if your theme has it)
    -edit the theme files

    I don’t think is possible to do it with a shortcode and it’s not convenient too because you would have to use it in every post. If you have lot of themes in your community you would have to change every theme.

    If you need more help you need to say the theme you are using and where exactly you would like the link.

    Avatar of James
    James
    Participant

    @janismo

    @francescolaffi
    hi and thanks for reply,

    1. want to place in BP default below postmetabox (below bottom border of tags and comments count)

    2. “…I don’t think is possible to do it with a shortcode and it’s not convenient too because you would have to use it in every post. If you have lot of themes in your community you would have to change every theme. …”

    You mean, if I have community with X users subdomains, after site wide activation of your plugin flag link will appear on every blog below every post automatically?

    thank you.

    Avatar of francescolaffi
    francescolaffi
    Participant

    @francescolaffi

    I don’t see any useful hook there, so you need to manually place it in the theme (better in a child theme). Check the WP codex on theme customization and the bpModFrontend::get_link() to generate the link.

    Yes content moderation is sitewide

    Avatar of stwc
    stwc
    Participant

    @stwc

    @francescolaffi – that last is exactly what I would like to do, for the main blog — place the flag in the comment metadata div, rather than attached to the actual blog comment content, basically for layout purposes. Could you offer a little help on how to use bpModFrontend::get_link() to generate the link? I understand where to put it in my comments template, but not sure how to use bpModFrontend::get_link() in terms of passing the arguments and stuff.

    Also, if manually adding it to the comments template, should the Blog Comment content type in the BP Moderation back end be switched off? (I assume so, but just making sure…)

    Thanks!

    Avatar of stwc
    stwc
    Participant

    @stwc

    Tried this, with no luck:

    ` ‘blog_comment’, ‘author_id’ => $comment->user_id,’id’ => $wpdb->blogid,’id2′ => $comment->comment_ID,’unflagged_text’ => __(‘Flag this comment as inappropriate’,’bp-moderation’))); ?>`

    Avatar of francescolaffi
    francescolaffi
    Participant

    @francescolaffi

    @stwc at first look it is correct, but remeber that $wpdb and $comment are globals variables, so you could access them trough $GLOBALS and $GLOBALS, or look for some wp function to get those info.

    Avatar of stwc
    stwc
    Participant

    @stwc

    Thanks for the advice, but nope, still no joy.

    I’ve checked and I’m definitely passing the correct values, but no flag link is appearing in the comment. The plugin works fine when I select Blog Comments as an item to moderate in the admin area, but when unselected in the backend, bpModFrontend isn’t writing a link beside comments…

    Avatar of francescolaffi
    francescolaffi
    Participant

    @francescolaffi

    @stwc you may already have tried this but is not in the snippet you posted. That function returns, doesn’t print: either prepend echo or use bpModFrontend::link instead (same params).

    if this is not the problem please post a larger snippet and info about your environment and I’ll try to reproduce it

    Avatar of stwc
    stwc
    Participant

    @stwc

    Ah, that’s probably it. I should have tried that! Thanks, Frances! I’m away from my dev machine, but I’ll give that a try as soon as I can.

    Avatar of stwc
    stwc
    Participant

    @stwc

    That was it, indeed. Thanks again — it’s working fine now.

Viewing 10 replies - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.