Skip to:
Content
Pages
Categories
Search
Top
Bottom

ajax problem after adding new groups sub nav

  • Avatar of tifire
    tifire
    Participant

    @tifire

    This problem has been bugging me for couple of days. After adding a new subnav, I got the following error when trying to use the drop down groups filter:
    404 Not Found – mysite.com/wp-admin/admin-ajax.php”

    Basically I wanted to add a new subnav items under a member’s main nav “groups”. Currently there are two subnav items there: “memberships” and “invitations”. I would like to add my own subnav item called “My Customized Groups”. When this subnav is clicked, it will show groups of certain feature.

    Okay the first step is to create a new subnav items. I did it by adding the following code to my functions.php

    //add new subnav items
    bp_core_new_subnav_item( array(
    'name' => __( 'My Customized Groups', 'buddypress' ),
    'slug' => 'my-custom-groups',
    'parent_url' => $groups_link,
    'parent_slug' => $bp->groups->slug,
    'screen_function' => 'groups_screen_my_custom_groups',
    'position' => 20
    ));

    To make sure my subnav works, my screen_function “groups_screen_my_custom_groups” is a exactly copy of the default “groups_screen_my_groups”. Now the subnav is added, and groups loop show up correctly. But when I select the drop down filter ( “last active”, “most members”, “newly created”, etc), the following error shows up:
    404 Not Found – mysite.com/wp-admin/admin-ajax.php”

    if I set this new subnav as the default by adding the following code in functions.php

    $args = array(
    'parent_slug' => $bp->groups->slug,
    'screen_function' => 'groups_screen_my_custom_groups',
    'subnav_slug' => 'my-custom-groups'
    );

    bp_core_new_nav_default($args);

    Then the ajax works correctly for my-custom-groups, but it doesn’t work for other subnav items anymore. It seems ajax only works for the default subnav? This is strange.

    It must be something minor, but I still can’t figure out what’s been wrong after searching everywhere for two days.

    Thanks in advance for the help.

    Wordpress version: 3.4.2
    buddypress version: 1.6.1

You must be logged in to reply to this topic.