Changeset 13005
- Timestamp:
- 07/14/2021 08:29:34 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 19 added
- 5 edited
-
.jshintignore (modified) (1 diff)
-
Gruntfile.js (modified) (3 diffs)
-
src/bp-messages/bp-messages-blocks.php (added)
-
src/bp-messages/bp-messages-cssjs.php (modified) (1 diff)
-
src/bp-messages/classes/class-bp-messages-component.php (modified) (2 diffs)
-
src/bp-messages/css/blocks (added)
-
src/bp-messages/css/blocks/sitewide-notices-rtl.css (added)
-
src/bp-messages/css/blocks/sitewide-notices.css (added)
-
src/bp-messages/js/blocks (added)
-
src/bp-messages/js/blocks/sitewide-notices.js (added)
-
src/bp-messages/js/sitewide-notices.js (added)
-
src/bp-messages/sass (added)
-
src/bp-messages/sass/blocks (added)
-
src/bp-messages/sass/blocks/sitewide-notices.scss (added)
-
src/bp-templates/bp-legacy/buddypress-functions.php (modified) (1 diff)
-
src/js/bp-messages (added)
-
src/js/bp-messages/js (added)
-
src/js/bp-messages/js/blocks (added)
-
src/js/bp-messages/js/blocks/.babelrc (added)
-
src/js/bp-messages/js/blocks/sitewide-notices (added)
-
src/js/bp-messages/js/blocks/sitewide-notices.js (added)
-
src/js/bp-messages/js/blocks/sitewide-notices/edit.js (added)
-
src/js/bp-messages/js/blocks/sitewide-notices/transforms.js (added)
-
src/js/bp-messages/js/sitewide-notices.js (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.jshintignore
r13004 r13005 13 13 src/**/js/dynamic-groups.js 14 14 src/**/js/dynamic-widget-block.js 15 src/**/js/sitewide-notices.js -
trunk/Gruntfile.js
r13004 r13005 27 27 '!**/js/dynamic-members.js', 28 28 '!**/js/dynamic-groups.js', 29 '!**/js/dynamic-widget-block.js' 29 '!**/js/dynamic-widget-block.js', 30 '!**/js/sitewide-notices.js' 30 31 ], 31 32 … … 48 49 '!bp-friends/css/blocks/friends.css', 49 50 '!bp-members/css/blocks/dynamic-members.css', 50 '!bp-groups/css/blocks/dynamic-groups.css' 51 '!bp-groups/css/blocks/dynamic-groups.css', 52 '!bp-messages/css/blocks/sitewide-notices.css' 51 53 ], 52 54 … … 185 187 src: ['bp-friends/sass/blocks/*.scss'], 186 188 dest: SOURCE_DIR + 'bp-friends/css/blocks/' 189 }, 190 messages_blocks: { 191 cwd: SOURCE_DIR, 192 extDot: 'last', 193 expand: true, 194 ext: '.css', 195 flatten: true, 196 src: ['bp-messages/sass/blocks/*.scss'], 197 dest: SOURCE_DIR + 'bp-messages/css/blocks/' 187 198 } 188 199 }, -
trunk/src/bp-messages/bp-messages-cssjs.php
r12401 r13005 74 74 <?php 75 75 } 76 77 /** 78 * Registers a new script to manage the dismissal action for the Sitewide notice widget/block. 79 * 80 * @since 9.0.0 81 * 82 * @param array $scripts Data about the scripts to register. 83 * @return array Data about the scripts to register. 84 */ 85 function bp_messages_register_scripts( $scripts = array() ) { 86 $scripts['bp-sitewide-notices-script'] = array( 87 'file' => plugins_url( 'js/sitewide-notices.js', __FILE__ ), 88 'dependencies' => array(), 89 'footer' => true, 90 ); 91 92 return $scripts; 93 } 94 add_filter( 'bp_core_register_common_scripts', 'bp_messages_register_scripts', 9, 1 ); -
trunk/src/bp-messages/classes/class-bp-messages-component.php
r12994 r13005 63 63 'functions', 64 64 'widgets', 65 'blocks', 65 66 ); 66 67 … … 456 457 */ 457 458 public function blocks_init( $blocks = array() ) { 458 parent::blocks_init( array() ); 459 parent::blocks_init( 460 array( 461 'bp/sitewide-notices' => array( 462 'name' => 'bp/sitewide-notices', 463 'editor_script' => 'bp-sitewide-notices-block', 464 'editor_script_url' => plugins_url( 'js/blocks/sitewide-notices.js', dirname( __FILE__ ) ), 465 'editor_script_deps' => array( 466 'wp-blocks', 467 'wp-element', 468 'wp-components', 469 'wp-i18n', 470 'wp-block-editor', 471 'bp-block-data', 472 'bp-block-components', 473 ), 474 'style' => 'bp-sitewide-notices-block', 475 'style_url' => plugins_url( 'css/blocks/sitewide-notices.css', dirname( __FILE__ ) ), 476 'attributes' => array( 477 'title' => array( 478 'type' => 'string', 479 'default' => '', 480 ), 481 ), 482 'render_callback' => 'bp_messages_render_sitewide_notices_block', 483 ), 484 ) 485 ); 459 486 } 460 487 } -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r12997 r13005 491 491 public function sitewide_notices() { 492 492 // Do not show notices if user is not logged in. 493 if ( ! is_user_logged_in() )493 if ( ! is_user_logged_in() || is_admin() ) { 494 494 return; 495 } 495 496 496 497 // Add a class to determine if the admin bar is on or not.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)