• Plugin is working at all on 3.8, but when is enabled bbPress plugin stop working and error appeared

    Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /var/www/tests/wpcebp3x/wp-includes/functions.php on line 3049

    When I disable the plugin, bbPress is working as expect

    https://www.ads-software.com/plugins/custom-background-extended/

Viewing 1 replies (of 1 total)
  • Thread Starter dimitrov.adrian

    (@dimitrovadrian)

    I make a patch that fix that.

    custom-background-extended/admin/class-custom-backgrounds-admin.php

    We need to hook on admin_init becase the message, so need to add one more callback.

    public function __construct() {
    
    		/* Custom meta for plugin on the plugins admin screen. */
    		add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
    
    		/* If the current user can't edit custom backgrounds, bail early. */
    		if ( !current_user_can( 'cbe_edit_background' ) && !current_user_can( 'edit_theme_options' ) )
    			return;
    
    		/* Only load on the edit post screen. */
    		add_action( 'load-post.php',     array( $this, 'load_post' ) );
    		add_action( 'load-post-new.php', array( $this, 'load_post' ) );
    	}

    to

    public function __construct() {
    
    		/* Custom meta for plugin on the plugins admin screen. */
    		add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
    
    		add_action( 'admin_init', array( $this, 'attach_load_post_events' ) );
        }
    
    public function attach_load_post_events() {
    		/* If the current user can't edit custom backgrounds, bail early. */
    		if ( !current_user_can( 'cbe_edit_background' ) && !current_user_can( 'edit_theme_options' ) )
    		        return;
    
    		/* Only load on the edit post screen. */
    		add_action( 'load-post.php',     array( $this, 'load_post' ) );
    		add_action( 'load-post-new.php', array( $this, 'load_post' ) );
        }
Viewing 1 replies (of 1 total)
  • The topic ‘Breaking bbPress (2.6dev)’ is closed to new replies.