Skip to content

Commit d380667

Browse files
committed
Merge pull request #88 from bendoh/issue-87-restore-name-description
Remove unset of post_title and post_content before inserting consumer object
2 parents f3dab2b + a70e0fe commit d380667

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/class-wp-json-authentication.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ public function add_consumer( $params ) {
6868
);
6969
$params = wp_parse_args( $params, $default );
7070

71-
$data = array();
72-
$data['post_title'] = $params['name'];
73-
$data['post_content'] = $params['description'];
74-
unset( $data['post_title'], $data['post_content'] );
75-
76-
$data['post_type'] = 'json_consumer';
71+
$data = array(
72+
'post_type' => 'json_consumer',
73+
'post_title' => $params['name'],
74+
'post_content' => $params['description'],
75+
);
7776

7877
$ID = wp_insert_post( $data );
7978
if ( is_wp_error( $ID ) ) {

0 commit comments

Comments
 (0)