This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if (window.localStorage && window.localStorage._gf_cache) { | |
document.documentElement.classList.add('wf-active'); | |
var script = document.createElement('script'); | |
script.innerHTML = localStorage._gf_cache; | |
document.head.appendChild(script); | |
} | |
window._gfonload = function () { | |
var req = new XMLHttpRequest() | |
req.addEventListener("load", function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function the_acf_field($acf) { | |
$field = get_field($acf); | |
if(!$field) { | |
$field = get_sub_field($acf); | |
} | |
echo $field; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updated the Walker_Nav_Menu class to accept an array of classnames via argument | |
// Comments below show what has been changed / updated | |
// Original Walker_Nav_Menu copied from here: https://core.trac.wordpress.org/browser/tags/4.5.3/src//wp-includes/nav-menu-template.php#L0 | |
<?php | |
class Nav_Walker extends Walker_Nav_Menu { | |
// Setup empty $data array | |
// Can be used to store any other data | |
private $data = []; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ajax_setup_scripts() { | |
// Register and Enqueue Script | |
wp_register_script('afp_script', get_template_directory_uri() . '/js/scripts.js', false, null, false); | |
wp_enqueue_script('afp_script'); | |
wp_localize_script( 'afp_script', 'afp_vars', array( | |
'afp_nonce' => wp_create_nonce( 'afp_nonce' ), | |
'afp_ajax_url' => admin_url( 'admin-ajax.php' ), | |
) | |
); |