Skip to content

Instantly share code, notes, and snippets.

@jaredatch
jaredatch / functions.php
Created August 24, 2016 14:59
WPForms limit form overview entries to current user
<?php
/**
* In WPForms Form Overview, for non admin users, only show forms that belong to
* current user.
*
* @param object $query
* @return object
*/
function wpf_forms_current_author( $query ) {
@jaredatch
jaredatch / functions.php
Last active August 25, 2016 14:51
WPForms dynamically add countries to a select field
<?php
/**
* Dynamically add countries to a select field.
*
* This snippet should go in your theme's function.php file.
*
* @param array $field
* @param array $field_atts
* @param array $form_data
@jaredatch
jaredatch / functions.php
Last active May 11, 2017 15:13
WPForms customize strings for date picker
<?php
/**
* Customize strings for WPForms date picker.
*
* This snippet should go in your theme's function.php file
*/
function wpforms_datepicker_strings() {
?>
<script type="text/javascript">
var Flatpickr = Flatpickr||{l10n: {}};
@jaredatch
jaredatch / functions.php
Created August 18, 2016 21:25
WPForms Address field store full country name instead of country code
<?php
/**
* Use full country name instead of the country code.
*
* @param array $fields
* @param array $entry
* @param array $form_data
* @return array
*/
function wpf_address_full_country( $fields, $entry, $form_data ) {
@jaredatch
jaredatch / how-to.txt
Last active July 20, 2023 17:46
WPForms prevent duplicate / double form entry submissions
<script type="text/javascript">
/**
* Prevent double entry submissions.
*
* Steps to install:
* ​1 - Download and activate the "Insert Headers and Footers" plugin (by WPBeginner)
* 2 - Go to Settings > Insert Headers and Footers
* 3 - Paste this entire code snippet
* 4 - Save
*/
@jaredatch
jaredatch / header-default.php
Last active August 8, 2022 19:55
WPForms Email template with WHITE background
<?php
/**
* Directions to install:
*
* - Inside your WordPress theme, create a directory named "wpforms-email"
* - Within this new directory, create a file named "header-default.php" and paste this file
* - That's it!
*/
// Exit if accessed directly
@jaredatch
jaredatch / style.css
Last active August 25, 2016 14:57
WPForms remove/reset confirmation box styling
div.wpforms-confirmation-container-full {
color: inherit;
margin: 0;
background: none;
border: none;
padding: 0;
}
div.wpforms-confirmation-container-full p:last-of-type {
margin: inherit;
@jaredatch
jaredatch / functions.php
Last active October 9, 2015 17:26
Mobile sharing icons that dock to the bottom of the device
<?php
/**
* Mobile share buttons
*
* @since 1.0.0
*/
function ja_share_buttons_mobile() {
if ( !is_front_page() && ( is_page() || is_singular( 'post' ) ) ) :
#! /bin/bash
# main config
PLUGINSLUG=${PWD##*/} # returns basename of current directory
CURRENTDIR=`pwd`
# configs
GITPATH="$CURRENTDIR/" # this file should be in the base of your git repository
SVNPATH="/tmp/$PLUGINSLUG" # path to a temp SVN repo. No trailing slash required and don't add trunk.
SVNURL="http://plugins.svn.wordpress.org/$PLUGINSLUG" # Remote SVN repo on wordpress.org, with no trailing slash
@jaredatch
jaredatch / global.js
Created August 5, 2015 20:45
Simple jQuery scrollspy
(function ($) {
/**
* Scroll spy
*/
// Cache selectors
var lastId,
scrollSpyMenu = $(".process-nav");
scrollSpyMenuHeight = scrollSpyMenu.outerHeight()+55;
scrollSpyMenuItems = scrollSpyMenu.find('a');
scrollItems = scrollSpyMenuItems.map(function(){