Name: Static-Page
Owner: Human Made
Description: Static Page offloading
Created: 2016-12-06 01:54:58.0
Updated: 2017-10-23 09:34:52.0
Pushed: 2017-09-21 16:29:00.0
Homepage: null
Size: 38
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Export / save static copies of all your WordPress URLs.
This plugin is very specific in what it offers, that is - saving (almost) all URLs that can be publicly viewed on a WordPress site to another directory. This can be used in conjunction with different Stream Wrappers to upload to locations on S3, FTP etc.
The plugin essentials works like so:
get_posts
, get_terms
etc etc.This can be triggered via WP CLI Commands, or via cron when content on the WordPress site is updated.
Get the output of a single page, for testing
tatic-page output http://wordpress.dev/ [--replace-from=<from>] [--replace-to=<to>]
List all URLs that Static Page knows about
tatic-page urls
Save the site to static files
tatic-page save [--replace-from=<from>] [--replace-to=<to>]
List all assets that Static Page knows about
tatic-page assets
Save all assets out
tatic-page save-assets
Static Page is meant to be require little configuration, in the case than you do need to configure this, you can use the following hooks:
Add / remove URLs that are generated
filter( 'static_page_site_urls', function ( $urls ) {
$urls[] = site_url( '/my-hidden-url/' );
return $urls;
Make custom URL replacements on the contents of pages
filter( 'static_page_replace_urls_in_content', function ( $page_markup ) {
return str_replace( site_url(), 'https://my-cdn.example.com/', $page_markup );
Add / remove assets directories to be copied on save-assets
All files of type jpg
, css
, js
, png
, gif
will be copied from the directories.
filter( 'static_page_assets_dirs', function ( $dirs ) {
$dirs[] = plugin_dir( 'akismet' );
return $dirs;