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 $get_custom_value = new WP_Query( array( 'post_type' => 'yourposttypehere', 'posts_per_page' => -1 ) ); ?> | |
<?php while ( $get_custom_value->have_posts() ) : $get_custom_value->the_post(); ?> | |
<!-- The stuff you want to loop goes in here --> | |
<?php endwhile; wp_reset_query(); ?> |
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 disable_plugin_updates( $value ) { | |
$plugin_path = 'default-featured-image/set-default-featured-image.php'; | |
if ( (isset($value) ) && (is_object($value) ) ) { | |
if (isset( $value->response[$plugin_path] )) { | |
unset( $value->response[$plugin_path] ); | |
} | |
} | |
return $value; | |
} |
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 isMultisite() { | |
if (function_exists('is_multisite')) | |
return is_multisite(); | |
return false; | |
} | |
function isMainSite() { | |
if (!function_exists('is_main_site' ) || !$this->isMultisite()) |
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
/** 6) Given an array of potential voters, return an object representing the results of the vote | |
Include how many of the potential voters were in the ages 18-25, how many from 26-35, how many from 36-55, and how many of each of those age ranges actually voted. The resulting object containing this data should have 6 properties. See the example output at the bottom. | |
*/ | |
var voters = [ | |
{name:'Bob' , age: 30, voted: true}, | |
{name:'Jake' , age: 32, voted: true}, | |
{name:'Kate' , age: 25, voted: false}, | |
{name:'Sam' , age: 20, voted: false}, | |
{name:'Phil' , age: 21, voted: true}, | |
{name:'Ed' , age:55, voted:true}, |
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 my_give_tribute_by_default() { ?> | |
<script> | |
let searchParams = new URLSearchParams(window.location.search); | |
// Change the parameter name here | |
let referrer = searchParams.has('referrer') ? searchParams.get('referrer') : ''; | |
// Change the target variable here | |
jQuery("input#ffm-referrer").prop("value", referrer); | |
</script> |
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 my_give_limit_comment_length() { ?> | |
<script> | |
let comments = document.querySelectorAll('textarea#give-comment'); | |
comments.forEach(comment => comment.setAttribute('maxlength', 255)); | |
</script> | |
<?php } |
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 change_amount_focus() { ?> | |
<script> | |
jQuery("#give-amount").val("").focus(); | |
</script> | |
<?php } | |
add_action( 'give_payment_mode_top', 'change_amount_focus' ); |
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 my_mailchimp_tribute_by_default() { ?> | |
<script> | |
jQuery("input[name=give_mailchimp_signup]").prop("checked", true); | |
</script> | |
<?php } | |
add_action( 'give_donation_form_after_submit', 'my_mailchimp_tribute_by_default' ); |
OlderNewer