Skip to content

Instantly share code, notes, and snippets.

View aibrean's full-sized avatar

April Sadowski aibrean

View GitHub Profile
<?php if(get_field('header_footer_theme', 'option') == 'stuck') : ?>
<!– Stick Menu –>
<?php elseif(get_field('header_footer_theme', 'option') == 'light') : ?>
<!– Light Menu –>
<?php elseif(get_field('header_footer_theme', 'option') == 'dark') : ?>
@joshuadavidnelson
joshuadavidnelson / set-post-fields-gf.php
Last active April 5, 2017 03:36
Connect a Gravity Form upload field to ACF Gallery Field when creating a front-end post submission, requires the jdn_create_image_id function from https://gist.github.com/joshuadavidnelson/164a0a0744f0693d5746
<?php
/**
* Attach images uploaded through Gravity Form to ACF Gallery Field
*
* @author Joshua David Nelson, josh@joshuadnelson.com
* @return void
*/
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number
add_filter( "gform_after_submission_{$gravity_form_id}", 'jdn_set_post_acf_gallery_field', 10, 2 );
function jdn_set_post_acf_gallery_field( $entry, $form ) {
@joshuadavidnelson
joshuadavidnelson / create-image-id.php
Last active November 7, 2023 05:04
Programmatically create the image attachment and return the new media upload id.
<?php
/**
* Create the image attachment and return the new media upload id.
*
* @author Joshua David Nelson, josh@joshuadnelson.com
*
* @since 03.29.2017 updated to a class, utilizing code from Takuro Hishikawa's gist linked below.
*
* @see https://gist.github.com/hissy/7352933
*
<?php
/**
* Override the output of the submit button on forms, useful for
* adding custom classes or other attributes.
*
* @param string $button An HTML string of the default button
* @param array $form An array of form data
* @return string $button
*
* @filter gform_submit_button
@Cais
Cais / wpfa-login-form.php
Last active May 29, 2019 14:38
WPFA Login Form
<?php
/**
* WPFA Login Form
* Borrowed from the core login form and used with the shortcode 'bns_login'
* This allows for the 'bns_login' shortcode to accept all of the parameters
* of the `wp_login_form` function as the shortcode attributes.
*
* @package WPFA_Login_Form
* @since 1.0
*
@webaware
webaware / force-ssl-url-scheme.php
Last active September 3, 2023 00:05
For WordPress, force the protocol scheme to be HTTPS when is_ssl() doesn't work, e.g. on a load-balanced server where _SERVER['HTTPS'] and _SERVER['SERVER_PORT'] don't indicate that SSL is being used. NB: may not be needed now, see SSL Insecure Content Fixer and HTTP Detection: https://ssl.webaware.net.au/https-detection/
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility