*/ function link_args( string $from = '' ): array { $args = array( 'v' => defined( 'FORGE12_OPTIN_VERSION' ) ? FORGE12_OPTIN_VERSION : '' ); if ( $from !== '' ) { $args['from'] = $from; } return $args; } /** * Build a link to the product page. * * @param string $from Which entry point the click came from. * * @return string */ function get_product_url( string $from = '' ): string { $url = add_query_arg( link_args( $from ), PRODUCT_BASE . PRODUCT_PATH ); /** * Filter a link to the product site. * * @param string $url The full URL including its query arguments. * @param string $from Which entry point this is. * * @since 5.2.0 */ return (string) apply_filters( 'f12_doi_product_url', $url, $from ); } /** * Build a feedback link. * * @param string $from Which entry point the click came from. * * @return string */ function get_feedback_url( string $from = '' ): string { $url = add_query_arg( link_args( $from ), FEEDBACK_URL ); /** * Filter the feedback destination. * * @param string $url The full URL including its query arguments. * @param string $from Which entry point this is. * * @since 5.2.0 */ return (string) apply_filters( 'f12_doi_feedback_url', $url, $from ); } /** * Build a support link. Same rules as get_feedback_url(). * * @param string $from Which entry point the click came from. * * @return string */ function get_support_url( string $from = '' ): string { $url = add_query_arg( link_args( $from ), sprintf( SUPPORT_URL, product_lang() ) ); /** * Filter the support destination. * * @param string $url The full URL including its query arguments. * @param string $from Which entry point this is. * * @since 5.2.0 */ return (string) apply_filters( 'f12_doi_support_url', $url, $from ); }