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 | |
class PHPDebug { | |
function __construct() { | |
if (!defined("LOG")) define("LOG",1); | |
if (!defined("INFO")) define("INFO",2); | |
if (!defined("WARN")) define("WARN",3); | |
if (!defined("ERROR")) define("ERROR",4); |
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 | |
add_action( 'add_meta_boxes', 'add_custom_page_attributes_meta_box' ); | |
function add_custom_page_attributes_meta_box(){ | |
global $post; | |
if ( 'page' != $post->post_type && post_type_supports($post->post_type, 'page-attributes') ) { | |
add_meta_box( 'custompageparentdiv', __('Template'), 'custom_page_attributes_meta_box', NULL, 'side', 'core'); | |
} | |
} | |
function custom_page_attributes_meta_box($post) { |
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 | |
// go to wp-config.ini | |
define('WP_DEBUG', false); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', true ); | |
?> |
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 | |
ob_start(); | |
var_dump($someVar); | |
$result = ob_get_clean(); | |
file_put_contents('file.txt', $result); | |
?> |
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 | |
$wpcf7 = WPCF7_ContactForm::get_current(); | |
$submission = WPCF7_Submission::get_instance(); | |
$data = $submission->get_posted_data(); | |
$form_type = $data['form-type']; | |
?> |
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 | |
add_filter( 'wpcf7_validate_configuration', '__return_false' ); | |
?> |
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 | |
function add_email_to_sendpulse($contact_form) { | |
$wpcf7 = WPCF7_ContactForm::get_current(); | |
$submission = WPCF7_Submission::get_instance(); | |
$data = $submission->get_posted_data(); | |
$cur_email = $data['Email']; | |
if ($cur_email != '') { | |
define( 'API_USER_ID', '' ); |
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
$.when( runGal() ).done(function() { | |
$('.fotogal').show(); | |
}); |
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
$('.fancybox').fancybox({ | |
scrolling: 'hidden', | |
helpers: { | |
overlay: { | |
locked: true | |
} | |
} | |
}); |
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
/* | |
Validate fields in Contact Form 7 | |
*/ | |
function cf7_validation( $result, $tag ) { | |
$tag = new WPCF7_FormTag( $tag ); | |
$name = $tag->name; | |
if ($name == 'inn') { | |
if( !preg_match( "/(\d{8,12})/", $_POST[$name] ) or strlen( $_POST[$name] ) > 12 ) { | |
$result->invalidate( $tag, "Проверьте правильность заполнения поля. ИНН должно содержать не более 12 цифр цифр." ); |
OlderNewer