MP_Addon_Slack_Settings::upload( array $args )
Callback function upload icon message.
Contents
Parameters Parameters
- $args
-
(array) (Required)
Source Source
File: calculator-slack-notification-add-on/inc/MP_Addon_Slack_Settings.php
public function upload( $args ) {
$attachment_url = $args['label_for'];
$attachment_id = $args['attachment_id'];
$option_name = $args['option_name'];
$input = get_option( $option_name );
$value_url = isset( $input[ $attachment_url ] ) ? $input[ $attachment_url ] : '';
$value_id = isset( $input[ $attachment_id ] ) ? $input[ $attachment_id ] : '';
$description = $args['description'];
echo '<button id="slack_upload" class="button button-primary slack_upload">' . esc_html__( 'Upload', 'CalculatorsSlackNotificationAddon' ) . '</button> ';
echo '<button class="button button-primary slack_logo_clear">' . esc_html__( 'Clear Image', 'CalculatorsSlackNotificationAddon' ) . '</button> ';
echo '<img class="' . esc_attr( MortgagePlatform::$prefix ) . 'slack_logo_image" style="display:none; width: 150px; height: auto;" src="' . esc_attr( $value_url ) . '" />';
echo '<input class="slack_icon_url" type="text" style="display:none;" id="' . esc_attr( $attachment_url ) . '" name="' . esc_attr( $option_name ) . '[' . esc_attr( $attachment_url ) . ']" value="' . esc_url( $value_url ) . '">';
echo '<input class="slack_icon_id" type="text" style="display:none;" id="' . esc_attr( $attachment_id ) . '" name="' . esc_attr( $option_name ) . '[' . esc_attr( $attachment_id ) . ']" value="' . esc_attr( $value_id ) . '">';
echo '<p>' . esc_attr( $description ) . '</p>';
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |