Lines:
1 to 100 of 146
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName use Automattic\Jetpack\Assets; use Automattic\Jetpack\Blocks; use Automattic\Jetpack\Sync\Settings; define( 'GRUNION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'GRUNION_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); if ( is_admin() ) { require_once GRUNION_PLUGIN_DIR . 'admin.php'; } add_action( 'rest_api_init', 'grunion_contact_form_require_endpoint' ); /* function grunion_contact_form_require_endpoint() – Grunion Contact Form Add a contact form to any post, page or text widget. */ /* class Grunion_Contact_Form_Plugin */ /* function Grunion_Contact_Form_Plugin::init() – */ /* function Grunion_Contact_Form_Plugin::daily_akismet_meta_cleanup() – Runs daily to clean up spam detection metadata after 15 days. Keeps your DB squeaky clean. */ /* function Grunion_Contact_Form_Plugin::strip_tags() – Strips HTML tags from input. Output is NOT HTML safe. */ /* function Grunion_Contact_Form_Plugin::__construct() – Class uses singleton pattern; use Grunion_Contact_Form_Plugin::init() to initialize. */ /* function Grunion_Contact_Form_Plugin::register_contact_form_blocks() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_form() – */ /* function Grunion_Contact_Form_Plugin::block_attributes_to_shortcode_attributes() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_text() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_name() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_email() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_url() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_date() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_telephone() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_textarea() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_checkbox() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_checkbox_multiple() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_radio() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_select() – */ /* function Grunion_Contact_Form_Plugin::gutenblock_render_field_consent */ /* function Grunion_Contact_Form_Plugin::admin_menu() – Add the ‘Export’ menu item as a submenu of Feedback. */ /* function Grunion_Contact_Form_Plugin::allow_feedback_rest_api_type() – Add to REST API post type whitelist */ /* function Grunion_Contact_Form_Plugin::unread_count() – Display the count of new feedback entries received. It’s reset when user visits the Feedback screen. */ /* function Grunion_Contact_Form_Plugin::process_form_submission() – Handles all contact-form POST submissions */ /* function Grunion_Contact_Form_Plugin::ajax_request() – This filter is already documented in core. wp-includes/post-template.php */ /* function Grunion_Contact_Form_Plugin::insert_feedback_filter() – Ensure the post author is always zero for contact-form feedbacks Attached to `wp_insert_post_data` */ /* function Grunion_Contact_Form_Plugin::add_shortcode() – */ /* function Grunion_Contact_Form_Plugin::tokenize_label() – */ /* function Grunion_Contact_Form_Plugin::sanitize_value() – */ /* function Grunion_Contact_Form_Plugin::replace_tokens_with_input() – Replaces tokens like {city} or {City} (case insensitive) with the value of an input field of that name */ /* function Grunion_Contact_Form_Plugin::track_current_widget() – Tracks the widget currently being processed. */ /* function Grunion_Contact_Form_Plugin::widget_atts() – Adds a "widget" attribute to every contact-form embedded in a text widget. */ /* function Grunion_Contact_Form_Plugin::widget_shortcode_hack() – For sites where text widgets are not processed for shortcodes, we add this hack to process just our shortcode Attached to `widget_text` */ /* function Grunion_Contact_Form_Plugin::is_spam_blocklist() – Check if a submission matches the Comment Blocklist. */ /* function Grunion_Contact_Form_Plugin::is_in_disallowed_list */ /* function Grunion_Contact_Form_Plugin::prepare_for_akismet() – Populate an array with all values necessary to submit a NEW contact-form feedback to Akismet. */ /* function Grunion_Contact_Form_Plugin::is_spam_akismet() – Submit contact-form data to Akismet to check for spam. */ /* function Grunion_Contact_Form_Plugin::akismet_submit() – Submit a feedback as either spam or ham */ /* function Grunion_Contact_Form_Plugin::export_form() – Prints the menu */ /* function Grunion_Contact_Form_Plugin::get_post_content_for_csv_export() – Fetch post content for a post and extract just the comment. */ /* function Grunion_Contact_Form_Plugin::get_post_meta_for_csv_export() – Get `_feedback_extra_fields` field from post meta data. */ /* function Grunion_Contact_Form_Plugin::get_parsed_field_contents_of_post() – Get parsed feedback post fields. */ /* function Grunion_Contact_Form_Plugin::map_parsed_field_contents_of_post_to_field_names() – Properly maps fields that are missing from the post meta data to names, that are similar to those of the post meta. */ /* function Grunion_Contact_Form_Plugin::register_personal_data_exporter() – Registers the personal data exporter. */ /* function Grunion_Contact_Form_Plugin::register_personal_data_eraser() – Registers the personal data eraser. */ /* function Grunion_Contact_Form_Plugin::personal_data_exporter() – Exports personal data. */ /* function Grunion_Contact_Form_Plugin::_internal_personal_data_exporter() – Internal method for exporting personal data. */ /* function Grunion_Contact_Form_Plugin::personal_data_eraser() – Erases personal data. */ /* function Grunion_Contact_Form_Plugin::_internal_personal_data_eraser() – Internal method for erasing personal data. */ /* function Grunion_Contact_Form_Plugin::personal_data_post_ids_by_email() – Queries personal data by email address. */ /* function Grunion_Contact_Form_Plugin::personal_data_search_filter() – Filters searches by email address. */ /* function Grunion_Contact_Form_Plugin::get_export_data_for_posts() – Prepares feedback post data for CSV export. */ /* function Grunion_Contact_Form_Plugin::download_feedback_as_csv() – download as a csv a contact form or all of them in a csv file */ /* function Grunion_Contact_Form_Plugin::esc_csv() – Escape a string to be used in a CSV context */ /* function Grunion_Contact_Form_Plugin::get_feedbacks_as_options() – Returns a string of HTML <option> items from an array of posts */ /* function Grunion_Contact_Form_Plugin::get_field_names() – Get the names of all the form’s fields */ /* function Grunion_Contact_Form_Plugin::parse_fields_from_content() – */ /* function Grunion_Contact_Form_Plugin::make_csv_row_from_feedback() – Creates a valid csv row from a post id */ /* function Grunion_Contact_Form_Plugin::get_ip_address() – */ /* class Crunion_Contact_Form_Shortcode */ /* function Crunion_Contact_Form_Shortcode::__construct() – */ /* function Crunion_Contact_Form_Shortcode::parse_content() – Processes the shortcode’s inner content for "child" shortcodes */ /* function Crunion_Contact_Form_Shortcode::get_attribute() – Returns the value of the requested attribute. */ /* function Crunion_Contact_Form_Shortcode::esc_attr() – */ /* function Crunion_Contact_Form_Shortcode::unesc_attr() – */ /* function Crunion_Contact_Form_Shortcode::__toString() – Generates the shortcode */ /* class Grunion_Contact_Form */ /* function Grunion_Contact_Form::__construct() – */ /* function Grunion_Contact_Form::store_shortcode() – Store shortcode content for recall later – used to receate shortcode when user uses do_shortcode */ /* function Grunion_Contact_Form::style() – Toggle for printing the grunion.css stylesheet */ /* function Grunion_Contact_Form::_style_on() – Turn on printing of grunion.css stylesheet */ /* function Grunion_Contact_Form::parse() – The contact-form shortcode processor */ /* function Grunion_Contact_Form::success_message() – Returns a success message to be returned if the form is sent via AJAX. */ /* function Grunion_Contact_Form::get_compiled_form() – Returns a compiled form with labels and values in a form of an array of lines. */ /* function Grunion_Contact_Form::escape_and_sanitize_field_value() – Only get data for the compiled form if `$extra_fields` is a valid and non-empty array. */