This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function will see if a PDF or other "attachment" post-type returned by SearchWP | |
* is present in a custom field in a regular post, and will return that post instead. Note | |
* this will only process documents which are referenced via the "attachment" post type. | |
* | |
* For example, you may have a product specification PDF and would like it in the search | |
* results, but would rather people got to it by visiting the product page itself. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Procedural JS that ensures FacetWP has fully rendered all of its various pieces; | |
* triggers 'facetwp-done' when everything is rendered. | |
* | |
* Useful if you need to change the HTML within '.facetwp-selections', for example. | |
* | |
* 'waitlimit' : number of times to allow wait_for_facetwp() to be called | |
* 'waitime' : miliseconds between calls | |
*/ | |
jQuery( document ).ready( function ( $ ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* At line 56 of widget.php. | |
* | |
* - Adds default values for $instance to prevent PHP warnings | |
* - Gets rid of extract statement (using it does not make code any more readable) | |
*/ | |
function widget( $args, $instance ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* You need to run this within a WP environment, with Gravity Forms installed, for the called functions to register. | |
*/ | |
// make sure you have PHP error reporting on | |
error_reporting( E_ALL ); | |
// wordpress widget args array; these are always sent by WP | |
$args = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Puc_Factory { | |
/** | |
* Current version entered by default, but can be changed by ::version() | |
*/ | |
protected static $major = 4; | |
protected static $minor = 3; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is an abbreviated "ES5" script (though it has some ES6 language, just not JSX, or dependencies on npm) | |
* demonstrating how to get the WordPress "Gutenberg" SelectControl to allow dynamic options. | |
* | |
* It probably isn't elegant, but neither am I...I included more context than may be necessary. | |
* | |
* (SelectControl pukes on dynamic options because it completely dies, never to be seen again, if it | |
* is sent an empty options array. This prevents that with a placeholder until your results come back.) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* License: GPLv2 | |
* Created by Roger Los (rogerlos.com) | |
* https://github.com/rogerlos | |
*/ | |
jQuery( function ( $ ) { | |
/** | |
* Some values needed for this to work. The actual select is not set in this constant as jQuery won't | |
* catch its value changing, in my experience... |