Skip to content

Instantly share code, notes, and snippets.

View vince844's full-sized avatar
💭
I may be slow to respond.

vincenzo vecchio vince844

💭
I may be slow to respond.
View GitHub Profile
//CREAZIONE NUOVA PAGINA UTENTE E ATTRIBUZIONE DELLE CAPABILITIES
add_action('user_register', 'registration_newpage');
function registration_newpage($user_id) {
$user_info = get_userdata($user_id);
$username = $user_info->user_login;
$post = array();
$post['post_name'] = $username; // Il permalink della pagina
@vince844
vince844 / Woocommerce and Groups Integration
Created May 27, 2017 16:34
Woocommerce and Groups Integration
// @karibusana.org Funzione per indirizzare gli utenti a diversi negozi a seconda del loro gruppo di appartenenza
function karibusana_change_woocommerce_button_url() {
$user_id = get_current_user_id();
$group = Groups_Group::read_by_name( 'Rivenditori' ); // Qui specifica il nome del gruppo per il quale eseguire il redirect
if ( Groups_User_Group::read( $user_id, $group->group_id ) ) {
$redirect_to = get_permalink( 1054 ); // inserisci qui l'id dela pagina rivenditori
@vince844
vince844 / MyCred update user points on Gravity Form submission
Last active October 13, 2018 06:08
MyCred update user points on Gravity Form submission
add_action( 'gform_after_submission_1', 'karibusana_update_mycred_user_balance', 10, 2 ); // Change 1 with the form ID
function karibusana_update_mycred_user_balance ($entry, $form) {
// Change 23 to the ID of the form field you want
$orderID = rgar($entry, '23');
$user_id = get_current_user_id();
// switch to mycred_add if you want to add points instead of subtract
if (function_exists('mycred_subtract')) {
@vince844
vince844 / Gravity Form passing value from checkbox to text field
Created October 15, 2017 08:48
Gravity Form passing value from checkbox to text field
<script>
var checkboxHandler = {
//Change these IDs to match your form
checkboxFieldId: 'input_1_25', //checkbox container ID
outputFieldId: 'input_1_23', //hidden field to capture values
checkboxField: null,
outputField: null,
@vince844
vince844 / MyCred custom column for mycred_history log
Created October 15, 2017 18:53
MyCred custom column for mycred_history log shortcode
// Add the following code to the functions.php code it will add a new column in the mycred_history with the user fisrt name and last name
function mycredpro_add_log_column( $columns ) {
// Add our own column
$columns['user-data'] = 'Utente';
return $columns;
}
<option value="A001">ABANO TERME</option>
<option value="A004">ABBADIA CERRETO</option>
<option value="A005">ABBADIA LARIANA</option>
<option value="A006">ABBADIA SAN SALVATORE</option>
<option value="A007">ABBASANTA</option>
<option value="A008">ABBATEGGIO</option>
<option value="A010">ABBIATEGRASSO</option>
<option value="A012">ABETONE</option>
<option value="M376">ABETONE CUTIGLIANO</option>
<option value="A013">ABRIOLA</option>
@vince844
vince844 / loop-custom.php
Created August 26, 2018 13:15 — forked from kevinwhoffman/loop-custom.php
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
@vince844
vince844 / kondomanager-cla.md
Created September 29, 2026 06:06
KondoManager Contributor License Agreement

KondoManager Contributor License Agreement

Version 1.0 · 29 September 2026

Thank you for your interest in contributing to KondoManager. This Contributor License Agreement (the "Agreement") sets out the terms on which You make Contributions to the Project. It is between You and Vincenzo Vecchio, the maintainer of the Project, who can be contacted at kondomanager@pm.me. "We", "Us" and "Our" refer to Vincenzo Vecchio or, after a transfer under section 9.3, to the transferee.

1. Definitions

1.1 "You" means the natural person who signs this Agreement. If, in the signing form, You state that You sign on behalf of Your employer or another legal entity and give its name (the "Entity"), You declare that You are authorised to bind the Entity. In that case, for the Contributions You Submit in the course of Your work for the Entity, "You" means the Entity, and for any other Contribution "You" means You personally. This Agreement does not cover Contributions Submitted by other people who work for the Entity unles