Skip to content

Instantly share code, notes, and snippets.

@bluantinoo
bluantinoo / wp-disable-plugin-update.php
Created April 12, 2019 17:59 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@bluantinoo
bluantinoo / darkify_slack.sh
Created March 7, 2019 09:37 — forked from ryanpcmcquen/darkify_slack.sh
Darkify your Slack.
#!/bin/sh
# Darkify Slack on Mac OS or Linux.
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh
if [ "`uname -s`" = "Darwin" ]; then
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js"
else
SLACK_INTEROP_JS="/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js"
fi
@bluantinoo
bluantinoo / child-theme-functions-php-snippet.php
Created July 6, 2017 09:21 — forked from lots0logs/child-theme-functions-php-snippet.php
WordPress :: Divi Builder :: Fullwidth Portfolio Module :: Custom Links
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_setup() {
if ( class_exists( 'ET_Builder_Module_Fullwidth_Portfolio' ) && file_exists( 'my-main-modules.php' ) ) {
get_template_part( 'my-main-modules' );
$et_pb_fullwidth_portfolio = new My_ET_Builder_Module_Fullwidth_Portfolio();
remove_shortcode('et_pb_fullwidth_portfolio');
add_shortcode('et_pb_fullwidth_portfolio', array( $et_pb_fullwidth_portfolio, '_shortcode_callback' ) );
@bluantinoo
bluantinoo / functions.php
Created July 6, 2017 09:19 — forked from lots0logs/functions.php
WordPress :: Divi Builder :: Filterable Portfolio Module :: Show Lightbox On-Click
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_setup() {
if ( class_exists( 'ET_Builder_Module_Filterable_Portfolio' ) ) {
get_template_part( 'my-main-modules' );
$et_pb_filterable_portfolio = new My_ET_Builder_Module_Filterable_Portfolio();
remove_shortcode('et_pb_filterable_portfolio');
add_shortcode('et_pb_filterable_portfolio', array( $et_pb_filterable_portfolio, '_shortcode_callback' ) );
@bluantinoo
bluantinoo / gist:3e4c8a82da8b0a187904472ed0e8f1a8
Created October 13, 2016 14:47 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

<?php
function analytics_confirmation($confirmation, $form, $entry, $ajax = 0)
{
$isProduct = false;
foreach ($form['fields'] as $field) {
if ($field['type'] == 'product') {
$isProduct = true;
$fieldID = $field['id'];
$productSKU = $form['id'] . '-' . str_replace(" ", "_", $field['label']);
break;