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 | |
/** | |
* This is a demo of mailchimp integration with contact form 7 with the help of Action URL. | |
* | |
* You can get these action URL from the mailchimp list | |
* follow this https://www.youtube.com/watch?v=sybmI8HgxFo | |
* | |
*/ | |
// define the wpcf7_mail_sent callback | |
function cf7_action_wpcf7_mail_sent( $contact_form ) { |
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 id="address_search" class="slp search_box layout row wrap"> | |
<div class="filter-online-dealer-section"><img class="new-cart-icon" src="http://staging.bennetttrimtabs.com/wp-content/uploads/2015/05/ws-cart.png" /><a href="http://staging.bennetttrimtabs.com/dealers-list/">View Online Dealers</a><img class="new-right-arrow" src="http://staging.bennetttrimtabs.com/wp-content/uploads/2018/10/right-arrow.png" /></div> | |
<div class='filter-heading section'> | |
<h3>Filters</h3> | |
<a href='#' class='dx_hide_form_data dx_left'>hide all</a> | |
<a href='#' class='reset_form_data dx_right'>reset all</a> | |
</div> | |
<div class="flex xs12 section dx-cat-shortable">[slp_search_element dropdown_with_label="category"]</div> | |
<div class='section dx-address-shortable'> | |
<div class="flex xs4"><label>Location: </label> <a href='#' class="dx_link" id="dx_addressSubmit" >find my locations</a> [slp_search_element input_with_label="address"]</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
<?php | |
/** | |
* Function to extract content from html. | |
* $html HTML data | |
* $expression Expression used to extract the data ex. //div[@id='breadcrumbs']/span | |
*/ | |
function extract_content_from_html( $html, $expression ){ | |
$dom = new DOMDocument(); | |
$output = ''; | |
libxml_use_internal_errors( true ); |
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 | |
// this action get fire during registration process. | |
add_action('wpas_pre_register_account','wpas_pre_register_account_callback', 10, 3); | |
function wpas_pre_register_account_callback( $user, $redirect_to, $data ){ | |
if( !is_pwd_strong( $user['pwd'] ) ){ | |
wpas_add_error( 'accept_terms_conditions', esc_html__( 'Add strong password', 'awesome-support' ) ); | |
wp_safe_redirect( $redirect_to ); | |
exit; | |
} | |
} |
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 | |
function wpgeodir_prefix_comments_open( $open, $post_id ) { | |
$post_type = get_post_type( $post_id ); | |
// allow comments for built-in "post" post type | |
if ( 'gd_compt_coaching' === $post_type ) { | |
return false; | |
} | |
// disable comments for any other post types | |
return true; | |
} |
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
/** | |
* code to trigger comment email on comment submission. | |
*/ | |
add_action( 'init', 'gd_custom_comment_post' ); | |
function gd_custom_comment_post() { | |
remove_action( 'comment_post', 'geodir_new_comment_notify_postauthor', 99999, 1 ); | |
add_filter( 'geodir_should_notify_comment_author', 'geodir_should_notify_comment_author_custom_callback', 10, 2); | |
add_filter( 'geodir_should_notify_listing_author', 'geodir_should_notify_listing_author_custom_callback', 10, 2 ); | |
add_action( 'comment_post', 'geodir_custom_notify_on_comment_approved', 99999, 1 ); | |
} |
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 | |
/** | |
* code to trigger comment email on comment submission. | |
*/ | |
add_action( 'init', 'gd_custom_comment_post' ); | |
function gd_custom_comment_post() { | |
remove_action( 'comment_post', 'geodir_new_comment_notify_postauthor', 99999, 1 ); | |
add_filter( 'geodir_should_notify_comment_author', 'geodir_should_notify_comment_author_custom_callback', 10, 2); | |
add_filter( 'geodir_should_notify_listing_author', 'geodir_should_notify_listing_author_custom_callback', 10, 2 ); | |
add_action( 'comment_post', 'geodir_custom_notify_on_comment_approved', 99999, 1 ); |
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 | |
/** | |
* Add custom field to the custom field list. | |
* | |
* @param array $custom_fields { | |
* The custom fields array to be filtered. | |
* | |
* @type string $field_type The type of field, eg: text, datepicker, textarea, time, checkbox, phone, radio, email, select, multiselect, url, html, file. | |
* @type string $class The class for the field in backend. |
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 | |
/** | |
* I am changing map popup layout of gd_places here. | |
*/ | |
add_filter('geodir_get_template_part', 'geodir_get_template_part_callback', 10, 3); | |
function geodir_get_template_part_callback( $template, $slug, $name ){ | |
global $gd_post; | |
if( 'gd_place' === $gd_post->post_type ){ | |
?> |
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 | |
// og:title | |
add_filter('wpseo_opengraph_title', 'wpseo_opengraph_title_callback'); | |
function wpseo_opengraph_title_callback( $title ){ | |
// do something here. | |
return $title; | |
} | |
// og:description | |
add_filter('wpseo_opengraph_desc', 'wpseo_opengraph_desc_callback'); | |
function wpseo_opengraph_desc_callback( $ogdesc ){ |