2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-10-04 09:01:05 +08:00

Add missing initialisation of optional parameter (#461)

Before $comment_type was a required parameter following an optional parameter and this results in:
```Deprecated: Required parameter $comment_type follows optional parameter $perform_sync in [redacted]/wp-content/plugins/wp-discourse/lib/utilities.php on line 338```
This then completely breaks login on our Wordpress instance. Adding ```= null``` seems to fix the problem.

Co-authored-by: Angus McLeod <angus@mcleod.org.au>
This commit is contained in:
Daniel Thomas 2023-02-15 20:17:16 +00:00 committed by GitHub
parent 42b81e903f
commit 2c498b73ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -335,7 +335,7 @@ class Utilities {
*
* @return string
*/
public static function get_discourse_comments( $post_id, $perform_sync = true, $force_sync = false, $comment_type ) {
public static function get_discourse_comments( $post_id, $perform_sync = true, $force_sync = false, $comment_type = null ) {
$comment_formatter = new \WPDiscourse\DiscourseCommentFormatter\DiscourseCommentFormatter();
$comment_formatter->setup_options();
$comment_formatter->setup_logger();