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
// Make WPML compatible with ACF field groups with location set to 'page parent' | |
function filter_acf_location_rule_match_param( $result, $rule, $screen, $field_group ) { | |
$default_lang = apply_filters( 'wpml_default_language', NULL ); | |
if ( ! isset( $screen['lang'] ) || $default_lang == $screen['lang'] ) { | |
return $result; | |
} | |
if ( ! isset( $screen['post_id'] ) || empty( $screen['post_id'] ) ) { | |
return $result; |
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
Array | |
( | |
[list] => Array | |
( | |
[] => | |
[fa-500px] =>  500px | |
[fa-address-book] =>  address-book | |
[fa-address-book-o] =>  address-book-o | |
[fa-address-card] =>  address-card | |
[fa-address-card-o] =>  address-card-o |
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
public function new_submission() | |
{ | |
acf_enqueue_scripts(); | |
if ( ! acf_verify_nonce( 'acf_form' ) || ! acf_validate_save_post( true ) ) { | |
return; | |
} | |
add_filter('acf/pre_save_post', '_acf_pre_save_post', 5, 2); |
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
/** | |
* Get the Font Awesome CSS. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $url URL of the remote stylesheet. | |
* @param string $version Version of Font Awesome to fetch. | |
* | |
* @return string $response Font Awesome CSS, from either: | |
* 1. transient, |
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 | |
if ( is_active_nav_menu( 'primary' ) ) { | |
$divider_html = ''; | |
wp_nav_menu( array( | |
'theme_location' => 'primary', // Setting up the location for the main-menu, Main Navigation. | |
'menu_class' => 'dropdown', //Adding the class for dropdowns | |
'divider_html' => $divider_html, | |
'container_id' => 'navwrap', //Add CSS ID to the containter that wraps the menu. | |
'fallback_cb' => 'wp_page_menu', //if wp_nav_menu is unavailable, WordPress displays wp_page_menu function, which displays the pages of your blog. | |
) |
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
// GRAVITY FORMS SUBMIT BUTTON STYLING | |
function form_submit_button($button, $form){ | |
return "<input type='submit' id='gform_submit_button_{$form["id"]}' class='btn' value='Send Email'>"; | |
} | |
add_filter("gform_submit_button_1", "form_submit_button", 10, 2); | |
// REMOVING GRAVITY FORMS FIELD LABELS | |
function form_required_label($content, $field, $value, $lead_id, $form_id){ | |
$types = array('radio','checkbox','textarea','hidden'); |
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
$menu = wp_nav_plus(array('menu' => $instance['menu_term_id'], 'echo' => false, 'container' => false, 'items_wrap' => '%3$s', 'start_depth' => $instance['start_depth'], 'depth' => $instance['depth'])); | |
if(!empty($menu)) { | |
echo 'your container html'; | |
echo $menu; | |
echo 'end your container html here'; | |
} |
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 | |
/* | |
* Are You My Mother? by: Matt Keys | |
* Function: Pass an array of Prospective Page IDs along with the current Page ID. | |
* Return true if the current page is a child of any of the Prospective Page IDs. | |
* Optional: Set third parameter to TRUE if you want to check if the current page is a direct match to a Prospective Page ID | |
*/ | |
function are_you_my_mother(array $prospective_page_ids, $current_page_id, $match_parent = false) { | |
// If match_parent is true, see if current page is a direct match before trying ancestors |