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
//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
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) | |
{ | |
//... |
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 rc_add_cpts_to_search($query) { | |
// Check to verify it's search page | |
if( is_search() ) { | |
// Get post types | |
$post_types = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects'); | |
$searchable_types = array(); | |
// Add available post types | |
if( $post_types ) { | |
foreach( $post_types as $type) { | |
$searchable_types[] = $type->name; |
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 createCustomOrder($products, $posted_data) { | |
global $woocommerce; | |
$address = array( | |
'first_name' => $posted_data["popup-name"], | |
'last_name' => '', | |
'company' => $posted_data["popup-company"], | |
'email' => $posted_data["popup-email"], | |
'phone' => $posted_data["popup-phone"], | |
'address_1' => $posted_data["popup-address"], |
OlderNewer