Completed
Push — master ( 2f95aa...1df65a )
by Evan
05:36
created

helpers.php ➔ yikes_get_form_data()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 6
ccs 0
cts 3
cp 0
crap 6
rs 9.4285
1
<?php 
2
/*
3
*	All helper functions that users can use to access or alter data
4
*	@since 6.0.3.4
5
*/
6
7
/*
8
*	Legacy support for our PHP Snippet
9
*	- this snippet existed in previous versions, and hes been preserved
10
*	  to maintain backwards compatibility. The form ID needs to be updated.
11
*	
12
*	@since 6.0.0
13
*/
14
function yksemeProcessSnippet( $list=false, $submit_text ) {
15
	$submit_text = ( isset( $submit_text ) ) ? 'submit="' . $submit_text . '"' : '';
16
	return do_shortcode( '[yikes-mailchimp form="' . $list . '" ' . $submit_text . ']' );
17
}
18
19
/*
20
*	Some Useful Helper Functions for our users
21
*	@since 6.0.3.4
22
*/
23
function yikes_get_form_data( $form_id ) {
24
	if( ! $form_id ) {
25
		return __( 'Whoops, you forgot to specify a form ID.', 'yikes-inc-easy-mailchimp-extender' );
26
	}
27
	return Yikes_Inc_Easy_Mailchimp_Extender_Public::yikes_retrieve_form_settings( $form_id );
28
}
29
30
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...