Skip to content

Instantly share code, notes, and snippets.

Musilek Vladislav Musilda

Block or report user

Report or block Musilda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wp-auto-upload-image-batch.php
<?php
global $wp_aui;
$custom_posts = get_posts($args);
foreach($custom_posts as $post) : setup_postdata($post);
$content = $wp_aui->save($post);
wp_insert_post( array( 'ID' => $post->ID, 'post_content' => $content ) );
endforeach;
View display-variation-sku.php
<?php
//Use template file single-produtc/add-to-cart/variation.php
//Replace code with snippet
?>
<script type="text/template" id="tmpl-variation-template">
<div class="woocommerce-variation-description">{{{ data.variation.variation_description }}}</div>
<div class="woocommerce-variation-price">{{{ data.variation.price_html }}}</div>
<div class="woocommerce-variation-availability">{{{ data.variation.availability_html }}}</div>
<div class="woocommerce-variation-sku"><strong>Katalogové číslo:</strong> {{{ data.variation.sku }}}</div>
</script>
View extend-comgate-blocked-statuses.php
<?php
//Defined
$default_blocked_statuses = array( 'processing', 'completed' );
$blocked_statuses = apply_filters( 'comgate_blocked_statuses', $default_blocked_statuses );
//Snippet
add_filter( 'comgate_blocked_statuses', 'extend_comgate_blocked_statuses' );
function extend_comgate_blocked_statuses( $statuses ){
$statuses[] = 'nezaplaceno';
return $statuses;
View csob-bank-extend-blocked-statuses.php
<?php
//Defined
$statuses = array(
'completed',
'failed',
'cancelled',
'refunded'
);
apply_filters( 'csob_bank_blocked_order_statuses', $statuses );
View change-order-status-webhook-paid.php
<?php
$status = apply_filters( 'fakturoid_webhook_paid_status', 'completed', $order );
add_filter( 'fakturoid_webhook_paid_status', 'toret_fakturoid_webhook_paid_status', 10, 2 );
function toret_fakturoid_webhook_paid_status( $status, $order ){
return 'processing';
}
View add-idoklad-invoice-exchange-rate.php
<?php
$ExchangeRate = apply_filters( 'idoklad_exchange_rate', false, $order_id );
if( $ExchangeRate != false ){
$data['ExchangeRate'] = $ExchangeRate;
}
$ExchangeRateAmount = apply_filters( 'idoklad_exchange_rate_amount', false, $order_id );
if( $ExchangeRateAmount != false ){
$data['ExchangeRateAmount'] = $ExchangeRateAmount;
View change-idoklad-order-number.php
<?php
$data['OrderNumber'] = apply_filters( 'idoklad_order_number', $order_id );
add_filter( 'idoklad_order_number', 'toret_change_idoklad_order_number', 10, 1 );
function toret_change_idoklad_order_number( $order_id ){
$order = wc_get_order( $order_id );
return $order->get_order_number();
}
View change-idoklad-invoice-description.php
<?php
$description = 'Proforma za objednávku č: '.$order_id;
$data['Description'] = apply_filters( 'idoklad_proforma_description', $description, $order_id );
add_filter( 'idoklad_proforma_description', 'toret_change_idoklad_proforma_description', 10, 2 );
function toret_change_idoklad_proforma_description( $description, $order_id ){
return 'Zálohovka';
}
$description = 'Faktura za objednávku č: '.$order_id;
$data['Description'] = apply_filters( 'idoklad_invoice_description', $description, $order_id );
View change-paid-invoice-status.php
<?php
$status = apply_filters( 'idoklad_control_status', 'completed', $order );
add_filter( 'idoklad_control_status', 'toret_change_paid_status', 10, 2 );
function toret_change_paid_status( $status, $order ){
return 'zaplaceno';
}
View change-get-request-language.php
<?php
$language = 'cs-CZ';
$language = apply_filters( 'idoklad_request_language_code', $language );
add_filter( 'idoklad_request_language_code', 'toret_change_request_language' );
function toret_change_request_language( $lang ){
return 'en-EN';
}
You can’t perform that action at this time.