Skip to content

Instantly share code, notes, and snippets.

@max-kk
max-kk / toolbar.patch
Created March 17, 2023 18:18
FV toolbar.patch
Index: public/class-fv-public.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/public/class-fv-public.php b/public/class-fv-public.php
--- a/public/class-fv-public.php (revision 180f8ddeef46b02792f1d52a3b66b69eaaf43b04)
+++ b/public/class-fv-public.php (date 1679076895854)
@@ -86,7 +86,9 @@
$fv_sorting = $contest->sorting;
@max-kk
max-kk / custom_uploads.php
Created May 4, 2022 18:00
LRM custom_uploads
<?php
// Copy after
add_filter('lrm/additional_atts', function( $atts ) {
$atts['enctype'] = 'multipart/form-data';
return $atts;
});
global $lrm_files;
@max-kk
max-kk / unvote.js
Last active May 6, 2022 17:55
FV :: unvote
+(function($) {
// action before voting
FvLib.addFilter('fv/vote/get_data', function(data) {
if ( data.res !== 10 ) {
return data;
}
data.no_process = "yes";
if ( FvVote.is_voted_for(data.contestant_id) ) {
localStorage.removeItem( "voted_" + data.contestant_id );
@max-kk
max-kk / hide_woocommerce_order_details_after_order_table.php
Created July 30, 2021 17:01
WOR - hide woocommerce_order_details_after_order_table
<?php
// COPY AFTER
add_filter('wccp__call__woocommerce_order_details_after_order_table', '__return_false');
<?php
//Example:
// USE a custom value: filter-id:fv-meta-email
add_action('fv/approve_photo', function($competitor_id, $admin_comment, $competitor) {
add_filter('notification/recipient/email/fv-meta-email', function($value) {
return $competitor->meta()->get_value( "meta_key" );
});
}, 10, 3);
@max-kk
max-kk / fv.js
Created April 30, 2021 17:58
Change link depends on a Contest ID
if ( fv.contest_id === "2" ) {
jQuery(".fv_lightbox").each(function(K, el) {
el.href = "https://boxtelontspant.nl/single-photo/" + fv_lightbox.dataset.id + "/";
el.classList.remove("fv_lightbox");
});
}
@max-kk
max-kk / fv_gallery_slider.php
Created April 15, 2021 16:09
FV Gallery slider exmaple
@max-kk
max-kk / gist:835f925b5d11925f2510ca43f82d3c71
Created March 24, 2021 19:44
FV Gallery - disable list output
<?php
// COPY AFTER
remove_all_actions('fv/public/list_item/extra');
@max-kk
max-kk / wor_hook_example.php
Last active January 15, 2021 17:47
WOR hooks
<?php
// COPY AFTER
add_action( "wccp/public/confirmation_page/after_left_column", function($order) {
echo $order->get_meta('jmeno_ditete_1');
echo $order->get_meta('billing_country');
}, 10, 1);
// Too add some data for specific section
// For billing:
@max-kk
max-kk / stop the auto-populated password.js
Created October 2, 2020 12:21
LRM removing the auto-populated password
jQuery( document ).ready(function() {
jQuery(".lrm-restore-password #lrm-password1").val( "" );
});