WP Webhooks / Docs / fswa_can_publish_build
Filter since v3.0.0

fswa_can_publish_build

Allows or refuses publishing a build to wpwebhooks.org from this site.

$

/ Signature

apply_filters( 'fswa_can_publish_build', $allowed )

/ When it fires

Fires when an author tries to publish a build, after the built-in checks: WordPress Playground sandboxes and sites whose address is not reachable from the internet are refused before this filter runs.

/ Parameters

NameInTypeReqDescription
$allowedparambool|stringyes`true` to allow, or a string — the reason shown to the author when publishing is refused. Default: `true`.

/ Returns

bool|string `true` to allow publishing, or the refusal reason.

/ Examples

Block publishing from staging

add_filter( 'fswa_can_publish_build', function ( $allowed ) {
    if ( wp_get_environment_type() !== 'production' ) {
        return 'Publish builds from the production site.';
    }
    return $allowed;
} );

/ Related

Ready

Your next automation is
one sentence away.

$ wp plugin install flowsystems-webhook-actions --activate