It is not new. It is mine. And TinyMCE has not changed for several versions in WP so all I had to do is change readme.
If I deactivate mine then it just shows an error for EnlighterJS instead (which adds code buttons)
I don’t get this.
Look here:
Create New Topic
I am getting a message under the TinyMCE toolbar. My two icons are now showing either.
My code is very basic:
<?php
/**
* Plugin Name: Add AutoSave | Fullscreen to TinyMCE
* Description: This will install the TinyMCE AutoSave | Fullscreen Plugins (version 4.9.11) and register them with TinyMCE.
* Version: 2.1
* Author: Andrew Truckle
* Author URI: https://www.trucklesoft.co.uk/
**/
/**
* Add the TinyMCE AutoSave and Fullscreen Plugins.
*
* @param array $plugins An array of all plugins.
* @return array
*/
function aaft_custom_plugins( $plugins ) {
$plugins['autosave'] = plugins_url( 'mce/', __FILE__ ) . 'autosave/plugin.min.js';
$plugins['fullscreen'] = plugins_url( 'mce/', __FILE__ ) . 'fullscreen/plugin.min.js';
return $plugins;
}
add_filter( 'mce_external_plugins', 'aaft_custom_plugins' );
I don’t have a copy of this plugin, but given that calling these functions does by necessity involve specifying all the variables, I’d suggest you simply take out the='' in the function where it is erroring.
so in your example change
public function __construct ( $file = '', $version ) {
to
public function __construct ( $file, $version ) {
and do this for all the ones erroring
Recently upgraded to WP 6.1 and this plugin bbPress Advanced Statistics gives deprecation warnings when I have debug mode enabled:
The official website for the plugin seems dead now.
The warnings:
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.utils.php on line 25
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.utils.php on line 64
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.statistics.php on line 153
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.statistics.php on line 332
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/core/class.activity.php on line 98
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/public/class.online.php on line 86
Deprecated: Required parameter $version follows optional parameter $file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/wp-content/plugins/bbpress-improved-statistics-users-online/includes/public/class.extras.php on line 47
One example:
public function __construct ( $file = '', $version ) {
$this->init();
} // End __construct ()
I understand what it means, and I see that the parameter is ot used in the function. Dos that mean we just delete the parameter?
Another example:
public static function instance ( $file = '', $version ) {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self( $file, $version );
}
return self::$_instance;
} // End instance ()
Problem here is that the version value is being used.
Advice appreciated.
from this article
https://www.tiny.cloud/docs/plugins/opensource/paste/
try this, otherwise I don’t have a further solution
//clean html when copy and paste into forum
function bbp_tinymce_paste_plain_text( $plugins = array() ) {
$plugins[] = 'paste';
$paste_word_valid_elements[] = 'b,strong';
return $plugins;
}
add_filter( ‘bbp_get_tiny_mce_plugins’, ‘bbp_tinymce_paste_plain_text’ );
Hi!
When our users copy emails into the forum all the HTML table code shows up in the published post (it’s fine in the editor itself though). I found this filter which I suppose cleans out all HTML when copying
//clean html when copy and paste into forum
function bbp_tinymce_paste_plain_text( $plugins = array() ) {
$plugins[] = 'paste';
return $plugins;
}
add_filter( ‘bbp_get_tiny_mce_plugins’, ‘bbp_tinymce_paste_plain_text’ );
I’m wondering if there’s a filter that would still allow bold to remain, but remove everything else?
Thank you in advance!
You can use the Yoast plugin to display breadcrumb!
wp-dashboard –> Yoast –> search appearance –> breadcrumbs and then aticate it.
later on you will have to add a code to header.php
@codejp3 thanks for all your efforts on this, much appreciated.
I have now incorportated your code into my plugin.
Great work 🙂
I’m been exploring different view shortcodes but I can’t make it seems to work.
I wanted to display both latest topics and most popular topics at the same time in the home page.
I use [bbp-display-topic-index show=’5′ forum =’10,11,12′] or [bbp-single-view id=’popular’] and [bbp-single-view] but only one view is showing up.
took me a few minutes to work it out !!
Try
.post-type-archive-forum p {
display: none ;
}
Thanks for the response I have read through the Codex. I knew i wasn’t being very clear lol.
I created a Board Admin Role in Memberpress and assigned the roles needed for wordpress permissions i wanted the role to have.
The problem is, I can clone Keymaster, which is a bbPress Role, but it doesn’t show up in Forum Roles dropdown, I can give forum permissions, but by giving edit user she can edit site admin, if i restrict edit user, she can’t manage users.
I am looking for a way to restrict access to upper-level site admin, while having certain admin, yet needs Full admin rights in Forum, but not the ability to accidentally delete or change higher admin roles and create or manage lower level bbPress forum roles.
Basically, I Need a MODERATOR Role with adjusted Admin Privileges and forum roles that can still perform role functions based on their level rather than just on or off, weighted capabilities with if statements that disables edit links or delete links unless the weighted role is below the administrator that is performing the tasks.
This needs to be something that each role has the same ability to adjust for each role, like you would have in tech support with tech support roles but 3 tiers of tech support levels vs customer service vs billing department. Customer Service and billing have access to user profile to view, however billing can only see user address and phone number and payment information, customer service can only see name, phone, email, previous tickets, plan type and tier 3 tech support can see everything that customer service can see plus ipaddress, database, files where tier 2 can see tier 3 level plus has the ability to backup or reboot, where tier 1 can see and do everything… except travel agency type stuff with boards.
bbpress has roles of keymaster, moderator, participant, spectator and blocked – see
bbPress User Roles and Capabilities
The rest of the above is either roles that you have created or come with memberpress, or roles that don’t exist but that you want – it’s not quite clear which 🙂 – please come back with further info.
so is a ‘secondary keymaster’ a concept you want, or something that you have created or exists in memberpress???
If you want to create a new memberpress role then the capabilities in the link above might help.
Good day to all the wonderful devs,
Site: https://h99.cd7.myftpupload.com/
I am Running Current:
Wordpress 6.0.3
PHP 8.0
Plugins:
MemberPress Members 3.2.1
BBPress 2.6.9
My questions:
#1 I am working on a travel agent site for my wife which will include the forums. I will be the main site admin and primary Keymaster, however i want to add a secondary keymaster for her. However i want to make it so she has access to use certain admin tools on the wp-admin dashboard which i have done using Memberpress Members Roles. However i dont want her to have full keymaster in BBPress.
So, the idea in thought is Primary Keymaster has obvious full permissions, secondary Keymaster has full rights as well but not the ability to modify the primary keymaster.
Currently I have Primary Keymaster which is also Site Full Admin, Secondary Keymaster, named Board Admin.
I still want the Board Admin to have Admin rights to Dashboard Menus but not the ability to edit the Keymaster like it shows for the current BBPress Roles with only view ability. I think I wrote that right.
#2 BBPress Forum page login for general users. Currently BBPress sends registration and login to the wp-admin page to login. Is there a way to edit the forum link to use another page by having the login shortcode embedded into a page of choice, same question for Profile. Currently the edit profile link on the forum takes users directly to the wordpress profile rather than their forum profile, what am i missing for the redirect?
Thank you in advance for the patience and assistance.
I have created a few websites for myself, but learning the plugin dev stuff and theme editing, still infantile.. lol
I already broke her site once and had to delete everything and start over.
it’s a lot of code to learn.
There are hundreds of filters and actions.
most of it is detective work.
I have bbpress in a folder on my laptop/
I use
https://notepad-plus-plus.org/
as my main tool, it understands all the file types and displays them in a very readable way.
It has a ‘search on files’, so in your case I looked for ‘subscribe’ as this was the word that had the | before it.
that got me to the subscribe link function, which has the ' | ' in it, which got me to the filter
When you came back with it changing when you click, I then searched for ' | ' and found it in the core function.
For the ‘before_xx_parse_args’ and other filter stuff see
Step by step guide to setting up a bbPress forum – part 5
Hello. I want to add a special feature to my site using the ajax load more plugin. I want to load topic replies with ajax by scrolling. I don’t want the visitor to have to go to pages 2, 3 and… to see all the replies. This plugin gives me a shortcode like this:
[ajax_load_more loading_style="infinite fading-blocks" container_type="ul" post_type="reply"]
And I have to embed this short code in the function file of the template.
<?php echo do_shortcode('[ajax_load_more loading_style="infinite fading-blocks" container_type="ul" post_type="reply"]'); ?>
But this code does not work properly anywhere. Can you guide me? By the way, I am an amateur.
ah, found the function that the ajax call is doing.
this code works on my test site
function remove_sep ($args) {
$args['before'] = ' ' ;
return $args ;
}
add_filter ('bbp_before_get_topic_subscribe_link_parse_args', 'remove_sep') ;
remove_action( 'bbp_ajax_subscription', array( 'BBP_Default', 'ajax_subscription' ) );
add_action ( 'bbp_ajax_subscription', 'new_ajax_subscription');
function new_ajax_subscription() {
// Bail if subscriptions are not active
if ( ! bbp_is_subscriptions_active() ) {
bbp_ajax_response( false, esc_html__( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
}
// Bail if user is not logged in
if ( ! is_user_logged_in() ) {
bbp_ajax_response( false, esc_html__( 'Please login to subscribe.', 'bbpress' ), 301 );
}
// Get user and topic data
$user_id = bbp_get_current_user_id();
$id = ! empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;
$type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : 'post';
// Bail if user cannot add favorites for this user
if ( ! current_user_can( 'edit_user', $user_id ) ) {
bbp_ajax_response( false, esc_html__( 'You do not have permission to do this.', 'bbpress' ), 302 );
}
// Get the object
if ( 'post' === $type ) {
$object = get_post( $id );
}
// Bail if topic cannot be found
if ( empty( $object ) ) {
bbp_ajax_response( false, esc_html__( 'Subscription failed.', 'bbpress' ), 303 );
}
// Bail if user did not take this action
if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $object->ID ) ) {
bbp_ajax_response( false, esc_html__( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
}
// Take action
$status = bbp_is_user_subscribed( $user_id, $object->ID )
? bbp_remove_user_subscription( $user_id, $object->ID )
: bbp_add_user_subscription( $user_id, $object->ID );
// Bail if action failed
if ( empty( $status ) ) {
bbp_ajax_response( false, esc_html__( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );
}
// Put subscription attributes in convenient array
$attrs = array(
'object_id' => $object->ID,
'object_type' => $type,
'user_id' => $user_id
);
// Add separator to topic if favorites is active
if ( ( 'post' === $type ) && ( bbp_get_topic_post_type() === get_post_type( $object ) ) && bbp_is_favorites_active() ) {
$attrs['before'] = ' ';
}
// Action succeeded
bbp_ajax_response( true, bbp_get_user_subscribe_link( $attrs, $user_id, false ), 200 );
}
Hello, I use bbpress login form shortcode and when I press the login button without filing any data, it keeps redirect me to the normal wp form with errors msgs, is there a way to keep the errors msg in the same form without redirect?
hello, I need to change the css class”bbp-template-notice” of the returned html in the function bbp_template_notices() exist in includes/common/template.php but i dont see any filter in it , how this can be done?
the function:
function bbp_template_notices() {
// Bail if no notices or errors
if ( ! bbp_has_errors() ) {
return;
}
// Define local variable(s)
$errors = $messages = array();
// Get bbPress
$bbp = bbpress();
// Loop through notices
foreach ( $bbp->errors->get_error_codes() as $code ) {
// Get notice severity
$severity = $bbp->errors->get_error_data( $code );
// Loop through notices and separate errors from messages
foreach ( $bbp->errors->get_error_messages( $code ) as $error ) {
if ( 'message' === $severity ) {
$messages[] = $error;
} else {
$errors[] = $error;
}
}
}
// Display errors first...
if ( ! empty( $errors ) ) : ?>
<div class="bbp-template-notice error" role="alert" tabindex="-1">
<ul>
<li><?php echo implode( "</li>\n<li>", $errors ); ?></li>
</ul>
</div>
<?php endif;
// ...and messages last
if ( ! empty( $messages ) ) : ?>
<div class="bbp-template-notice">
<ul>
<li><?php echo implode( "</li>\n<li>", $messages ); ?></li>
</ul>
</div>
<?php endif;
}
add_filter ('bbp_get_topic_class', 'rew_author_current' , 100 , 3) ;
add_filter ('bbp_get_reply_class', 'rew_author_current' , 100 , 3) ;
function rew_author_current ($post_classes, $topic_id, $classes) {
$author_id = bbp_get_topic_author_id( $topic_id );
$current_id = get_current_user_id() ;
if ($author_id == $current_id) {
$post_classes[] = 'rew-current-user' ;
$post_classes = array_merge( (array) $post_classes);
}
return $post_classes ;
}
will give you ‘rew-current-user’ as a style to add css
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
function remove_sep ($args) {
$args['before'] = ' ' ;
return $args ;
}
add_filter ('bbp_before_get_topic_subscribe_link_parse_args', 'remove_sep') ;
is the code for space, so if you want 2 spaces put
$args['before'] = ' ' ;
Very, very old topic – but still relevant today. This topic is searchable in google, so I’m not creating another one 😉
The above code does unfortunately not work anymore.
Do you have an updated code for removing the pipepline between favorite | subscribe ?
And if you don’t – how do you actually find what to use. I’m trying to learn, but I don’t know what to look for..
ok, let’s just redo the whole thing
function custom_callback( $args=array()) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'select_id' => 'bbp_topic_status',
'select_class' => 'my-class',
'tab' => false,
'topic_id' => 0,
'selected' => false
), 'topic_open_close_select' );
// Filter & return
return apply_filters( 'custom_callback', ob_get_clean(), $r, $args );
}
add_filter( 'bbp_get_form_topic_status_dropdown', 'custom_callback');
the ‘,2’ might be the issue, as you only then use 1, but try this
function custom_callback($args) {
$args['select_class'] = 'my-class' ;
return $args;
}
add_filter( 'bbp_get_form_topic_status_dropdown', 'custom_callback');
I need to add a class to the dropdown topic select_class.
the original function is:
function bbp_get_form_topic_status_dropdown( $args = array() ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'select_id' => 'bbp_topic_status',
'select_class' => 'bbp_dropdown',
'tab' => false,
'topic_id' => 0,
'selected' => false
), 'topic_open_close_select' );
// Filter & return
return apply_filters( 'bbp_get_form_topic_status_dropdown', ob_get_clean(), $r, $args );
}
I tired to use this but didnt work
function custom_callback($args = array() ) {
$r = bbp_parse_args( $args, array(
'select_class' => 'my-class',
) );
return $r;
}
add_filter( 'bbp_get_form_topic_status_dropdown', 'custom_callback', 12, 2);
ok, my code does not change any roles, the user will still get the participant role.
The plugin makes them a member of a group, and as the forum is also a member of that group, they can them see the forum. The forum’s topic permissions then let them see only their topic