gocodebox / banner-notifications
Library for showing admin-area banner notices.
Installs: 1 204
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 5
Type:wordpress-plugin
pkg:composer/gocodebox/banner-notifications
Requires
- php: >=7.4
Requires (Dev)
- lifterlms/lifterlms-cs: dev-trunk
- lifterlms/lifterlms-tests: ^4.3
- dev-trunk
- 1.1.1
- 1.1.0
- 1.0.1
- dev-dependabot/npm_and_yarn/js-yaml-3.14.2
- dev-fix-check-option
- dev-dependabot/npm_and_yarn/tar-fs-3.1.1
- dev-dependabot/npm_and_yarn/multi-127d05f333
- dev-release
- dev-dev
- dev-fix/check-class-exists
- dev-dependabot/npm_and_yarn/form-data-4.0.4
- dev-adding-llms-settings
- dev-unit-tests
This package is auto-updated.
Last update: 2025-11-18 09:53:57 UTC
README
WordPress Editor (Gutenberg) blocks for LifterLMS.
Installing
TBW
- Adding notification area in admin header
<?php // Default to showing notification banners. $show_notifications = true; // Hide notifications on certain pages. $hide_on_these_pages = array( 'pmpro-updates' ); if ( ! empty( $_REQUEST['page'] ) && in_array( sanitize_text_field( $_REQUEST['page'] ), $hide_on_these_pages ) ) { $show_notifications = false; } // Hide notifications if the user has disabled them. if( pmpro_get_max_notification_priority() < 1 ) { $show_notifications = false; } if( $show_notifications ) : ?> <div id="pmpro_notifications"> </div> <?php // To debug a specific notification. if ( !empty( $_REQUEST['pmpro_notification'] ) ) { $specific_notification = '&pmpro_notification=' . intval( $_REQUEST['pmpro_notification'] ); } else { $specific_notification = ''; } ?> <script> jQuery(document).ready(function() { jQuery.get('<?php echo esc_url_raw( admin_url( "admin-ajax.php?action=pmpro_notifications" . $specific_notification ) ); ?>', function(data) { if(data && data != 'NULL') jQuery('#pmpro_notifications').html(data); }); }); </script> <?php endif; ?>
- Loading an instance of the class with unique slug (ie. for the )
$GLOBALS['pmpro_banner_notifications'] = new Gocodebox_Banner_Notifier( array(
'prefix' => 'pmpro',
'version' => PMPRO_VERSION,
'notifications_url' => 'https://notifications.paidmembershipspro.com/v2/notifications.json'
) );
Development
TBW