Search Results for 'code'
-
Search Results
-
Topic: add new roles
Hello,
I would like to create new roles in bbpress.
Since this is not easy, I have used this code/** * Neue Benutzerrollen */ function add_new_roles( $bbp_roles ) { /* Add a role called Super-Administrator */ $bbp_roles['bbp_super-administrator'] = array( 'name' => 'Super-Administrator', 'capabilities' => custom_capabilities( 'bbp_super-administrator' ) ); /* Add a role called Administrator */ $bbp_roles['bbp_administrator'] = array( 'name' => 'Administrator', 'capabilities' => custom_capabilities( 'bbp_administrator' ) ); /* Add a role called VIP-Member */ $bbp_roles['bbp_vip-member'] = array( 'name' => 'VIP-Member', 'capabilities' => custom_capabilities( 'bbp_vip-member' ) ); /* Add a role called Member */ $bbp_roles['bbp_member'] = array( 'name' => 'Member', 'capabilities' => custom_capabilities( 'bbp_member' ) ); /* Add a role called Trial-Member */ $bbp_roles['bbp_trial-member'] = array( 'name' => 'Trial-Member', 'capabilities' => custom_capabilities( 'bbp_trial-member' ) ); /* Add a role called User */ $bbp_roles['bbp_user'] = array( 'name' => 'User', 'capabilities' => custom_capabilities( 'bbp_User' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 ); function add_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_super-administrator' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_administrator' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_vip-member' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_member' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_trial-member' ) $caps = custom_capabilities( $role ); if( $role == 'bbp_user' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { /* Capabilities for 'Super-Administrator' role */ case 'bbp_super-administrator': return array( // Keymasters only 'keep_gate' => true, // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // Forum caps 'publish_forums' => true, 'edit_forums' => true, 'edit_others_forums' => true, 'delete_forums' => true, 'delete_others_forums' => true, 'read_private_forums' => true, 'read_hidden_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true ); /* Capabilities for 'Administrator' role */ case 'bbp_administrator': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => true, 'throttle' => true, 'view_trash' => true, // Forum caps 'publish_forums' => true, 'edit_forums' => true, 'read_private_forums' => true, 'read_hidden_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => true, 'delete_topics' => true, 'delete_others_topics' => true, 'read_private_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => true, 'delete_replies' => true, 'delete_others_replies' => true, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => true, 'edit_topic_tags' => true, 'delete_topic_tags' => true, 'assign_topic_tags' => true, ); /* Capabilities for 'VIP-Member' role */ case 'bbp_vip-member': return array( // Primary caps 'spectate' => true, 'participate' => true, // Forum caps 'read_private_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, // Topic tag caps 'assign_topic_tags' => true, ); /* Capabilities for 'Member' role */ case 'bbp_member': return array( // Primary caps 'spectate' => true, 'participate' => true, // Forum caps 'read_private_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, // Topic tag caps 'assign_topic_tags' => true, ); /* Capabilities for 'Trial-Member' role */ case 'bbp_trial-member': return array( // Primary caps 'spectate' => true, 'participate' => true, // Forum caps 'read_private_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, // Topic tag caps 'assign_topic_tags' => true, ); /* Capabilities for 'User' role */ case 'bbp_user': return array( // Primary caps 'spectate' => true, 'participate' => true, // Forum caps 'read_private_forums' => true, // Topic caps 'publish_topics' => true, 'edit_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, // Topic tag caps 'assign_topic_tags' => true, ); break; default : return $role; } }Unfortunately, I have the problem that the rights are all set to deny, as soon as the user changes something in his profile.
Can I prevent that?In addition I have installed the plugin “bbPress Advanced Capabilities”
VeePay
Topic: syntax error in auto embed
So basically found that there is a syntax error be created with youtube links
<iframe width="560" height="315" src="https://www.youtube.com/embed/pt8VYOfr8To?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen><="" ifram=""></iframe><iframe src="https://www.youtube.com/embed/pt8VYOfr8To?rel=0" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>the allofulscreen and ifram
Does anyone now where in the plug this is generated.
wp autoembed seem to do the youtube but not sure where the iframe parameters are being generated.this is an issue mainly seen in mobile view only as other views seem to ignore the error.
Topic: Change oEmbed Size?
I would like my site to be completely user driven. I don’t want to create all the possible forums and only have users create topics, can I do this?
Right now when I include the new forum shortcode, it forces users to select a “parent forum” which is not what I want
Now we have using a latest version of your plugin with buddy press.
How to get latest 10 discussion based on forum id which on assign on buddy-press group.
We need to custom code or suggestion for this. Please replay as soon as.
Thanks
Topic: Single Forums
Topic: Rendering Issue
Hello,
Sometimes when some of my bbpress pages render, they render with bbpress code above everything else in the source (even the doctype!). It breaks the page and a user needs to refresh to see the page correctly.
For example:
<div id="bbpress-forums"> <div id="bbp-user-wrapper"> <div id="bbp-single-user-details"> <div id="bbp-user-avatar"> <span class='vcard'> <a class="url fn n" href="http://example.com/forums/users/firstname-lastname/" title="firstname-lastname" rel="me"> <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <![endif]-->This doesn’t happen consistently. Does anyone have idea what might be causing this?