This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change text string for Jetpack Protect Bot Challenge Text | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function digisavvy_change_humanity_string( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Prove your humanity:' : | |
$translated_text = __( 'Prove you\'re not a bot', 'jetpack' ); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* WC Vendors Pro - Add a custom link to your Pro Dashboard navigation bar */ | |
add_filter( 'wcv_pro_dashboard_urls', 'custom_menu_link' ); | |
function custom_menu_link( $pages ) { | |
$pages[ 'custom_link' ] = array( | |
'slug' => 'http://yoursite.com/customlink/here', // Change this to whatever you like, it must be a full URL | |
'label' => __('My Custom Link', 'wcvendors-pro' ), | |
'actions' => array() | |
); | |
return $pages; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example text input with validation | |
*/ | |
WCVendors_Pro_Form_Helper::input( | |
array( | |
'post_id' => $object_id, | |
'id' => '_wcv_custom_product_example_text_input', | |
'label' => __( 'Product Meta Text Input', 'wcvendors-pro' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To require, or not to require, that is the question...... In the future, we'll make these into checkboxes to require/not require, | |
but for now you use filters. Add this code to your themes functions.php file. Here's the process: | |
1.) Find the filter for the field you want to adjust the requirements. This file is in /plugins/wc-vendors-pro/public/forms/class-wcvendors-pro-product-form.php | |
2.) Create a filter for each field you'd like to make required (or not required). The code below will make the description required: | |
/* WC Vendors Pro - Make Description Required */ | |
function wcv_product_description_required( $args ) { | |
$args[ 'custom_attributes' ] = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this in your themes function.php | |
function vendor_feedback_sidebar() { | |
if ( is_shop() ) { | |
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) ); | |
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); | |
if ( ! WCVendors_Pro::get_option( 'ratings_management_cap' ) ) echo WCVendors_Pro_Ratings_Controller::ratings_link( $vendor_id, true ); | |
} | |
} // vendor_feedback_sidebar() | |
// call this in your side bar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The following functions will allow a vendor to edit and delete their media alt text and descriptions. | |
// HOWEVER this requires post editing permissions so would also allow them to edit ALL posts and comments on | |
// your site if they know how to do it. | |
// WC Vendors will not support this code and is provided for educational purposes only. | |
// THIS IS DANGEROUS TO DO -- USE AT YOUR OWN RISK -- YOU HAVE BEEN WARNED! | |
// Update vendor role to support media handling | |
function update_vendor_role( ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_before_cart', 'move_proceed_button' ); | |
function move_proceed_button( $checkout ) { | |
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WC Vendors Pro vendors list uses the same layout as the default woocommerce pagination | |
// IF your theme is overriding the layout of the pagination links then you can use the following snippets (modified for your theme) | |
// to make the vendor list pagination links wrap with your theme wrappers and styles. | |
// Pagination wrapper opening tag | |
add_filter( 'wcv_pagination_before', 'wcv_pagination_before_wrapper' ); | |
function wcv_pagination_before_wrapper( $html ) { | |
return '<div class="somethign else">'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* WC Vendors Pro - Add another file uploader to upload a file with the ID in a meta key */ | |
function custom_wcv_file_uploader( ){ | |
$value = get_user_meta( get_current_user_id(), 'wcv_custom_product_file1', true ); // Must match meta key used in line 8 | |
WCVendors_Pro_Form_Helper::file_uploader( array( | |
'header_text' => __('File uploader', 'wcvendors-pro' ), | |
'add_text' => __('Add file', 'wcvendors-pro' ), | |
'remove_text' => __('Remove file', 'wcvendors-pro' ), | |
'image_meta_key' => 'wcv_custom_product_file1', // Must match meta key used in line 3 | |
'save_button' => __('Add file', 'wcvendors-pro' ), | |
'window_title' => __('Select an Image', 'wcvendors-pro' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Hijack vendor menu to insert view store link. | |
function wcv_store_menu_link( $items, $args ) { | |
if ( WCV_Vendors::is_vendor( get_current_user_id() ) ) { | |
// Only insert the link in the menu you want based on the menu slug you define below. | |
// In this example a menu has been created called 'Vendor Menu' that has the menu slug vendor-menu | |
// This link will be the last link in the vendor menu |