Skip to content

Instantly share code, notes, and snippets.

View geotsiokos's full-sized avatar
🏠
Working from home

George Tsiokos geotsiokos

🏠
Working from home
View GitHub Profile
add_filter( 'affiliates_notifications_tokens', 'example_affiliates_notifications_tokens' );
function example_affiliates_notifications_tokens( $tokens ) {
$tokens['your_token_name'] = 'your_token_value';
return $tokens;
}
@geotsiokos
geotsiokos / archive_sm_options.desktop
Last active May 27, 2018 17:15
An example to add options like extract, extract to folder and compress to the Service Menu of Konqueror file manager for KDE. Works with KDE, Konqueror 4.x.x and ark.
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/octet-stream;inode/directory
Actions=extract;extractTo;compress
[Desktop Action extract]
Name=Extract Here
Icon=ark
Exec=ark --batch %f
add_filter( 'groups_import_export_new_user_registration_subject', 'example_groups_import_export_new_user_registration_subject', 10, 3 );
function example_groups_import_export_new_user_registration_subject( $subject, $user_id, $plaintext_pass ) {
$subject = 'Here you can add whatever you like to display as subject, in the notification mail a user receives for his new account';
return $subject;
}
add_filter( 'groups_import_export_new_user_registration_message', 'example_groups_import_export_new_user_registration_message', 10, 3 );
function example_groups_import_export_new_user_registration_message( $message, $user_id, $plaintext_pass ) {
$message = 'Here you can add whatever you like to display as message, in the notification mail a user receives for his new account';
add_filter( 'affiliates_new_affiliate_user_registration_message', 'example_user_registration_message', 10, 2 );
function example_user_registration_message( $message, $params ) {
$message = 'Write here whatever you prefer your user should read in the welcome email.';
$message .= 'User info can be found in the params array, like user object, username, user_id';
return $message;
}
@geotsiokos
geotsiokos / gist:643e76be168b86e350ddb0690b8ed871
Created June 23, 2017 13:24
Referring Affiliate's avatar - example shortcode
add_action( 'init', 'referring_affiliate_avatar_shortcode' );
function referring_affiliate_avatar_shortcode() {
add_shortcode( 'referring-affiliate-avatar', 'referring_affiliate_avatar' );
}
function referring_affiliate_avatar( $atts ) {
$output = '';
if ( !is_admin() ) {
if ( !class_exists( "Affiliates_Service" ) ) {
include_once( AFFILIATES_CORE_LIB . '/class-affiliates-service.php' );
$affiliate_id = Affiliates_Service::get_referrer_id();
function my_affiliates_permanent_my_users( $atts ){
$output = "";
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
$args = array(
'meta_key' => Affiliates_Permanent::REFERRER,
'meta_value' => $user->ID
);
$users = get_users( $args );