Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: DreamHost Panel Login
* Plugin URI: https://www.dreamhost.com/wordpress/
* Description: Used by DreamHost to generate a one-time login URL for your admin user that is to be used from within https://panel.dreamhost.com.
* Author: DreamHost, danielbachhuber
* Author URI: https://dreamhost.com
* Version: 1.0.0
*
* @package One_Time_Login
@bradvin
bradvin / album-custom.php
Created March 6, 2022 14:29
FooGallery Album - Get Previous & Next Gallery ID
echo 'Previous : ' . foogallery_album_find_previous_gallery_id( $current_foogallery_album, $foogallery->ID );
echo 'Next : ' . foogallery_album_find_next_gallery_id( $current_foogallery_album, $foogallery->ID );
@bradvin
bradvin / functions.php
Last active September 26, 2021 11:56
FooGallery - Override the paging for every gallery, no matter what settings
function override_foogallery_paging($foogallery) {
$paging_options = array(
'type' => 'dots', // or pagination, infinite or loadMore
'theme' => 'fg-light', // or fg-dark
'size' => 5, // page size
'position' => 'top', // or bottom or both
'scrollToTop' => 'false', // or true
'output' => '',
);
@bradvin
bradvin / foogallery-foobox-size.php
Last active April 18, 2021 09:19
FooGallery - Override FooBox Width & Heights Per Attachment
<?php
/**
* Plugin Name: FooGallery - Override FooBox Width & Heights Per Attachment
* Description: A small plugin for adding size fields to all attachments to force that size when shown in FooBox
* Version: 1.0.0
* Author: Brad Vincent
* Author URI: https://fooplugins.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@bradvin
bradvin / freemius-checkout-ga-fb-tracking.js
Last active August 18, 2020 10:53 — forked from vovafeldman/freemius-checkout-ga-fb-tracking.js
Tracking purchases with Google Analytics and Facebook for Freemius Checkout
//
// Gist was kindly contributed by @jamesckemp from @iconicwp. Thanks!
//
handler.open({
...
purchaseCompleted: function( response ) {
var trial = response.purchase.trial_ends !== null,
total = trial ? 0 : response.purchase.initial_amount.toString(),
productName = 'FooGallery',
@bradvin
bradvin / font-face-hack
Created May 15, 2013 12:21
Font face hack
@font-face {
font-family: 'myfont';
src: url('fonts/myfont.eot#iefix');
src: url('fonts/myfont.woff') format('woff'),
url('fonts/myfont.ttf') format('truetype'),
url('fonts/myfont.svg#myfont') format('svg');
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
git tag -a 0.5.0 -m "Version 0.5.0 Stable"
@bradvin
bradvin / check_plugin_exists.js
Created May 2, 2013 18:32
check jQuery plugin exists
if (jQuery.fn.pluginname) {
}
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
@bradvin
bradvin / jquery.foobar.2.1.css
Created April 28, 2013 15:37
fixed foobar CSS to correct bottom bars revesred image shown on open/close button
/* CSS Resets */
.foobar-container { border-collapse:separate !important; border-spacing: 0 !important; }
.foobar-container, .foobar-container-row, .foobar-container-left, .foobar-container-right, .foobar-container-center,
.foobar-close-button-container, .foobar-close-button-spacer { padding: 0 !important; margin: 0 !important; }
.foobar-message-wrapper { line-height: normal; }
/* Core CSS */
.foobar-wrapper { width: 100%; z-index: 1001; }
.foobar-container { width: 100%; table-layout: fixed; }
.foobar-container-left, .foobar-container-center, .foobar-container-right { vertical-align: middle; }