v 0.1.4.1 correction new DateTime in shortcode, conflict with namespace

This commit is contained in:
asus
2024-03-19 07:11:04 +01:00
parent c1b687064f
commit ba1d3e3707
3 changed files with 9 additions and 8 deletions

View File

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

View File

@@ -93,7 +93,8 @@ function format_user_info($query, &$current_user, $user_id) {
$timestamp = strtotime($output); $timestamp = strtotime($output);
} }
if ($timestamp !== false) { if ($timestamp !== false) {
$date = new DateTime('@' . $timestamp); //$date = new \DateTime('@' . $timestamp);
$date = date_create('@' . $timestamp);
$output = $date->format($output_date_format); $output = $date->format($output_date_format);
} }
} }

View File

@@ -65,12 +65,12 @@ function output_list_front($array, $current_user, $user_id) {
/* /*
* shortcode to write user info of post author * shortcode to write user info of post author
* 0 or 1 argument, usage : * 0 or 1 argument, usage :
* - [cipf_user_info] -> list of all availables infos * - [custer_user_info] -> list of all availables infos
* - [cipf_user_info user_email] -> display the email * - [custer_user_info user_email] -> display the email
* - [cipf_user_info user_email user_login] -> display the email * - [custer_user_info user_email user_login] -> display the email
* - [cipf_user_info user_email id='logged_in'] -> display the email of the connected user * - [custer_user_info user_email id='logged_in'] -> display the email of the connected user
* - [cipf_user_info user_email id='author'] -> display the email of the creator of the page/post * - [custer_user_info user_email id='author'] -> display the email of the creator of the page/post
* - [cipf_user_info user_email id='logged_in' important] -> display the email of the connected user, even if surrounded by shortcode 'custer_change_id' * - [custer_user_info user_email id='logged_in' important] -> display the email of the connected user, even if surrounded by shortcode 'custer_change_id'
* important keyword has no effect if id='author' * important keyword has no effect if id='author'
* *
*/ */