Skip to content

Instantly share code, notes, and snippets.

@VlooMan
VlooMan / functions.php
Created June 7, 2019 07:56
No CAPTCHA reCAPTCHA for WooCommerce plugin - Lost password wrong link fix.
<?php
/**
* This piece of code fixes the "No CAPTCHA reCAPTCHA for WooCommerce" plugin's incorrect code when generating
* lost password link. You can copy it to functions.php of your theme or child theme until the plugin developer fixes
* the plugin behavior.
*/
// Add our fixed version only if the original filter is hooked already.
if ( has_filter( 'allow_password_reset', array( 'WC_Ncr_Lost_Password_Captcha', 'validate_lost_password_captcha' ) ) ) {
@VlooMan
VlooMan / Highlight CPT Archive and wp_nav_menu parents
Last active May 23, 2023 17:15
Highlight the CPT (Custom Post Type) Archive & its Parents ("current-menu-parent") & its Ancestors ("current-menu-ancestor") in the WordPress Navigation wp_nav_menu() when viewing the Archive itself or a single detail page of the CPT. Let's say you have CPT called "projects" and you have a WordPress menu set as "My Work (link to a page) > Projec…
/**
* Gist Name: Highlight CPT Archive and wp_nav_menu parents
* Author: VlooMan
* Author URI: http://ishyoboy.com
*
* Highlight the CPT (Custom Post Type) Archive & its Parents ("current-menu-parent")
* & its Ancestors ("current-menu-ancestor") in the WordPress Navigation wp_nav_menu() when viewing the Archive itself
* or a single detail page of the CPT.
*
* Let's say you have CPT called "projects" and you have a WordPress menu set as