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 | |
$handle = fopen("style.css", "r"); | |
$file = 'config.json'; | |
$arr = array(); | |
if ($handle) { | |
$key = ''; | |
while (($line = fgets($handle)) !== false) { | |
preg_match('/[\w-]+/', $line, $matches ); |
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 | |
//Register tag cloud filter callback | |
add_filter('widget_tag_cloud_args', 'tag_widget_limit'); | |
//Limit number of tags inside widget | |
function tag_widget_limit($args){ | |
//Check if taxonomy option inside widget is set to tags | |
if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){ |
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( defined('YITH_WCAS_PREMIUM') ){ | |
global $yith_wcas; | |
add_filter( 'ywrac_results', 'ywrac_custom_result', 10, 2 ); | |
remove_action( 'pre_get_posts', array( $yith_wcas, 'pre_get_posts' ) ); | |
} | |
function ywrac_custom_result( $posts, $search_keyword ){ | |
global $woocommerce; | |
$ordering_args = $woocommerce->query->get_catalog_ordering_args( 'title', 'asc' ); |
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('ywraq_product_added_view_browse_list', 'ywraq_change_browse_list'); | |
function ywraq_change_browse_list( $text ){ | |
$text = "View the list"; | |
return $text; | |
} |
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('yith_ywraq_product_added_to_list_message', 'ywraq_change_product_added'); | |
function ywraq_change_product_added( $text ){ | |
$text = "Done!"; | |
return $text; | |
} |
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( defined( 'YITH_YWRAQ_PREMIUM' ) ){ | |
add_filter( 'ywraq_clear_list_after_send_quote', 'ywraq_clear_list_after_send_quote', 10, 2); | |
function ywraq_clear_list_after_send_quote( $clear, $raq ){ | |
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 ywsl_process_login_start() | |
{ | |
setcookie( LOGGED_IN_COOKIE, md5(rand()), time()+15, preg_replace('|https?://[^/]+|i', '', YITH_YWSL_HYBRID_URL ) ); | |
} | |
add_filter( 'ywsl_process_login_start', 'ywsl_process_login_start' ); | |
?> |
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
To show the search form, | |
you can use | |
[yith_woocommerce_ajax_search] | |
or php code: | |
<?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?> | |
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('woocommerce_get_catalog_ordering_args', 'ywcas_woocommerce_catalog_orderby'); | |
function ywcas_woocommerce_catalog_orderby( $args ) { | |
$args['orderby'] = 'meta_value'; | |
$args['order'] = 'asc'; | |
$args['meta_key'] = '_sku'; | |
return $args; |
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 | |
///Renewal subscription | |
add_filter( 'views_edit-shop_order', 'yith_add_renewal_subscription' ); | |
function yith_add_renewal_subscription( $views ) { | |
$post_status = wc_get_order_statuses(); | |
$args = array( | |
'post_type' => 'shop_order', |