|Plugin Name||JSM's file_get_contents() Shortcode|
|Summary||A safe and reliable WordPress shortcode for PHP's file_get_contents() function.|
|Requires PHP||7.0 or newer|
|Requires WordPress||4.5 or newer|
|Tested Up To WordPress||5.7.1|
|Tags / Keywords||file_get_contents, shortcode, include, file, url, body, content|
A safe and reliable WordPress shortcode for PHP's file_get_contents() function.
Note that all local file paths are relative to the wp-content/ folder — you cannot include files outside the wp-content/ folder. For example, the shortcode attributes
file="/dir/file.html" are both read as wordpress/wp-contents/dir/file.html. The
.. folder name is stripped from file paths to prevent backing out of the wp-content/ folder.
The WPFGC_SHORTCODE_NAME constant can be defined in your wp-config.php file to add an additional custom shortcode name (the default shortcode names are 'wp-file-get-contents' and 'wpfgc').
define( 'WPFGC_SHORTCODE_NAME', 'include' );
[wpfgc url="http://example.com/dir/file.html"] [wpfgc url="http://example.com/counter/" cache="7200"] [wpfgc url="file://dir/file.html"] [wpfgc file="/dir/file.txt" pre="true" filter="my_custom_filter_name" cache="600"]
Check out the WPSSO Core plugin to present your content at its best on social sites and in search results, no matter how webpages are shared, re-shared, messaged, posted, embedded, or crawled.