LLMS_Admin_Notices::hide_notices()

Called when “Dismiss X” or “Remind Me” is clicked on a notice


Description Description

Validates request and deletes the notice.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.notices.php

	 *
	 * @since 3.0.0
	 * @since 3.35.0 Unslash input data.
	 * @since 5.2.0 Remove notice and notice query string vars and redirect after clearing.
	 *
	 * @return void
	 */
	public static function hide_notices() {
		if ( ( isset( $_GET['llms-hide-notice'] ) || isset( $_GET['llms-remind-notice'] ) ) && isset( $_GET['_llms_notice_nonce'] ) ) {
			if ( ! llms_verify_nonce( '_llms_notice_nonce', 'llms_hide_notices_nonce', 'GET' ) ) {
				wp_die( __( 'Action failed. Please refresh the page and retry.', 'lifterlms' ) );
			}
			if ( ! current_user_can( 'manage_options' ) ) {
				wp_die( __( 'Cheatin’ huh?', 'lifterlms' ) );
			}
			if ( isset( $_GET['llms-hide-notice'] ) ) {
				$notice = sanitize_text_field( wp_unslash( $_GET['llms-hide-notice'] ) );
				$action = 'hide';
			} elseif ( isset( $_GET['llms-remind-notice'] ) ) {


Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Remove notice and notice query string vars and redirect after clearing.
3.35.0 Unslash input data.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.