Skip to content

Instantly share code, notes, and snippets.

View techies23's full-sized avatar
🎧
Beep Beep

Deepen Bajracharya techies23

🎧
Beep Beep
View GitHub Profile
@techies23
techies23 / main.yml
Created March 17, 2023 09:58 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
name: CD
on:
push:
branches: [ production ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@techies23
techies23 / functions.php
Created December 20, 2022 07:08
Change the join links to a link that you want for Zoom integration with WooCommerce
<?php
remove_action( 'woocommerce_order_item_meta_end', [
\Codemanas\ZoomWooCommerceAddon\Orders::get_instance(),
'email_meeting_details'
], 20 );
add_action( 'woocommerce_order_item_meta_end', 'reshape_zoom_order_item_meta', 20, 3 );
function reshape_zoom_order_item_meta( $item_id, $item, $order ) {
if ( $order->get_status() === "completed" || $order->get_status() === "processing" ) {
$product_id = $item['product_id'];
@techies23
techies23 / functions.php
Last active December 13, 2022 07:02
Changes the login limit text for Inactive Logout pro version
<?php
add_filter('ina_limit_msg', 'ina_addon_limit_message');
function ina_addon_limit_message($msg) {
return "If you think your account has been compromised, this custom message will save you.";
}
@techies23
techies23 / functions.php
Last active December 9, 2022 06:28
Change booking title for Zoom Event Booking on Zoom portal.
<?php
//Add this to your functions.php in your active theme.
add_filter( 'vczapi_woo_addon_meeting_title', 'vczapi_woo_addon_meeting_title_20220628', 10, 4 );
function vczapi_woo_addon_meeting_title_20220628( $text, $booking_id, $product_id, $host_id ) {
$booking = get_wc_booking( $booking_id );
$customer_name = $booking->get_customer()->name;
if ( ! empty( $customer_name ) ) {
return "Booking Session by " . $customer_name . " for " . get_the_title( $product_id ) . '-' . $booking_id;
} else {
@techies23
techies23 / functions.php
Last active November 28, 2022 11:11
Override WooCommerce email order template for admin to show start link
<?php
add_filter( 'woocommerce_email_order_details', 'email_order_details_20221128', 1, 4 );
function email_order_details_20221128( $order, $sent_to_admin, $plain_text, $email ) {
$GLOBALS['zoom_sent_to_admin'] = $sent_to_admin;
}
add_action( 'vczapi_woocommerce_order_item_meta', 'custom_order_meta_20221128', 99, 4 );
function custom_order_meta_20221128( $content, $item_id, $item, $order ) {
$sent_to_admin = ! empty( $GLOBALS['zoom_sent_to_admin'] ) ? $GLOBALS['zoom_sent_to_admin'] : false;
@techies23
techies23 / functions.php
Created November 28, 2022 05:09
Change registration confirmation title for Video Conferencing zoom pro plugin.
add_filter('vczapi_pro_registration_confirm_title', 'change_confirmation_title_20221128', 10, 2);
function change_confirmation_title_20221128( $topic, $details ) {
return 'Your title';
}
@techies23
techies23 / functions.php
Created May 5, 2022 07:58
Redirect from "zoom-meetings" page to 404 or any other page
//Paste below code to your theme's functions.php file
// Change 'your-desired-page' to something you want to redirect to
add_action('template_redirect', 'vczapi_redirect_archive_cpt');
function vczapi_redirect_archive_cpt()
{
if (is_post_type_archive('zoom-meetings')) {
wp_redirect('/your-desired-page', 301);
exit;
}
}
@techies23
techies23 / list-meetings-host.php
Created January 18, 2022 07:27
Listing meetings by HOST ID
<?php
/**
* Only show upcoming meetings
*/
?>
<table id="vczapi-show-meetings-list-table" class="vczapi-user-meeting-list">
<thead>
<tr>
<th><?php _e( 'Topic', 'video-conferencing-with-zoom-api' ); ?></th>
<th><?php _e( 'Meeting Status', 'video-conferencing-with-zoom-api' ); ?></th>
@techies23
techies23 / functions.php
Last active September 7, 2021 07:12
Remove purchase restriction for WooCommerce integration for Zoom Meetings
add_filter( 'vczapi_woocommerce_check_deadline_crossed_meeting_date', 'vczapi_deadline_check', 20 );
/**
* @param $meeting_date DateTime
*
* @return mixed
*/
function vczapi_deadline_check( $meeting_date ) {
if ( ! empty( $meeting_date ) ) {
$timezone = $meeting_date->getTimezone()->getName();
$current_date = vczapi_dateConverter( 'now', $timezone, false );