Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding/Copying new widget..


  • ichbinsdennis
    Member

    @ichbinsdennis

    I would like to add a new widget/copy an already existing widget..

    I would like to have a “new members” widget in my profile sidebar..

    Now my question is how to exactly duplicate the existing widget to add it to my profile sidebar.. Would be great to hear some suggestions..

    Cheers

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

  • Erwin Gerrits
    Participant

    @egerrits

    Copy bp_core_widget_members() and bp_core_widget_members_control() functions from the file bp-core-widgets.php into a new file. Rename the widget functions from “members” to “newmembers” or whatever. Remove everything in the div “item-options” if you don’t need ajax option choices.

    Add these two lines to the end of the file:

    register_sidebar_widget( __(‘New Members’, ‘buddypress’), ‘bp_core_widget_newmembers’);

    register_widget_control( __(‘New Members’, ‘buddypress’), ‘bp_core_widget_newmembers_control’ );

    Save the file as “newmembers.php” into mu-plugins. Next time you login the widget will be listed on the widgets page ready to be placed on the front page.


    derosion
    Participant

    @derosion

    Hey I tried this with the latest version 1.0 release and WPMU 2.7.1 and nothing shows up in my widgets screen. Basically I\’ve just done this:

    1) Copied the bp-blogs-register-widgets.php file

    2) Renamed it to ds-blogs-register-widgets.php

    3) Changed function to be ds_blogs_register_widgets()

    4) Changed all function names to correspond with the wp_register_sidebar_widget()

    Yet my new widget is not shown in the widget list.

    Is this information posted here still supposed to work in the current release versions?


    Jeff Sayre
    Participant

    @jeffsayre

    @Derosion-

    Try placing your new widget in /mu-plugins/, not the /plugins/ folder.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding/Copying new widget..’ is closed to new replies.
Skip to toolbar