Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wpforms-.../template.../builder
File: templates-item.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Panel Setup (form templates).
[2] Fix | Delete
* Form templates list item template.
[3] Fix | Delete
*
[4] Fix | Delete
* @since 1.6.8
[5] Fix | Delete
* @since 1.8.4 Added subcategories attribute.
[6] Fix | Delete
* @since 1.8.6 Added fields attribute.
[7] Fix | Delete
* @since 1.8.8 Added edit button attributes.
[8] Fix | Delete
*
[9] Fix | Delete
* @var bool $selected Is template selected.
[10] Fix | Delete
* @var string $license_class License class (in the case of higher license needed).
[11] Fix | Delete
* @var string $categories Categories, coma separated.
[12] Fix | Delete
* @var string $subcategories Subcategories, comma separated.
[13] Fix | Delete
* @var string $fields Fields, comma separated.
[14] Fix | Delete
* @var string $badge_text Badge text.
[15] Fix | Delete
* @var string $demo_url Template demo URL.
[16] Fix | Delete
* @var string $template_id Template ID (Slug or ID if available).
[17] Fix | Delete
* @var string $education_class Education class (in the case of higher license needed).
[18] Fix | Delete
* @var string $education_attributes Education attributes.
[19] Fix | Delete
* @var string $addons_attributes Required addons attributes.
[20] Fix | Delete
* @var array $template Template data.
[21] Fix | Delete
* @var string $action_text Template action button text.
[22] Fix | Delete
* @var string $create_url User template creation URL.
[23] Fix | Delete
* @var string $edit_url User template edit URL.
[24] Fix | Delete
* @var string $edit_action_text User template edit button text.
[25] Fix | Delete
* @var string $badge_class Badge class in case if there is any badge text exists.
[26] Fix | Delete
* @var bool $can_create Capability to create forms.
[27] Fix | Delete
* @var bool $can_edit Capability to edit forms (more granular for template - own, others).
[28] Fix | Delete
* @var bool $can_delete Capability to delete forms (more granular for template - own, others).
[29] Fix | Delete
* @var bool $is_open Is user template currently open in the builder.
[30] Fix | Delete
* @var int $post_id Post ID.
[31] Fix | Delete
*/
[32] Fix | Delete
[33] Fix | Delete
use WPForms\Admin\Education\Helpers;
[34] Fix | Delete
[35] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[36] Fix | Delete
exit;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
$user_template_class = $template['source'] === 'wpforms-user-template' ? ' wpforms-user-template' : '';
[40] Fix | Delete
[41] Fix | Delete
?>
[42] Fix | Delete
<div class="wpforms-template<?php echo esc_attr( $user_template_class ); ?><?php echo esc_attr( $license_class ); ?><?php echo esc_attr( $badge_class ); ?>"
[43] Fix | Delete
id="wpforms-template-<?php echo sanitize_html_class( $template['slug'] ); ?>"
[44] Fix | Delete
<?php echo $template['source'] === 'wpforms-user-template' ? 'data-template-id="' . esc_attr( $post_id ) . '"' : ''; ?>>
[45] Fix | Delete
[46] Fix | Delete
<div class="wpforms-template-thumbnail">
[47] Fix | Delete
<?php if ( empty( $template['thumbnail'] ) ) { ?>
[48] Fix | Delete
<div class="wpforms-template-thumbnail-placeholder">
[49] Fix | Delete
<?php if ( $template['slug'] === 'blank' ) { ?>
[50] Fix | Delete
<img src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-file.svg' ); ?>" alt="Blank Form Template" loading="lazy" />
[51] Fix | Delete
<?php } elseif ( $template['source'] === 'wpforms-user-template' ) { ?>
[52] Fix | Delete
<img src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-user-template.svg' ); ?>" alt="User Form Template" loading="lazy" />
[53] Fix | Delete
<?php } else { ?>
[54] Fix | Delete
<img src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-wpforms.svg' ); ?>" alt="Customizable Form Template" loading="lazy" />
[55] Fix | Delete
<?php } ?>
[56] Fix | Delete
</div>
[57] Fix | Delete
<?php } else { ?>
[58] Fix | Delete
<img src="<?php echo esc_url( $template['thumbnail'] ); ?>" alt="<?php echo esc_attr( $template['name'] ); ?> Template" loading="lazy" />
[59] Fix | Delete
<?php } ?>
[60] Fix | Delete
</div>
[61] Fix | Delete
[62] Fix | Delete
<!-- As requirement for Lists.js library data attribute slug is used in classes list. -->
[63] Fix | Delete
<h3 class="wpforms-template-name categories has-access favorite slug subcategories fields"
[64] Fix | Delete
data-categories="<?php echo esc_attr( $categories ); ?>"
[65] Fix | Delete
data-subcategories="<?php echo esc_attr( $subcategories ); ?>"
[66] Fix | Delete
data-fields="<?php echo esc_attr( $fields ); ?>"
[67] Fix | Delete
data-has-access="<?php echo esc_attr( $template['has_access'] ); ?>"
[68] Fix | Delete
data-favorite="<?php echo esc_attr( $template['favorite'] ); ?>"
[69] Fix | Delete
data-slug="<?php echo esc_attr( $template['slug'] ); ?>"
[70] Fix | Delete
>
[71] Fix | Delete
<?php echo esc_html( $template['name'] ); ?>
[72] Fix | Delete
</h3>
[73] Fix | Delete
[74] Fix | Delete
<?php if ( $template['source'] === 'wpforms-user-template' && $can_delete ) : ?>
[75] Fix | Delete
<span class="wpforms-template-remove" data-template="<?php echo esc_attr( $post_id ); ?>">
[76] Fix | Delete
<i class="fa fa-trash-o" title="<?php esc_attr_e( 'Delete', 'wpforms-lite' ); ?>"></i>
[77] Fix | Delete
</span>
[78] Fix | Delete
<?php elseif ( $template['source'] !== 'wpforms-user-template' ) : ?>
[79] Fix | Delete
<span class="wpforms-template-favorite">
[80] Fix | Delete
<?php if ( $can_create ) : ?>
[81] Fix | Delete
<i class="fa fa-heart <?php echo $template['favorite'] ? '' : 'wpforms-hidden'; ?>" title="<?php esc_attr_e( 'Remove from Favorites', 'wpforms-lite' ); ?>"></i>
[82] Fix | Delete
<i class="fa fa-heart-o <?php echo $template['favorite'] ? 'wpforms-hidden' : ''; ?>" title="<?php esc_attr_e( 'Mark as Favorite', 'wpforms-lite' ); ?>"></i>
[83] Fix | Delete
<?php endif; ?>
[84] Fix | Delete
</span>
[85] Fix | Delete
<?php endif; ?>
[86] Fix | Delete
[87] Fix | Delete
<?php
[88] Fix | Delete
if ( ! empty( $badge_text ) && ! $selected ) {
[89] Fix | Delete
Helpers::print_badge( $badge_text, 'sm', 'corner', 'steel', 'rounded-bl' );
[90] Fix | Delete
}
[91] Fix | Delete
?>
[92] Fix | Delete
[93] Fix | Delete
<p class='wpforms-template-desc'>
[94] Fix | Delete
<?php echo esc_html( $template['description'] ); ?>
[95] Fix | Delete
</p>
[96] Fix | Delete
[97] Fix | Delete
<?php if ( $can_create ) : ?>
[98] Fix | Delete
<div class="wpforms-template-buttons">
[99] Fix | Delete
<a href="#" class="wpforms-template-select wpforms-btn wpforms-btn-md wpforms-btn-orange<?php echo esc_attr( $education_class ); ?>"
[100] Fix | Delete
data-template-name-raw="<?php echo esc_attr( $template['name'] ); ?>"
[101] Fix | Delete
data-template="<?php echo esc_attr( $template_id ); ?>"
[102] Fix | Delete
data-slug="<?php echo esc_attr( $template['slug'] ); ?>"
[103] Fix | Delete
data-create-url="<?php echo esc_url( $create_url ); ?>"
[104] Fix | Delete
<?php echo $education_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
[105] Fix | Delete
<?php echo $addons_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
[106] Fix | Delete
<?php echo esc_html( $action_text ); ?>
[107] Fix | Delete
</a>
[108] Fix | Delete
[109] Fix | Delete
<?php if ( $template['url'] !== '' ) : ?>
[110] Fix | Delete
<a class="wpforms-template-demo wpforms-btn wpforms-btn-md wpforms-btn-light-grey"
[111] Fix | Delete
href="<?php echo esc_url( $demo_url ); ?>"
[112] Fix | Delete
target="_blank" rel="noopener noreferrer">
[113] Fix | Delete
<?php esc_html_e( 'View Demo', 'wpforms-lite' ); ?>
[114] Fix | Delete
</a>
[115] Fix | Delete
<?php endif; ?>
[116] Fix | Delete
[117] Fix | Delete
<?php if ( ! empty( $edit_url ) && $can_edit ) : ?>
[118] Fix | Delete
<a class="wpforms-template-edit wpforms-btn wpforms-btn-md wpforms-btn-light-grey"
[119] Fix | Delete
href="<?php echo esc_url( $edit_url ); ?>">
[120] Fix | Delete
<?php echo esc_html( $edit_action_text ); ?>
[121] Fix | Delete
</a>
[122] Fix | Delete
<?php endif; ?>
[123] Fix | Delete
</div>
[124] Fix | Delete
<?php else : ?>
[125] Fix | Delete
<span class="wpforms-template-select" data-template="<?php echo esc_attr( $template_id ); ?>"></span>
[126] Fix | Delete
<?php endif; ?>
[127] Fix | Delete
[128] Fix | Delete
</div>
[129] Fix | Delete
[130] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function