Skip to content

Commit

Permalink
Event Application: Resolve a unset variable warning, $wordcamp_user_i…
Browse files Browse the repository at this point in the history
…d was used but never set.
  • Loading branch information
dd32 authored Jan 8, 2025
1 parent a171eb7 commit 3e198be
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public function get_default_application_values() {
* @return int|WP_Error
*/
public function create_post( $data ) {
$wordcamp_user_id = get_user_by( 'email', 'support@wordcamp.org' )->ID;

// Create the post.
$user = wcorg_get_user_by_canonical_names( $data['q_wporg_username'] );
$statuses = \WordCamp_Loader::get_post_statuses();
Expand All @@ -156,7 +158,7 @@ public function create_post( $data ) {
'post_type' => self::get_event_type(),
'post_title' => esc_html( $data['q_event_location'] ),
'post_status' => self::get_default_status(),
'post_author' => is_a( $user, 'WP_User' ) ? $user->ID : 7694169, // Set `wordcamp` as author if supplied username is not valid.
'post_author' => is_a( $user, 'WP_User' ) ? $user->ID : $wordcamp_user_id, // Set `wordcamp` as author if supplied username is not valid.
);

$post_id = wp_insert_post( $post, true );
Expand Down

0 comments on commit 3e198be

Please sign in to comment.