WC Vendors Activate All Vendors

/** Activates all Vendor Stores **/ function wcv_activate_all_vendors() { global $wpdb; $users = get_users( array( ‘fields’ => array( ‘ID’ ), ‘role’ => ‘Vendor’ ) ); $meta_key = ‘_wcv_vendor_status’; foreach($users as $user){ $wpdb->query($wpdb->prepare(“UPDATE wp_usermeta SET meta_value=’active’ WHERE user_id=$user->ID AND meta_key=’$meta_key’”)); }…Continue reading

Add A Default Campaign Custom Amount

add_filter( ‘charitable_session_donation_amount’, ‘example_get_donation_amount_in_session’, 999, 2 ); function example_get_donation_amount_in_session( $amount = false, $campaign = false ) { // If the donation amount is not set in the session, return the default amount. // WARNING: Setting a default amount here will override…Continue reading

Remove image link from media uploads

/* Remove image link from media uploads */ function wpb_imagelink_setup() { $image_set = get_option( ‘image_default_link_type’ ); if ($image_set !== ‘none’) { update_option(‘image_default_link_type’, ‘none’); } } add_action(‘admin_init’, ‘wpb_imagelink_setup’, 10);Continue reading