Failed Conditions
Push — develop ( 859ffd...1f8c75 )
by Remco
06:53
created

views/transaction-form.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * MemberPress transaction form.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2021 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Extensions\MemberPress
9
 */
10
11
if ( ! isset( $memberpress_transaction_id ) ) {
12
	return;
13
}
14
15
?>
16
<tr valign="top">
17
	<th scope="row">
18
		<label for="trans_num"><?php esc_html_e( 'Pronamic Payment', 'pronamic_ideal' ); ?></label>
19
	</th>
20
	<td>
21
		<?php
22
23
		$query = new WP_Query(
24
			array(
25
				'post_type'   => 'pronamic_payment',
26
				'post_status' => 'any',
27
				'nopaging'    => true,
28
				'meta_query'  => array(
29
					array(
30
						'key'     => '_pronamic_payment_source',
31
						'compare' => '=',
32
						'value'   => 'memberpress',
33
					),
34
					array(
35
						'key'     => '_pronamic_payment_source_id',
36
						'compare' => '=',
37
						'value'   => $memberpress_transaction_id,
38
					),
39
				),
40
			)
41
		);
42
43
		if ( $query->have_posts() ) {
44
			echo '<ul>';
45
46
			while ( $query->have_posts() ) {
47
				$query->the_post();
48
49
				echo '<li>';
50
51
				printf(
52
					'<a href="%s">%s</a>',
53
					esc_attr( get_edit_post_link( get_post() ) ),
54
					esc_html( get_the_ID() )
0 ignored issues
show
It seems like get_the_ID() can also be of type false; however, parameter $text of esc_html() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

54
					esc_html( /** @scrutinizer ignore-type */ get_the_ID() )
Loading history...
55
				);
56
57
				echo '</li>';
58
			}
59
60
			echo '</ul>';
61
62
			wp_reset_postdata();
63
		}
64
65
		?>
66
	</td>
67
</tr>
68