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
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_page(array( | |
'page_title' => 'Theme General Settings', | |
'menu_title' => 'Theme Settings', | |
'menu_slug' => 'theme-general-settings', | |
'capability' => 'edit_posts', | |
'redirect' => false | |
)); | |
acf_add_options_sub_page(array( | |
'page_title' => 'Theme Header Settings', |
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
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else"); | |
function wpcf7_do_something_else($cf7) { | |
$wpcf = WPCF7_ContactForm::get_current(); | |
$wpcf->skip_mail = true; | |
$cookieForm = array( | |
'billing_first_name' => $_POST["text-873"], | |
'billing_last_name' => $_POST["text-251"], | |
); |
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
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields', 10, 1 ); | |
function custom_override_checkout_fields( $fields ) { | |
$fields['billing']['billing_phone']['required'] = false; | |
unset($fields['billing']['billing_phone']['validate']); | |
$fields['billing']['billing_country']['required'] = false; | |
unset($fields['billing']['billing_country']['validate']); | |
unset($fields['billing']['billing_country']); |
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
/* | |
Plugin Name: Cyr to Lat enhanced | |
Plugin URI: http://wordpress.org/plugins/cyr3lat/ | |
Description: Converts Cyrillic, European and Georgian characters in post, term slugs and media file names to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov. | |
Author: Sol, Sergey Biryukov, Nikolay Karev, Dmitri Gogelia | |
Author URI: http://karevn.com/ | |
Version: 3.5 | |
*/ | |
function ctl_sanitize_title($title) | |
{ |
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
add_filter("woocommerce_checkout_fields", "order_fields"); | |
function order_fields($fields) { | |
//Show only fields: fname,lname | |
$order = array( | |
"billing_first_name", | |
"billing_last_name", | |
); | |
foreach($order as $field) | |
{ |
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 | |
/*IS NOT WOOCOMMERCE*/ | |
if ( ! function_exists( 'is_ajax' ) ) { | |
/** | |
* is_ajax - Returns true when the page is loaded via ajax. | |
* @return bool | |
*/ | |
function is_ajax() { | |
return defined( 'DOING_AJAX' ); | |
} |
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
//set popularity product | |
function wpb_set_post_views($postID) { | |
$count_key = 'wpb_post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
$count = 0; | |
delete_post_meta($postID, $count_key); | |
add_post_meta($postID, $count_key, '0'); | |
}else{ | |
$count++; |
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
function arrayCastRecursive($array) | |
{ | |
if (is_array($array)) { | |
foreach ($array as $key => $value) { | |
if (is_array($value)) { | |
$array[$key] = arrayCastRecursive($value); | |
} | |
if ($value instanceof stdClass) { | |
$array[$key] = arrayCastRecursive((array)$value); | |
} |
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
//AUTHOR: Ronn0 ( stackoverflow.com 31787244 ) | |
if (isset($_POST['isOrder']) && $_POST['isOrder'] == 1) { | |
$address = array( | |
'first_name' => $_POST['notes']['domain'], | |
'last_name' => '', | |
'company' => $_POST['customer']['company'], | |
'email' => $_POST['customer']['email'], | |
'phone' => $_POST['customer']['phone'], | |
'address_1' => $_POST['customer']['address'], |
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
if ( sizeof( WC()->cart->get_cart() ) > 0 ) { | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) | |
{ | |
$_product = $values['data']; | |
if ( $_product->id == $product_id ) | |
$found = true; | |
} | |
if ( $found == true) | |
{ | |
//... |
OlderNewer