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 | |
/* | |
Plugin Name: Contact Form 7 Zipcode check | |
Plugin URI: http://youruri.com/ | |
Description: | |
Author: | |
Version: 1.0 | |
Author URI: | |
*/ |
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
function get_theme_menu_name( $theme_location ) { | |
if ( !has_nav_menu( $theme_location ) ) return false; | |
$menus = get_nav_menu_locations(); | |
$menu_title = wp_get_nav_menu_object( $menus[$theme_location] )->name; | |
return $menu_title; | |
} |
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 the poststype of the current post | |
$posttype = get_post_type(); | |
$obj = get_post_type_object( $posttype ); | |
$args = array ( | |
'post_type' => $posttype, | |
'post_status' => 'publish', | |
'post_count' => 5 |
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 the poststype of the current post | |
$posttype = get_post_type(); | |
$obj = get_post_type_object( $posttype ); | |
$args = array ( | |
'post_type' => $posttype, | |
'post_status' => 'publish', | |
'post_count' => 5 |
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
/* | |
* Add description to Featured image box | |
*/ | |
function new_post_thumbnail_meta_box() { | |
global $post; | |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); // grabing the thumbnail id of the post | |
echo _wp_post_thumbnail_html( $thumbnail_id ); // echoing the html markup for the thumbnail |
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
<div class="checkbox-wrap"> | |
<input name="checkbox1" type="checkbox" value="Yes" checked="checked" id="checkbox1"> | |
<label for="checkbox1" id="label1">Yes</label> | |
</div> |
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
/** | |
* We calculate the input value of give form inputs and change the redirect url afterwards | |
* | |
* @param array $form, array $lead | |
* | |
* @return array $confirmation[ 'redirect' ] | |
**/ | |
add_filter( 'gform_confirmation', 'custom_confirmation', 10, 4 ); | |