- How to Set Rate Limits and Upload Security in Presto Capture
- How to Get Started with Presto Capture
- Why Presto Capture Needs HTTPS
- Presto Capture Block Settings
- Presto Capture Shortcode Reference
- How to Choose Where Recordings Are Saved in Presto Capture
- How to Control Who Can Record in Presto Capture
- How to Brand the Recorder in Presto Capture
- Understanding the Presto Capture Admin Panel
- How to Manage Recordings in Presto Capture
- How to Activate Your Presto Capture Licence
- Troubleshooting Presto Capture
- Privacy and Recordings in Presto Capture
- Presto Capture FAQ
- How to Add a Recording Field to SureForms with Presto Capture
- How to Add Video Replies to SureDash Discussions
- How to Collect Video Reviews in WooCommerce with Presto Capture
- Presto Capture for Developers: REST API and PHP Filters
- How to Allow Camera, Microphone, and Screen Access in Presto Capture
- How to Collect Video Reviews in SureCart with Presto Capture
- Understanding Trust Tiers in Presto Capture
- How to Approve, Reject and Block Recordings in Presto Capture
- How to Clean Up Unused Recordings in Presto Capture
- How to Protect Private Recordings on NGINX in Presto Capture
- What Happens When You Uninstall Presto Capture
Presto Capture for Developers: REST API and PHP Filters
Building Presto Capture into a client site, or connecting it to another plugin? Presto Capture has action hooks that fire as recordings are saved, approved, and deleted, and a filter to change how the recorder looks. You can also tag a recorder with your own context, so every recording knows where it came from. This page lists what’s available and shows where to add your code.
Applies to: Presto Capture 1.0.0 and above.
Before You Begin
- You should be comfortable with PHP and WordPress hooks.
- Add your code to a child theme’sÂ
functions.php file or a code snippets plugin. - Don’t edit the plugin files, because updates will overwrite them.
- Test every change on a staging site before you add it to your live site.
How to Add a Filter or Hook
- Open your child theme’sÂ
functions.php file, or add a new snippet in your code snippets plugin. - Paste the code.
- Save the file or snippet.
- Record a test video on your staging site to check that the change works.
Here’s an example that changes the recorder’s accent colour on every recorder:
add_filter( 'presto_capture_branding', function ( $branding ) { $branding['accentColor'] = '#1e40af'; return $branding;} );
Branding Filter
| Filter | What it changes |
|---|---|
presto_capture_branding | The accent colour, logo, brand name, font, header and button text. Receives $branding and $attributes. $attributes holds the block’s settings, so you can change branding for one recorder only. |
Note: Presto Capture checks the branding values from Settings, but your filter runs after that check. Make sure the values you return are valid, for example a real hex colour.
Action Hooks
When a Recording Is Saved
do_action( 'presto_capture_recording_saved', int $post_id, array $meta );
This fires once a recording is saved as a Media Hub item (pp_video_block). It runs for both Bunny.net and Media Library saves, and also for recordings waiting for approval.
$post_id is the Media Hub item ID.$meta holds the recording’s details:
| Meta key | What it holds |
|---|---|
_presto_capture_submitter | The user ID of the person who recorded it |
_presto_capture_destination | bunny or self-hosted |
_presto_capture_method | How it was recorded: camera, screen, screen-camera or audio |
_presto_capture_duration | Length in seconds |
_presto_capture_source_post | The ID of the page the recorder was on |
_presto_capture_source_url | The URL of the page the recorder was on |
_presto_capture_source_type | Your integration’s source type (see Building Your Own Integration) |
_presto_capture_source_id | Your integration’s ID for the item the recorder was attached to |
_presto_capture_source_session | Your integration’s session value |
Note: Use _presto_capture_submitter to find who recorded a video, not post_author. For some users, post_author is 0.
There is no block or shortcode ID in $meta. Read these values from the post instead:
- Presto Player video row:Â
get_post_meta( $post_id, '_presto_capture_video_row', true ) - Media Library file:Â the attachment whoseÂ
_presto_capture_recording_file meta equalsÂ$post_id - Status:Â
get_post_status( $post_id ). A recording waiting for approval isÂpending.
When Bunny.net Finishes Processing
do_action( 'presto_capture_bunny_resolved', int $post_id );
For Bunny.net recordings, presto_capture_recording_saved fires while Bunny is still processing the video. This hook fires once Bunny reports the video as ready or failed.
Moderation and Deletion
| Hook | When it fires |
|---|---|
presto_capture_recording_approved | An admin approves a pending recording. Receives $post_id. |
presto_capture_recording_rejected | An admin rejects or deletes a recording from the Recordings screen, just before it’s deleted. Receives $post_id. There is no “rejected but kept” status. |
presto_capture_recording_deleted | Any recording is deleted, including by auto-delete. Receives $post_id and $meta_before, the recording’s meta from before the delete. |
presto_capture_orphan_deleted | Auto-delete removes an unattached recording. Receives $post_id. |
A pending recording plays only for admins and the person who recorded it.
Building Your Own Integration
You can connect Presto Capture to another plugin, so a recording is posted wherever the member recorded it. Here’s how the pieces fit together.
1. Add the Recorder With Your Context
Render the recorder from PHP and pass a source:
echo \PrestoCapture\Blocks\CaptureRenderer::render( array( 'label' => 'Record a video' ), null, array( 'type' => 'my-plugin', 'id' => $item_id, 'session' => $session, ));
type,Âid andÂsession are signed, so visitors can’t change them.- They come back inÂ
$meta asÂ_presto_capture_source_type,Â_presto_capture_source_id andÂ_presto_capture_source_session. - TheÂ
[ presto_capture ]Â shortcode can’t carry a source. Use the PHP method instead.
2. Link the Recording
In your presto_capture_recording_saved callback, check the source type and link the recording to your item:
\PrestoCapture\Media\CaptureMeta::link( $post_id, 'my-plugin-' . $item_id );
Important: A recording with a source type counts as “unattached” until you call link(). Auto-delete removes unattached recordings after 30 days. You can change or turn off this period in Presto Capture’s General settings.
Before you publish the recording in your plugin, check get_post_status( $post_id ). If it’s pending, wait for presto_capture_recording_approved.
3. Show the Recording
Use the Presto Player shortcode with the Media Hub item ID:
echo do_shortcode( '[presto_player id=' . $post_id . ']' );
4. Control Who Can Play It
By default, a recording with a source type only plays for admins and the person who recorded it. To let others watch it, answer this filter for your source type:
add_filter( 'presto_capture_recording_visible', function ( $visible, $recording_id, $source_type ) { if ( 'my-plugin' !== $source_type ) { return $visible; } // Replace with your own access check. return my_plugin_user_can_view( get_current_user_id(), $recording_id ) ? true : $visible;}, 10, 3 );
- The filter runs only after the recording is linked.
- ReturnÂ
true (a real boolean) to allow playback. - Admins and the person who recorded it can always play it.
Note: This filter controls the player only. If the video files themselves must be private, use a private Bunny.net library or private Media Library storage.
5. Clean Up
Hook presto_capture_recording_rejected and presto_capture_recording_deleted to remove the matching item in your plugin when a recording is rejected or deleted.
REST API
Presto Capture’s REST API is used by its own admin screens and the recorder. It isn’t meant for custom code, so use the PHP hooks above instead.
For example, to list one member’s recordings:
$recordings = new WP_Query( array( 'post_type' => 'pp_video_block', 'meta_key' => '_presto_capture_submitter', 'meta_value' => $user_id,) );
Good to Know
- Settings changes apply to new blocks only. Filters run on every request, so they affect existing recorders too.
- Recording limits and upload settings are managed from Presto Capture’s Settings. If your project needs something the settings don’t cover, contact our support team.
- If you need a hook that isn’t listed here, tell us what you’re building.
You now have everything you need to connect Presto Capture to the rest of your site. Start small, test on staging, and build up from there.
If you have any questions or need further help, feel free to reach out to our support team. We’re always happy to help!
We don't respond to the article feedback, we use it to improve our support content.