Skip to:
Content
Pages
Categories
Search
Top
Bottom

Plugin “Tip of the Day” : Ajax functions no more working when BP is disabled


  • grosbouff
    Participant

    @grosbouff

    Hey, does anyone know how WP & BP do handle ajax functions ?
    My ajax functions hooked on ‘wp_ajax_…’ are not fired when I disable BuddyPress.
    I get no JS errors.
    Here’s an example of a JS & PHP function : http://pastie.org/1290385

    Thanks a lot !

Viewing 1 replies (of 1 total)

  • grosbouff
    Participant

    @grosbouff

    Ok, got it.
    I have to use another ajaxurl than the one defined in BuddyPress :

    `function totd_wp_head() {
    //ajax url is defined in BP but not in WP
    if (!defined( ‘BP_VERSION’ )) {
    ?>

    <!–
    var ajaxurl = “/wp-admin/admin-ajax.php”;
    //–>
    <?php
    }
    }

    add_action(‘wp_print_styles’,’totd_wp_styles’);`

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin “Tip of the Day” : Ajax functions no more working when BP is disabled’ is closed to new replies.
Skip to toolbar