Actions and hooks of StaticPress

Actions and hooks of StaticPress

StaticPress has some own actions and hooks. You can use them to upload files to S3 or a server with FTP automatically when static files are generated.

This page describes how to use them with samples codes.

StaticPress::file_put

You can process created files with StaticPress::file_put action hook.

This is called just after the static files are generated.
This has 2 parameters and they are:

  • $file_dest – the path to the generated file.
  • $url – the URL of the generated file on the static site.

* the function “my_s3_upload_function()” is not implemented

 

StaticPress::options_page

You can add items to StaticPress setting screen with StaticPress::options_page action hook.

You may want to use it like:

StaticPress::options_save

You can save options added in the StaticPress options screen to WordPress’s DB with StaticPress::options_save action hook.

You may want to use it like:

Well, actually you can’t use the above codes. The plugin includes them and is opened at GitHub, so if you are interested in it, please look into it.
https://github.com/megumiteam/staticpress-s3