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
/** | |
* Gravity Wiz // Gravity Forms // Style Number Fields like Total Field | |
* | |
* Use "gf_price" and "gf_total" CSS classes via the "CSS Class Name" setting to style your Number fields like a product | |
* price (red) or total (green). | |
*/ | |
.gform_wrapper .gf_price input[type=text], | |
.gform_wrapper .gf_price input[type=number] { | |
border: 0; | |
font-size: 1.2em; |
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 fields to new vendor form | |
add_action( 'shop_vendor_add_form_fields', 'custom_add_vendor_fields', 2, 1 ); | |
function custom_add_vendor_fields( $taxonomy ) { | |
?> | |
<div class="form-field"> | |
<label for="vendor_website"><?php _e( 'Vendor website' ); ?></label> | |
<input type="text" name="vendor_data[website]" id="vendor_website" class="vendor_fields" /><br/> | |
<span class="description"><?php _e( 'The vendor\'s website.' ); ?></span> | |
</div> | |
<?php |
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 | |
// Add fields to new vendor form | |
add_action( 'shop_vendor_add_form_fields', 'custom_add_vendor_fields', 2, 1 ); | |
function custom_add_vendor_fields( $taxonomy ) { | |
?> | |
<div class="form-field"> | |
<label for="vendor_website"><?php _e( 'Vendor website' ); ?></label> | |
<input type="text" name="vendor_data[website]" id="vendor_website" class="vendor_fields" /><br/> | |
<span class="description"><?php _e( 'The vendor\'s website.' ); ?></span> |
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_filter( 'mycred_affiliatewp_payout', 'mycredpro_adjust_affiliatewp_payout', 10, 3 ); | |
function mycredpro_adjust_affiliatewp_payout( $amount, $referral, $new_status ) { | |
$ten_procent = $referral->amount / 10; | |
return $ten_procent; | |
} |
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
function getCities() { | |
//get the value from the 'parent' field, sent via the AJAX post. | |
$choice = $_POST['parent_option']; | |
//Depending on the value of $choice, return a different array. | |
switch($choice) { | |
case "France": | |
$cities = [ | |
"Paris" =>"Paris", |
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
/** | |
* Convert myCRED Points into WooCommerce Coupon | |
* Requires myCRED 1.4 or higher! | |
* @version 1.3.1 | |
*/ | |
add_shortcode( 'mycred_to_woo_coupon', 'mycred_pro_render_points_to_coupon' ); | |
function mycred_pro_render_points_to_coupon( $atts, $content = NULL ) { | |
// Users must be logged in | |
if ( ! is_user_logged_in() ) |
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 | |
/* | |
Use this recipe in combination with MyCRED to award points to members when signing up | |
for Level 1 membership. This code gist could be customized to give points for another | |
membership level ID, award recurring points for each subscription payment, and more. | |
MyCRED can be downloaded/configured here: https://wordpress.org/plugins/mycred/ | |
*/ | |
// Register Hook for PMPro Membership Points at Signup |
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
/** | |
* Ultimate member - Display User ID below Username in Profile Page. | |
* @link https://wordpress.org/plugins/ultimate-member/ | |
*/ | |
function custom_display_id_profile_page(){ | |
echo '<p>'; | |
esc_html_e( 'Membership ID: ', 'theme-name'); | |
echo um_profile_id(); | |
echo '</p>'; |
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 | |
add_filter( 'wpseo_canonical', 'um_custom_user_yoast_canonical' ); | |
function um_custom_user_yoast_canonical() { | |
if( function_exists('um_is_core_page') ){ | |
if ( um_is_core_page('user') && um_get_requested_user() ) { | |
um_fetch_user( um_get_requested_user() ); | |
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 new tab called "mytab | |
/*Original author is Ultimate Member*/ | |
add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 ); | |
function my_custom_tab_in_um( $tabs ) { | |
$tabs[800]['mytab']['icon'] = 'um-faicon-pencil'; | |
$tabs[800]['mytab']['title'] = 'My Custom Tab'; | |
$tabs[800]['mytab']['custom'] = true; | |
return $tabs; | |
} |