Get WP Nav Item top parent

function get_nav_menu_top_parent($menu_name){
global $post;
$items = wp_get_nav_menu_items($menu_name);
foreach($items as $item){
if($item->menu_item_parent == 0 ) $parent_name = $item->title;
if($item->object_id == $post->ID) $top_parent = $parent_name;
}
return $top_parent;
}

Gform after submission

<?php
add_action("gform_after_submission", "set_post_content", 10, 2);
function set_post_content($entry, $form){

//getting post
$post = get_post($entry["post_id"]);

//changing post content
$post->post_content = "Blender Version:" . $entry[7] . "<br/> <img src='" . $entry[8] . "'> <br/> <br/> " . $entry[13] . " <br/> <img src='" . $entry[5] . "'>";

//updating post
wp_update_post($post);
}
?>

Switch Themes2

if(!current_user_can('manage_options')){
add_filter('template', 'ter_change_theme');
add_filter('option_template', 'ter_change_theme');
add_filter('option_stylesheet', 'ter_change_theme');
}
function ter_change_theme($theme){ return 'terra'; }

Pad Inputs

.gform_wrapper input[type="text"], .gform_wrapper input[type="url"], .gform_wrapper input[type="email"], .gform_wrapper input[type="tel"], .gform_wrapper input[type="number"], .gform_wrapper input[type="password"], .gform_wrapper textarea{padding:2px 2px!important; font-size:100%!important}
.ginput_complex input,.ginput_complex select{margin:8px 0 0; font-size:100%!important}

Facebook Like To View

function parsePageSignedRequest() {
if (isset($_REQUEST['signed_request'])) {
$encoded_sig = null;
$payload = null;
list($encoded_sig, $payload) = explode('.', $_REQUEST['signed_request'], 2);
$sig = base64_decode(strtr($encoded_sig, '-_', '+/'));
$data = json_decode(base64_decode(strtr($payload, '-_', '+/'), true));
return $data;
}
return false;
}

if($signed_request = parsePageSignedRequest()) {
if($signed_request->page->liked) {
echo "This content is for Fans only!";
} else {
echo "Please click on the Like button to view this tab!";
}
}

/* Change YOUR_APP_ID and YOUR_APP_ID */
/* YOUR_APP_ID = ID of App you want to link to */
/* YOUR_URL = URL of app you are wanting to link to */
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID &display=popup&next=YOUR_URL