kollapsminoriteten/wp-content/plugins/jetpack/modules/contact-form/admin.php

530 lines
18 KiB
PHP
Raw Normal View History

2023-01-25 20:43:46 +01:00
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName -- legacy file
2022-12-15 17:41:53 +01:00
/**
* Contact form elements in the admin area. Used with Classic Editor.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use automattic/jetpack-forms
2022-12-15 17:41:53 +01:00
* @package automattic/jetpack
*/
2019-11-15 23:26:29 +01:00
2023-04-26 17:39:43 +02:00
// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
2024-04-17 11:32:24 +02:00
use Automattic\Jetpack\Forms\ContactForm\Admin;
2019-11-15 23:26:29 +01:00
2022-12-15 17:41:53 +01:00
/**
* Build contact form button.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_media_button
2022-12-15 17:41:53 +01:00
* @return void
*/
2019-11-15 23:26:29 +01:00
function grunion_media_button() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_media_button' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_media_button();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Display edit form view.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_display_form_view
2022-12-15 17:41:53 +01:00
* @return void
*/
2019-11-15 23:26:29 +01:00
function grunion_display_form_view() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_display_form_view' );
Grunion_Admin::$instance->grunion_display_form_view();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Enqueue styles.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_css
2022-12-15 17:41:53 +01:00
* @return void
*/
2019-11-15 23:26:29 +01:00
function grunion_admin_css() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_css' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_admin_css();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Enqueue scripts.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_js
2022-12-15 17:41:53 +01:00
* @return void
*/
function grunion_admin_js() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_js' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_admin_js();
2019-11-15 23:26:29 +01:00
}
/**
* Hack a 'Bulk Spam' option for bulk edit in other than spam view
* Hack a 'Bulk Delete' option for bulk edit in spam view
*
* There isn't a better way to do this until
* https://core.trac.wordpress.org/changeset/17297 is resolved
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_add_bulk_edit_option
2019-11-15 23:26:29 +01:00
*/
function grunion_add_bulk_edit_option() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_add_bulk_edit_option' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_add_bulk_edit_option();
2019-11-15 23:26:29 +01:00
}
/**
* Handle a bulk spam report
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_handle_bulk_spam
2019-11-15 23:26:29 +01:00
*/
function grunion_handle_bulk_spam() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_handle_bulk_spam' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_handle_bulk_spam();
2019-11-15 23:26:29 +01:00
}
2024-04-17 11:32:24 +02:00
2022-12-15 17:41:53 +01:00
/**
* Display spam message.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_message_bulk_spam
2022-12-15 17:41:53 +01:00
* @return void
*/
2019-11-15 23:26:29 +01:00
function grunion_message_bulk_spam() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_message_bulk_spam' );
Grunion_Admin::$instance->grunion_message_bulk_spam();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Unset edit option when bulk editing.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_bulk_actions
2022-12-15 17:41:53 +01:00
* @param array $actions List of actions available.
* @return array $actions
*/
2019-11-15 23:26:29 +01:00
function grunion_admin_bulk_actions( $actions ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_bulk_actions' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_admin_bulk_actions( $actions );
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Unset publish button when editing feedback.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_view_tabs
2022-12-15 17:41:53 +01:00
* @param array $views List of post views.
* @return array $views
*/
2019-11-15 23:26:29 +01:00
function grunion_admin_view_tabs( $views ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_admin_view_tabs' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_admin_view_tabs( $views );
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Build Feedback admin page columns.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_post_type_columns_filter
2022-12-15 17:41:53 +01:00
* @param array $cols List of available columns.
* @return array
*/
function grunion_post_type_columns_filter( $cols ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_post_type_columns_filter' );
return Grunion_Admin::$instance->grunion_post_type_columns_filter( $cols );
2022-12-15 17:41:53 +01:00
}
2019-11-15 23:26:29 +01:00
2022-12-15 17:41:53 +01:00
/**
* Displays the value for the source column. (This function runs within the loop.)
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_date
2022-12-15 17:41:53 +01:00
* @return void
*/
function grunion_manage_post_column_date() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_date' );
Grunion_Admin::$instance->grunion_manage_post_column_date();
2022-12-15 17:41:53 +01:00
}
/**
* Displays the value for the from column.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_from
2022-12-15 17:41:53 +01:00
* @param \WP_Post $post Current post.
* @return void
*/
function grunion_manage_post_column_from( $post ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_from' );
2022-12-15 17:41:53 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_manage_post_column_from( $post );
2022-12-15 17:41:53 +01:00
}
/**
* Displays the value for the response column.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_response
2022-12-15 17:41:53 +01:00
* @param \WP_Post $post Current post.
* @return void
*/
function grunion_manage_post_column_response( $post ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_response' );
2023-04-26 17:39:43 +02:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_manage_post_column_response( $post );
2022-12-15 17:41:53 +01:00
}
/**
* Displays the value for the source column.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_source
2022-12-15 17:41:53 +01:00
* @param \WP_Post $post Current post.
* @return void
*/
function grunion_manage_post_column_source( $post ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_column_source' );
2022-12-15 17:41:53 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_manage_post_column_source( $post );
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Parse message content and display in appropriate columns.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_columns
2022-12-15 17:41:53 +01:00
* @param array $col List of columns available on admin page.
* @param int $post_id The current post ID.
* @return void
*/
function grunion_manage_post_columns( $col, $post_id ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_columns' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_manage_post_columns( $col, $post_id );
2022-12-15 17:41:53 +01:00
}
2019-11-15 23:26:29 +01:00
2022-12-15 17:41:53 +01:00
/**
* Add a post filter dropdown at the top of the admin page.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_source_filter
2022-12-15 17:41:53 +01:00
* @return void
*/
function grunion_source_filter() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_source_filter' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_source_filter();
2022-12-15 17:41:53 +01:00
}
2019-11-15 23:26:29 +01:00
2022-12-15 17:41:53 +01:00
/**
* Filter feedback posts by parent_id if present.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_source_filter_results
2022-12-15 17:41:53 +01:00
* @param WP_Query $query Current query.
* @return void
*/
function grunion_source_filter_results( $query ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_source_filter_results' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_source_filter_results( $query );
2022-12-15 17:41:53 +01:00
}
2019-11-15 23:26:29 +01:00
2022-12-15 17:41:53 +01:00
/**
* Add actions to feedback response rows in WP Admin.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_row_actions
2022-12-15 17:41:53 +01:00
* @param string[] $actions Default actions.
* @return string[]
*/
function grunion_manage_post_row_actions( $actions ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_manage_post_row_actions' );
2022-12-15 17:41:53 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_manage_post_row_actions( $actions );
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Escape grunion attributes.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_esc_attr
2022-12-15 17:41:53 +01:00
* @param string $attr - the attribute we're escaping.
* @return string
*/
2019-11-15 23:26:29 +01:00
function grunion_esc_attr( $attr ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_esc_attr' );
return Grunion_Admin::$instance->grunion_esc_attr( $attr );
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Sort grunion items.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_sort_objects
2022-12-15 17:41:53 +01:00
* @param array $a - the first item we're sorting.
* @param array $b - the second item we're sorting.
* @return string
*/
2019-11-15 23:26:29 +01:00
function grunion_sort_objects( $a, $b ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_sort_objects' );
return Grunion_Admin::$instance->grunion_sort_objects( $a, $b );
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Take an array of field types from the form builder, and construct a shortcode form.
* returns both the shortcode form, and HTML markup representing a preview of the form
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_ajax_shortcode
2022-12-15 17:41:53 +01:00
*/
2019-11-15 23:26:29 +01:00
function grunion_ajax_shortcode() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_ajax_shortcode' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_ajax_shortcode();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Takes a post_id, extracts the contact-form shortcode from that post (if there is one), parses it,
* and constructs a json object representing its contents and attributes.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_ajax_shortcode_to_json
2022-12-15 17:41:53 +01:00
*/
2019-11-15 23:26:29 +01:00
function grunion_ajax_shortcode_to_json() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_ajax_shortcode_to_json' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_ajax_shortcode_to_json();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Handle marking feedback as spam.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_ajax_spam
2022-12-15 17:41:53 +01:00
*/
2019-11-15 23:26:29 +01:00
function grunion_ajax_spam() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_ajax_spam' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_ajax_spam();
2019-11-15 23:26:29 +01:00
}
/**
* Add the scripts that will add the "Check for Spam" button to the Feedbacks dashboard page.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_enable_spam_recheck
2019-11-15 23:26:29 +01:00
*/
function grunion_enable_spam_recheck() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_enable_spam_recheck' );
2019-11-15 23:26:29 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_enable_spam_recheck();
2020-09-15 14:30:05 +02:00
}
/**
* Add the JS and CSS necessary for the Feedback admin page to function.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_add_admin_scripts
2020-09-15 14:30:05 +02:00
*/
function grunion_add_admin_scripts() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_add_admin_scripts' );
2020-09-15 14:30:05 +02:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_add_admin_scripts();
2019-11-15 23:26:29 +01:00
}
2022-12-15 17:41:53 +01:00
/**
* Adds the 'Export' button to the feedback dashboard page.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_export_button
2022-12-15 17:41:53 +01:00
* @return void
*/
function grunion_export_button() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_export_button' );
2022-12-15 17:41:53 +01:00
2024-04-17 11:32:24 +02:00
Grunion_Admin::$instance->grunion_export_button();
2022-12-15 17:41:53 +01:00
}
2019-11-15 23:26:29 +01:00
/**
* Add the "Check for Spam" button to the Feedbacks dashboard page.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_check_for_spam_button
2019-11-15 23:26:29 +01:00
*/
function grunion_check_for_spam_button() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_check_for_spam_button' );
return Grunion_Admin::$instance->grunion_check_for_spam_button();
2019-11-15 23:26:29 +01:00
}
/**
* Recheck all approved feedbacks for spam.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_recheck_queue
2019-11-15 23:26:29 +01:00
*/
function grunion_recheck_queue() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_recheck_queue' );
2020-11-18 09:10:44 +01:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_recheck_queue();
2019-11-15 23:26:29 +01:00
}
2020-09-15 14:30:05 +02:00
/**
* Delete a number of spam feedbacks via an AJAX request.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_delete_spam_feedbacks
2020-09-15 14:30:05 +02:00
*/
function grunion_delete_spam_feedbacks() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_delete_spam_feedbacks' );
2020-09-15 14:30:05 +02:00
2024-04-17 11:32:24 +02:00
return Grunion_Admin::$instance->grunion_delete_spam_feedbacks();
2020-09-15 14:30:05 +02:00
}
/**
2020-11-18 09:10:44 +01:00
* Show an admin notice if the "Empty Spam" or "Check Spam" process was unable to complete, probably due to a permissions error.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->grunion_feedback_admin_notice
2020-09-15 14:30:05 +02:00
*/
2020-11-18 09:10:44 +01:00
function grunion_feedback_admin_notice() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __FUNCTION__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->grunion_feedback_admin_notice' );
return Grunion_Admin::$instance->grunion_feedback_admin_notice();
2020-09-15 14:30:05 +02:00
}
2023-01-25 20:43:46 +01:00
/**
* Class Grunion_Admin
*
* Singleton for Grunion admin area support.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin
2023-01-25 20:43:46 +01:00
*/
class Grunion_Admin {
/**
* CSV export nonce field name
*
* @var string The nonce field name for CSV export.
*/
private $export_nonce_field_csv = 'feedback_export_nonce_csv';
/**
* GDrive export nonce field name
*
* @var string The nonce field name for GDrive export.
*/
private $export_nonce_field_gdrive = 'feedback_export_nonce_gdrive';
2024-04-17 11:32:24 +02:00
/**
* Singleton class instance
*
* @var Grunion_Admin Class instance.
*/
public static $instance;
2023-01-25 20:43:46 +01:00
/**
* Instantiates this singleton class
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin::init
2023-01-25 20:43:46 +01:00
* @return Grunion_Admin The Grunion Admin class instance.
*/
public static function init() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin::init' );
2023-01-25 20:43:46 +01:00
2024-04-17 11:32:24 +02:00
if ( ! isset( self::$instance ) ) {
self::$instance = new Admin();
2023-01-25 20:43:46 +01:00
}
2024-04-17 11:32:24 +02:00
return self::$instance;
2023-01-25 20:43:46 +01:00
}
/**
* Grunion_Admin constructor
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->__construct
2023-01-25 20:43:46 +01:00
*/
public function __construct() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->__construct' );
2023-01-25 20:43:46 +01:00
}
/**
* Hook handler for admin_enqueue_scripts hook
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->admin_enqueue_scripts
2023-01-25 20:43:46 +01:00
*/
public function admin_enqueue_scripts() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->admin_enqueue_scripts' );
return self::$instance->admin_enqueue_scripts();
2023-01-25 20:43:46 +01:00
}
/**
* Prints the modal markup with export buttons/content.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->print_export_modal
2023-01-25 20:43:46 +01:00
*/
public function print_export_modal() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->print_export_modal' );
2023-01-25 20:43:46 +01:00
2024-04-17 11:32:24 +02:00
return self::$instance->print_export_modal();
2023-01-25 20:43:46 +01:00
}
/**
* Ajax handler for wp_ajax_grunion_export_to_gdrive.
* Exports data to Google Drive, based on POST data.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->export_to_gdrive
2023-01-25 20:43:46 +01:00
* @see Grunion_Contact_Form_Plugin::get_feedback_entries_from_post
*/
public function export_to_gdrive() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->export_to_gdrive' );
2023-01-25 20:43:46 +01:00
2024-04-17 11:32:24 +02:00
return self::$instance->export_to_gdrive();
2023-01-25 20:43:46 +01:00
}
/**
* Return HTML markup for the CSV download button.
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->get_csv_export_section
2023-01-25 20:43:46 +01:00
*/
public function get_csv_export_section() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->get_csv_export_section' );
return self::$instance->get_csv_export_section();
2023-01-25 20:43:46 +01:00
}
/**
* Render/output HTML markup for the export to gdrive section.
* If the user doesn't hold a Google Drive connection a button to connect will render (See grunion-admin.js).
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->get_gdrive_export_section
2023-01-25 20:43:46 +01:00
*/
public function get_gdrive_export_section() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->get_gdrive_export_section' );
2023-01-25 20:43:46 +01:00
2024-04-17 11:32:24 +02:00
return self::$instance->get_gdrive_export_section();
2023-01-25 20:43:46 +01:00
}
/**
* Ajax handler. Sends a payload with connection status and html to replace
* the Connect button with the Export button using get_gdrive_export_button
2024-04-17 11:32:24 +02:00
*
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->test_gdrive_connection
2023-01-25 20:43:46 +01:00
*/
public function test_gdrive_connection() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->test_gdrive_connection' );
2023-01-25 20:43:46 +01:00
2024-04-17 11:32:24 +02:00
return self::$instance->test_gdrive_connection();
2023-01-25 20:43:46 +01:00
}
/**
* Markup helper so we DRY, returns the button markup for the export to GDrive feature.
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->get_gdrive_export_button_markup
2023-01-25 20:43:46 +01:00
* @return string The HTML button markup
*/
public function get_gdrive_export_button_markup() {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->get_gdrive_export_button_markup' );
return self::$instance->get_gdrive_export_button_markup();
2023-01-25 20:43:46 +01:00
}
2023-04-26 17:39:43 +02:00
/**
* Get a filename for export tasks
*
2024-04-17 11:32:24 +02:00
* @deprecated 13.3 Use Automattic\Jetpack\Forms\ContactForm\Admin->get_export_filename
2023-04-26 17:39:43 +02:00
* @param string $source The filtered source for exported data.
* @return string The filename without source nor date suffix.
*/
public function get_export_filename( $source = '' ) {
2024-04-17 11:32:24 +02:00
_deprecated_function( __METHOD__, 'jetpack-13.3', 'Automattic\Jetpack\Forms\ContactForm\Admin->get_export_filename' );
return self::$instance->get_export_filename( $source );
2023-04-26 17:39:43 +02:00
}
2023-01-25 20:43:46 +01:00
}