• Hello, since your plugin doesnt support native to the wp_login_form() – which I believe it should and be easy to support.

    the configure of which version is private in your class – which is ok you do:

    $sgrDisplay = $this->version === 3 ? ‘v3Display’ : ‘v2Display’;

    so maybe just have a function

    
    public function display() {
         $sgrDisplay = $this->version === 3 ? 'v3Display' : 'v2Display';
         $this->$sgrDisplay();
    }
    
    

    and change the 231 line

    
      add_action($sgr_display, [$this, $sgrDisplay]);
      
      to
    
      add_action($sgr_display, [$this, 'display' ]); 
    

    even better if you can add support to the wp_login_form(), which is something similar to that

    
        add_filter( 'login_form_bottom', function( $html, $args ) {
    		if ( !class_exists( 'SimpleGoogleRecaptcha' ) ) return( $html );
    		$recaptcha = SimpleGoogleRecaptcha::getInstance();
    		ob_start();
    		$recaptcha->enqueueScripts();
    		$recaptcha->v3Display();
    		$html .= ob_get_clean();
    		return( $html );
    	}, 100, 2 );
    

    and maybe just allow to hook using filters to your

    $sgr_display_list

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Encapsulate display (for support for both v2 /v3)’ is closed to new replies.