Skip to content

Commit 6ece6a3

Browse files
committed
PHPCS cleanup
1 parent ae18d74 commit 6ece6a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/dashboard/widgets/dashboard-notepad.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function init() {
1818
register_post_type( self::notepad_post_type, array(
1919
'rewrite' => false,
2020
'label' => __( 'Dashboard Note', 'edit-flow' )
21-
)
21+
)
2222
);
2323

2424
$this->edit_cap = apply_filters( 'ef_dashboard_notepad_edit_cap', $this->edit_cap );
@@ -45,13 +45,13 @@ public function handle_notepad_update() {
4545
}
4646

4747
$note_data = array(
48-
'post_content' => wp_filter_nohtml_kses( $_POST['note'] ),
48+
'post_content' => isset( $_POST['note'] ) ? wp_filter_nohtml_kses( $_POST['note'] ) : '',
4949
'post_type' => self::notepad_post_type,
5050
'post_status' => 'draft',
5151
'post_author' => get_current_user_id(),
5252
);
5353

54-
$existing_notepad = get_post( absint( $_POST['notepad-id'] ) );
54+
$existing_notepad = isset( $_POST['notepad-id'] ) ? get_post( absint( $_POST['notepad-id'] ) ) : null;
5555
if ( isset( $existing_notepad->post_type ) && self::notepad_post_type === $existing_notepad->post_type ) {
5656
$note_data['ID'] = $existing_notepad->ID;
5757
}

0 commit comments

Comments
 (0)