Skip to content

Instantly share code, notes, and snippets.

// Pageviews Dashboard Widget
add_action('wp_dashboard_setup', 'count_dashboard_widgets');
function count_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Build Your Campaign Pageviews', 'custom_dashboard_help');
}
<?php
// Determine Campaign Costs
add_filter('gform_pre_render_2', 'campaign_cost');
function campaign_cost($form){
//Get current form page
$current_page = GFFormDisplay::get_current_page($form["id"]);
// Add students to roster upon registration
add_action('gform_after_submission_2', 'update_sat_roster', 10, 2);
function update_sat_roster($entry, $form) {
//getting post and entry data
if($entry["26"]) :
$post_num = $entry["26"];
else :
$post_num = $entry["18"];
endif;
$taken = get_post_meta($post_num, 'seats_taken' , true);
// Determine SAT Cost Depending on School
add_filter('gform_pre_render_2', 'define_sat_cost');
function define_sat_cost($form){
//Get current form page
$current_page = GFFormDisplay::get_current_page($form["id"]);
//If the current form page is page 2
if ($current_page == 2) {
$school = $_POST["input_6"];
//Update sponsor count
add_action("gform_after_submission_9", "update_sponsor_count_9", 10, 2);
function update_sponsor_count_9($entry, $form) {
//getting post and entry data
$sponsor_level = $entry["3"];
$post_num = $entry["12"];
$sponsors = get_post_meta($post_num, 'sponsors' , true);
<?php
//Setup data to include in the form
if ( have_posts() ) while ( have_posts() ) : the_post();
$child_name=get_the_title();
$child_id=get_field('listing_code');
$sponsor_count = get_field('sponsors');
if (h1n_in_taxonomy('status', 'orphaned') || h1n_in_taxonomy('status', 'teacher')) {
$slots=5;