Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

View GitHub Profile
@pije76
pije76 / gw-gravity-forms-style-numbers-like-total.css
Created June 30, 2019 20:08 — forked from spivurno/gw-gravity-forms-style-numbers-like-total.css
Gravity Wiz // Gravity Forms // Style Number Fields like Total Field
/**
* 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;
@pije76
pije76 / functions.php
Created June 24, 2019 13:15 — forked from woogist/functions.php
WooCommerce Product Vendors: Add extra custom fields to vendor profiles
// 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
@pije76
pije76 / functions.php
Created June 24, 2019 13:13 — forked from hlashbrooke/functions.php
WooCommerce Product Vendors: Add extra custom fields to vendor profiles
<?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>
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;
}
@pije76
pije76 / example.php
Created June 23, 2019 08:05 — forked from dave-mills/example.php
Example Callback function for Ultimate Member dropdown field
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",
@pije76
pije76 / mycred-woo-coupon
Created June 22, 2019 13:28 — forked from gabrielmerovingi/mycred-woo-coupon
This custom shortcode allows your users to convert their myCRED points into a WooCommerce coupon, in order to give themselves a discount or partial payment on their order. In order for this to work, you need to set an exchange rate between points and your store currency and select. Requires myCRED 1.6+ and WooCommerce 2.4+
/**
* 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() )
@pije76
pije76 / pmpromyCRED.php
Created June 20, 2019 16:32 — forked from strangerstudios/pmpromyCRED.php
Award MyCRED points for members who sign up for Membership Level 1.
<?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
@pije76
pije76 / um-profile-show-id.php
Last active June 20, 2019 07:17 — forked from cryptexvinci/um-profile-show-id.php
Ultimate member - Display User ID below Username in Profile Page. (*Cek Profile Programmmernya)
/**
* 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>';
<?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() );
/* 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;
}