Skip to:

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8315 closed enhancement (fixed)

Make all admin notices dismissible

Reported by: imath's profile imath Owned by: slaffik's profile slaFFik
Milestone: 7.0.0 Priority: normal
Severity: normal Version:
Component: Administration Keywords: good-first-bug has-patch


I believe we should add the needed class to make all our admin notices dismissible.

If you're a new BuddyPress contributor, building the patch of this improvement is a good way to start contributing ;)

Attachments (2)

8315.patch (2.1 KB) - added by immeet94 4 years ago.
8315_2.patch (5.5 KB) - added by immeet94 4 years ago.
updated patch

Download all attachments as: .zip

Change History (12)

#1 @immeet94
4 years ago

Hello @imath

I am a new BuddyPress contributor if you guide me I will create patch for this.


#2 @misfist
4 years ago

I'd be happy to make this happen also.

Version 1, edited 4 years ago by misfist (previous) (next) (diff)

#3 @imath
4 years ago

Hi @immeet94 & @misfist

Thanks for your feedbacks. I'll write a new codex page asap as I've just noticed a tutorial to quickly get started was missing.

I've also opened this ticket #8317 which should greatly improve how to set up a development environment for BuddyPress.

In the meantime, you can:

  • install your local development environment following this WordPress documentation page. Desktop server seems to be the easiest one to use as it includes WordPress already (make sure to download the free version!!).
  • we are using SVN to manage our code if you don't have SVN installed, here's how to install it. If you prefer Git, that's probably because you already have it installed, so you can alternatively use it.
  • once done, using a terminal (or Windows command line tool like Powershell), browse to the /wp-content/plugins directory of your WordPress and checkout the development version of BuddyPress:
    • SVN : svn co buddypress
    • or Git : git clone git:// buddypress
  • Activate BuddyPress
  • Using a code editor like VSCode Edit the needed files to make all admin notices dismissible. For instance, in src/bp-activity/bp-activity-admin.php at line 1174: replace <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> by <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?> notice is-dismissible"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> as to make a notice dismissible, you simply need to add these two CSS classes notice is-dismissible.
  • Save your edits, Test them deleting an activity from the Activity Administration screen and if it's ok, build a patch!
  • go to your terminal app into the /wp-content/plugins/buddypress directory and run svn diff > path-to-your-patch/8315.patch if you're using SVN or git diff --no-prefix > path-to-your-patch/8315.patch if you're using Git.
  • the path-to-your-patch/8315.patch file is the one you'll need to upload to this ticket.
  • Find the other places where BuddyPress is adding admin notices and edit the needed files to build a more complete patch and upload it here.

Now it's your turn!
Thanks in advance.

#4 @immeet94
4 years ago

Hello @imath

Thanks for guiding the contribution to BuddyPress.

patch created and please review it.


4 years ago

#5 @imath
4 years ago

In 12664:

Make Activity and Group screens admin notices dismissible

props immeet94

See #8315

#6 @imath
4 years ago

  • Keywords needs-patch added

Thanks a lot @immeet94 I've just committed your patch! Let's celebrate your first contribution to BuddyPress 🥂🎉.

FYI your name will appear into BuddyPress 7.0.0 credits when it will be released. Welcome on board 👏.

But there are more places where we need to make sure admin notices are dismissible 😉. That's why I've left the ticket open.

you and/or @misfist should have a look at these places:

  • src/bp-loader.php at line 61,
  • src/bp-core/admin/bp-core-admin-functions.php at line 154,
  • src/bp-core/admin/bp-core-admin-tools.php at line 425,
  • src/bp-members/classes/class-bp-members-admin.php at line 1989 and 1993,
  • src/bp-messages/classes/class-bp-messages-notices-admin.php at line 221,
  • src/bp-xprofile/bp-xprofile-admin.php at line 173,
  • src/bp-xprofile/bp-xprofile-admin.php at line 316,
  • src/bp-xprofile/classes/class-bp-xprofile-field.php at line 1233,
  • src/bp-xprofile/classes/class-bp-xprofile-group.php at line 851.

#7 @immeet94
4 years ago

Hello @imath

Thanks for providing list of files need to changes.

I will update the patch please review it.


4 years ago

updated patch

#8 @imath
4 years ago

  • Keywords has-patch added; needs-patch removed

Hi @immeet94

Thanks a lot for this new patch. It looks good at first sight. I'll test it asap.

#9 @imath
4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 12668:

Administration: make all remaining admin notices dismissible

props immeet94

Fixes #8315

This ticket was mentioned in Slack in #buddypress by imath. View the logs.

4 years ago

Note: See TracTickets for help on using tickets.