Search Results for 'code'
-
Search Results
-
Hi everyone,
I have almost finished setting up BBpress on my site. The last thing I am stuck is I want to add WP Social Login ICONS to the bottom of topic discussions. I have already succeeded adding this to bottom of forums here https://ehospital.in/forum/help-support/about-us/ by adding the php code<?php do_action( 'wordpress_social_login' ); ?>I want to do the same to the bottom or under the user not logged in template notice. But unable to do that. Most probably, I am adding the code to wrong templates? Please tell which template should I edit?
I’m trying to integrate buddypress-docs with bbpress forums; the intention is to have topics of discussion within an article/doc. Using buddypress-docs hook ‘bp_docs_after_doc_content’, I create a corresponding forum (if it doesn’t exist) and add a shortcode to display a topic creation form. If a topic exists and is selected, I redirect to the associated article, and display a single topic with:
echo do_shortcode( '[bbp-single-topic id=' . $topic_id .']' );
So far, so good, I don’t know if it is the right aproach, but it seems to work.
The problem comes when I want to post a reply within the selected topic. $_REQUEST variables are used to detect and display the selected topic, but on single-topic the additional ‘bbp_redirect_to’ hidden field is added, causing to redirect and lose those variables. I commented the line where this field is added (bbpress/includes/common/template.php:1620) and it works the way I want, but don’t want to do that 🙂
Any suggestions on how to work this around without messing around with the plugin’s code? Hope the issue is clear, thank you for any help you can provide and for taking the time to read this.Wordpress ver. 4.8.2
BBPress ver. 2.5.14
BuddyPress Docs ver. 1.9.4Hi
When I editing some topic I don’t see tags in the input which I entered, can we call them via some PHP code?
Also screenshot: http://prntscr.com/gvpn8kBest Regards, and also I want to say that I like minimalism of this plugin 🙂
Regards
Hello Guys,
I think I have found a bug. But at first some Info from the System:
WP version 4.8.2
PHP version 7.0.22-0ubuntu0.16.04.1
bbPress version 2.5.14-6684I want the hide the Tag-Input for all “normal” Users. So only the Keymaster and the mods can assign tags. I found, that I can hook into the capatiblities with
bbp_get_caps_for_roleand set the settings tofalse:`
add_filter(‘bbp_get_caps_for_role’, function ($caps, $role) {
// only the admin can delete and manage topic tags
if (!in_array($role, [‘bbp_keymaster’])) {
$caps[‘manage_topic_tags’] = false;
$caps[‘delete_topic_tags’] = false;
}// only mods and admin can edit or assign tags
if (!in_array($role, [‘bbp_keymaster’, ‘bbp_moderator’])) {
$caps[‘edit_topic_tags’] = false;
$caps[‘assign_topic_tags’] = false;
}return $caps;
}, 10, 2);
But the problem is, that in
template\defaults\bbpress\form-reply.phpwe check with:<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) ) : ?>current_user_cancallsWP_User->has_capand there is$capabilities['assign_topic_tags'] = true.—–
Workaround:
`
add_filter(‘user_has_cap’, function($caps, $metaCaps, $args) {
$forumCaps = bbp_get_caps_for_role($args[0]);return array_merge($caps, $forumCaps);
}, 10, 4);
`