Skip to content

Instantly share code, notes, and snippets.

@studioleland
studioleland / initial-traffic-cookie.html
Last active September 18, 2019 13:51
Initial Traffic Cookie for GTM
@zackkatz
zackkatz / gravityview-trigger-gform_after_submission.php
Created June 19, 2017 19:09
GravityView - Trigger the `gform_after_submission` action when an entry is edited. This adds support for the Gravity Forms Zapier addon, for example.
<?php
/**
* GravityView doesn't trigger the `gform_after_submission` action when editing entries. This does that.
*
* @param array $form
* @param int $entry_id ID of the entry being updated
* @param GravityView_Edit_Entry_Render $object
*
* @return void
@danbp
danbp / gist:ea92923b1109ee1fcebd0741d861cda6
Created August 23, 2016 17:29
BuddyPress Move Profile Edit edit tab to Profile Settings tab
/* This goes to child-theme style.css and will hide the Profile Edit button. */
#edit-personal-li {
display:none!important;
}
*/ And this is to put into bp-custom.php to get the Edit button on the Profile Settings subnav.
Note that there is an array field containing a new css rule for the item. */
function bpex_move_profile_edit_tab() {
@mgibbs189
mgibbs189 / 01_Query_Arguments.php
Last active August 27, 2023 10:11
FacetWP - show both a Google Map and a result listings
<?php
return array(
"post_type" => "park",
"post_status" => "publish",
"posts_per_page" => 100
);
@codearachnid
codearachnid / filter_gf_select_optgroup.php
Last active July 16, 2024 15:51
Add the optgroup ability to Gravity Forms default select field.
/**
* Filter Gravity Forms select field display to wrap optgroups where defined
* USE:
* set the value of the select option to `optgroup` within the form editor. The
* filter will then automagically wrap the options following until the start of
* the next option group
*/
add_filter( 'gform_field_content', 'filter_gf_select_optgroup', 10, 2 );
function filter_gf_select_optgroup( $input, $field ) {
@yratof
yratof / functions.php
Created June 2, 2015 12:35
Getting the Video ID from ACF OEmbed, then using that ID to call in videos without bloat
<?php
/* Parse the video uri/url to determine the video type/source and the video id */
function parse_video_uri( $url ) {
// Parse the url
$parse = parse_url( $url );
// Set blank variables
$video_type = '';
$video_id = '';
@thenbrent
thenbrent / switch-subscription-link.php
Created November 13, 2013 19:27
Output a link to switch a subscription for the current user.
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000