Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Groups Extensions API – examples not work !!!


  • jessy
    Participant

    @jessy-marco

    I am using latest WP 4.0 and BuddyPress 2.1.1

    I try to learn Groups Extensions API, but examples from: Google Groups API: https://codex.buddypress.org/developer/group-extension-api/#examples are with errors:

    Errors:
    Strict Standards: Declaration of Group_Extension_Example_2::settings_screen() should be compatible with BP_Group_Extension::settings_screen($group_id = NULL) in /opt/wordpress-4.0-0/apps/wordpress/htdocs/wp-content/plugins/bp-custom-admin-groups-widget/bp-custom-admin-groups-widget.php on line 8

    Strict Standards: Declaration of Group_Extension_Example_2::settings_screen_save() should be compatible with BP_Group_Extension::settings_screen_save($group_id = NULL) in /opt/wordpress-4.0-0/apps/wordpress/htdocs/wp-content/plugins/bp-custom-admin-groups-widget/bp-custom-admin-groups-widget.php on line 8

    Strict Standards: Declaration of Group_Extension_Example_2::create_screen() should be compatible with BP_Group_Extension::create_screen($group_id = NULL) in /opt/wordpress-4.0-0/apps/wordpress/htdocs/wp-content/plugins/bp-custom-admin-groups-widget/bp-custom-admin-groups-widget.php on line 8

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

  • shanebp
    Moderator

    @shanebp

    I’ve updated the codex page.
    Please use the updated examples.

    Note this addition$group_id = bp_get_group_id(); to function display()


    jessy
    Participant

    @jessy-marco

    I did, I palced the code into function display(), but without luck. Still Same Error.

    [Edited – please use pastebin or gist to share large chunks of code. ]


    jessy
    Participant

    @jessy-marco

    Solved:
    Define $group_id = NULL in the functions where errors appear, like this:

    function settings_screen( $group_id = NULL )
    function settings_screen_save( $group_id = NULL )
    function create_screen( $group_id = NULL )
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Groups Extensions API – examples not work !!!’ is closed to new replies.
Skip to toolbar