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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../src/Admin/Payments/Views
File: Single.php
[500] Fix | Delete
$allowed_intervals = ValueValidator::get_allowed_subscription_intervals();
[501] Fix | Delete
[502] Fix | Delete
if ( isset( $this->subscription_meta['subscription_period']->value, $allowed_intervals[ $this->subscription_meta['subscription_period']->value ] ) ) {
[503] Fix | Delete
$amount = wpforms_format_amount( wpforms_sanitize_amount( $this->payment->total_amount, $this->payment->currency ), true, $this->payment->currency );
[504] Fix | Delete
$interval = $allowed_intervals[ $this->subscription_meta['subscription_period']->value ];
[505] Fix | Delete
[506] Fix | Delete
return "{$amount} / {$interval}";
[507] Fix | Delete
}
[508] Fix | Delete
[509] Fix | Delete
return Helpers::get_placeholder_na_text( false );
[510] Fix | Delete
}
[511] Fix | Delete
[512] Fix | Delete
/**
[513] Fix | Delete
* Get Subscription lifetime total.
[514] Fix | Delete
*
[515] Fix | Delete
* @since 1.8.4
[516] Fix | Delete
*
[517] Fix | Delete
* @return string
[518] Fix | Delete
*/
[519] Fix | Delete
private function get_subscription_lifetime_total() {
[520] Fix | Delete
[521] Fix | Delete
return wpforms_format_amount( (float) $this->subscription->total_amount + array_sum( array_column( $this->renewals, 'total_amount' ) ), true, $this->payment->currency );
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
/**
[525] Fix | Delete
* Get Subscription times billed.
[526] Fix | Delete
*
[527] Fix | Delete
* @since 1.8.4
[528] Fix | Delete
*
[529] Fix | Delete
* @return int|string
[530] Fix | Delete
*/
[531] Fix | Delete
private function get_subscription_times_billed() {
[532] Fix | Delete
[533] Fix | Delete
// Display "N/A", in case no subscription ID is found.
[534] Fix | Delete
if ( empty( $this->payment->subscription_id ) ) {
[535] Fix | Delete
return Helpers::get_placeholder_na_text( false );
[536] Fix | Delete
}
[537] Fix | Delete
[538] Fix | Delete
// Add the initial subscription payment object to the renewal array.
[539] Fix | Delete
// The "+1" has to be added, because the initial subscription payment is not included in the renewals array.
[540] Fix | Delete
if ( ! empty( $this->subscription ) ) {
[541] Fix | Delete
$this->renewals[] = $this->subscription;
[542] Fix | Delete
}
[543] Fix | Delete
[544] Fix | Delete
return count( $this->renewals );
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
/**
[548] Fix | Delete
* Get Subscription renewal date.
[549] Fix | Delete
*
[550] Fix | Delete
* @since 1.8.2
[551] Fix | Delete
*
[552] Fix | Delete
* @return string
[553] Fix | Delete
*/
[554] Fix | Delete
private function get_renewal_date() {
[555] Fix | Delete
[556] Fix | Delete
if (
[557] Fix | Delete
$this->payment->subscription_status === 'cancelled'
[558] Fix | Delete
|| $this->is_renewal_of_cancelled_subscription()
[559] Fix | Delete
) {
[560] Fix | Delete
return Helpers::get_placeholder_na_text( false );
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
$converted_periods = [
[564] Fix | Delete
'daily' => '+1 day',
[565] Fix | Delete
'weekly' => '+1 week',
[566] Fix | Delete
'monthly' => '+1 month',
[567] Fix | Delete
'quarterly' => '+3 month',
[568] Fix | Delete
'semiyearly' => '+6 month',
[569] Fix | Delete
'yearly' => '+1 year',
[570] Fix | Delete
];
[571] Fix | Delete
[572] Fix | Delete
if ( ! isset( $this->subscription_meta['subscription_period']->value, $converted_periods[ $this->subscription_meta['subscription_period']->value ] ) ) {
[573] Fix | Delete
return '';
[574] Fix | Delete
}
[575] Fix | Delete
[576] Fix | Delete
return gmdate( 'M d, Y', strtotime( $this->payment->date_updated_gmt . $converted_periods[ $this->subscription_meta['subscription_period']->value ] ) );
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
/**
[580] Fix | Delete
* Is renewal of cancelled subscription.
[581] Fix | Delete
*
[582] Fix | Delete
* @since 1.8.4
[583] Fix | Delete
*
[584] Fix | Delete
* @return bool
[585] Fix | Delete
*/
[586] Fix | Delete
private function is_renewal_of_cancelled_subscription() {
[587] Fix | Delete
[588] Fix | Delete
return $this->payment->type === 'renewal'
[589] Fix | Delete
&& $this->subscription->subscription_status === 'cancelled';
[590] Fix | Delete
}
[591] Fix | Delete
[592] Fix | Delete
/**
[593] Fix | Delete
* Get payment type name.
[594] Fix | Delete
* i.e. One-time, Subscription, etc.
[595] Fix | Delete
*
[596] Fix | Delete
* @since 1.8.4
[597] Fix | Delete
*
[598] Fix | Delete
* @return string
[599] Fix | Delete
*/
[600] Fix | Delete
private function get_payment_type() {
[601] Fix | Delete
[602] Fix | Delete
if ( isset( $this->payment->type ) && ValueValidator::is_valid( $this->payment->type, 'type' ) ) {
[603] Fix | Delete
return ValueValidator::get_allowed_types()[ $this->payment->type ];
[604] Fix | Delete
}
[605] Fix | Delete
[606] Fix | Delete
return Helpers::get_placeholder_na_text( false );
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
/**
[610] Fix | Delete
* Get payment method type.
[611] Fix | Delete
*
[612] Fix | Delete
* @since 1.8.2
[613] Fix | Delete
*
[614] Fix | Delete
* @return string
[615] Fix | Delete
*/
[616] Fix | Delete
private function get_payment_method() {
[617] Fix | Delete
[618] Fix | Delete
$method = isset( $this->payment_meta['credit_card_method'] ) ? ucfirst( $this->payment_meta['credit_card_method']->value ) : '';
[619] Fix | Delete
[620] Fix | Delete
if ( $method ) {
[621] Fix | Delete
return $method;
[622] Fix | Delete
}
[623] Fix | Delete
[624] Fix | Delete
return isset( $this->payment_meta['method_type'] ) ? ucfirst( $this->payment_meta['method_type']->value ) : Helpers::get_placeholder_na_text( false );
[625] Fix | Delete
}
[626] Fix | Delete
[627] Fix | Delete
/**
[628] Fix | Delete
* Get payment method details.
[629] Fix | Delete
*
[630] Fix | Delete
* @since 1.8.2
[631] Fix | Delete
*
[632] Fix | Delete
* @return string
[633] Fix | Delete
*/
[634] Fix | Delete
private function get_payment_method_details() {
[635] Fix | Delete
[636] Fix | Delete
if (
[637] Fix | Delete
! isset( $this->payment_meta['method_type'] ) ||
[638] Fix | Delete
$this->payment_meta['method_type']->value !== 'card' ||
[639] Fix | Delete
empty( $this->payment_meta['credit_card_last4'] ) ||
[640] Fix | Delete
empty( $this->payment_meta['credit_card_expires'] )
[641] Fix | Delete
) {
[642] Fix | Delete
return '';
[643] Fix | Delete
}
[644] Fix | Delete
[645] Fix | Delete
$credit_card_last = 'xxxx xxxx xxxx ' . $this->payment_meta['credit_card_last4']->value;
[646] Fix | Delete
$expires_in = sprintf( /* translators: %s - credit card expiry date. */
[647] Fix | Delete
__( 'Expires %s', 'wpforms-lite' ),
[648] Fix | Delete
$this->payment_meta['credit_card_expires']->value
[649] Fix | Delete
);
[650] Fix | Delete
[651] Fix | Delete
$output = '<div>';
[652] Fix | Delete
[653] Fix | Delete
if ( ! empty( $this->payment_meta['credit_card_name'] ) ) {
[654] Fix | Delete
$output .= '<span>' . esc_html( $this->payment_meta['credit_card_name']->value ) . '</span></br>';
[655] Fix | Delete
}
[656] Fix | Delete
[657] Fix | Delete
$output .= '<span>' . esc_html( $credit_card_last ) . '</span></br>';
[658] Fix | Delete
$output .= '<span>' . esc_html( $expires_in ) . '</span>';
[659] Fix | Delete
$output .= '</div>';
[660] Fix | Delete
[661] Fix | Delete
return $output;
[662] Fix | Delete
}
[663] Fix | Delete
[664] Fix | Delete
/**
[665] Fix | Delete
* Get coupon info.
[666] Fix | Delete
*
[667] Fix | Delete
* @since 1.8.2.2
[668] Fix | Delete
*
[669] Fix | Delete
* @return string
[670] Fix | Delete
*/
[671] Fix | Delete
private function get_coupon_info() {
[672] Fix | Delete
[673] Fix | Delete
$coupon_info = ! empty( $this->payment_meta['coupon_info']->value ) ? $this->payment_meta['coupon_info']->value : '';
[674] Fix | Delete
[675] Fix | Delete
/**
[676] Fix | Delete
* Allow modifying coupon info.
[677] Fix | Delete
*
[678] Fix | Delete
* @since 1.8.2.2
[679] Fix | Delete
*
[680] Fix | Delete
* @param string $coupon_info Coupon info.
[681] Fix | Delete
* @param object $payment Payment object.
[682] Fix | Delete
* @param array $payment_meta Payment meta.
[683] Fix | Delete
*/
[684] Fix | Delete
return apply_filters( 'wpforms_admin_payments_views_single_get_coupon_info', $coupon_info, $this->payment, $this->payment_meta );
[685] Fix | Delete
}
[686] Fix | Delete
[687] Fix | Delete
/**
[688] Fix | Delete
* Get coupon value.
[689] Fix | Delete
*
[690] Fix | Delete
* @since 1.8.2.2
[691] Fix | Delete
*
[692] Fix | Delete
* @return string
[693] Fix | Delete
*/
[694] Fix | Delete
private function get_coupon_value() {
[695] Fix | Delete
[696] Fix | Delete
return ! empty( $this->payment_meta['coupon_value']->value ) ? sprintf( '-%s', $this->payment_meta['coupon_value']->value ) : '';
[697] Fix | Delete
}
[698] Fix | Delete
[699] Fix | Delete
/**
[700] Fix | Delete
* Education notice for lite users output.
[701] Fix | Delete
*
[702] Fix | Delete
* @since 1.8.2
[703] Fix | Delete
*/
[704] Fix | Delete
private function education_details() {
[705] Fix | Delete
[706] Fix | Delete
if ( in_array( wpforms_get_license_type(), [ 'pro', 'elite', 'agency', 'ultimate' ], true ) ) {
[707] Fix | Delete
return;
[708] Fix | Delete
}
[709] Fix | Delete
[710] Fix | Delete
$dismissed = get_user_meta( get_current_user_id(), 'wpforms_dismissed', true );
[711] Fix | Delete
[712] Fix | Delete
if ( ! empty( $dismissed['edu-single-payment'] ) ) {
[713] Fix | Delete
return;
[714] Fix | Delete
}
[715] Fix | Delete
[716] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[717] Fix | Delete
echo wpforms_render( 'education/admin/payments/single-page' );
[718] Fix | Delete
}
[719] Fix | Delete
[720] Fix | Delete
/**
[721] Fix | Delete
* Advanced details output.
[722] Fix | Delete
*
[723] Fix | Delete
* @since 1.8.2
[724] Fix | Delete
*/
[725] Fix | Delete
private function advanced_details() {
[726] Fix | Delete
[727] Fix | Delete
/**
[728] Fix | Delete
* Allow to modify a single payment page advanced details list.
[729] Fix | Delete
*
[730] Fix | Delete
* @since 1.8.2
[731] Fix | Delete
*
[732] Fix | Delete
* @param array $list Advanced details to show.
[733] Fix | Delete
* @param object $payment Payment object.
[734] Fix | Delete
*/
[735] Fix | Delete
$details_list = (array) apply_filters(
[736] Fix | Delete
'wpforms_admin_payments_views_single_advanced_details_list',
[737] Fix | Delete
[
[738] Fix | Delete
'transaction_id' => [
[739] Fix | Delete
'label' => __( 'Transaction ID', 'wpforms-lite' ),
[740] Fix | Delete
'link' => $this->get_gateway_transaction_link(),
[741] Fix | Delete
'value' => $this->payment->transaction_id,
[742] Fix | Delete
],
[743] Fix | Delete
'subscription_id' => [
[744] Fix | Delete
'label' => __( 'Subscription ID', 'wpforms-lite' ),
[745] Fix | Delete
'link' => $this->get_gateway_subscription_link(),
[746] Fix | Delete
'value' => $this->payment->subscription_id,
[747] Fix | Delete
],
[748] Fix | Delete
'customer_id' => [
[749] Fix | Delete
'label' => __( 'Customer ID', 'wpforms-lite' ),
[750] Fix | Delete
'link' => $this->get_gateway_customer_link(),
[751] Fix | Delete
'value' => $this->payment->customer_id,
[752] Fix | Delete
],
[753] Fix | Delete
'customer_ip' => [
[754] Fix | Delete
'label' => __( 'Customer IP Address', 'wpforms-lite' ),
[755] Fix | Delete
'value' => ! empty( $this->payment_meta['ip_address']->value ) ? $this->payment_meta['ip_address']->value : false,
[756] Fix | Delete
],
[757] Fix | Delete
'payment_method' => [
[758] Fix | Delete
'label' => __( 'Payment Method', 'wpforms-lite' ),
[759] Fix | Delete
'value' => $this->get_payment_method_details(),
[760] Fix | Delete
],
[761] Fix | Delete
'coupon_info' => [
[762] Fix | Delete
'label' => __( 'Coupon', 'wpforms-lite' ),
[763] Fix | Delete
'value' => $this->get_coupon_info(),
[764] Fix | Delete
],
[765] Fix | Delete
],
[766] Fix | Delete
$this->payment
[767] Fix | Delete
);
[768] Fix | Delete
[769] Fix | Delete
// Skip empty details.
[770] Fix | Delete
$details_list = array_filter(
[771] Fix | Delete
$details_list,
[772] Fix | Delete
static function ( $item ) {
[773] Fix | Delete
[774] Fix | Delete
return ! empty( $item['value'] );
[775] Fix | Delete
}
[776] Fix | Delete
);
[777] Fix | Delete
[778] Fix | Delete
// Return early if there are no details.
[779] Fix | Delete
if ( empty( $details_list ) ) {
[780] Fix | Delete
return;
[781] Fix | Delete
}
[782] Fix | Delete
[783] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[784] Fix | Delete
echo wpforms_render(
[785] Fix | Delete
'admin/payments/single/advanced-details',
[786] Fix | Delete
[
[787] Fix | Delete
'details_list' => $details_list,
[788] Fix | Delete
],
[789] Fix | Delete
true
[790] Fix | Delete
);
[791] Fix | Delete
}
[792] Fix | Delete
[793] Fix | Delete
/**
[794] Fix | Delete
* Entry details output.
[795] Fix | Delete
*
[796] Fix | Delete
* @since 1.8.2
[797] Fix | Delete
*/
[798] Fix | Delete
private function entry_details() { // phpcs:ignore WPForms.PHP.HooksMethod.InvalidPlaceForAddingHooks
[799] Fix | Delete
[800] Fix | Delete
$entry_id_title = '';
[801] Fix | Delete
$fields = '';
[802] Fix | Delete
$entry_status = '';
[803] Fix | Delete
[804] Fix | Delete
// Grab submitted values from the entry if it exists.
[805] Fix | Delete
if ( ! empty( $this->payment->entry_id ) && wpforms()->is_pro() ) {
[806] Fix | Delete
$entry = wpforms()->get( 'entry' )->get( $this->payment->entry_id );
[807] Fix | Delete
[808] Fix | Delete
if ( $entry ) {
[809] Fix | Delete
$fields = wpforms_decode( $entry->fields );
[810] Fix | Delete
$entry_id_title .= "#{$this->payment->entry_id}";
[811] Fix | Delete
$entry_status = $entry->status;
[812] Fix | Delete
}
[813] Fix | Delete
}
[814] Fix | Delete
[815] Fix | Delete
// Otherwise, grab submitted values from the payment meta if it exists.
[816] Fix | Delete
if ( empty( $fields ) && ! empty( $this->payment_meta['fields'] ) ) {
[817] Fix | Delete
$fields = wpforms_decode( $this->payment_meta['fields']->value );
[818] Fix | Delete
}
[819] Fix | Delete
[820] Fix | Delete
// Bail early if there are submitted values.
[821] Fix | Delete
if ( empty( $fields ) ) {
[822] Fix | Delete
return;
[823] Fix | Delete
}
[824] Fix | Delete
[825] Fix | Delete
/**
[826] Fix | Delete
* Allow modifying the form data before rendering the entry details.
[827] Fix | Delete
*
[828] Fix | Delete
* @since 1.8.9
[829] Fix | Delete
*
[830] Fix | Delete
* @param array $form_data Form data.
[831] Fix | Delete
* @param array $fields Entry fields.
[832] Fix | Delete
*/
[833] Fix | Delete
$form_data = apply_filters(
[834] Fix | Delete
'wpforms_admin_payments_views_single_form_data',
[835] Fix | Delete
wpforms()->get( 'form' )->get( $this->payment->form_id, [ 'content_only' => true ] ),
[836] Fix | Delete
$fields
[837] Fix | Delete
);
[838] Fix | Delete
[839] Fix | Delete
add_filter( 'wp_kses_allowed_html', [ $this, 'modify_allowed_tags_payment_field_value' ], 10, 2 );
[840] Fix | Delete
[841] Fix | Delete
/**
[842] Fix | Delete
* Allow modifying the entry fields before rendering the entry details.
[843] Fix | Delete
*
[844] Fix | Delete
* @since 1.8.9
[845] Fix | Delete
*
[846] Fix | Delete
* @param array $entry_fields Entry fields.
[847] Fix | Delete
* @param array $form_data Form data.
[848] Fix | Delete
*/
[849] Fix | Delete
$entry_fields = apply_filters(
[850] Fix | Delete
'wpforms_admin_payments_views_single_fields',
[851] Fix | Delete
$this->prepare_entry_fields( $fields, $form_data ),
[852] Fix | Delete
$form_data
[853] Fix | Delete
);
[854] Fix | Delete
[855] Fix | Delete
$entry_output = wpforms_render(
[856] Fix | Delete
'admin/payments/single/entry-details',
[857] Fix | Delete
[
[858] Fix | Delete
'entry_fields' => $entry_fields,
[859] Fix | Delete
'form_data' => $form_data,
[860] Fix | Delete
'entry_id_title' => $entry_id_title,
[861] Fix | Delete
'entry_id' => $this->payment->entry_id,
[862] Fix | Delete
'entry_status' => $entry_status,
[863] Fix | Delete
'entry_url' => add_query_arg(
[864] Fix | Delete
[
[865] Fix | Delete
'page' => 'wpforms-entries',
[866] Fix | Delete
'view' => 'details',
[867] Fix | Delete
'entry_id' => $this->payment->entry_id,
[868] Fix | Delete
],
[869] Fix | Delete
admin_url( 'admin.php' )
[870] Fix | Delete
),
[871] Fix | Delete
],
[872] Fix | Delete
true
[873] Fix | Delete
);
[874] Fix | Delete
[875] Fix | Delete
remove_filter( 'wp_kses_allowed_html', [ $this, 'modify_allowed_tags_payment_field_value' ] );
[876] Fix | Delete
[877] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[878] Fix | Delete
echo $entry_output;
[879] Fix | Delete
}
[880] Fix | Delete
[881] Fix | Delete
/**
[882] Fix | Delete
* Prepare entry fields.
[883] Fix | Delete
*
[884] Fix | Delete
* @since 1.8.2
[885] Fix | Delete
*
[886] Fix | Delete
* @param array $fields Entry fields.
[887] Fix | Delete
* @param array $form_data Form data.
[888] Fix | Delete
*
[889] Fix | Delete
* @return array
[890] Fix | Delete
*/
[891] Fix | Delete
private function prepare_entry_fields( $fields, $form_data ) { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded, Generic.Metrics.CyclomaticComplexity.TooHigh
[892] Fix | Delete
[893] Fix | Delete
if ( empty( $form_data['fields'] ) || empty( $fields ) ) {
[894] Fix | Delete
return [];
[895] Fix | Delete
}
[896] Fix | Delete
[897] Fix | Delete
$prepared_fields = [];
[898] Fix | Delete
[899] Fix | Delete
// Display the fields and their values.
[900] Fix | Delete
foreach ( $form_data['fields'] as $key => $field_data ) {
[901] Fix | Delete
[902] Fix | Delete
if ( empty( $field_data['type'] ) ) {
[903] Fix | Delete
continue;
[904] Fix | Delete
}
[905] Fix | Delete
[906] Fix | Delete
$field_type = $field_data['type'];
[907] Fix | Delete
[908] Fix | Delete
// Add repeater fields as is.
[909] Fix | Delete
if ( $field_type === 'repeater' && wpforms()->is_pro() ) {
[910] Fix | Delete
$prepared_fields[ $key ] = $field_data;
[911] Fix | Delete
[912] Fix | Delete
continue;
[913] Fix | Delete
}
[914] Fix | Delete
[915] Fix | Delete
$field = $fields[ $field_data['id'] ] ?? [];
[916] Fix | Delete
[917] Fix | Delete
if ( empty( $field ) ) {
[918] Fix | Delete
continue;
[919] Fix | Delete
}
[920] Fix | Delete
[921] Fix | Delete
// phpcs:disable WPForms.PHP.ValidateHooks.InvalidHookName
[922] Fix | Delete
/** This filter is documented in /src/Pro/Admin/Entries/Edit.php */
[923] Fix | Delete
if ( $this->payment->entry_id && ! (bool) apply_filters( "wpforms_pro_admin_entries_edit_is_field_displayable_{$field_type}", true, $field, $form_data ) ) {
[924] Fix | Delete
continue;
[925] Fix | Delete
}
[926] Fix | Delete
[927] Fix | Delete
$field_value = isset( $field['value'] ) ? $field['value'] : '';
[928] Fix | Delete
/** This filter is documented in src/SmartTags/SmartTag/FieldHtmlId.php.*/
[929] Fix | Delete
$prepared_fields[ $key ]['field_value'] = apply_filters( 'wpforms_html_field_value', wp_strip_all_tags( $field_value ), $field, $form_data, 'payment-single' );
[930] Fix | Delete
// phpcs:enable WPForms.PHP.ValidateHooks.InvalidHookName
[931] Fix | Delete
[932] Fix | Delete
$prepared_fields[ $key ]['field_class'] = sanitize_html_class( 'wpforms-field-' . $field_type );
[933] Fix | Delete
$prepared_fields[ $key ]['type'] = $field_type;
[934] Fix | Delete
$prepared_fields[ $key ]['id'] = $field_data['id'];
[935] Fix | Delete
$prepared_fields[ $key ]['field_name'] = ! empty( $field['name'] )
[936] Fix | Delete
? $field['name']
[937] Fix | Delete
: sprintf( /* translators: %d - field ID. */
[938] Fix | Delete
esc_html__( 'Field ID #%d', 'wpforms-lite' ),
[939] Fix | Delete
absint( $field['id'] )
[940] Fix | Delete
);
[941] Fix | Delete
[942] Fix | Delete
$is_empty_value = wpforms_is_empty_string( $field_value );
[943] Fix | Delete
$is_empty_quantity = isset( $field['quantity'] ) && ! $field['quantity'];
[944] Fix | Delete
[945] Fix | Delete
if ( $is_empty_value ) {
[946] Fix | Delete
$prepared_fields[ $key ]['field_value'] = esc_html__( 'Empty', 'wpforms-lite' );
[947] Fix | Delete
}
[948] Fix | Delete
[949] Fix | Delete
if ( $is_empty_value || $is_empty_quantity ) {
[950] Fix | Delete
$prepared_fields[ $key ]['field_class'] .= ' empty';
[951] Fix | Delete
}
[952] Fix | Delete
}
[953] Fix | Delete
[954] Fix | Delete
return $prepared_fields;
[955] Fix | Delete
}
[956] Fix | Delete
[957] Fix | Delete
/**
[958] Fix | Delete
* Allow additional tags for the wp_kses_post function.
[959] Fix | Delete
*
[960] Fix | Delete
* @since 1.8.2
[961] Fix | Delete
*
[962] Fix | Delete
* @param array $allowed_html List of allowed HTML.
[963] Fix | Delete
* @param string $context Context name.
[964] Fix | Delete
*
[965] Fix | Delete
* @return array
[966] Fix | Delete
*/
[967] Fix | Delete
public function modify_allowed_tags_payment_field_value( $allowed_html, $context ) {
[968] Fix | Delete
[969] Fix | Delete
if ( $context !== 'post' ) {
[970] Fix | Delete
return $allowed_html;
[971] Fix | Delete
}
[972] Fix | Delete
[973] Fix | Delete
$allowed_html['iframe'] = [
[974] Fix | Delete
'data-src' => [],
[975] Fix | Delete
'class' => [],
[976] Fix | Delete
];
[977] Fix | Delete
[978] Fix | Delete
return $allowed_html;
[979] Fix | Delete
}
[980] Fix | Delete
[981] Fix | Delete
/**
[982] Fix | Delete
* Details metabox output.
[983] Fix | Delete
*
[984] Fix | Delete
* @since 1.8.2
[985] Fix | Delete
*/
[986] Fix | Delete
private function details() {
[987] Fix | Delete
[988] Fix | Delete
$form_edit_link = $this->get_form_edit_link();
[989] Fix | Delete
$date = sprintf( /* translators: %1$s - date, %2$s - time when item was created, e.g. "Oct 22, 2022 at 11:11 am". */
[990] Fix | Delete
__( '%1$s at %2$s', 'wpforms-lite' ),
[991] Fix | Delete
wpforms_date_format( $this->payment->date_created_gmt, 'M j, Y', true ),
[992] Fix | Delete
wpforms_time_format( $this->payment->date_created_gmt, '', true )
[993] Fix | Delete
);
[994] Fix | Delete
[995] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[996] Fix | Delete
echo wpforms_render(
[997] Fix | Delete
'admin/payments/single/details',
[998] Fix | Delete
[
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function