custer fixed error in user id with email

This commit is contained in:
asus
2024-04-30 18:22:56 +02:00
parent d402e9a7e3
commit 0d20d71a7e
6 changed files with 650 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ Plugin Name: hggg_custer
Plugin URI:
Description: customize user : output infos on page, on email, and change current user id momentarly
Author: hugogogo
Version: 0.2.5.3
Version: 0.2.6
Author URI:
*/

View File

@@ -52,10 +52,6 @@ function format_user_info($query, $user_id, $if_empty = '') {
$output_date_format = Custer::USER_INFO_DATE_FORMAT;
$special_queries = Custer::QUERIES;
$current_user = get_user_by('id', $user_id);
if (empty($current_user)) {
return;
}
$is_acf = false;
@@ -71,6 +67,15 @@ function format_user_info($query, $user_id, $if_empty = '') {
}
/*
* for the rest, we need the user
*
*/
$current_user = get_user_by('id', $user_id);
if (empty($current_user)) {
return null;
}
/*
* check if it's an acf field

View File

@@ -9,8 +9,11 @@ if (!defined('ABSPATH')) {
}
function get_queries($user_id, $if_empty) {
function get_queries($user_id, $if_empty = '') {
$special_queries = Custer::QUERIES;
if (is_null($user_id)) {
return null;
}
$queries = array();
foreach($special_queries as $query) {
@@ -22,6 +25,9 @@ function get_queries($user_id, $if_empty) {
function find_author_page_url($user_id) {
if (is_null($user_id)) {
return null;
}
return get_author_posts_url($user_id);
}
@@ -33,6 +39,9 @@ function find_author_page_url($user_id) {
*
*/
function find_user_post_url($user_id) {
if (is_null($user_id)) {
return null;
}
$user_post_url = '';
$args = array(