LLMS_Admin_Review::maybe_show_notice()
Determine if the notice should be displayed and display it
Return Return
(null|false|void) Returns null when there are permission issues, false when the notification is not set to be displayed, and has no return when the notice is successfully displayed.
Source Source
File: includes/admin/class-llms-admin-review.php
* @since 3.24.0
* @since 4.14.0 Only users with `manager_lifterlms` caps can dismiss and added nonce verification.
* Use `llms_filter_input()` in favor of `filter_input()`.
* @since 5.9.0 Stop using deprecated `FILTER_SANITIZE_STRING`.
*
* @return void
*/
public function dismiss() {
if ( ! current_user_can( 'manage_lifterlms' ) || ! llms_verify_nonce( 'nonce', 'llms-admin-review-request-dismiss' ) ) {
wp_die();
}
$success = llms_parse_bool( llms_filter_input( INPUT_POST, 'success' ) );
update_option(
'llms_review',
array(
'time' => time(),
'dismissed' => true,
'success' => $success ? 'yes' : 'no',
)
);
wp_die();
}
/**
* Determine if the notice should be displayed and display it
*
* @since 3.24.0
* @since 4.14.0 Only show to users with `manage_lifterlms` instead of only admins.
*
* @return null|false|void Returns `null` when there are permission issues, `false` when the notification is not set to be
* displayed, and has no return when the notice is successfully displayed.
*/
public function maybe_show_notice() {
// Only show review request to admins.
if ( ! current_user_can( 'manage_lifterlms' ) ) {
return null;
}
// Verify that we can do a check for reviews.
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.14.0 | Only show to users with manage_lifterlms instead of only admins. |
| 3.24.0 | Introduced. |