Agentic
4 months ago
BlockTemplates
4 weeks ago
EmailImprovements
1 year ago
EmailPreview
4 weeks ago
Emails
1 year ago
ImportExport
1 year ago
Logging
1 year ago
Marketing
2 years ago
Notes
4 weeks ago
Onboarding
5 months ago
Orders
4 weeks ago
ProductForm
2 years ago
ProductReviews
4 weeks ago
RemoteFreeExtensions
4 weeks ago
Schedulers
4 weeks ago
Settings
2 weeks ago
Suggestions
4 weeks ago
WCPayPromotion
10 months ago
ActivityPanels.php
3 years ago
Analytics.php
4 weeks ago
CategoryLookup.php
4 years ago
Coupons.php
1 year ago
CouponsMovedTrait.php
5 months ago
CustomerEffortScoreTracks.php
7 months ago
Events.php
2 months ago
FeaturePlugin.php
4 months ago
Homescreen.php
1 month ago
Loader.php
4 weeks ago
Marketing.php
1 year ago
Marketplace.php
5 months ago
MobileAppBanner.php
4 years ago
OrderMilestoneEasterEgg.php
4 weeks ago
RemoteInboxNotifications.php
3 years ago
Settings.php
2 weeks ago
ShippingLabelBanner.php
1 year ago
ShippingLabelBannerDisplayRules.php
1 year ago
SiteHealth.php
3 years ago
Survey.php
4 years ago
SystemStatusReport.php
1 year ago
Translations.php
1 year ago
WCAdminAssets.php
2 weeks ago
WCAdminSharedSettings.php
1 year ago
WCAdminUser.php
9 months ago
WcPayWelcomePage.php
1 year ago
Survey.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Survey helper methods. |
| 4 | */ |
| 5 | |
| 6 | namespace Automattic\WooCommerce\Internal\Admin; |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | |
| 10 | /** |
| 11 | * Survey Class. |
| 12 | */ |
| 13 | class Survey { |
| 14 | /** |
| 15 | * Survey URL. |
| 16 | */ |
| 17 | const SURVEY_URL = 'https://automattic.survey.fm'; |
| 18 | |
| 19 | /** |
| 20 | * Get a survey's URL from a path. |
| 21 | * |
| 22 | * @param string $path Path of the survey. |
| 23 | * @param array $query Query arguments as key value pairs. |
| 24 | * @return string Full URL to survey. |
| 25 | */ |
| 26 | public static function get_url( $path, $query = array() ) { |
| 27 | $url = self::SURVEY_URL . $path; |
| 28 | |
| 29 | $query_args = apply_filters( 'woocommerce_admin_survey_query', $query ); |
| 30 | |
| 31 | if ( ! empty( $query_args ) ) { |
| 32 | $query_string = http_build_query( $query_args ); |
| 33 | $url = $url . '?' . $query_string; |
| 34 | } |
| 35 | |
| 36 | return $url; |
| 37 | } |
| 38 | } |
| 39 |