Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,001 through 1,025 (of 32,491 total)
  • Author
    Search Results
  • David
    Participant

    Hi
    I have 6 forums. I’d like to display 3 of them on one page and the other 3 on anoter page in WordPress. I thought that I could use the shortcode [bbp-single-forum id=32] but when using this, the single forum is added to the page but it’s already expanded showing all the topics within that forum. Is there a way to show single forums but in a collapsed format?

    Thanks for any help that you can offer (I’m not a programmer, so please keep replies easy for a non techie 😀)

    Thanks – David

    #232481
    Chuckie
    Participant

    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)

    #232479
    Chuckie
    Participant

    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' );
    #232471
    Robin W
    Moderator

    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

    #232463
    Chuckie
    Participant

    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.

    #232413
    Robin W
    Moderator

    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’ );
    #232412
    rinh
    Participant

    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!

    #232411
    jonearthur123
    Participant

    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

    #232381
    Robin W
    Moderator

    @codejp3 thanks for all your efforts on this, much appreciated.

    I have now incorportated your code into my plugin.

    Great work 🙂

    #232357
    Tom Ingalls
    Participant

    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.

    #232346

    In reply to: Forum Page Title

    Robin W
    Moderator

    took me a few minutes to work it out !!

    Try

    .post-type-archive-forum p {
    	display: none ;
    }
    veteranhdesigns
    Participant

    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.

    Robin W
    Moderator

    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.

    #232299

    In reply to: Remove Separator

    Robin W
    Moderator

    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 '&nbsp;|&nbsp;' in it, which got me to the filter

    When you came back with it changing when you click, I then searched for '&nbsp;|&nbsp;' 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

    #232294
    mehdinjm
    Participant

    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.

    #232290

    In reply to: Remove Separator

    Robin W
    Moderator

    ah, found the function that the ajax call is doing.

    this code works on my test site

    function remove_sep ($args) {
    $args['before'] = '&nbsp;&nbsp;' ;
    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'] = '&nbsp;&nbsp;';
    		}
    
    		// Action succeeded
    		bbp_ajax_response( true, bbp_get_user_subscribe_link( $attrs, $user_id, false ), 200 );
    }
    Nowarah
    Participant

    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?

    #232283
    Nowarah
    Participant

    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;
    }
    #232281
    Robin W
    Moderator
    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

    #232280

    In reply to: Remove Separator

    Robin W
    Moderator
    function remove_sep ($args) {
    $args['before'] = '&nbsp;' ;
    return $args ;
    }
    
    add_filter ('bbp_before_get_topic_subscribe_link_parse_args', 'remove_sep') ;

    &nbsp; is the code for space, so if you want 2 spaces put

    $args['before'] = '&nbsp;&nbsp;' ;

    #232279

    In reply to: Remove Separator

    Gomle
    Participant

    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..

    #232276
    Robin W
    Moderator

    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');
    #232274
    Robin W
    Moderator

    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');
    #232273
    Nowarah
    Participant

    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);
Viewing 25 results - 1,001 through 1,025 (of 32,491 total)
Skip to toolbar