Skip to content

Instantly share code, notes, and snippets.

View MarkKevin08's full-sized avatar

MarkKevin08

View GitHub Profile
@wp-user-manager
wp-user-manager / wpum_rearrange_account_tabs.php
Created May 13, 2022 08:45
WP User Manager - Rearrange order of account page tabs
<?php
function my_wpum_rearrange_account_tabs( $tabs ) {
// Find the correct slug used in the URL, alter the priority
$tabs['email-subscriptions'] ['priority'] = 5;
return $tabs;
}
add_filter( 'wpum_get_account_page_tabs', 'my_wpum_rearrange_account_tabs', 100 );
@wp-user-manager
wp-user-manager / wpum_do_not_generate_password.php
Created March 8, 2022 12:24
WP User Manager - Disable WPUM from generating a password if user registration is handled by another plugin
<?php
add_filter( 'wpum_new_user_notification_generate_password', '__return_false' );
@digitalchild
digitalchild / functions.php
Created November 9, 2021 06:43
Add inventory fields to product-simple.php template for WC Vendors Pro
add_action( 'wcv_after_product_simple_after', 'wcv_add_inventory_fields' );
function wcv_add_inventory_fields( $object_id ){
?>
<!-- Inventory -->
<div class="wcv-product-inventory inventory_product_data tabs-content" id="inventory">
<?php WCVendors_Pro_Product_Form::manage_stock( $object_id ); ?>
<?php do_action( 'wcv_product_options_stock', $object_id ); ?>
@wp-user-manager
wp-user-manager / wpum_privacy_text.php
Created September 15, 2021 10:37
WP User Manager - Alter the privacy checkbox text
<?php
add_filter( 'wpum_privacy_text', 'wpum_change_message', 10, 3 );
function wpum_change_message( $text, $privacy_url, $blogname ) {
return sprintf( __( 'I have read and accept the <a href="%1$s" target="_blank">privacy policy</a> and allow %2$s to collect and store the data I submit through this form.', 'wp-user-manager' ), $privacy_url, $blogname );
}
@digitalchild
digitalchild / functions.php
Created September 7, 2021 04:35
Update the seller info label for settings and sign up forms for WC Vendors Pro
<?php
// Update the label if you're using the wp_editor setting
add_filter( 'wcv_vendor_seller_info_editor', 'wcv_update_editor_seller_info_label' );
function wcv_update_editor_seller_info_label( $label ){
return __( 'Driver Bio', 'wcvendors-pro' );
}
// Update the label if you are using the standard text area setting
add_filter( 'wcv_vendor_seller_info', 'wcv_update_seller_info_label' );
function wcv_update_seller_info_label( $field ){
@digitalchild
digitalchild / functions.php
Created June 29, 2021 07:53
Disable All in One SEO on the WC Vendors Dashboard
<?php
/**
* Disable All In One SEO on the vendor dashboard.
*/
add_filter( 'aioseo_disable', 'wcv_aioseo_disable_term_output' );
function wcv_aioseo_disable_term_output( $disabled ) {
$current_page_id = get_the_ID();
if ( wcv_is_dashboard_page( $current_page_id ) ){
@digitalchild
digitalchild / functions.php
Last active June 17, 2021 03:12
remove mark received button from orders my-accounts
<?php
add_filter( 'woocommerce_my_account_my_orders_actions', 'remove_mark_received' );
function remove_mark_received( $actions ){
if (array_key_exists('wcv-mark-order-received', $actions ) ){
unset($actions['wcv-mark-order-received']);
}
return $actions;
}
@digitalchild
digitalchild / pro-vendor-list.php
Last active June 12, 2021 02:47
Add vendor address details to the vendor list template for WC Vendors Pro
<?php
/**
* The Template for displaying a vendor in the vendor list shortcode
*
* Override this template by copying it to yourtheme/wc-vendors/front
*
* @package WCVendors_Pro
* @since 1.2.3
* @version 1.6.3
*/
@digitalchild
digitalchild / gist:f7100f749f6118925952e75f74a6d803
Created November 9, 2020 04:37
Make all bank fields in WC Vendors Pro Settings required
<?php
add_filter( 'wcv_vendor_bank_account_name', 'make_required' );
add_filter( 'wcv_vendor_bank_account_number', 'make_required' );
add_filter( 'wcv_vendor_bank_name', 'make_required' );
add_filter( 'wcv_vendor_bank_routing_number', 'make_required' );
add_filter( 'wcv_vendor_bank_routing_number', 'make_required' );
add_filter( 'wcv_vendor_bank_bic_swift', 'make_required' );
function make_required( $field ){
$field['custom_attributes'] = array( 'required' => '' );
@junenacpil29
junenacpil29 / gist:5fa35000caaa6d3c9a56d88b142ac526
Created September 21, 2020 08:51
WC Vendors | Show both the State and Country, but not city or house address
add_filter( 'wcv_format_store_address_args', 'my_wcv_format_store_address', 11, 2 );
function my_wcv_format_store_address( $address_args, $vendor_id ) {
$address_args = array(
'country' => WC()->countries->countries[ get_user_meta( $vendor_id, '_wcv_store_country', true ) ],
'city' => get_user_meta( $vendor_id, '_wcv_store_city', true ),
);
return $address_args;
}