• Resolved javierpiedra

    (@javierpiedra)


    Hello!

    Great plugin!

    Is there a safe way (hook) to remove the target=”_blank” in order to open the terms and conditions using a pop up?

    I deleted ‘target=”_blank”‘ directly from all the lines it appeared in the class-main.php file and the pop up is working great now, but when the plugin updates this change will be reverted.

    Thank you for the support!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author giannis4

    (@giannis4)

    Hi Javier,

    Thank you for using our plugin!

    Sure, there is a hook you can use called “gkco_custom_product_terms_text”

    
    $terms_text = apply_filters(
         'gkco_custom_product_terms_text',
         $terms_text,
         $product_terms_url,
         $product_id
    );
    

    Let me know if that helps.

    Best regards,
    Giannis
    P.S. If you are happy using our plugin, please take a moment to add a review.

    Thread Starter javierpiedra

    (@javierpiedra)

    Thank you for creating this plugin Giannis!

    I managed to program this filter with the little knowledge I had and it worked!

    add_filter( 'gkco_custom_product_terms_text', 'gkco_filter_custom_product_terms_text' );
    // Filter: quitar el target=_blank de los terminos y condiciones para que abra en la misma ventana
    function gkco_filter_custom_product_terms_text( $terms_text ) {
    	$search = 'target="_blank"';
    	$replace = '';
    	$terms_text = str_replace(
    		$search,
    		$replace,
    		$terms_text
    	);
    	return $terms_text;
    }
    Plugin Author giannis4

    (@giannis4)

    Hi Javier,

    Well done! You have used the hook correctly to remove the link target.

    Feel free to contact me anytime if you need anything else.

    Best regards,
    Giannis
    P.S. Also a huge thank you for the review. I appreciate it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change target=”_blank” for “_self”’ is closed to new replies.