Skip to content

Commit 3e198be

Browse files
authored
Event Application: Resolve a unset variable warning, $wordcamp_user_id was used but never set.
1 parent a171eb7 commit 3e198be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public_html/wp-content/plugins/wcpt/wcpt-events/class-events-application.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ public function get_default_application_values() {
148148
* @return int|WP_Error
149149
*/
150150
public function create_post( $data ) {
151+
$wordcamp_user_id = get_user_by( 'email', '[email protected]' )->ID;
152+
151153
// Create the post.
152154
$user = wcorg_get_user_by_canonical_names( $data['q_wporg_username'] );
153155
$statuses = \WordCamp_Loader::get_post_statuses();
@@ -156,7 +158,7 @@ public function create_post( $data ) {
156158
'post_type' => self::get_event_type(),
157159
'post_title' => esc_html( $data['q_event_location'] ),
158160
'post_status' => self::get_default_status(),
159-
'post_author' => is_a( $user, 'WP_User' ) ? $user->ID : 7694169, // Set `wordcamp` as author if supplied username is not valid.
161+
'post_author' => is_a( $user, 'WP_User' ) ? $user->ID : $wordcamp_user_id, // Set `wordcamp` as author if supplied username is not valid.
160162
);
161163

162164
$post_id = wp_insert_post( $post, true );

0 commit comments

Comments
 (0)