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 / Staging&ProductionUsingGit
Created August 1, 2016 10:20 — forked from mediabeastnz/Staging&ProductionUsingGit
Staging and Production Server using Git.
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;)
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com
#Setup#
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time.
2. ssh into the server e.g. $ ssh username@ipaddress
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private
4. Create the main repo e.g. $ git init --bare apple.git
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com
@techies23
techies23 / _blank.js
Created December 3, 2018 16:27 — forked from CrocoDillon/_blank.js
Automatically open external links in new tab or window.
// vanilla JavaScript
var links = document.links;
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) {
links[i].target = '_blank';
}
}
// or in jQuery
@techies23
techies23 / remove-cross-sell-products.php
Last active November 27, 2019 07:06 — forked from prasidhda/remove-cross-sell-products.php
Remove Cross sell or up sell products from cart alongside main WooCommerce product
add_action( 'woocommerce_cart_item_removed', 'my_plugin_remove_upsell_crossell', 10, 2);
function my_plugin_remove_upsell_crossell( $cart_item, $cart ) {
//GETTING SESSION ID PAIRS
$product_id_cart_item_pairs = WC()->session->get( 'product_id_cart_item_pairs', array() );
$cart_item_product_pairs = WC()->session->get( 'cart_item_product_pairs', array() );
// Get the product ID using session store
$product_id = isset( $product_id_cart_item_pairs[ $cart_item ] ) ? $product_id_cart_item_pairs[ $cart_item ] : false;
if ( ! $product_id ) {
<?php
/**
* Renaming join link table rendered via shortcode
*
*/
remove_action('vczoom_meeting_before_shortcode', 'video_conference_zoom_shortcode_table', 10);
add_action( 'vczoom_meeting_before_shortcode', 'video_conference_zoom_shortcode', 10 );
function video_conference_zoom_shortcode( $zoom_meetings ) {
?>
@techies23
techies23 / functions.php
Last active April 9, 2020 07:50
Inactive Logout Addon add your custom post type pages to disabled pages.
add_filter( 'ina_disabled_pages', 'ina_disbable_pages_posts_types' );
function ina_disbable_pages_posts_types( $post_types ) {
$post_types[] = 'your_custom_post_type_name';
return $post_types;
}
@techies23
techies23 / functions.php
Created January 6, 2020 10:22
Inactive Logout External Redirection custom post type page support code.
//Add this to your functions.php file
add_filter('ina_free_get_custom_post_types', function ( $post_type ) {
$post_type[] = 'your_custom_post_type_slug';
return $post_type;
});
//Copy to your css file
//For changing Countdown cell background
.dpn-zvc-single-content-wrapper .dpn-zvc-sidebar-wrapper .dpn-zvc-timer .dpn-zvc-timer-cell {
background: #color_code; //For box background color
color: #color_code; //For text color
}
//For changing color of DETAILS section
.dpn-zvc-single-content-wrapper .dpn-zvc-sidebar-wrapper .dpn-zvc-sidebar-tile {
@techies23
techies23 / vczapi-pro.php
Last active November 25, 2020 08:36
Video Conferencing with Zoom API Pro version Email Filters - Add these to your theme/functions.php file.
//For Showing the custom variable in backend settings email text editor.
add_filter( 'vczapi_pro_admin_registration_confirmed_email_handles', 'vczapi_pro_registration_email_handles' );
function vczapi_pro_registration_email_handles( $data ) {
$data['confirmation_email']['customer_email_address'] = __( 'Show Customer Email Address', 'theme-slug' );
return $data;
}
//For Adding extra variables to your confirmation emails
add_filter( 'vczapi_pro_registration_confirmed_email_content', 'vczapi_pro_confirmed_email_content', 10, 5 );
@techies23
techies23 / join-web-browser.php
Last active February 1, 2021 07:57
Show logged in user first name and last name prefilled.
<?php
/**
* The Template for joining meeting via browser
*
* This template can be overridden by copying it to yourtheme/video-conferencing-zoom/join-web-browser.php.
*
* @package Video Conferencing with Zoom API/Templates
* @since 3.0.0
* @modified 3.3.1
*/
@techies23
techies23 / functions.php
Created December 8, 2020 13:29
Change permalink "zoom-meetings" to something custom. For https://wordpress.org/plugins/video-conferencing-with-zoom-api/ plugin.
//NOTE: After adding below code - Goto wp-admin > Settings > Permalinks and hit save button to apply changes.
add_filter('vczapi_cpt_slug', 'vczapi_change_slug');
function vczapi_change_slug() {
return 'custom-slug';
}