Skip to content

Commit 50611d0

Browse files
committed
Display success message on creation or edit
1 parent d3869fd commit 50611d0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/class-wp-rest-oauth1-admin.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,13 @@ public static function render_edit_page() {
239239
if ( ! empty( $_POST['submit'] ) ) {
240240
$messages = self::handle_edit_submit( $consumer );
241241
}
242+
if ( ! empty( $_GET['did_action'] ) ) {
243+
if ( $_GET['did_action'] === 'edit' ) {
244+
$messages[] = __( 'Updated application.', 'rest_oauth1' );
245+
} else {
246+
$messages[] = __( 'Successfully created application.', 'rest_oauth1' );
247+
}
248+
}
242249

243250
$data = array();
244251

@@ -268,7 +275,7 @@ public static function render_edit_page() {
268275
<?php
269276
if ( ! empty( $messages ) ) {
270277
foreach ( $messages as $msg )
271-
echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
278+
echo '<div id="message" class="updated"><p>' . esc_html( $msg ) . '</p></div>';
272279
}
273280
?>
274281

0 commit comments

Comments
 (0)