su_error_message

The shortcodes-ultimate su error message function.

Published Date - February 15, 2021

Description

Create an error message.

su_error_message( $title, $message );

Parameters

  1. $title

  2. $message


Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_error_message' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/functions-helpers.php';
}

// The input(s). 
$title = '';
$message = '';

// NOTICE! Understand what this does before running.
$result = su_error_message( $title, $message );
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/functions-helpers.php

function su_error_message( $title = '', $message = '' ) {

	if ( ! su_current_user_can_insert() ) {
		return;
	}

	if ( $title ) {
		$title = "<strong>${title}:</strong> ";
	}

	return sprintf(
		'<p class="su-error" style="padding:5px 10px;color:#ff685e;border-left:3px solid #ff685e;background:#fff">%1$s%2$s</p>',
		$title,
		$message
	);

}