This file contains hidden or 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
/* Add body class to admin */ | |
add_filter( 'admin_body_class', 'my_body_class' ); | |
function my_body_class( $class ) { | |
$class .= ' stormbox-plugin '; | |
return $class; | |
} |
This file contains hidden or 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 /* | |
Shortcode CTA button for use in the editor. | |
Example usage: | |
[button href="https://www.google.com.au" target="_blank"]Visit Google[/button] | |
*/ | |
function button( $atts, $content = null ) { | |
$a = shortcode_atts( array( | |
'class' => 'button-link external', | |
'href' => '#', |
This file contains hidden or 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
$( document ).ready(function() { | |
var width = $('iframe').width(); | |
$('iframe').css({ | |
'width': width, | |
'height': width*(9/16) | |
}); | |
}); |
This file contains hidden or 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
/* Additional user profile fields */ | |
function extra_profile_details( $methods ) { | |
$methods['new_email'] = __( "New email", "wproject" ); | |
return $methods; | |
} | |
add_filter('user_contactmethods','extra_profile_details',10,1); |
This file contains hidden or 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 src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script> | |
<form> | |
<div id="re-captcha"></div> | |
<input type="submit" value="Submit" id="contactFormSubmit" value="Submit" disabled /> | |
</form> | |
<script> | |
var actCallback = function (response) { | |
$('#contactFormSubmit').prop('disabled', false); |
This file contains hidden or 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
$cast_members = get_field( 'cast_members'); /* The repeater field */ | |
$row = $row[2]; /* The repeater field row number to target (start counting at 0) */ | |
$character = $row['character']; /* The field to get */ | |
echo $character; /* Echo the field */ |
This file contains hidden or 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
/* Note: Clip is deprecated and will be replaced by the clip-path in the future. */ | |
#my-div img { | |
position: absolute; | |
clip: rect( 0px, 300px, 177px, 0px ); | |
} |
This file contains hidden or 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
{{ string_with_newlines | strip_newlines }} |
This file contains hidden or 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
// Save this to the 'sections' directory... | |
{% if section.settings.hero_image %} | |
<img src="{{ section.settings.hero_image | img_url:'master' }}" alt="{{ section.settings.hero_image.alt | escape }}" /> | |
{% endif %} | |
{% schema %} { | |
"name": "Hero Image", | |
"settings": [ | |
{ |
This file contains hidden or 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 | |
/* | |
Only allow access to a URL if nonce passed. | |
Nonce docs: https://codex.wordpress.org/WordPress_Nonces | |
*/ | |
/* The URL you want to protect */ | |
$the_url = plugins_url() . '/my-plugin/top-secret.php'; | |
?> | |