tarecord / sign-in-with-google

A WordPress plugin that adds "Sign in with Google" functionality
https://wordpress.org/plugins/sign-in-with-google
GNU General Public License v2.0
26 stars 5 forks source link

Ability to access & execute the public methods programmatically #90

Closed ttodua closed 4 months ago

ttodua commented 2 years ago

Eventually, because of huge overhaul needed to use this plugin from core scripts (of app/system) it's inevitably needed to have an access to class instance. Typically, I would expect that when initializing the class within function sign_in_with_google_run the instance should have been exposed to global variable (like $SIWG = new Sign_In_With_Google( '1.6.0' )) however, as you have chosen to lock that side, there is no other way, other than hooks. This was the only way we could make this plugin to work in our complex app. Now, we can exec authenticate_user or any other functions we need, without re-initializing the siwg plugin second time (because WP already initializes is once).