Skip Navigation

[Gelöst] Need shortcode to view the user that last modified a post

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

I want to show in my view, the last modified date (I have no problem doing that), but I also want to show what user was the one that last modified the record. What short code would I use in a view to show the Modified by User?

Solution:

There isn't such a built-in feature within Toolset plugin, it needs some custom PHP codes, for example, add below codes into your theme file functions.php:

add_shortcode('the-modified-author', function( $atts = [], $content=null ) {
    return get_the_modified_author();
});

Then use shortcode [the-modified-author] in your content, and test again.

More help:

Relevant Documentation:

https://codex.wordpress.org/Function_Reference/get_the_modified_author

Retrieve the author who last edited the current post.

This support ticket is created vor 6 Jahren, 6 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 6 Jahren, 6 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#893901

Tell us what you are trying to do? I want to show in my view, the last modified date (I have no problem doing that), but I also want to show what user was the one that last modified the record. What short code would I use in a view to show the Modified by User?

#895078

Hello,

There isn't such a built-in feature within Toolset plugin, it needs some custom PHP codes, for example, add below codes into your theme file functions.php:

add_shortcode('the-modified-author', function( $atts = [], $content=null ) {
    return get_the_modified_author();
});

Then use shortcode [the-modified-author] in your content, and test again.

More help:
https://codex.wordpress.org/Function_Reference/get_the_modified_author
Retrieve the author who last edited the current post.

#898357

You guys rock!! Thanks for making this so simple!! I really appreciate it!

#899991

You are welcome