Change from e-mail address

//aanpassen afzender bij registratie etc /** change from e-mail address */ add_filter(‘wp_mail_from’, ‘new_mail_from’); add_filter(‘wp_mail_from_name’, ‘new_mail_from_name’); function new_mail_from($old) { return ‘[email protected]’; } function new_mail_from_name($old) { return ‘D\’Amore – de bruidssalon voor Amersfoort en Arnhem’; }Continue reading

Enable Zooming in Website

function remove_my_meta_viewport_action() { remove_action(‘wp_head’, ‘et_add_viewport_meta’); } function custom_et_add_viewport_meta(){ echo ‘‘; } add_action( ‘init’, ‘remove_my_meta_viewport_action’); add_action( ‘wp_head’, ‘custom_et_add_viewport_meta’ );Continue reading

ListMyFiles

//WPCode Snippet: ListMyFiles //Author: Richard Raymond //Date: 20241112 //ARGUMENTS: arguments passed from the short code are: //1. $ftypes: the allowable file types (file extensions) //2. $ffolder: the (local) work folder location relative to the root. (e.g. wp-content/documents/my_special_folder/ ). If left…Continue reading

ListMyFiles

//WPCode Snippet: ListMyFiles //Author: Richard Raymond //Date: 20241112 //ARGUMENTS: arguments passed from the short code are: //1. $ftypes: the allowable file types (file extensions) //2. $ffolder: the (local) work folder location relative to the root. (e.g. wp-content/documents/my_special_folder/ ). If left…Continue reading

PHP: User Render Gallery V4

function render_user_gallery() { if (!is_user_logged_in()) { error_log(“[GALLERY] User not logged in.”); return ‘ You must be logged in to view your gallery. ‘; } $current_user = wp_get_current_user(); $user_id = $current_user->ID; error_log(“[GALLERY] Current user ID: $user_id”); $upload_dir = wp_upload_dir(); $user_dir =…Continue reading

Remove weight from PDF invoices

/** * Hide weight from PDF invoices */ add_action( ‘wpo_wcpdf_custom_styles’, function( $document_type, $document ) { if ( $order = $document->order ) { ?> .meta .weight { display: none; }Continue reading

MFP > User Login & Logout Metrics

add_action(‘wp_login’, ‘user_last_login’, 99, 2); function user_last_login($user_login, WP_User $user) { $row = array( ‘browser’ => $_SERVER[‘HTTP_USER_AGENT’], ‘address’ => $_SERVER[‘SERVER_ADDR’], ‘status’ => $_SERVER[‘REDIRECT_STATUS’], ‘accept’ => $_SERVER[‘HTTP_ACCEPT’], ‘referer’ => $_SERVER[‘HTTP_REFERER’], ‘cookie’ => $_SERVER[‘HTTP_COOKIE’], ‘path’ => $_SERVER[‘PATH_INFO’], ‘start_time’ => current_time(‘timestamp’), ); add_row(‘session’, $row, ‘user_’…Continue reading

Inputs & Buttons

function get_city_field( $user_id = null, $role = null, $required = null, $readonly = null) { $field[‘name’] = ‘_city’; $field[‘label’] = ‘City’; $field[‘key’] = ‘city’; // // if( $user_id && in_array(‘exhibitor’, get_userdata( $user_id )->roles )){ // $field[‘label’] = ‘Gallery City’; //…Continue reading