wp-includes/class-wp-plugin-dependency-installer.php
/**
	 * Display admin notices / action links.
	 *
	 * @return bool/string false or Admin notice.
	 */
Display admin notices / action links.
@return bool/string false or Admin notice.
Display admin notices / action links . @return bool / string false or Admin notice .
public function admin_notices() {
		if ( ! current_user_can( 'update_plugins' ) ) {
			return false;
		}
		foreach ( $this->notices as $notice ) {
			$status      = isset( $notice['status'] ) ? $notice['status'] : 'notice-info';
			$class       = esc_attr( $status ) . ' notice is-dismissible dependency-installer';
			$source      = isset( $notice['source'] ) ? $notice['source'] : __( 'Dependency' );
			$label       = esc_html( $this->get_dismiss_label( $source ) );
			$message     = '';
			$action      = '';
			$dismissible = '';
			if ( isset( $notice['message'] ) ) {
				$message = esc_html( $notice['message'] );
			}
			if ( isset( $notice['action'] ) ) {
				$action = sprintf(
					' <a href="javascript:;" class="wpdi-button" data-action="%1$s" data-slug="%2$s">%3$s Now &raquo;</a> ',
					esc_attr( $notice['action'] ),
					esc_attr( $notice['slug'] ),
					esc_html( ucfirst( $notice['action'] ) )
				);
			}
			if ( isset( $notice['slug'] ) ) {
				$timeout     = apply_filters( 'wp_plugin_dependency_timeout', '14', $source );
				$dependency  = dirname( $notice['slug'] );
				$dismissible = empty( $timeout ) ? '' : sprintf( 'dependency-installer-%1$s-%2$s', esc_attr( $dependency ), esc_attr( $timeout ) );
			}
			if ( WP_Dismiss_Notice::is_admin_notice_active( $dismissible ) ) {
				printf(
					'<div class="%1$s" data-dismissible="%2$s"><p><strong>[%3$s]</strong> %4$s%5$s</p></div>',
					esc_attr( $class ),
					esc_attr( $dismissible ),
					esc_html( $label ),
					esc_html( $message ),
					$action 
				);
			}
		}
	}
public function admin_notices ( ) { if ( ! current_user_can ( 'update_plugins' ) ) { return false ; } foreach ( $ this -> notices as $ notice ) { $ status = isset ( $ notice [ 'status' ] ) ? $ notice [ 'status' ] : 'notice-info' ; $ class = esc_attr ( $ status ) . ' notice is-dismissible dependency-installer' ; $ source = isset ( $ notice [ 'source' ] ) ? $ notice [ 'source' ] : __ ( 'Dependency' ) ; $ label = esc_html ( $ this -> get_dismiss_label ( $ source ) ) ; $ message = '' ; $ action = '' ; $ dismissible = '' ; if ( isset ( $ notice [ 'message' ] ) ) { $ message = esc_html ( $ notice [ 'message' ] ) ; } if ( isset ( $ notice [ 'action' ] ) ) { $ action = sprintf ( ' <a href="javascript:;" class="wpdi-button" data-action="%1$s" data-slug="%2$s">%3$s Now &raquo;</a> ' , esc_attr ( $ notice [ 'action' ] ) , esc_attr ( $ notice [ 'slug' ] ) , esc_html ( ucfirst ( $ notice [ 'action' ] ) ) ) ; } if ( isset ( $ notice [ 'slug' ] ) ) { $ timeout = apply_filters ( 'wp_plugin_dependency_timeout' , '14' , $ source ) ; $ dependency = dirname ( $ notice [ 'slug' ] ) ; $ dismissible = empty ( $ timeout ) ? '' : sprintf ( 'dependency-installer-%1$s-%2$s' , esc_attr ( $ dependency ) , esc_attr ( $ timeout ) ) ; } if ( WP_Dismiss_Notice :: is_admin_notice_active ( $ dismissible ) ) { printf ( '<div class="%1$s" data-dismissible="%2$s"><p><strong>[%3$s]</strong> %4$s%5$s</p></div>' , esc_attr ( $ class ) , esc_attr ( $ dismissible ) , esc_html ( $ label ) , esc_html ( $ message ) , $ action ) ; } } }
Display admin notices / action links.
Display admin notices / action links .
/**
				 * Filters the dismissal timeout.
				 *
				 * @since 1.4.1
				 *
				 * @param string|int '14'               Default dismissal in days.
				 * @param  string     $notice['source'] Plugin slug of calling plugin.
				 * @return string|int Dismissal timeout in days.
				 */ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped