WordPress.org

Plugin Directory

wp-file-get-contents

A WordPress shortcode for PHP's file_get_contents() function.

A WordPress shortcode for PHP's file_get_contents() function.

Examples:

[wp-file-get-contents url="http://example.com/dir/file.html"]

[wp-file-get-contents url="file://dir/file.html"]

[wp-file-get-contents file="/dir/file.html"]

Note that all local file paths are relative to the wp-contents/ folder. You cannot include files outside of the wp-contents/ folder. As an example, file://dir/file.html and/or /dir/file.html will be interpreted as wordpress/wp-contents/dir/file.html. The .. folder name is also removed from file paths to prevent backing out of the wp-content/ folder.

Shortcode attributes:

  • url = http, https, or file URI
  • file = path to a local file (relative to the wp-content/ folder)
  • cache = number of seconds to cache the content in the transient cache (defaults to 300 seconds)

Requires: 3.0 or higher
Compatible up to: 4.1.4
Last Updated: 2015-4-26
Active Installs: 100+

Ratings

0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1