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
// 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'); | |
} |
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 | |
// 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"]); | |
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 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); |
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
// 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"]; |
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
//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); | |
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 | |
//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; |