admin-pages
1 year ago
core-api
1 year ago
debugger
1 year ago
markdown
1 year ago
class-jetpack-ai-helper.php
1 year ago
class-jetpack-currencies.php
2 years ago
class-jetpack-instagram-gallery-helper.php
2 years ago
class-jetpack-mapbox-helper.php
3 years ago
class-jetpack-podcast-feed-locator.php
1 year ago
class-jetpack-podcast-helper.php
1 year ago
class-jetpack-recommendations.php
2 years ago
class-jetpack-top-posts-helper.php
2 years ago
class-unauth-file-upload-handler.php
1 year ago
class.color.php
2 years ago
class.core-rest-api-endpoints.php
1 year ago
class.jetpack-automatic-install-skin.php
2 years ago
class.jetpack-iframe-embed.php
3 years ago
class.jetpack-password-checker.php
2 years ago
class.jetpack-search-performance-logger.php
4 years ago
class.media-extractor.php
2 years ago
class.media-summary.php
1 year ago
class.media.php
2 years ago
components.php
3 years ago
debugger.php
2 years ago
forms-integration.php
1 year ago
functions.wp-notify.php
1 year ago
icalendar-reader.php
1 year ago
jp-simplepie-alias-new.php
1 year ago
jp-simplepie-alias-old.php
1 year ago
jp-simplepie-alias.php
1 year ago
markdown.php
3 years ago
plans.php
4 years ago
plugins.php
4 years ago
tonesque.php
2 years ago
widgets.php
2 years ago
forms-integration.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | * File that sets up Jetpack integration with the Forms package. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Registers filters for integration with Forms package. |
| 10 | */ |
| 11 | function jetpack_forms_integration_init() { |
| 12 | // Only add the hook if we have the forms package |
| 13 | if ( ! class_exists( 'Automattic\Jetpack\Forms\ContactForm\Contact_Form_Field' ) ) { |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | // Add filter to provide the upload token |
| 18 | add_filter( 'jetpack_forms_file_upload_token', 'jetpack_forms_provide_upload_token' ); |
| 19 | } |
| 20 | add_action( 'init', 'jetpack_forms_integration_init' ); |
| 21 | |
| 22 | /** |
| 23 | * Provides an upload token using the Unauth_File_Upload_Handler. |
| 24 | * |
| 25 | * @return string The generated upload token. |
| 26 | */ |
| 27 | function jetpack_forms_provide_upload_token() { |
| 28 | require_once JETPACK__PLUGIN_DIR . '/_inc/lib/class-unauth-file-upload-handler.php'; |
| 29 | $handler = new Automattic\Jetpack\Unauth_File_Upload_Handler(); |
| 30 | return $handler->generate_upload_token(); |
| 31 | } |
| 32 |