@@ -284,7 +284,10 @@ function help_metabox_details( $post ) {
284284 <div class="awesome-meta-admin">
285285 Email field is added automatically, no need to include that.<br /><br />
286286 To make an input field compulsory add <code> required="required" </code> to the shortcode <br /><br />
287- It should look like this <code> [text name="Full Name" required="required" ]</code>
287+ It should look like this <code> [text name="Full Name" required="required" ]</code><br /><br />
288+
289+ <b style="color:red;">Warning:</b> Using the file input field may cause data overload on your server.
290+ Be sure you have enough server space before using it. You also have the ability to set file upload limits.
288291
289292 </div>
290293
@@ -311,9 +314,11 @@ function wpt_form_data() {
311314 $ successmsg = get_post_meta ($ post ->ID , '_successmsg ' , true );
312315 $ txncharge = get_post_meta ($ post ->ID , '_txncharge ' , true );
313316 $ loggedin = get_post_meta ($ post ->ID , '_loggedin ' , true );
314- $ currency = get_post_meta ($ post ->ID , '_currency ' , true );
317+ $ currency = get_post_meta ($ post ->ID , '_currency ' , true );
318+ $ filelimit = get_post_meta ($ post ->ID , '_filelimit ' , true );
315319
316320 if ($ amount == "" ) {$ amount = 0 ;}
321+ if ($ filelimit == "" ) {$ filelimit = 2 ;}
317322 if ($ paybtn == "" ) {$ paybtn = 'Pay ' ;}
318323 if ($ successmsg == "" ) {$ successmsg = 'Thank you for paying! ' ;}
319324 if ($ currency == "" ) {$ currency = 'NGN ' ;}
@@ -337,6 +342,8 @@ function wpt_form_data() {
337342 </select> ' ;
338343 echo '<p>Success Message after Payment</p> ' ;
339344 echo '<textarea rows="3" name="_successmsg" class="widefat" > ' .$ successmsg .'</textarea> ' ;
345+ echo '<p>File Upload Limit(MB):</p> ' ;
346+ echo '<input ttype="number" name="_filelimit" value=" ' . $ filelimit . '" class="widefat pf-number" /> ' ;
340347
341348 }
342349
@@ -355,16 +362,17 @@ function wpt_form_data_meta($post_id, $post) {
355362 // OK, we're authenticated: we need to find and save the data
356363 // We'll put it into an array to make it easier to loop though.
357364
358- $ events_meta ['_amount ' ] = $ _POST ['_amount ' ];
359- $ events_meta ['_paybtn ' ] = $ _POST ['_paybtn ' ];
360- $ events_meta ['_currency ' ] = $ _POST ['_currency ' ];
361- $ events_meta ['_successmsg ' ] = $ _POST ['_successmsg ' ];
362- $ events_meta ['_txncharge ' ] = $ _POST ['_txncharge ' ];
363- $ events_meta ['_loggedin ' ] = $ _POST ['_loggedin ' ];
365+ $ $ form_meta ['_amount ' ] = $ _POST ['_amount ' ];
366+ $ $ form_meta ['_paybtn ' ] = $ _POST ['_paybtn ' ];
367+ $ $ form_meta ['_currency ' ] = $ _POST ['_currency ' ];
368+ $ $ form_meta ['_successmsg ' ] = $ _POST ['_successmsg ' ];
369+ $ $ form_meta ['_txncharge ' ] = $ _POST ['_txncharge ' ];
370+ $ $ form_meta ['_loggedin ' ] = $ _POST ['_loggedin ' ];
371+ $ $ form_meta ['_filelimit ' ] = $ _POST ['_filelimit ' ];
364372
365- // Add values of $events_meta as custom fields
373+ // Add values of $$form_meta as custom fields
366374
367- foreach ($ events_meta as $ key => $ value ) { // Cycle through the $events_meta array!
375+ foreach ($ $ form_meta as $ key => $ value ) { // Cycle through the $$form_meta array!
368376 if ( $ post ->post_type == 'revision ' ) return ; // Don't store custom data twice
369377 $ value = implode (', ' , (array )$ value ); // If $value is an array, make it a CSV (unlikely)
370378 if (get_post_meta ($ post ->ID , $ key , FALSE )) { // If the custom field already has a value
0 commit comments