This file contains hidden or 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 | |
/* | |
Plugin Name: FacetWP Schedule Indexer | |
Plugin URI: https://facetwp.com/ | |
Description: Runs indexer periodically by cron | |
Version: 1.0 | |
Author: FacetWP, LLC | |
*/ | |
add_action( 'fwp_scheduled_index', 'fwp_scheduled_index' ); |
This file contains hidden or 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 | |
// Put this in wp-config.php and replace https://example.com/ with the URL of the production site. | |
define( 'RH_USE_REMOTE_MEDIA_URL', 'https://example.com/' ); | |
// Put the rest of this in functions.php or a custom plugin or somewhere else. | |
if ( defined( 'RH_USE_REMOTE_MEDIA_URL' ) && ! empty( RH_USE_REMOTE_MEDIA_URL ) ) { | |
add_filter( 'wp_get_attachment_image_src', 'filter_wp_get_attachment_image_src' ); | |
add_filter( 'wp_calculate_image_srcset', 'filter_wp_calculate_image_srcset' ); | |
add_filter( 'wp_get_attachment_url', 'filter_wp_get_attachment_url' ); | |
} |
This file contains hidden or 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 | |
/** | |
* Plugin name: HTTP2 Push scripts | |
* Author: Tom J Nowell | |
*/ | |
function tomjn_get_dep_url( /*\WP_Dependency*/ $dep ) { | |
global $wp_version; | |
$relative = str_replace( site_url(), '', $dep->src ); | |
$ver = $dep->ver; |
This file contains hidden or 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 | |
// Throw this in your theme and include it in your functions.php file | |
/** | |
* Helper function for fetching SVG icons | |
* | |
* @param string $icon Name of the SVG file in the icons directory | |
* @return string Inline SVG markup | |
*/ | |
function wp_svg_icon( $icon = '' ) { |
This file contains hidden or 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 | |
$args = array( | |
'post_type' => 'location', | |
'posts_per_page' => -1, | |
'order' => 'ASC', | |
'orderby' => 'title', | |
'facetwp' => true, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'advertiser-level', |
This file contains hidden or 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
product_add_to_cart : function(){ | |
var ajx_data = {}; | |
var ajx_grab = {}; | |
$(document).on('change','.single-product .variations_form select',function(e){ | |
var $this = $(this); | |
var pro_id = $(".single-product .variations_form").attr('data-product_id'); | |
var attribute_name = $this.attr('data-attribute_name'); | |
var attribute_value = $this.val(); | |
var post_ajxurl = window.location+"?wc-ajax=get_variation"; |
This file contains hidden or 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 | |
// In this brief example we'll scrape an Instagram post and save it as a WordPress post | |
// Go to a URL and get the contents back | |
// See https://developer.wordpress.org/reference/functions/wp_remote_get/ | |
$instagram_request = wp_remote_get( 'https://www.instagram.com/p/BSBvNVIF8tI/' ); | |
// If it's succesful, the payload of the request will be in $instagram_request['body'] | |
$instagram_html = $instagram_request['body']; |
This file contains hidden or 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 | |
/* | |
Plugin Name: Bogworld's Special Neat-o Plugin | |
Description: See https://twitter.com/boagworld/status/844200551017562112 | |
Author: kingkool68 | |
Version: 0.0.1 | |
Author URI: https://twitter.com/kingkool68 | |
*/ | |
/* |
This file contains hidden or 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 script will show a special designed message in the console.log section of your website | |
* for those who looks for something extra in your website. | |
* Fiddle Link: https://jsfiddle.net/isaumya/vtjswjuL/ | |
**/ | |
jQuery(function ($) { | |
try{ | |
console.log("%c < ISAUMYA /> ","background: linear-gradient(to right, rgba(231,76,60,1) 0%,rgba(155,89,182,1) 100%););font-size:3em;border-radius:1em;color:#ffffff;font-weight:bold;font-style: italic;"); | |
console.log('%c made with ♥ by Saumya Majumder © 2016', 'color: #e74c3c;font-size:1.1em;'); | |
} | |
catch(e){} |
NewerOlder