//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
//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
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
/** * 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
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
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
function wpf_snipTest_process_complete( $fields, $entry, $form_data, $entry_id ) { // Optional, you can limit to specific forms. Below, we restrict output to // form #5. //if ( absint( $form_data[‘id’] ) !== 12759 ) { if ( absint( $form_data[‘id’] ) !== 12330…Continue reading
function wpf_sniperRegister_process_complete( $fields, $entry, $form_data, $entry_id ) { // Optional, you can limit to specific forms. Below, we restrict output to // form #5. if ( absint( $form_data[‘id’] ) !== 12330 ) { error_log(“Id form no encontrado”); return; } //…Continue reading
function wpf_snipTest_process_complete( $fields, $entry, $form_data, $entry_id ) { // Optional, you can limit to specific forms. Below, we restrict output to // form #5. if ( absint( $form_data[‘id’] ) !== 12330 ) { error_log(“Id form no encontrado”); return; } //…Continue reading