Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/wpforms-.../includes/function...
File: checks.php
function wpforms_doing_scheduled_action(): bool {
[500] Fix | Delete
[501] Fix | Delete
return class_exists( Tasks::class ) && Tasks::is_executing();
[502] Fix | Delete
}
[503] Fix | Delete
[504] Fix | Delete
/**
[505] Fix | Delete
* Determines whether search functionality is enabled for Choices.js elements in the admin area.
[506] Fix | Delete
*
[507] Fix | Delete
* @since 1.8.3
[508] Fix | Delete
*
[509] Fix | Delete
* @param array $data Data to be displayed in the dropdown.
[510] Fix | Delete
*
[511] Fix | Delete
* @return string
[512] Fix | Delete
*/
[513] Fix | Delete
function wpforms_choices_js_is_search_enabled( $data ): string {
[514] Fix | Delete
[515] Fix | Delete
/**
[516] Fix | Delete
* Filter max number of items at which no search box is displayed.
[517] Fix | Delete
*
[518] Fix | Delete
* @since 1.8.3
[519] Fix | Delete
*
[520] Fix | Delete
* @param int $count Max items count.
[521] Fix | Delete
*/
[522] Fix | Delete
return count( $data ) >= apply_filters( 'wpforms_choices_js_is_search_enabled_max_limit', 20 ) ? 'true' : 'false';
[523] Fix | Delete
}
[524] Fix | Delete
[525] Fix | Delete
/**
[526] Fix | Delete
* Check if a form is a template.
[527] Fix | Delete
*
[528] Fix | Delete
* @since 1.8.8
[529] Fix | Delete
*
[530] Fix | Delete
* @param int|WP_Post $form Form ID or object.
[531] Fix | Delete
*
[532] Fix | Delete
* @return bool True if the form is a template.
[533] Fix | Delete
*/
[534] Fix | Delete
function wpforms_is_form_template( $form ): bool {
[535] Fix | Delete
[536] Fix | Delete
$template_post_type = 'wpforms-template';
[537] Fix | Delete
[538] Fix | Delete
if ( $form instanceof WP_Post ) {
[539] Fix | Delete
return $form->post_type === $template_post_type;
[540] Fix | Delete
}
[541] Fix | Delete
[542] Fix | Delete
return $template_post_type === get_post_type( $form );
[543] Fix | Delete
}
[544] Fix | Delete
[545] Fix | Delete
/**
[546] Fix | Delete
* Checks if the current screen is using the block editor.
[547] Fix | Delete
*
[548] Fix | Delete
* @since 1.8.8
[549] Fix | Delete
*
[550] Fix | Delete
* @return bool True if the current screen is using the block editor, false otherwise.
[551] Fix | Delete
*/
[552] Fix | Delete
function wpforms_is_block_editor(): bool {
[553] Fix | Delete
[554] Fix | Delete
$screen = get_current_screen();
[555] Fix | Delete
[556] Fix | Delete
return $screen && method_exists( $screen, 'is_block_editor' ) && $screen->is_block_editor();
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
/**
[560] Fix | Delete
* Check for the editor page.
[561] Fix | Delete
*
[562] Fix | Delete
* @since 1.9.0
[563] Fix | Delete
*
[564] Fix | Delete
* @return bool True if the page is in the editor, false otherwise.
[565] Fix | Delete
*/
[566] Fix | Delete
function wpforms_is_editor_page(): bool {
[567] Fix | Delete
[568] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification
[569] Fix | Delete
$rest_request = defined( 'REST_REQUEST' ) && REST_REQUEST;
[570] Fix | Delete
$context = isset( $_REQUEST['context'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['context'] ) ) : '';
[571] Fix | Delete
$post_action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : '';
[572] Fix | Delete
$get_action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
[573] Fix | Delete
[574] Fix | Delete
$is_gutenberg = $rest_request && $context === 'edit';
[575] Fix | Delete
$is_elementor = $post_action === 'elementor_ajax' || $get_action === 'elementor';
[576] Fix | Delete
$is_divi = wpforms_is_divi_editor();
[577] Fix | Delete
// phpcs:enable WordPress.Security.NonceVerification
[578] Fix | Delete
[579] Fix | Delete
return $is_gutenberg || $is_elementor || $is_divi;
[580] Fix | Delete
}
[581] Fix | Delete
[582] Fix | Delete
/**
[583] Fix | Delete
* Determines whether the current context is the Divi editor.
[584] Fix | Delete
*
[585] Fix | Delete
* @since 1.9.4
[586] Fix | Delete
*
[587] Fix | Delete
* @return bool
[588] Fix | Delete
*/
[589] Fix | Delete
function wpforms_is_divi_editor(): bool {
[590] Fix | Delete
[591] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended
[592] Fix | Delete
return ! empty( $_GET['et_fb'] ) || ( isset( $_POST['action'] ) && sanitize_key( $_POST['action'] ) === 'wpforms_divi_preview' );
[593] Fix | Delete
}
[594] Fix | Delete
[595] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function