Skip to content

Instantly share code, notes, and snippets.

@digamber89
digamber89 / enqueue.php
Created February 5, 2019 17:06
Multiple Upload WordPress Media
<?php
function enqueue_media_uploader()
{
wp_enqueue_media();
}
add_action("admin_enqueue_scripts", "enqueue_media_uploader");
@digamber89
digamber89 / modify-functions.php
Last active February 21, 2019 11:58
Quick Fix Terms and Conditions
<?php
add_action( 'woocommerce_after_checkout_validation', 'digthis_two_step_checkout_validate', 9999, 2 );
function digthis_two_step_checkout_validate( $data, $errors ) {
$step = filter_input( INPUT_POST, 'current_step' );
if ( empty( $errors->errors ) && $step == 'step-1' ) {
$errors->add( 'digthis', __( '<span id="digthis-prevent-error">Digthis Error</span>', 'woocommerce' ) );
}
@digamber89
digamber89 / index.html
Last active April 11, 2019 15:37
Multi Image Uploader Using - jQuery Dependent
<form class="digthis-multi-upload-form" action="" method="post" enctype="multipart/form-data">
<div>
<label for="title">Title</label>
<input type="text" id="title" name="title" required>
</div>
<div>
<label for="content">Content</label>
<textarea id="content" name="content" required></textarea>
</div>
@digamber89
digamber89 / main.js
Created May 3, 2019 10:13
Check if Item is in viewport -> add class if it is - remove class if it isn't
(function ($) {
var digthisAddClassToElement = function (element) {
//cache the DOM
//use the element send through function as the dom element
var $element = $(element);
//scoped helper functions
var isInViewport = function (elem) {
var bounding = elem.getBoundingClientRect();
return (
@digamber89
digamber89 / functions.php
Created July 7, 2020 11:25
Show Only Own Meetings for Users
<?php
add_action( 'pre_get_posts', 'show_only_authors_own_meetings' );
function show_only_authors_own_meetings( $query ) {
global $pagenow;
if ( 'edit.php' != $pagenow || ! $query->is_admin ) {
return false;
}
if ( $query->is_main_query() && $query->get( 'post_type' ) == 'zoom-meetings' ) {
@digamber89
digamber89 / zoom-single-link.php
Created July 16, 2020 10:19
Shortcode to add join via browser link
@digamber89
digamber89 / functions.php
Created August 6, 2020 14:22
Send Order E-mails to Zoom Hosts when Booking is Made
<?php
//this code is expected to be added in child theme or custom functions.php
add_action( 'woocommerce_order_status_cancelled_to_processing_notification', 'send_email_to_booking_host', 10, 2 );
add_action( 'woocommerce_order_status_failed_to_processing_notification', 'send_email_to_booking_host', 10, 2 );
add_action( 'woocommerce_order_status_on-hold_to_processing_notification', 'send_email_to_booking_host', 10, 2 );
add_action( 'woocommerce_order_status_pending_to_processing_notification', 'send_email_to_booking_host', 10, 2 );
add_action( 'woocommerce_order_status_completed_notification', 'send_email_to_booking_host', 10, 2 );
add_filter( 'vczapi_wc_check_valid_deadline', '__return_false' );
@digamber89
digamber89 / functions.php
Last active October 1, 2020 09:32
Author Meetings Only
function show_only_authors_own_meetings( $query ) {
global $pagenow;
if ( 'edit.php' != $pagenow || ! $query->is_admin ) {
return false;
}
if ( $query->is_main_query() && $query->get( 'post_type' ) == 'zoom-meetings' ) {
$user = wp_get_current_user();
$privileged_roles = [ 'administrator' ]
@digamber89
digamber89 / functions.php
Last active August 30, 2022 12:21
Change Join via App / Broswer text - Zoom WooCommerce Meetings
<?php
//change join via app text
add_filter('vczapi_join_meeting_via_app_text','change_join_via_app_text');
function change_join_via_app_text($join_text){
return 'Join Meeting';
}
add_filter('vczapi_join_meeting_via_browser_text','change_join_via_broswer_text');
function change_join_via_broswer_text($join_meeting_text){
return 'Join via Browser';