admin_notices[$parent->args['page_slug']][] = array( 'type' => $type, 'msg' => $msg, 'id' => $id . '_' . $parent->args['opt_name'], 'dismiss' => $dismiss, 'color' => isset($color) ? $color : '#00A2E3' ); } /** * adminNotices - Evaluates user dismiss option for displaying admin notices * * @since 3.2.0 * @access public * @return void */ public static function adminNotices($parent, $notices = array() ) { global $current_user, $pagenow, $wp_version;; // Check for an active admin notice array if ( ! empty( $notices ) ) { if (isset($_GET) && isset($_GET['page']) && $_GET['page'] == $parent->args['page_slug']) { // Enum admin notices foreach ( $notices[$parent->args['page_slug']] as $notice ) { $add_style = ''; if ( strpos( $notice['type'], 'redux-message' ) != false ) { $add_style = 'style="border-left: 4px solid ' . esc_attr( $notice['color'] ) . '!important;"'; } if ( true == $notice['dismiss'] ) { // Get user ID $userid = $current_user->ID; if ( ! get_user_meta( $userid, 'ignore_' . $notice['id'] ) ) { // Check if we are on admin.php. If we are, we have // to get the current page slug and tab, so we can // feed it back to Wordpress. Why> admin.php cannot // be accessed without the page parameter. We add the // tab to return the user to the last panel they were // on. $pageName = ''; $curTab = ''; if ( $pagenow == 'admin.php' || $pagenow == 'themes.php' ) { // Get the current page. To avoid errors, we'll set // the redux page slug if the GET is empty. $pageName = empty( $_GET['page'] ) ? '&page=' . $parent->args['page_slug'] : '&page=' . esc_attr( $_GET['page'] ); // Ditto for the current tab. $curTab = empty( $_GET['tab'] ) ? '&tab=0' : '&tab=' . esc_attr( $_GET['tab'] ); } // Print the notice with the dismiss link if ( version_compare( $wp_version, '4.2', '>' ) ) { $output = ""; $css_id = esc_attr( $notice['id'] ) . $pageName . $curTab; $css_class = esc_attr( $notice['type'] ) . ' redux-notice notice is-dismissible redux-notice'; $output .= "
' . wp_kses_post( $notice['msg'] ) . '
'; $output .= "' . wp_kses_post( $notice['msg'] ) . ' ' . esc_html__( 'Dismiss', 'redux-framework' ) . '.
' . wp_kses_post( $notice['msg'] ) . '.