gravityflow_workflow_url

Description

This gravityflow_workflow_url is used to filter any URL(s) which Gravity Flow outputs. It is primarily called through notifications and merge tags for inbox or status pages. 

Parameters

ParameterTypeDetails
$urlStringWorkflow URL
$page_idInteger ID of the workflow page
$assigneeAssigneeCurrent assignee

Examples

Customize the host portion of URL for a local environment

This is an example for a non-prod environment which sets WP_HOME / WP_SITEURL different by environment.
For most local, dev or staging environments, this use of filter should not be required.

add_filter( 'gravityflow_workflow_url', 'sh_custom_workflow_url', 10, 3 );
function sh_custom_workflow_url( $url, $page_id, $assignee ) {
    //Identify server level info host provides to compare / confirm environment
    if ( $_SERVER['HTTP_ORIGIN'] == 'http://local.test' ) {
        //Replace prod details with local/test URL
        $url = str_replace( "http://production.url", "http://local.test", $url );
    }
    return $url;
}

Another use case for the filter might be when you want to include analytic tracking info onto all links.

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?