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/advanced.../admin/views/conditio...
File: display-conditions-list.php
<table id="<?php echo esc_attr( $list_target ); ?>" class="advads-conditions-table">
[0] Fix | Delete
<tbody>
[1] Fix | Delete
<?php
[2] Fix | Delete
$last_index = - 1;
[3] Fix | Delete
$i = 0;
[4] Fix | Delete
if ( is_array( $set_conditions ) ) :
[5] Fix | Delete
foreach ( $set_conditions as $_index => $_options ) :
[6] Fix | Delete
$show_or_force_warning = false;
[7] Fix | Delete
$show_is_not_or_warning = false;
[8] Fix | Delete
// get type attribute from previous option format.
[9] Fix | Delete
$_options['type'] = isset( $_options['type'] ) ? $_options['type'] : $_index;
[10] Fix | Delete
$connector = ( ! isset( $_options['connector'] ) || 'or' !== $_options['connector'] ) ? 'and' : 'or';
[11] Fix | Delete
$operator = ! isset( $_options['operator'] ) || $_options['operator'] !== 'is_not' ? 'is' : 'is_not';
[12] Fix | Delete
if ( isset( $_options['type'] ) && isset( $conditions[ $_options['type'] ]['metabox'] ) ) {
[13] Fix | Delete
$metabox = $conditions[ $_options['type'] ]['metabox'];
[14] Fix | Delete
} else {
[15] Fix | Delete
continue;
[16] Fix | Delete
}
[17] Fix | Delete
if ( method_exists( $metabox[0], $metabox[1] ) ) {
[18] Fix | Delete
/**
[19] Fix | Delete
* Show warning for connector when
[20] Fix | Delete
* not set to OR already
[21] Fix | Delete
* this condition and the previous are on page level and not from the identical type
[22] Fix | Delete
* they are both set to SHOW
[23] Fix | Delete
*/
[24] Fix | Delete
$tax = ( isset( $_options['type'] ) && isset( $conditions[ $_options['type'] ]['taxonomy'] ) ) ? $conditions[ $_options['type'] ]['taxonomy'] : false;
[25] Fix | Delete
$last_tax = ( isset( $set_conditions[ $last_index ]['type'] ) && isset( $conditions[ $set_conditions[ $last_index ]['type'] ]['taxonomy'] ) ) ? $conditions[ $set_conditions[ $last_index ]['type'] ]['taxonomy'] : false;
[26] Fix | Delete
if (
[27] Fix | Delete
$tax && $last_tax && $last_tax === $tax
[28] Fix | Delete
&& ( ! isset( $_options['connector'] ) || 'or' !== $_options['connector'] )
[29] Fix | Delete
&& 'is' === $operator && 'is' === $set_conditions[ $last_index ]['operator']
[30] Fix | Delete
&& $_options['type'] !== $set_conditions[ $last_index ]['type']
[31] Fix | Delete
) {
[32] Fix | Delete
$show_or_force_warning = true;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
if (
[36] Fix | Delete
$operator === 'is_not'
[37] Fix | Delete
&& $connector === 'or'
[38] Fix | Delete
&& isset( $set_conditions[ $last_index ]['operator'] )
[39] Fix | Delete
&& $set_conditions[ $last_index ]['operator'] === 'is_not'
[40] Fix | Delete
) {
[41] Fix | Delete
$show_is_not_or_warning = true;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
if ( $i > 0 ) :
[45] Fix | Delete
[46] Fix | Delete
?>
[47] Fix | Delete
<tr class="advads-conditions-connector advads-conditions-connector-<?php echo esc_attr( $connector ); ?>">
[48] Fix | Delete
<td colspan="3">
[49] Fix | Delete
<?php
[50] Fix | Delete
echo Advanced_Ads_Display_Conditions::render_connector_option( $i, $connector, $form_name );
[51] Fix | Delete
if ( $show_or_force_warning || $show_is_not_or_warning ) {
[52] Fix | Delete
?>
[53] Fix | Delete
<p class="advads-notice-inline advads-error" style="display: block;">
[54] Fix | Delete
<?php
[55] Fix | Delete
if ( $show_or_force_warning ) {
[56] Fix | Delete
esc_attr_e( 'Forced to OR.', 'advanced-ads' );
[57] Fix | Delete
echo '&nbsp;<a target="_blank" href="https://wpadvancedads.com/manual/display-conditions#manual-combining-multiple-conditions">' . esc_attr__( 'manual', 'advanced-ads' ) . '</a>';
[58] Fix | Delete
} else {
[59] Fix | Delete
esc_attr_e( 'The ad might always show due to OR and "is not". Better use AND.', 'advanced-ads' );
[60] Fix | Delete
echo '&nbsp;<a target="_blank" href="https://wpadvancedads.com/manual/display-conditions/#Combining_conditions_with_AND_and_OR">' . esc_attr__( 'manual', 'advanced-ads' ) . '</a>';
[61] Fix | Delete
}
[62] Fix | Delete
?>
[63] Fix | Delete
</p>
[64] Fix | Delete
<?php
[65] Fix | Delete
[66] Fix | Delete
}
[67] Fix | Delete
?>
[68] Fix | Delete
</td>
[69] Fix | Delete
</tr><?php endif; ?>
[70] Fix | Delete
<tr>
[71] Fix | Delete
<td class="advads-conditions-type"
[72] Fix | Delete
data-condition-type="<?php echo esc_attr( $_options['type'] ); ?>"><?php echo esc_html( $conditions[ $_options['type'] ]['label'] ); ?></td>
[73] Fix | Delete
<td>
[74] Fix | Delete
<?php
[75] Fix | Delete
call_user_func( [ $metabox[0], $metabox[1] ], $_options, $i ++, $form_name );
[76] Fix | Delete
?>
[77] Fix | Delete
</td>
[78] Fix | Delete
<td>
[79] Fix | Delete
<button type="button" class="advads-conditions-remove button">x</button>
[80] Fix | Delete
</td>
[81] Fix | Delete
</tr>
[82] Fix | Delete
<?php
[83] Fix | Delete
}
[84] Fix | Delete
$last_index = $_index;
[85] Fix | Delete
endforeach;
[86] Fix | Delete
endif;
[87] Fix | Delete
?>
[88] Fix | Delete
</tbody>
[89] Fix | Delete
</table>
[90] Fix | Delete
[91] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function