Skip to:

Search Results for 'code'

Viewing 25 results - 1 through 25 (of 31,406 total)
  • Author
    Search Results
  • Robin W

    something (not bbpress) is using a filter to call this function.

    so you’d be looking for a hook that looks kinda like this

    add_filter( ‘bp_notifications_get_notifications_for_user’, ‘xxxxxxxx’, 10, 5 );

    or some code directly calling ‘bp_notifications_get_notifications_for_user’

    Both of those should pass 8 arguments, but are only passing 5 – hence the issue.

    it is not bbp-private-groups

    if you really want to track it down, then use FTP to transfer the wp-content directory of your site to your PC.

    then download and install notepad++ and use the search/find in files option to find bp_notifications_get_notifications_for_user in wp-content

    that should get you to options where it is called


    Hi, the error codes were found in my files in the back end/ftp. The error email is only sent to me while bbpress is activated. It has been hard to find out what is causing this. I tried deactivating youzify as well as buddypress. So far no more error emails have been received but I’m at a loss as to where it’s coming from exactly and how to correct it. My site needs these 3 plugins to function as well as the bbpress private groups plugin I have. My only theory is that the privacy function is conflicting with the notifications for some reason but like I said, it’s hard to pinpoint. My host is unsure and said to try asking bbpress. Maybe someone has a similar issue? I’ll keep researching and if I find an answer, I’ll post it here.


    In reply to: New Post

    Robin W

    thanks, I had read your original question as ‘new topic’ not ‘unread post’ – sorry

    yes there is a bug, but this will only add a ‘mark as read’ button in any case. I’ll fix the bug shortly.

    There is no ‘new posts’ button, I simply inherited the code for this functionality, and I don’t plan to work further on it.


    Further info update:

    Hi, after doing further testing, I’m still getting an error. I deactivated youzify. Then, I deactivated bbpress and buddypress but still getting an error. I am not too familiar with the files and coding but I opened the files where the errors are indicatd in the above error message I posted. If anyone is familiar and sees an error, I would really appreciate the heads up. Probably a long shot but thought I’d try. Thanks!

    First file:
    An error of type E_ERROR was caused in line 62 of the file /home/advance1/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/notifications.php. Error message: Uncaught ArgumentCountError: Too few arguments to function bbp_format_buddypress_notifications(), 5

    this is the code showing in the above file currently:

    Line 62-6 :

    function bbp_format_buddypress_notifications( $content, $item_id, $secondary_item_id, $action_item_count, $format, $component_action_name, $component_name, $id ) {

    // Bail if not the notification action we are looking for
    if ( 0 !== strpos( $component_action_name, ‘bbp_new_reply’ ) ) {
    return $content;

    The code found in this file: passed in /home/advance1/public_html/wp-includes/class-wp-hook.php on line 307:

    line 303: // Avoid the array_slice() if possible.
    if ( 0 == $the_[‘accepted_args’] ) {
    $value = call_user_func( $the_[‘function’] );
    } elseif ( $the_[‘accepted_args’] >= $num_args ) {
    line 307–> $value = call_user_func_array( $the_[‘function’], $args );
    } else {
    $value = call_user_func_array( $the_[‘function’], array_slice( $args, 0, (int) $the_[‘accepted_args’] ) );
    } while ( false !== next( $this->iterations[ $nesting_level ] ) );

    Last error file:passed in /home/advance1/public_html/wp-includes/class-wp-hook.php on line 307

    Robin W

    @jimmyt53 – thanks

    I’ll try and work up some code in the next couple of days

    Robin W

    All – let me just clarify that I’m just a guy sat in his kitchen who helps out here, I am not a bbpress author !!

    & @iqfy- trashing topics or replies calls a standard WordPress function which checks for comments and media on each post before trashing. This involves a database lookup to check whether anything in those tables needs deleting and it is this that seems to be taking the time and making you both time out. Topics and replies don’t have comments or media that is attached in that way, so these steps are not needed.

    Now trashing a reply is fairly easy, replies don’t hold any data that needs referencing elsewhere that we need to worry about.

    But Topics have engagements and subscriptions to be gone through.

    so if I wrote some code to allow you to delete a numbered topic, this could use a quicker method to permanently delete all the replies, and then use the proper function to delete the topic.

    And as long as the topic or reply it is not latest activity, then we can maybe skip the step that needs to recalculate what the lastest activity now needs to be.

    That should prevent timeouts I hope.

    SO 2 things here

    1. any topic/reply being got rid of should not be the ‘latest activity’ in the forum – but I’m guessing if the topic is still getting replies and therefore ‘hot’ then you would not be deleting it
    2. this would be deleting it a numbered topic at a time, so you would look up the topic and then in the dashboard there would be an option to enter that topic number to trash it.

    Does that sound as if it would work for you?

    – not sure how easily I’d be able to fix that, but I’ll think about it as I progress. so

    1. how would you want to pick topics for deletion – by ‘older than’ presumably? and
    2. just from one forum or across all forums?
    3. again could not be a topic or reply where it is latest activity

    Feedback before I start code something that doesn’t help would be great 🙂

    and from all – are we talking about permanently deleting – ie reduce database size, or just trashing – ie stopping people seeing, but retaining the ability to restore later?


    In reply to: seachform shortcode

    Robin W

    #bbp-search-form …

    and if you are using the

    bbp style pack

    [bsp-display-topic-index show=’5′] you can see the settings in

    dashboard>settings>bbp style pack>shortcodes


    I realize this topic is more than six years old, but I’ve been attempting to achieve similar behavior, and adding the following code in a custom plug-in seems to work. I have a taxonomy of “ideacategory” and I’m able to create a bbPress view called “ideacat” that filters all of the topics where the category term is equal to “24-hour-market-watch.”

    function idea_register_custom_views() {
    			esc_html__( 'Idea Category', 'bbpress' ),
    			apply_filters( 'bbp_register_view_ideacat', array(
    			'tax_query' => array(
    					'taxonomy' => 'ideacategory',
    					'field' => 'slug',
    					'terms' => array( '24-hour-market-watch' )
    			'show_stickies' => false
    		) );
    add_action( 'bbp_register_views', 'idea_register_custom_views' );

    In reply to: seachform shortcode

    Robin W

    link to an example please, and where did you put this code?


    I used the shortcode[bbp-search] make seachform.
    I want to change border color and size of this searchform.
    So I wrote CSS like this.

    #bbp_search {
    border-color:#0c162a important!;

    But the design did’t change.
    What CSS should I write?


    Even simpler; add this one line to twenty twenty two’s index.php file; this will preserve the theme’s menus, header, etc. and tell WordPress to use 2022’s template engine:

    include ABSPATH . WPINC . '/template-canvas.php';

    Or, to prevent losing changes when/if 2022 updates; use this hook in your own functions/plugin/child:

    add_filter( 'template_include', function( $template ) {
        if ( false !== strpos($template, 'twentytwentytwo/index.php') ) {
    		$template = ABSPATH . WPINC . '/template-canvas.php';
        return $template;

    In reply to: padding between topics

    Robin W

    try this in your custom css

    #bbpress-forums li.bbp-body, #bbpress-forums li.bbp-body ul.topic {
    	padding: 5px 25px !important;
    iQfy Media

    A few months ago I played around with popular SEO plugins. Unbeknownst to me, one of them created a sitemap that included over 50,000(!) individual topic reply pages, and Googlebot indexed over 20,000 of them…making my site run out of crawler quota.

    I didn’t notice the problem until Google went from instantly indexing my articles to ignoring them until manually submitted.

    Blocking the community/reply/* URL in robots.txt has little effect because it only blocks googlebot from visiting the URL format again – it doesn’t drop the existing indexed pages.

    So I added this to a custom plugin:

    add_action("wp_head", function ()
    	if (substr($_SERVER['REQUEST_URI'], 0, 17) == "/community/reply/")
    		echo '<meta name="robots" content="noindex">';
    } );

    Self-explanatory – adds the noindex to the header of reply pages. If you’ve named the slugs differently, obviously edit them and the substr length count.

    Let me know if you’ve experienced the same issue and how you went about fixing it. And.. what’s the point of the reply page any way? It’s just duplicate content because the reply is already listed in the thread.


    The image uploader used to ask for size, but after installing the bbPress image loader upgrade, it no longer gives the size field. thanks for the trouble shooting thing. This twenty fourteen theme has been modified and is now using a child theme. I’m not exactly sure what that means but I see no additional settings for the child portion. Neither the wordpress page editor nor the forum page editor have any format choices either. In addition I tried to make one page full width with this code .page-id-17507 .site-inner, .page-id-17507 .site-footer {
    max-width: none !important;
    width: 95% !important;
    but it had no affect either, it works on my webpages at
    but not on this website.

    Robin W

    portal-admin is not a default wordpress or bbpress role, so how ever you created that, you’ll need to add the appropriate bbpress capabilities to it.

    bbPress User Roles and Capabilities

    Robin W

    do you mean access to the forums on the front end ?

    Step by step guide to setting up a bbPress forum – Part 1

    item 3

    You really don’t want to give access at the backend – bbpress is simply not designed to work that way !


    Very nice work with the style pack Robin! I do have one issue with Mega Max menu compatibility. For whatever reason, it doesn’t look like shortcodes are being processed when style pack is activated (which is how MegaMax allows menus to be embedded).

    Otherwise I’d recommend your style pack for bbPress users as this “simply works” to deliver the forum styling to Twenty Twenty Two without having to painfully apply one’s own CSS rules to make it marginally pretty.

    For those willing to go that far, I found that simply adding a basic, default template page as described on will do the trick. Supposedly block editor doesn’t care for/use PHP template pages anymore so it’s otherwise ignored.

    For simplicity, I just replace Twenty Twenty Two’s otherwise empty index.php with the “skinny” template index.php I created here:

    Robin W

    thanks, just had a look on my test site.

    The first hat image I uploaded displays as

    <img src="" alt="picture">

    so will load at the size of the web page.

    On your site it displays as

    <img src="" alt="Hats" width="473" height="316">

    It is uploading as full size, so something, maybe your theme or a wordpress setting is limiting it’s display.

    I’m not sure if those width details are being saved as part of the post saved in the database, or are added in displaying.

    you might also look at



    Hello all,

    I’m working in PHP in WordPress. I’m comfortable modifying and editing code.

    I have a collection of Musical Artists and their releases. I’ve created a topic for each artist (post type) and release (post type) using bbPress Topics For Posts.

    The user then replies to the topic. I want them to be forced to choose a tag when they reply: “Buy”, “Sell”, or “Info”.

    Then I want them to be able to click a button that only shows replies tagged “Buy”, “Sell”, or “Info”.

    How do I create a button to filter replies in PHP? Thanks!

    Here’s an example of an artist page with a discussion forum below

    Robin W

    also try

    .bbp-search-form input[type="submit"] {
      float: none !important;
    Robin W

    maybe this is closer, not quite right order

    li.bbp-forum-info, li.bbp-topic-title {
    	float: right !important;
    	text-align: right !important ;
    Robin W

    ok, I think you have fixed the title

    For the breadcrumbs add this to your css

    .site-breadcrumbs,, #searchform-dropdown, .current-shop-items-dropdown {
      right: 0 !important;
      left: 0; !important
    Robin W

    I doubt this can be solved as posted without custom code.

    You can import files using

    GD bbPress Attachments

    It would be possible to add some fields to the topic and or reply fields – this article explains the principals.

    Whilst it talks about the functions file, you can also use code snipetts

    Code Snippets

    so for instance if you wanted to try their code you would put all this into a single code snippet

    add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields');
    function bbp_extra_fields() {
       $value = get_post_meta( bbp_get_topic_id(), 'bbp_extra_field1', true);
       echo '<label for="bbp_extra_field1">Extra Field 1</label><br>';
       echo "<input type='text' name='bbp_extra_field1' value='".$value."'>";
       $value = get_post_meta( bbp_get_topic_id(), 'bbp_extra_field2', true);
       echo '<label for="bbp_extra_field1">Extra Field 2</label><br>';
       echo "<input type='text' name='bbp_extra_field2' value='".$value."'>";
    add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );
    function bbp_save_extra_fields($topic_id=0) {
      if (isset($_POST) && $_POST['bbp_extra_field1']!='')
        update_post_meta( $topic_id, 'bbp_extra_field1', $_POST['bbp_extra_field1'] );
      if (isset($_POST) && $_POST['bbp_extra_field1']!='')
        update_post_meta( $topic_id, 'bbp_extra_field1', $_POST['bbp_extra_field2'] );
    add_action('bbp_template_before_replies_loop', 'bbp_show_extra_fields');
    function bbp_show_extra_fields() {
      $topic_id = bbp_get_topic_id();
      $value1 = get_post_meta( $topic_id, 'bbp_extra_field1', true);
      $value2 = get_post_meta( $topic_id, 'bbp_extra_field2', true);
      echo "Field 1: ".$value1."<br>";
      echo "Field 2: ".$value2."<br>";

    There are reply equivalents, but would need you to specify what should go into topic and what reply

    Robin W

    This might be the same as you are saying you don’t want – the user can press the submit, but it returns an error. As close as you’ll get without some js.

    function rew_min_length ($reply_content) {
    	if (strlen($reply_content)<500) {
    		bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be at least 500 characters.', 'bbpress' ) );
    return $reply_content ;
    add_filter( 'bbp_new_reply_pre_content', 'rew_min_length' );
    Robin W
Viewing 25 results - 1 through 25 (of 31,406 total)
Skip to toolbar