Skip to content

Instantly share code, notes, and snippets.

@saiful7
saiful7 / imapsync.md
Created January 11, 2023 20:44 — forked from nosmall/imapsync.md
Imapsync on Ubuntu 20.04 (lazy guide)

Imapsync on Ubuntu 20.04 (lazy guide)

sudo apt install -y libauthen-ntlm-perl libclass-load-perl libcrypt-ssleay-perl libdata-uniqid-perl libdigest-hmac-perl libdist-checkconflicts-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-compress-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libmail-imapclient-perl libmodule-scandeps-perl libnet-dbus-perl libnet-ssleay-perl libpar-packer-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-fatal-perl libtest-mock-guard-perl libtest-mockobject-perl libtest-pod-perl libtest-requires-perl libtest-simple-perl libunicode-string-perl liburi-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus && \
cd ~/ && \
git clone https://github.com/imapsync/imapsync.git && \
cd ~/imapsync/ && \
sudo ln -s ~/imapsync/imapsync /usr/bin/imapsync && \
imapsync --testslive
<?php
/*
* Paste this code in the functions.php
*/
add_action( 'woocommerce_after_add_to_cart_button', 'seller_link_in_product_page');
function seller_link_in_product_page() {
/**
* Register term fields
*/
add_action( 'init', 'register_vendor_custom_fields' );
function register_vendor_custom_fields() {
add_action( WC_PRODUCT_VENDORS_TAXONOMY . '_add_form_fields', 'add_vendor_custom_fields' );
add_action( WC_PRODUCT_VENDORS_TAXONOMY . '_edit_form_fields', 'edit_vendor_custom_fields', 10 );
add_action( 'edited_' . WC_PRODUCT_VENDORS_TAXONOMY, 'save_vendor_custom_fields' );
add_action( 'created_' . WC_PRODUCT_VENDORS_TAXONOMY, 'save_vendor_custom_fields' );
}
@mahbubme
mahbubme / functions.php
Created March 1, 2016 11:15
Remove Dokan seller registration form default validation and add new validation.
// remove the filter
remove_filter( 'woocommerce_process_registration_errors', 'dokan_seller_registration_errors' );
remove_filter( 'registration_errors', 'dokan_seller_registration_errors' );
// New registration form erros handling
function dokan_update_seller_registration_errors( $error ) {
$allowed_roles = apply_filters( 'dokan_register_user_role', array( 'customer', 'seller' ) );
// is the role name allowed or user is trying to manipulate?
if ( isset( $_POST['role'] ) && !in_array( $_POST['role'], $allowed_roles ) ) {