#8315 closed enhancement (fixed)
Make all admin notices dismissible
Reported by: | imath | Owned by: | slaFFik |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | good-first-bug has-patch |
Cc: |
Description
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)
Change History (12)
#3
@
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 https://buddypress.svn.wordpress.org/trunk/ buddypress
- or Git :
git clone git://buddypress.git.wordpress.org/ buddypress
- SVN :
- 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 classesnotice 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 runsvn diff > path-to-your-patch/8315.patch
if you're using SVN orgit 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
@
4 years ago
Hello @imath
Thanks for guiding the contribution to BuddyPress.
patch created and please review it.
Thanks.
#6
@
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
@
4 years ago
Hello @imath
Thanks for providing list of files need to changes.
I will update the patch please review it.
Thanks.
#8
@
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.
Hello @imath
I am a new BuddyPress contributor if you guide me I will create patch for this.
Thanks.