'closed', 'ping_status' => 'closed', 'post_content' => $affiliate_area_page_content, 'post_status' => 'publish', 'post_title' => __( 'Affiliate Area', 'affiliates' ), 'post_type' => 'page' ); $post_id = wp_insert_post( $postarr, true ); // @since 5.4.1 cause error to be returned instead of 0 if ( $post_id instanceof WP_Error ) { wp_admin_notice( // wp_kses_post's the message output so we do not escape here sprintf( /* translators: error message */ __( 'The affiliate area page could not be created. Error: %s', 'affiliates' ), $post_id->get_error_message() ), array( 'type' => 'error' ) ); } else { $post_ids[] = $post_id; } $post_ids = apply_filters( 'affiliates_setup_pages', $post_ids ); do_action( 'affiliates_after_setup_pages', $post_ids ); return $post_ids; } }