Skip to content

Instantly share code, notes, and snippets.

View gregBerthelot's full-sized avatar

Greg gregBerthelot

  • iPaoo
  • French Riviera Tech
View GitHub Profile
@gregBerthelot
gregBerthelot / facetwp 3.8+ dropdowns with chosen()
Created July 29, 2022 15:18 — forked from remcokalf/facetwp 3.8+ dropdowns with chosen()
Fixes for dropdowns facets and sortbox with .chosen() in FacetWP 3.8.0 - 3.8.2 because Facetwp fUtil library did not pick up jQuery.trigger change events from chosen() in these FacetWP versions. This was fixed in FacetWP 3.8.3+. Check this page for current versions of FacetWP: https://gist.facetwp.com/gist/use-chosen-js-with-facetwp-dropdowns-or…
(function ($) {
$(document).on('facetwp-loaded', function () {
// Facetwp Dropdowns to chosen dropdows
$('.facetwp-dropdown option:first-child').text('');
$('.facetwp-dropdown').attr('data-placeholder', 'All');
$('.facetwp-dropdown').chosen({disable_search_threshold: 50, allow_single_deselect: true});
// Facetwp Sort box to chosen dropdows
@gregBerthelot
gregBerthelot / wp-custom-reset-password-form.php
Created January 11, 2022 15:10 — forked from iqbalrony/wp-custom-reset-password-form.php
WordPress custom reset password form
<?php
/*
*Example Follw:-https://code.tutsplus.com/tutorials/build-a-custom-wordpress-user-flow-part-3-password-reset--cms-23811
*/
// Create the custom pages at plugin activation
register_activation_hook( __FILE__, 'dgm_plugin_activated' );
function dgm_plugin_activated() {
// Information needed for creating the plugin's pages
$page_definitions = array(
@gregBerthelot
gregBerthelot / breadcrumbs.php
Created January 11, 2022 15:09 — forked from iqbalrony/breadcrumbs.php
WordPress Custom Breadcrumbs
/**
* Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user.
*
* @since 0.6.0
* @access public
*/
class Breadcrumb_Trail {
/**
* Array of items belonging to the current breadcrumb trail.
@gregBerthelot
gregBerthelot / striptags.js
Created April 14, 2020 11:52 — forked from fernandosavio/striptags.js
Simple regex-based strip_tags in Javascript
/*
regex example(strips 'i' and 'em' tags): /(<(?!\/?em|\/?i).*?>)/ig
*/
/**
* @param string html
* @param string allowed_tags space-separated allowed tags
*/
function strip_tags(html, allowed_tags){
allowed_tags = allowed_tags.trim()
@gregBerthelot
gregBerthelot / custom-search-acf-wordpress.php
Created March 21, 2019 08:46 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@gregBerthelot
gregBerthelot / keybase.md
Created May 27, 2016 08:50
Keybase proof

Keybase proof

I hereby claim:

  • I am gregberthelot on github.
  • I am gregberthelot (https://keybase.io/gregberthelot) on keybase.
  • I have a public key whose fingerprint is A5F2 C5AF D555 8324 AFF0 00C1 1A11 BB34 514E 755B

To claim this, I am signing this object: