Skip to content

Fix: Correct login_form_middle filter parameter type - #2954

Open
shsajalchowdhury wants to merge 1 commit into
themeum:devfrom
shsajalchowdhury:fix/login-form-middle-parameter-type
Open

Fix: Correct login_form_middle filter parameter type#2954
shsajalchowdhury wants to merge 1 commit into
themeum:devfrom
shsajalchowdhury:fix/login-form-middle-parameter-type

Conversation

@shsajalchowdhury

Copy link
Copy Markdown

Summary

The apply_filters('login_form_middle') call in both login form templates was passing an empty string ('') as the second argument instead of an array. This causes fatal errors (TypeError) when third-party plugins — such as hCaptcha for WordPress — register a callback on this filter with a type-hinted array $args parameter, which is what WordPress core specifies.

Root Cause

Per WordPress core, the login_form_middle filter signature is:

apply_filters( 'login_form_middle', string , array  )

Tutor passes:

apply_filters( 'login_form_middle', '', '' )  // ← second arg should be array

Changes Made

  • templates/login-form.php:71 — Changed second argument from '' to array()
  • templates/login-form-legacy.php:70 — Same fix

Testing Instructions

  1. Install a plugin that hooks into login_form_middle with a type-hinted array parameter (e.g., hCaptcha for WordPress)
  2. Open any page with the Tutor login form or modal login
  3. Before fix: Fatal error / blank page (TypeError)
  4. After fix: Login form renders correctly

Does this PR change what data or activity we track or use?

No.

Fixes #2355

The apply_filters('login_form_middle') call was passing an empty
string as the second argument instead of an array, causing fatal
errors when third-party plugins (e.g., hCaptcha) type-hint the
parameter as array per WordPress core specifications.

Fixes themeum#2355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant