|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
// extract |
|
4
|
|
|
extract($args); |
|
5
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
// vars |
|
8
|
|
|
$active = $license ? true : false; |
|
9
|
|
|
$nonce = $active ? 'deactivate_pro_licence' : 'activate_pro_licence'; |
|
10
|
|
|
$input = $active ? 'password' : 'text'; |
|
11
|
|
|
$button = $active ? __('Deactivate License', 'acf') : __('Activate License', 'acf'); |
|
12
|
|
|
$readonly = $active ? 1 : 0; |
|
13
|
|
|
|
|
14
|
|
|
?> |
|
15
|
|
|
<div class="wrap acf-settings-wrap"> |
|
16
|
|
|
|
|
17
|
|
|
<h1><?php _e('Updates', 'acf'); ?></h1> |
|
18
|
|
|
|
|
19
|
|
|
<div class="acf-box"> |
|
20
|
|
|
<div class="title"> |
|
21
|
|
|
<h3><?php echo acf_get_setting('name'); ?> <?php _e('License','acf') ?></h3> |
|
22
|
|
|
</div> |
|
23
|
|
|
<div class="inner"> |
|
24
|
|
|
<p><?php _e("To unlock updates, please enter your license key below. If you don't have a licence key, please see",'acf'); ?> <a href="http://www.advancedcustomfields.com/pro" target="_blank"><?php _e('details & pricing', 'acf'); ?></a></p> |
|
25
|
|
|
<form action="" method="post"> |
|
26
|
|
|
<div class="acf-hidden"> |
|
27
|
|
|
<input type="hidden" name="_acfnonce" value="<?php echo wp_create_nonce( $nonce ); ?>" /> |
|
28
|
|
|
</div> |
|
29
|
|
|
<table class="form-table"> |
|
30
|
|
|
<tbody> |
|
31
|
|
|
<tr> |
|
32
|
|
|
<th> |
|
33
|
|
|
<label for="acf-field-acf_pro_licence"><?php _e('License Key', 'acf'); ?></label> |
|
34
|
|
|
</th> |
|
35
|
|
|
<td> |
|
36
|
|
|
<?php |
|
37
|
|
|
|
|
38
|
|
|
// render field |
|
39
|
|
|
acf_render_field(array( |
|
|
|
|
|
|
40
|
|
|
'type' => $input, |
|
41
|
|
|
'name' => 'acf_pro_licence', |
|
42
|
|
|
'value' => str_repeat('*', strlen($license)), |
|
43
|
|
|
'readonly' => $readonly |
|
44
|
|
|
)); |
|
45
|
|
|
|
|
46
|
|
|
?> |
|
47
|
|
|
</td> |
|
48
|
|
|
</tr> |
|
49
|
|
|
<tr> |
|
50
|
|
|
<th></th> |
|
51
|
|
|
<td> |
|
52
|
|
|
<input type="submit" value="<?php echo $button; ?>" class="acf-button blue"> |
|
53
|
|
|
</td> |
|
54
|
|
|
</tr> |
|
55
|
|
|
</tbody> |
|
56
|
|
|
</table> |
|
57
|
|
|
</form> |
|
58
|
|
|
|
|
59
|
|
|
</div> |
|
60
|
|
|
|
|
61
|
|
|
</div> |
|
62
|
|
|
|
|
63
|
|
|
<div class="acf-box"> |
|
64
|
|
|
<div class="title"> |
|
65
|
|
|
<h3><?php _e('Update Information', 'acf'); ?></h3> |
|
66
|
|
|
</div> |
|
67
|
|
|
<div class="inner"> |
|
68
|
|
|
<table class="form-table"> |
|
69
|
|
|
<tbody> |
|
70
|
|
|
<tr> |
|
71
|
|
|
<th> |
|
72
|
|
|
<label><?php _e('Current Version', 'acf'); ?></label> |
|
73
|
|
|
</th> |
|
74
|
|
|
<td> |
|
75
|
|
|
<?php echo $current_version; ?> |
|
76
|
|
|
</td> |
|
77
|
|
|
</tr> |
|
78
|
|
|
<tr> |
|
79
|
|
|
<th> |
|
80
|
|
|
<label><?php _e('Latest Version', 'acf'); ?></label> |
|
81
|
|
|
</th> |
|
82
|
|
|
<td> |
|
83
|
|
|
<?php echo $remote_version; ?> |
|
84
|
|
|
</td> |
|
85
|
|
|
</tr> |
|
86
|
|
|
<tr> |
|
87
|
|
|
<th> |
|
88
|
|
|
<label><?php _e('Update Available', 'acf'); ?></label> |
|
89
|
|
|
</th> |
|
90
|
|
|
<td> |
|
91
|
|
|
<?php if( $update_available ): ?> |
|
92
|
|
|
|
|
93
|
|
|
<span style="margin-right: 5px;"><?php _e('Yes', 'acf'); ?></span> |
|
94
|
|
|
|
|
95
|
|
|
<?php if( $active ): ?> |
|
96
|
|
|
<a class="acf-button blue" href="<?php echo admin_url('plugins.php?s=Advanced+Custom+Fields+Pro'); ?>"><?php _e('Update Plugin', 'acf'); ?></a> |
|
97
|
|
|
<?php else: ?> |
|
98
|
|
|
<a class="acf-button" disabled="disabled" href="#"><?php _e('Please enter your license key above to unlock updates', 'acf'); ?></a> |
|
99
|
|
|
<?php endif; ?> |
|
100
|
|
|
|
|
101
|
|
|
<?php else: ?> |
|
102
|
|
|
|
|
103
|
|
|
<span style="margin-right: 5px;"><?php _e('No', 'acf'); ?></span> |
|
104
|
|
|
<a class="acf-button" href="<?php echo add_query_arg('force-check', 1); ?>"><?php _e('Check Again', 'acf'); ?></a> |
|
105
|
|
|
<?php endif; ?> |
|
106
|
|
|
</td> |
|
107
|
|
|
</tr> |
|
108
|
|
|
<?php if( $changelog ): ?> |
|
109
|
|
|
<tr> |
|
110
|
|
|
<th> |
|
111
|
|
|
<label><?php _e('Changelog', 'acf'); ?></label> |
|
112
|
|
|
</th> |
|
113
|
|
|
<td> |
|
114
|
|
|
<?php echo $changelog; ?> |
|
115
|
|
|
</td> |
|
116
|
|
|
</tr> |
|
117
|
|
|
<?php endif; ?> |
|
118
|
|
|
<?php if( $upgrade_notice ): ?> |
|
119
|
|
|
<tr> |
|
120
|
|
|
<th> |
|
121
|
|
|
<label><?php _e('Upgrade Notice', 'acf'); ?></label> |
|
122
|
|
|
</th> |
|
123
|
|
|
<td> |
|
124
|
|
|
<?php echo $upgrade_notice; ?> |
|
125
|
|
|
</td> |
|
126
|
|
|
</tr> |
|
127
|
|
|
<?php endif; ?> |
|
128
|
|
|
</tbody> |
|
129
|
|
|
</table> |
|
130
|
|
|
</form> |
|
131
|
|
|
|
|
132
|
|
|
</div> |
|
133
|
|
|
|
|
134
|
|
|
|
|
135
|
|
|
</div> |
|
136
|
|
|
|
|
137
|
|
|
</div> |
|
138
|
|
|
<style type="text/css"> |
|
139
|
|
|
#acf_pro_licence { |
|
140
|
|
|
width: 75%; |
|
141
|
|
|
} |
|
142
|
|
|
</style> |
|
143
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: