Skip to:

Possible bug: ajaxurl for Favourites/Subscribes

  • This is with bbPress theme files in a custom theme and refers to the functions.php file supplied with the plugin in the sample theme.

    From poking around it looks like the head_scripts() function (in functions.php) is hooked into bbp_head, which is in turn hooked into wp_head without a priority.

    This means it gets added with a priority 10 whereas wp_lists.js gets called with wp_print_head_scripts which has a priority 9 causing var ajaxurl to be defined too late. (As it’s required by wp-lists.php).

    If anyone else finds their ajax doesn’t work on topic pages you can get round this by changing in functions.php:

    add_action( ‘bbp_head’, array( $this, ‘head_scripts’ ));


    add_action( ‘wp_head’, array( $this, ‘head_scripts’ ), 8 );

    This might not be the case with all themes and only applies if you use functions.php from the bbPress plugin in your theme but thought it was worth mentioning.

    @JJJ: The plugin is Frickin awesome! Good job sir.

Viewing 5 replies - 1 through 5 (of 5 total)

  • highexistence


    Just the answer I was looking for! Thanks for solving that major headache for me

    **Edit: I’m still getting this error:

    topic.js:39 — Uncaught TypeError: Object #<Object> has no method ‘wpList’

    Any ideas?

    It looks like wpList is set up in:

    **YOUR SITES WP DIRECTORY**/wp-includes/js/wp-lists.js

    Have a look at the page source in your browser and see if the above file is called BEFORE:




    Yes it’s called before topic.js. What now?

    Dunno mate, is jQuery also being called before these two scripts?

    Also have you got any other plugins enabled that use javascript for anything, I’d try disabling them to see if anything changes.



    JQuery is called first and I’ve tried only activating BBpress and Buddypress and the error is still there.

    Thanks for your help mate! This is a tough one. If you have any other suggestions, I’m all ears. Thanks again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar