---
title: "fswa_can_publish_build — Filter Hook"
description: "Allows or refuses publishing a build to wpwebhooks.org from this site."
url: "https://wpwebhooks.org/docs/fswa-can-publish-build/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/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

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $allowed | param | bool|string | yes | \`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

[Publish a build](https://wpwebhooks.org/docs/publish-a-build/)[Share a build](https://wpwebhooks.org/docs/share-a-build/)

/Ready

## Your next automation is  
one sentence away.

[Try the Live Preview](https://playground.wordpress.net/?blueprint-url=https://wpwebhooks.org/blueprint.json) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

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

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"fswa_can_publish_build — Filter Hook — Webhook Actions Docs","description":"Allows or refuses publishing a build to wpwebhooks.org from this site.","url":"https://wpwebhooks.org/docs/fswa-can-publish-build/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
