Change Add Product button URL

add_filter( ‘wcv_dashboard_quick_links’, ‘change_add_product_link’ ); /** * Change the add product link * * @param array $links The links. */ function change_add_product_link( $links ) { if ( isset( $links[‘product’] ) ) { $links[‘product’][‘url’] = ‘https://example.com/add-product/’; $links[‘product’][‘label’] = __( ‘Add Product’, ‘wc-vendors’…Continue reading

Cusdtom WP escape

function my_plugin_kses( $html ) { $kses_defaults = wp_kses_allowed_html( ‘post’ ); $svg_args = array( ‘svg’ => array( ‘class’ => true, ‘aria-hidden’ => true, ‘aria-labelledby’ => true, ‘role’ => true, ‘xmlns’ => true, ‘fill’ => true, ‘width’ => true, ‘height’ => true,…Continue reading

Allow Unfiltered HTML by Role in Multisite

/** * Enable unfiltered_html capability for role. * * @param array $caps The user’s capabilities. * @param string $cap Capability name. * @param int $user_id The user ID. * @return array $caps The user’s capabilities, with ‘unfiltered_html’ potentially added. */…Continue reading

Set the ranges for Calendar View | Display Eventbrite Events

/** * Set the valid range for the calendar view. */ add_filter( ‘wfea_cal_options’ , function( $options ) { $options[‘fullcalendar’][‘validRange’] = array( ‘start’ => date( ‘Y-m-d’, strtotime( ‘-5 months’ ) ), // 5 months ago ‘end’ => date( ‘Y-m-d’, strtotime( ‘+5…Continue reading

Disable, Add, and Enable Thumbnail Sizes

// disable generated image sizes //function tps_disable_image_sizes($sizes) { // unset($sizes[‘thumbnail’]); // disable thumbnail size // unset($sizes[‘medium’]); // disable medium size // unset($sizes[‘large’]); // disable large size //unset($sizes[‘medium_large’]); // disable medium-large size //unset($sizes[‘1536×1536’]); // disable 2x medium-large size //unset($sizes[‘2048×2048’]); // disable…Continue reading