Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan nocean

View GitHub Profile
View WordPress Debug wp-config.php addon
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
if (!defined('WP_DEBUG')) {
define('WP_DEBUG', true);
define( 'WP_DEBUG_DISPLAY', false );
@nocean
nocean / language-independent-acf-theme-options-output.php
Last active Aug 9, 2018 — forked from senlin/language-independent-acf-theme-options-output.php
How to get language independent ACF theme options on a WPML site
View language-independent-acf-theme-options-output.php
<?php
/**
* To get this to work, you need to tinker with the acf/settings/ filter and reset the default language
* so that the get_field() function returns the correct results even when not on the default language.
*
* You can add the filter before you call the get_field() function and then remove it once complete.
*
* answer courtesy of James of ACF Support + love on GitHub
*/
View oldie-redirect.js
/*******************************************************************************
OLDIE - or Old IE. A script that finds the version of IE you're using,
and redirects if lower than the set parameter.
[[ Created by Ryan McLaughlin, www.DaoByDesign.com ]]
*******************************************************************************/
var browser = navigator.appName
var ver = navigator.appVersion
var thestart = parseFloat(ver.indexOf("MSIE"))+1 //This finds the start of the MS version string.
var brow_ver = parseFloat(ver.substring(thestart+4,thestart+7)) //This cuts out the bit of string we need.
View oldie-redirect.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Browser Version Not Supported</title>
</head>
<body style="text-align:center;">
<div style="margin:30px auto;border:1px solid #333;padding:10px;text-align:left;width:550px;background:#FFFFCC;">
<h2 style="font-variant:small-caps;">Your browser seems out of date!</h2>
View cf7-honeypot-override-filter
function my_honeypot_override( $html, $args ) {
// [DO STUFF HERE]
return $html;
}
add_filter('wpcf7_honeypot_html_output', 'my_honeypot_override', 10, 2 );
@nocean
nocean / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.