AI Verified

Name

Reading time

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

Grassmediaweb

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

18/08/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Reading time

 
                    
1function reading_time_shortcode() {
2 $content = get_post_field('post_content', get_the_ID());
3 $word_count = str_word_count(strip_tags($content));
4 $reading_time = ceil($word_count / 200); // Assuming an average reading speed of 200 words per minute
5 return $reading_time;
6}
7add_shortcode('reading_time', 'reading_time_shortcode');

0

Related Snippets

Please see some snippets below related to this snippet..

General

AI Verified

0

Insert WordPress website name via custom shortcode

Added: 8 months ago

Last Updated: 7 months ago

Displays the website name wherever the custom shortcode is inserted.

General

AI Verified

0

Add Custom Fields

Added: 5 months ago

Last Updated: 5 months ago

General

AI Verified

1

Fetch Users Minecraft Avatar Shortcode

Added: 1 year ago

Last Updated: 1 year ago

Update: Added style function

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WordPress Admin

AI Verified

3

Redirect after successful non-admin login

Added: 1 year ago

Last Updated: 3 months ago

This snippet redirects a non-admin user to the URL or page/post of choice.

WordPress Admin

AI Verified

1

Add a custom post type to WordPress named "Slides"

Added: 11 months ago

Last Updated: 7 months ago

Add a custom post type to WordPress without having to use a plugin.

WordPress Admin

AI Verified

1

Add custom fields to user profile

Added: 1 year ago

Last Updated: 1 year ago

This is a simple and very flexible code snippet for adding custom fields to a user profile. Saves a bulky extra plugin!