Last active
February 15, 2019 15:26
-
-
Save lithiumlab/e0cc432c100b8c5e96647d3cc9be3082 to your computer and use it in GitHub Desktop.
WP Write Log
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 $post_type = get_post_type_object( get_post_type( get_the_ID()) ); | |
echo $post_type->labels->singular_name ; ?> |
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 | |
if ( ! function_exists('write_log')) { | |
function write_log ( $log ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( print_r( $log, true ) ); | |
} else { | |
error_log( $log ); | |
} | |
} | |
} |
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 | |
/* | |
Prevent the email sending step for specific form | |
*/ | |
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else"); | |
function wpcf7_do_something_else($cf7) { | |
// get the contact form object | |
$wpcf = WPCF7_ContactForm::get_current(); | |
// if you wanna check the ID of the Form $wpcf->id | |
if (/*Perform check here*/) { | |
// If you want to skip mailing the data, you can do it... | |
$wpcf->skip_mail = true; | |
} | |
return $wpcf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment