Changeset 1522309
- Timestamp:
- 10/26/2016 09:39:03 AM (9 years ago)
- Location:
- wp-libre-form
- Files:
-
- 26 edited
- 1 copied
-
tags/1.1 (copied) (copied from wp-libre-form/trunk)
-
tags/1.1/assets/scripts/wplf-form.js (modified) (1 diff)
-
tags/1.1/classes/class-cpt-wplf-form.php (modified) (11 diffs)
-
tags/1.1/classes/class-cpt-wplf-submission.php (modified) (4 diffs)
-
tags/1.1/inc/wplf-ajax.php (modified) (3 diffs)
-
tags/1.1/inc/wplf-form-actions.php (modified) (2 diffs)
-
tags/1.1/lang/wp-libre-form-fi.mo (modified) (previous)
-
tags/1.1/lang/wp-libre-form-fi.po (modified) (7 diffs)
-
tags/1.1/lang/wp-libre-form-nb_NO.mo (modified) (previous)
-
tags/1.1/lang/wp-libre-form-nb_NO.po (modified) (5 diffs)
-
tags/1.1/lang/wp-libre-form.pot (modified) (5 diffs)
-
tags/1.1/readme.md (modified) (2 diffs)
-
tags/1.1/readme.txt (modified) (1 diff)
-
tags/1.1/wp-libre-form.php (modified) (3 diffs)
-
trunk/assets/scripts/wplf-form.js (modified) (1 diff)
-
trunk/classes/class-cpt-wplf-form.php (modified) (11 diffs)
-
trunk/classes/class-cpt-wplf-submission.php (modified) (4 diffs)
-
trunk/inc/wplf-ajax.php (modified) (3 diffs)
-
trunk/inc/wplf-form-actions.php (modified) (2 diffs)
-
trunk/lang/wp-libre-form-fi.mo (modified) (previous)
-
trunk/lang/wp-libre-form-fi.po (modified) (7 diffs)
-
trunk/lang/wp-libre-form-nb_NO.mo (modified) (previous)
-
trunk/lang/wp-libre-form-nb_NO.po (modified) (5 diffs)
-
trunk/lang/wp-libre-form.pot (modified) (5 diffs)
-
trunk/readme.md (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-libre-form.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-libre-form/tags/1.1/assets/scripts/wplf-form.js
r1359097 r1522309 3 3 */ 4 4 5 (function($) { 5 // Fetch polyfill: https://github.com/github/fetch 6 !function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return y.iterable&&(e[Symbol.iterator]=function(){return e}),e}function n(t){this.map={},t instanceof n?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function s(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function i(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function a(t){var e=new FileReader;return e.readAsArrayBuffer(t),i(e)}function h(t){var e=new FileReader;return e.readAsText(t),i(e)}function u(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(y.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(y.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(y.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(t){if(!y.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):y.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},y.blob?(this.blob=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(a)},this.text=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return h(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=s(this);return t?t:Promise.resolve(this._bodyText)},y.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(t){var e=t.toUpperCase();return b.indexOf(e)>-1?e:t}function d(t,e){e=e||{};var r=e.body;if(d.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new n(t.headers)),this.method=t.method,this.mode=t.mode,r||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",(e.headers||!this.headers)&&(this.headers=new n(e.headers)),this.method=f(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function c(t){var e=new n,r=(t.getAllResponseHeaders()||"").trim().split("\n");return r.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function l(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof n?e.headers:new n(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var y={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};n.prototype.append=function(t,o){t=e(t),o=r(o);var n=this.map[t];n||(n=[],this.map[t]=n),n.push(o)},n.prototype["delete"]=function(t){delete this.map[e(t)]},n.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},n.prototype.getAll=function(t){return this.map[e(t)]||[]},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(t,o){this.map[e(t)]=[r(o)]},n.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)},n.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},n.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},n.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},y.iterable&&(n.prototype[Symbol.iterator]=n.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},u.call(d.prototype),u.call(l.prototype),l.prototype.clone=function(){return new l(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},l.error=function(){var t=new l(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];l.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new l(null,{status:e,headers:{location:t}})},t.Headers=n,t.Request=d,t.Response=l,t.fetch=function(t,e){return new Promise(function(r,o){function n(){return"responseURL"in i?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):void 0}var s;s=d.prototype.isPrototypeOf(t)&&!e?t:new d(t,e);var i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:c(i),url:n()},e="response"in i?i.response:i.responseText;r(new l(e,t))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(s.method,s.url,!0),"include"===s.credentials&&(i.withCredentials=!0),"responseType"in i&&y.blob&&(i.responseType="blob"),s.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof s._bodyInit?null:s._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this); 6 7 7 $(document).ready(function() { 8 // Promise polyfill: https://github.com/taylorhakes/promise-polyfill 9 !function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function r(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void a(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?i:f)(e.promise,t._value);var o;try{o=n(t._value)}catch(r){return void f(e.promise,r)}i(e.promise,o)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof o)return t._state=3,t._value=e,void u(t);if("function"==typeof r)return void s(n(r,e),t)}t._state=1,t._value=e,u(t)}catch(i){f(t,i)}}function f(t,e){t._state=2,t._value=e,u(t)}function u(t){2===t._state&&0===t._deferreds.length&&a(function(){t._handled||d(t._value)});for(var e=0,n=t._deferreds.length;n>e;e++)r(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,i(e,t))},function(t){n||(n=!0,f(e,t))})}catch(o){if(n)return;n=!0,f(e,o)}}var l=setTimeout,a="function"==typeof setImmediate&&setImmediate||function(t){l(t,0)},d=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new c(t,n,o)),o},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){function o(i,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(t){o(i,t)},n)}e[i]=f,0===--r&&t(e)}catch(c){n(c)}}if(0===e.length)return t([]);for(var r=e.length,i=0;i<e.length;i++)o(i,e[i])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var o=0,r=t.length;r>o;o++)t[o].then(e,n)})},o._setImmediateFn=function(t){a=t},o._setUnhandledRejectionFn=function(t){d=t},"undefined"!=typeof module&&module.exports?module.exports=o:t.Promise||(t.Promise=o)}(this); 8 10 9 // ajax form submissions10 $('.libre-form').submit(function(e) {11 11 12 var $form = $(this); 12 (function(){ 13 13 14 // add class to enable css changes to indicate ajax loading 15 $form.addClass('sending'); 14 window.wplf = { 15 successCallbacks: [], 16 errorCallbacks: [] 17 }; 16 18 17 // reset errors 18 $form.find('.wplf-error').remove();19 document.addEventListener("DOMContentLoaded", function(){ 20 [].forEach.call(document.querySelectorAll(".libre-form"), function(form){ 19 21 20 // submit form to ajax handler in admin-ajax.php 21 $.post( ajax_object.ajax_url + '?action=wplf_submit', 22 $(this).serialize(), 23 function(response) { 24 console.log(response); 22 form.addEventListener("submit", function(e){ 23 24 // add class to enable css changes to indicate ajax loading 25 form.classList.add("sending"); 26 27 [].forEach.call(form.querySelectorAll(".wplf-error"), function(error){ 28 // reset errors 29 error.parentNode.removeChild(error); 30 }); 31 32 var data = new FormData(form); 33 34 window.data = data; 35 36 fetch(ajax_object.ajax_url + '?action=wplf_submit', { 37 method: "POST", 38 body: data 39 }).then(function(response){ 40 41 return response.text(); 42 43 }).then(function(response){ 44 45 response = JSON.parse(response); 46 25 47 if( 'success' in response ) { 26 48 // show success message if one exists 27 $form.after(response.success); 28 } 49 50 var success = document.createElement("p"); 51 success.className = "wplf-success"; 52 success.innerHTML = response.success; 53 54 form.parentNode.insertBefore(success, form.nextSibling); 55 } 56 29 57 if( 'ok' in response && response.ok ) { 30 58 // submit succesful! 31 $form.remove(); 59 form.parentNode.removeChild(form); 60 61 window.wplf.successCallbacks.forEach(function(func){ 62 func(response); 63 }); 32 64 } 65 33 66 if( 'error' in response ) { 34 67 // show error message in form 35 $form.append('<p class="wplf-error error">' + response.error + '</p>'); 68 69 var error = document.createElement("p"); 70 error.className = "wplf-error error"; 71 error.textContent = response.error; 72 73 form.appendChild(error); 74 75 window.wplf.errorCallbacks.forEach(function(func){ 76 func(response); 77 }); 36 78 } 37 }38 ).always(function() {39 // finished XHR request40 $form.removeClass('sending');41 });;42 79 43 // don't actually submit the form, causing a page reload 44 e.preventDefault(); 45 return false; 80 form.classList.remove('sending'); 81 82 }).catch(function(error){ 83 84 console.warn("Fetch error: ", error); 85 form.classList.remove("sending"); 86 87 }); 88 89 // don't actually submit the form, causing a page reload 90 91 e.preventDefault(); 92 }); 46 93 47 94 }); 48 95 }); 49 50 })(jQuery); 51 96 })(); -
wp-libre-form/tags/1.1/classes/class-cpt-wplf-form.php
r1450731 r1522309 24 24 25 25 // post.php / post-new.php view 26 add_filter( 'get_sample_permalink_html', array( $this, 'modify_permalink_html' ), 10, 2 ); 26 27 add_action( 'save_post', array( $this, 'save_cpt' ) ); 27 28 add_filter( 'content_save_pre' , array( $this, 'strip_form_tags' ), 10, 1 ); … … 30 31 31 32 // edit.php view 33 add_filter( 'post_row_actions', array( $this, 'remove_row_actions' ), 10, 2 ); 32 34 add_filter( 'manage_edit-wplf-form_columns' , array( $this, 'custom_columns_cpt' ), 100, 1 ); 33 35 add_action( 'manage_posts_custom_column' , array( $this, 'custom_columns_display_cpt' ), 10, 2 ); … … 38 40 // front end 39 41 add_shortcode( 'libre-form', array( $this, 'shortcode' ) ); 42 add_action( 'wp', array( $this, 'maybe_set_404_for_single_form' ) ); 40 43 add_filter( 'the_content', array( $this, 'use_shortcode_for_preview' ) ); 41 44 add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_frontend_script' ) ); … … 93 96 } 94 97 98 /** 99 * Modify post.php permalink html to show notice if form isn't publicly visible. 100 */ 101 function modify_permalink_html( $html, $post_id ) { 102 $publicly_visible = $this->get_publicly_visible_state( $post_id ); 103 104 if( get_post_type( $post_id ) === 'wplf-form' && !$publicly_visible ) { 105 $html .= '<span>' . __( 'Permalink is for preview purposes only.', 'wp-libre-form' ) . '</span>'; 106 } 107 108 return $html; 109 } 95 110 96 111 /** … … 165 180 } 166 181 182 /** 183 * Remove view action in edit.php for forms 184 */ 185 function remove_row_actions( $actions, $post ) { 186 $publicly_visible = $this->get_publicly_visible_state( $post->ID ); 187 188 if( $post->post_type === 'wplf-form' && !$publicly_visible ) 189 unset( $actions['view'] ); 190 191 return $actions; 192 } 167 193 168 194 /** … … 315 341 <label for="wplf_email_copy_enabled"> 316 342 <input type="checkbox" <?php echo $email_enabled ? 'checked="checked"' : ''; ?> id="wplf_email_copy_enabled" name="wplf_email_copy_enabled"> 317 <?php _e( 'Send an email copy when a form is submitted?' ); ?>343 <?php _e( 'Send an email copy when a form is submitted?', 'wp-libre-form' ); ?> 318 344 </label> 319 345 </p> … … 333 359 <p><?php _e('Submissions from this form will use this formatting in their title.', 'wp-libre-form'); ?></p> 334 360 <p><?php _e('You may use any field values enclosed in "%" markers.', 'wp-libre-form');?></p> 335 <p><input type="text" name="wplf_title_format" value="<?php echo esc_attr( $format ); ?>" placeholder="<?php echo esc_attr( $default ); ?>" class="code" style="width:100%"></p> 336 <?php 337 } 338 361 <p><input type="text" name="wplf_title_format" value="<?php echo esc_attr( $format ); ?>" placeholder="<?php echo esc_attr( $default ); ?>" class="code" style="width:100%" autocomplete="off"></p> 362 <?php 363 } 339 364 340 365 /** … … 385 410 // save email copy 386 411 if ( isset( $_POST['wplf_email_copy_to'] ) ) { 387 update_post_meta( $post_id, '_wplf_email_copy_to', sanitize_email( $_POST['wplf_email_copy_to'] ) ); 412 $emailField = $_POST['wplf_email_copy_to']; 413 $to = ''; 414 415 if( strpos( $emailField, "," ) > 0 ) { 416 // Intentional. Makes no sense if the first character is a comma, so pass it along as a single address. 417 // sanitize_email() should take care of the rest. 418 $emailArray = explode( ",", $emailField ); 419 foreach($emailArray as $email){ 420 $email = trim($email); 421 $email = sanitize_email( $email ) . ", "; 422 $to .= $email; 423 } 424 $to = rtrim( $to, ", " ); 425 } 426 else { 427 $to = sanitize_email( $emailField ); 428 } 429 430 if( !empty( $to ) ) { 431 update_post_meta( $post_id, '_wplf_email_copy_to', $to ); 432 } else { 433 delete_post_meta( $post_id, '_wplf_email_copy_to' ); 434 } 388 435 } 389 436 … … 423 470 $content = get_post( $id )->post_content; 424 471 } 472 473 $multipart = ""; 474 // check if form contains file inputs 475 if(strpos($content, "type='file'") > -1 || strpos($content, "type=\"file\"") > -1){ 476 $multipart = "enctype='multipart/form-data'"; 477 } 478 425 479 ob_start(); 426 480 ?> 427 <form class="libre-form libre-form-<?php echo $id . ' ' . $xclass; ?>"> 481 <form class="libre-form libre-form-<?php echo $id . ' ' . $xclass; ?>" <?php echo $multipart; ?>> 482 <?php if( is_singular( 'wplf-form' ) && current_user_can( 'edit_post', $id ) ) { 483 $publicly_visible = $this->get_publicly_visible_state( $id ); 484 if( !$publicly_visible ) { 485 ?> 486 <p style="background:#f5f5f5;border-left:4px solid #dc3232;padding:6px 12px;"> 487 <b style="color:#dc3232;"><?php _e( 'This form preview URL is not public and cannot be shared.', 'wp-libre-form' ) ?>.</b><br /> 488 <?php _e( 'Non-logged in visitors will see a 404 error page instead.', 'wp-libre-form' ) ?> 489 </p> 490 <?php 491 } 492 } ?> 428 493 <?php echo apply_filters( 'wplf_form', $content ); ?> 429 494 <input type="hidden" name="referrer" value="<?php the_permalink(); ?>"> 495 <input type="hidden" name="_referrer_id" value="<?php esc_attr_e( get_the_id() ) ?>"> 430 496 <input type="hidden" name="_form_id" value="<?php esc_attr_e( $id ); ?>"> 431 497 </form> … … 447 513 448 514 // register the script, but only enqueue it if the current post contains a form in it 449 wp_register_script( 'wplf-form-js', plugins_url( 'assets/scripts/wplf-form.js', dirname(__FILE__) ), array( 'jquery' ));515 wp_register_script( 'wplf-form-js', plugins_url( 'assets/scripts/wplf-form.js', dirname(__FILE__) ), array(), WPLF_VERSION, true ); 450 516 451 517 if( is_a( $post, 'WP_Post' ) && ( has_shortcode( $post->post_content, 'libre-form') || $post->post_type === 'wplf-form') ) { … … 480 546 return $content; 481 547 } 548 549 /** 550 * Set and show 404 page for visitors trying to see single form. 551 * And yes, it is a global $post. That's right. 552 */ 553 function maybe_set_404_for_single_form() { 554 global $post; 555 556 if( !is_singular( 'wplf-form' ) ) 557 return; 558 559 $publicly_visible = $this->get_publicly_visible_state( $post->ID ); 560 if( $publicly_visible ) 561 return; 562 563 if( !current_user_can( 'edit_post', $post->ID ) ) { 564 global $wp_query; 565 $wp_query->set_404(); 566 } 567 } 568 569 /** 570 * Wrapper function to check if form is publicly visible. 571 */ 572 function get_publicly_visible_state( $id ) { 573 return apply_filters( 'wplf-form-publicly-visible', false, $id ); 574 } 482 575 } 483 576 -
wp-libre-form/tags/1.1/classes/class-cpt-wplf-submission.php
r1359097 r1522309 107 107 global $pagenow; 108 108 109 if( 'edit.php' != $pagenow ) { 109 $allowed = array("wplf-submission"); // show filter on these post types (currently only one?) 110 $allowed = apply_filters("wplf-dropdown-filter", $allowed); 111 $post_type = get_query_var("post_type"); 112 113 if( 'edit.php' != $pagenow || !in_array($post_type, $allowed)) { 110 114 return; 111 115 } 112 116 113 // TODO: put this in a transient 114 $forms = get_posts( array( 115 'post_per_page' => '-1', 116 'post_type' => 'wplf-form', 117 ) ); 117 $transient = get_transient("wplf-form-filter"); 118 119 if($transient){ 120 $forms = $transient; 121 } 122 123 else{ 124 $forms = get_posts( array( 125 'post_per_page' => '-1', 126 'post_type' => 'wplf-form', 127 ) ); 128 129 set_transient("wplf-form-filter", $forms, 15 * MINUTE_IN_SECONDS); 130 } 131 118 132 ?> 119 133 <label for="filter-by-form" class="screen-reader-text">Filter by form</label> … … 171 185 $postmeta = get_post_meta( $post->ID ); 172 186 $fields = array_keys( $postmeta ); 187 $home_path = get_home_path(); 173 188 ?> 174 189 <p> … … 183 198 <?php foreach( $fields as $field ) : ?> 184 199 <?php if( '_' != $field[0] ) : ?> 185 <?php $value = $postmeta[ $field ][0]; ?> 200 <?php 201 $value = $postmeta[ $field ][0]; 202 $possible_link = ''; 203 $attachment_url = wp_get_attachment_url( $value ); // get_edit_post_link returns something awkward. 204 205 // Maybe add a filter for target="_blank"? Wouldn't enable by default. 206 207 if ( $attachment_url ) { 208 // If this is true, $value was a valid attachment_id. 209 // Caveat: if user enters a numeric value here, it could be interpreted as attachment. 210 $attachment_url = get_edit_post_link($value); 211 $possible_link = "<a href='$attachment_url' style='float: right;'>Edit attachment</a>"; 212 } elseif ( file_exists( $home_path . substr( $value, 1 ) ) ) { 213 // This is bit less ambiguous. Check if there's a file, and if there is, get link for it. 214 $attachment_url = get_home_url() . $value; 215 $possible_link = "<a href='$attachment_url' style='float: right;'>Open file</a>"; 216 } 217 ?> 186 218 <tr> 187 <th><strong><?php echo $field; ?></strong> </th>219 <th><strong><?php echo $field; ?></strong> <?php echo $possible_link; ?></th> 188 220 <?php if( strlen( $value ) > 60 || strpos( $value, "\n" ) ) : ?> 189 221 <td><textarea style="width:100%" readonly><?php echo esc_textarea( $value ); ?></textarea></td> … … 202 234 203 235 endif; 204 -
wp-libre-form/tags/1.1/inc/wplf-ajax.php
r1359097 r1522309 19 19 if( $return->ok ) { 20 20 // form existence has already been validated via filters 21 22 21 23 $form = get_post( intval( $_POST['_form_id'] ) ); 22 24 … … 53 55 } 54 56 57 // handle files 58 foreach( $_FILES as $key => $file) { 59 // Is this enough security wise? 60 // Currenly only supports 1 file per input 61 $attach_id = media_handle_upload( $key, 0, array(), array( "test_form" => false ) ); 62 add_post_meta( $post_id, $key, wp_get_attachment_url($attach_id) ); 63 add_post_meta( $post_id, $key . "_attachment", $attach_id ); 64 } 65 66 67 55 68 $return->submission_id = $post_id; 56 69 $return->submission_title = $post_title; 70 $return->form_id = $form->ID; 57 71 58 72 // return the success message for the form … … 69 83 wp_die(); 70 84 } 71 -
wp-libre-form/tags/1.1/inc/wplf-form-actions.php
r1365849 r1522309 19 19 $to = isset($form_meta['_wplf_email_copy_to']) ? $form_meta['_wplf_email_copy_to'][0] : get_option( 'admin_email' ); 20 20 $subject = wp_sprintf( __('New submission from %s', 'wp-libre-form'), $referrer ); 21 $content = wp_sprintf( __('Form "%s" (ID %d) was submitted with values below: ', 'wp-libre-form'), $form_title, $form_id ) . "\n\n"; 21 $content = wp_sprintf( __('Form "%s" (ID %d) was submitted with values below: ', 'wp-libre-form'), $form_title, $form_id ); 22 $content = apply_filters( 'wplf_email_copy_content_start', $content, $form_title, $form_id ). "\n\n"; 23 22 24 foreach( $_POST as $key => $value ) { 23 25 if( '_' === $key[0] ) { … … 26 28 $content .= esc_html( $key ) . ': ' . esc_html( print_r( $value, true ) ) . "\n"; 27 29 } 28 wp_mail( $to, $subject, $content ); 30 31 wp_mail( 32 apply_filters( 'wplf_email_copy_to', $to ), 33 apply_filters( 'wplf_email_copy_subject', $subject ), 34 apply_filters( 'wplf_email_copy_content', $content ), 35 apply_filters( 'wplf_email_copy_headers', '' ), 36 apply_filters( 'wplf_email_copy_attachments', array() ) 37 ); 29 38 } 30 39 } 31 -
wp-libre-form/tags/1.1/lang/wp-libre-form-fi.po
r1359097 r1522309 2 2 msgstr "" 3 3 "Project-Id-Version: WP Libre Form\n" 4 "POT-Creation-Date: 2016- 02-21 23:16+0100\n"5 "PO-Revision-Date: 2016- 02-21 23:16+0100\n"4 "POT-Creation-Date: 2016-10-26 10:29+0100\n" 5 "PO-Revision-Date: 2016-10-26 10:30+0100\n" 6 6 "Last-Translator: Antti Kuosmanen <antti@seravo.fi>\n" 7 7 "Language-Team: Antti Kuosmanen <antti@seravo.fi>\n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 1.8. 6\n"13 "X-Generator: Poedit 1.8.8\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-WPHeader: wp-libre-form.php\n" … … 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 22 23 #: classes/class-cpt-wplf-form.php:5 323 #: classes/class-cpt-wplf-form.php:56 24 24 msgctxt "post type general name" 25 25 msgid "Forms" 26 26 msgstr "Lomakkeet" 27 27 28 #: classes/class-cpt-wplf-form.php:5 428 #: classes/class-cpt-wplf-form.php:57 29 29 msgctxt "post type singular name" 30 30 msgid "Form" 31 31 msgstr "Lomake" 32 32 33 #: classes/class-cpt-wplf-form.php:5 533 #: classes/class-cpt-wplf-form.php:58 34 34 msgctxt "admin menu" 35 35 msgid "Forms" 36 36 msgstr "Lomakkeet" 37 37 38 #: classes/class-cpt-wplf-form.php:5 638 #: classes/class-cpt-wplf-form.php:59 39 39 msgctxt "add new on admin bar" 40 40 msgid "Form" 41 41 msgstr "Lomake" 42 42 43 #: classes/class-cpt-wplf-form.php: 5743 #: classes/class-cpt-wplf-form.php:60 44 44 msgctxt "form" 45 45 msgid "New Form" 46 46 msgstr "Uusi lomake" 47 47 48 #: classes/class-cpt-wplf-form.php: 5848 #: classes/class-cpt-wplf-form.php:61 49 49 msgid "Add New Form" 50 50 msgstr "Luo uusi lomake" 51 51 52 #: classes/class-cpt-wplf-form.php: 5952 #: classes/class-cpt-wplf-form.php:62 53 53 msgid "New Form" 54 54 msgstr "Uusi lomake" 55 55 56 #: classes/class-cpt-wplf-form.php:6 056 #: classes/class-cpt-wplf-form.php:63 57 57 msgid "Edit Form" 58 58 msgstr "Muokkaa lomaketta" 59 59 60 #: classes/class-cpt-wplf-form.php:6 160 #: classes/class-cpt-wplf-form.php:64 61 61 msgid "View Form" 62 62 msgstr "Näytä lomake" 63 63 64 #: classes/class-cpt-wplf-form.php:6 2 classes/class-cpt-wplf-submission.php:12164 #: classes/class-cpt-wplf-form.php:65 classes/class-cpt-wplf-submission.php:135 65 65 msgid "All Forms" 66 66 msgstr "Kaikki lomakkeet" 67 67 68 #: classes/class-cpt-wplf-form.php:6 368 #: classes/class-cpt-wplf-form.php:66 69 69 msgid "Search Forms" 70 70 msgstr "Etsi lomakkeita" 71 71 72 #: classes/class-cpt-wplf-form.php:6 472 #: classes/class-cpt-wplf-form.php:67 73 73 msgid "No forms found." 74 74 msgstr "Lomakkeita ei löytynt." 75 75 76 #: classes/class-cpt-wplf-form.php:6 576 #: classes/class-cpt-wplf-form.php:68 77 77 msgid "No forms found in Trash." 78 78 msgstr "Roskakorissa ei ole lomakkeita." 79 79 80 #: classes/class-cpt-wplf-form.php:148 80 #: classes/class-cpt-wplf-form.php:105 81 msgid "Permalink is for preview purposes only." 82 msgstr "Kestolinkki toimii vain esikatseluna." 83 84 #: classes/class-cpt-wplf-form.php:163 81 85 msgid "Please enter your name" 82 86 msgstr "Kirjoita nimesi" 83 87 84 #: classes/class-cpt-wplf-form.php:1 4988 #: classes/class-cpt-wplf-form.php:164 85 89 msgctxt "Default placeholder name" 86 90 msgid "John Doe" 87 91 msgstr "Matti Meikäläinen" 88 92 89 #: classes/class-cpt-wplf-form.php:1 5193 #: classes/class-cpt-wplf-form.php:166 90 94 msgid "Please enter your email address" 91 95 msgstr "Kirjoita sähköpostiosoitteesi" 92 96 93 #: classes/class-cpt-wplf-form.php:1 51 classes/class-cpt-wplf-form.php:15497 #: classes/class-cpt-wplf-form.php:166 classes/class-cpt-wplf-form.php:169 94 98 msgid "(required)" 95 99 msgstr "(pakollinen)" 96 100 97 #: classes/class-cpt-wplf-form.php:1 52101 #: classes/class-cpt-wplf-form.php:167 98 102 msgctxt "Default placeholder email" 99 103 msgid "example@email.com" 100 104 msgstr "esimerkki@esimerkki.fi" 101 105 102 #: classes/class-cpt-wplf-form.php:1 54106 #: classes/class-cpt-wplf-form.php:169 103 107 msgid "Write your message below" 104 108 msgstr "Kirjoita viestisi alle" 105 109 106 #: classes/class-cpt-wplf-form.php:1 55110 #: classes/class-cpt-wplf-form.php:170 107 111 msgctxt "Default placeholder message" 108 112 msgid "I wanted to ask about..." 109 113 msgstr "Halusin kysyä..." 110 114 111 #: classes/class-cpt-wplf-form.php:1 57115 #: classes/class-cpt-wplf-form.php:172 112 116 msgid "Submit" 113 117 msgstr "Lähetä" 114 118 115 #: classes/class-cpt-wplf-form.php:1 59119 #: classes/class-cpt-wplf-form.php:174 116 120 msgctxt "The HTML comment at the end of the example form" 117 121 msgid "Any valid HTML form can be used here!" 118 122 msgstr "Tässä toimii mikä tahansa HTML-lomake!" 119 123 120 #: classes/class-cpt-wplf-form.php: 175 classes/class-cpt-wplf-form.php:212124 #: classes/class-cpt-wplf-form.php:201 classes/class-cpt-wplf-form.php:240 121 125 msgid "Shortcode" 122 126 msgstr "Lyhytkoodi" 123 127 124 #: classes/class-cpt-wplf-form.php: 176classes/class-cpt-wplf-submission.php:46128 #: classes/class-cpt-wplf-form.php:202 classes/class-cpt-wplf-submission.php:46 125 129 msgid "Submissions" 126 130 msgstr "Vastaukset" 127 131 128 #: classes/class-cpt-wplf-form.php:2 22132 #: classes/class-cpt-wplf-form.php:250 129 133 msgid "Success Message" 130 134 msgstr "Onnistumisviesti" 131 135 132 #: classes/class-cpt-wplf-form.php:2 32136 #: classes/class-cpt-wplf-form.php:260 133 137 msgid "Form Fields Detected" 134 138 msgstr "Lomakekentät" 135 139 136 #: classes/class-cpt-wplf-form.php:2 41140 #: classes/class-cpt-wplf-form.php:269 137 141 msgid "Emails" 138 142 msgstr "Sähköpostit" 139 143 140 #: classes/class-cpt-wplf-form.php:2 50144 #: classes/class-cpt-wplf-form.php:278 141 145 msgid "Submission Title Format" 142 146 msgstr "Nimi lähetetylle lomakkeelle" 143 147 144 #: classes/class-cpt-wplf-form.php: 273148 #: classes/class-cpt-wplf-form.php:301 145 149 msgctxt "Default success message" 146 150 msgid "Thank you! :)" 147 151 msgstr "Kiitos! :)" 148 152 149 #: classes/class-cpt-wplf-form.php: 294153 #: classes/class-cpt-wplf-form.php:322 150 154 msgid "Fields marked with * are required" 151 155 msgstr "Tähdelliset * kentät on pakollisia" 152 156 153 #: classes/class-cpt-wplf-form.php:3 15157 #: classes/class-cpt-wplf-form.php:343 154 158 msgid "Send an email copy when a form is submitted?" 155 159 msgstr "Lähetä kopio sähköpostiin kun lomake lähetetään?" 156 160 157 #: classes/class-cpt-wplf-form.php:3 31161 #: classes/class-cpt-wplf-form.php:359 158 162 msgid "Submissions from this form will use this formatting in their title." 159 163 msgstr "" … … 161 165 "mukaisesti." 162 166 163 #: classes/class-cpt-wplf-form.php:3 32167 #: classes/class-cpt-wplf-form.php:360 164 168 msgid "You may use any field values enclosed in \"%\" markers." 165 169 msgstr "" 166 170 "Voit käyttää otsikossa mitä tahansa kenttiä arvoja \"%\"-merkkien sisällä." 171 172 #: classes/class-cpt-wplf-form.php:487 173 msgid "This form preview URL is not public and cannot be shared." 174 msgstr "Tämä esikatselusivu ei ole julkinen, eikä sitä voi jakaa." 175 176 #: classes/class-cpt-wplf-form.php:488 177 msgid "Non-logged in visitors will see a 404 error page instead." 178 msgstr "Kirjautumattomille vierailijoille näytetään 404-sivu." 167 179 168 180 #: classes/class-cpt-wplf-submission.php:37 … … 227 239 msgstr "Lomake" 228 240 229 #: classes/class-cpt-wplf-submission.php:1 58241 #: classes/class-cpt-wplf-submission.php:172 230 242 msgid "Submission" 231 243 msgstr "Vastaus" 232 244 233 #: classes/class-cpt-wplf-submission.php:1 78245 #: classes/class-cpt-wplf-submission.php:193 234 246 msgid "Field" 235 247 msgstr "Kenttä" 236 248 237 #: classes/class-cpt-wplf-submission.php:1 79249 #: classes/class-cpt-wplf-submission.php:194 238 250 msgid "Value" 239 251 msgstr "Arvo" … … 267 279 268 280 #. Description of the plugin/theme 269 msgid " HTML form builder for WordPress"270 msgstr " HTML form builder for WordPress"281 msgid "A minimal HTML form builder for WordPress; made for developers" 282 msgstr "Minimalistinen HTML lomakerakentaja WordPressille; tehty kehittäjille." 271 283 272 284 #. Author of the plugin/theme … … 278 290 msgstr "https://github.com/anttiviljami/" 279 291 292 #~ msgid "Form is not publicly visible" 293 #~ msgstr "Lomake ei näy julkisesti" 294 295 #~ msgid ", permalink will not work for visitors." 296 #~ msgstr ", eikä kestolinkki toimi käyttäjillä." 297 298 #~ msgid "Visibility" 299 #~ msgstr "Näkyvyys" 300 301 #~ msgid "Make this form publicly visible with permalink?" 302 #~ msgstr "Näytä lomake julkisesti kestolinkillä?" 303 304 #~ msgid "Subscriber or visitor will see a 404 error page instead of form." 305 #~ msgstr "Tilaaja tai käyttäjä näkee lomakkeen sijaan 404-virhesivun." 306 307 #~ msgid "Make this form publicly visible with direct link?" 308 #~ msgstr "Näytä lomake julkisesti suoralla linkillä?" 309 310 #~ msgid "HTML form builder for WordPress" 311 #~ msgstr "HTML form builder for WordPress" 312 280 313 #~ msgid "referrer" 281 314 #~ msgstr "lähde" -
wp-libre-form/tags/1.1/lang/wp-libre-form-nb_NO.po
r1359097 r1522309 2 2 msgstr "" 3 3 "Project-Id-Version: WP Libre Form\n" 4 "POT-Creation-Date: 2016- 02-21 23:16+0100\n"5 "PO-Revision-Date: 2016- 02-22 15:12+0100\n"4 "POT-Creation-Date: 2016-10-26 10:29+0100\n" 5 "PO-Revision-Date: 2016-10-26 10:29+0100\n" 6 6 "Last-Translator: Antti Kuosmanen <antti@seravo.fi>\n" 7 7 "Language-Team: Antti Kuosmanen <antti@seravo.fi>\n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 1.8. 6\n"13 "X-Generator: Poedit 1.8.8\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-WPHeader: wp-libre-form.php\n" … … 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 22 23 #: classes/class-cpt-wplf-form.php:5 323 #: classes/class-cpt-wplf-form.php:56 24 24 msgctxt "post type general name" 25 25 msgid "Forms" 26 26 msgstr "Skjemaer" 27 27 28 #: classes/class-cpt-wplf-form.php:5 428 #: classes/class-cpt-wplf-form.php:57 29 29 msgctxt "post type singular name" 30 30 msgid "Form" 31 31 msgstr "Skjema" 32 32 33 #: classes/class-cpt-wplf-form.php:5 533 #: classes/class-cpt-wplf-form.php:58 34 34 msgctxt "admin menu" 35 35 msgid "Forms" 36 36 msgstr "Skjemaer" 37 37 38 #: classes/class-cpt-wplf-form.php:5 638 #: classes/class-cpt-wplf-form.php:59 39 39 msgctxt "add new on admin bar" 40 40 msgid "Form" 41 41 msgstr "Skjema" 42 42 43 #: classes/class-cpt-wplf-form.php: 5743 #: classes/class-cpt-wplf-form.php:60 44 44 msgctxt "form" 45 45 msgid "New Form" 46 46 msgstr "nytt skjema" 47 47 48 #: classes/class-cpt-wplf-form.php: 5848 #: classes/class-cpt-wplf-form.php:61 49 49 msgid "Add New Form" 50 50 msgstr "Lag nytt skjema" 51 51 52 #: classes/class-cpt-wplf-form.php: 5952 #: classes/class-cpt-wplf-form.php:62 53 53 msgid "New Form" 54 54 msgstr "nytt skjema" 55 55 56 #: classes/class-cpt-wplf-form.php:6 056 #: classes/class-cpt-wplf-form.php:63 57 57 msgid "Edit Form" 58 58 msgstr "Rediger skjema" 59 59 60 #: classes/class-cpt-wplf-form.php:6 160 #: classes/class-cpt-wplf-form.php:64 61 61 msgid "View Form" 62 62 msgstr "Vis skjema" 63 63 64 #: classes/class-cpt-wplf-form.php:6 2 classes/class-cpt-wplf-submission.php:12164 #: classes/class-cpt-wplf-form.php:65 classes/class-cpt-wplf-submission.php:135 65 65 msgid "All Forms" 66 66 msgstr "Alle skjemaer" 67 67 68 #: classes/class-cpt-wplf-form.php:6 368 #: classes/class-cpt-wplf-form.php:66 69 69 msgid "Search Forms" 70 70 msgstr "Søk etter skjema" 71 71 72 #: classes/class-cpt-wplf-form.php:6 472 #: classes/class-cpt-wplf-form.php:67 73 73 msgid "No forms found." 74 74 msgstr "Ingen skjemaer funnet." 75 75 76 #: classes/class-cpt-wplf-form.php:6 576 #: classes/class-cpt-wplf-form.php:68 77 77 msgid "No forms found in Trash." 78 78 msgstr "Ingen skjema ble funnet i papirkurven" 79 79 80 #: classes/class-cpt-wplf-form.php:148 80 #: classes/class-cpt-wplf-form.php:105 81 msgid "Permalink is for preview purposes only." 82 msgstr "" 83 84 #: classes/class-cpt-wplf-form.php:163 81 85 msgid "Please enter your name" 82 86 msgstr "Vennligst skriv inn ditt navn" 83 87 84 #: classes/class-cpt-wplf-form.php:1 4988 #: classes/class-cpt-wplf-form.php:164 85 89 msgctxt "Default placeholder name" 86 90 msgid "John Doe" 87 91 msgstr "Ola Nordmann" 88 92 89 #: classes/class-cpt-wplf-form.php:1 5193 #: classes/class-cpt-wplf-form.php:166 90 94 msgid "Please enter your email address" 91 95 msgstr "Vennligst skriv inn din e-postadresse" 92 96 93 #: classes/class-cpt-wplf-form.php:1 51 classes/class-cpt-wplf-form.php:15497 #: classes/class-cpt-wplf-form.php:166 classes/class-cpt-wplf-form.php:169 94 98 msgid "(required)" 95 99 msgstr "(påkrevd)" 96 100 97 #: classes/class-cpt-wplf-form.php:1 52101 #: classes/class-cpt-wplf-form.php:167 98 102 msgctxt "Default placeholder email" 99 103 msgid "example@email.com" 100 104 msgstr "eksempel@e-mail.no" 101 105 102 #: classes/class-cpt-wplf-form.php:1 54106 #: classes/class-cpt-wplf-form.php:169 103 107 msgid "Write your message below" 104 108 msgstr "Skriv din melding nedenfor" 105 109 106 #: classes/class-cpt-wplf-form.php:1 55110 #: classes/class-cpt-wplf-form.php:170 107 111 msgctxt "Default placeholder message" 108 112 msgid "I wanted to ask about..." 109 113 msgstr "Jeg ønsket å spørre om ..." 110 114 111 #: classes/class-cpt-wplf-form.php:1 57115 #: classes/class-cpt-wplf-form.php:172 112 116 msgid "Submit" 113 117 msgstr "Send" 114 118 115 #: classes/class-cpt-wplf-form.php:1 59119 #: classes/class-cpt-wplf-form.php:174 116 120 msgctxt "The HTML comment at the end of the example form" 117 121 msgid "Any valid HTML form can be used here!" 118 122 msgstr "Alle gyldig skjema med HTML kan brukes her!" 119 123 120 #: classes/class-cpt-wplf-form.php: 175 classes/class-cpt-wplf-form.php:212124 #: classes/class-cpt-wplf-form.php:201 classes/class-cpt-wplf-form.php:240 121 125 msgid "Shortcode" 122 126 msgstr "Shortcode" 123 127 124 #: classes/class-cpt-wplf-form.php: 176classes/class-cpt-wplf-submission.php:46128 #: classes/class-cpt-wplf-form.php:202 classes/class-cpt-wplf-submission.php:46 125 129 msgid "Submissions" 126 130 msgstr "Svar" 127 131 128 #: classes/class-cpt-wplf-form.php:2 22132 #: classes/class-cpt-wplf-form.php:250 129 133 msgid "Success Message" 130 134 msgstr "Suksessmelding" 131 135 132 #: classes/class-cpt-wplf-form.php:2 32136 #: classes/class-cpt-wplf-form.php:260 133 137 msgid "Form Fields Detected" 134 138 msgstr "Skjemafelt oppdaget" 135 139 136 #: classes/class-cpt-wplf-form.php:2 41140 #: classes/class-cpt-wplf-form.php:269 137 141 msgid "Emails" 138 142 msgstr "E-post" 139 143 140 #: classes/class-cpt-wplf-form.php:2 50144 #: classes/class-cpt-wplf-form.php:278 141 145 msgid "Submission Title Format" 142 146 msgstr "Tittel på svar" 143 147 144 #: classes/class-cpt-wplf-form.php: 273148 #: classes/class-cpt-wplf-form.php:301 145 149 msgctxt "Default success message" 146 150 msgid "Thank you! :)" 147 151 msgstr "Tusen takk! :)" 148 152 149 #: classes/class-cpt-wplf-form.php: 294153 #: classes/class-cpt-wplf-form.php:322 150 154 msgid "Fields marked with * are required" 151 155 msgstr "Feltene merket med * er obligatoriske" 152 156 153 #: classes/class-cpt-wplf-form.php:3 15157 #: classes/class-cpt-wplf-form.php:343 154 158 msgid "Send an email copy when a form is submitted?" 155 159 msgstr "Send en e-post når et skjema er sendt?" 156 160 157 #: classes/class-cpt-wplf-form.php:3 31161 #: classes/class-cpt-wplf-form.php:359 158 162 msgid "Submissions from this form will use this formatting in their title." 159 163 msgstr "Svar fra dette skjemaet vil bruke denne formateringen i tittelen." 160 164 161 #: classes/class-cpt-wplf-form.php:3 32165 #: classes/class-cpt-wplf-form.php:360 162 166 msgid "You may use any field values enclosed in \"%\" markers." 163 167 msgstr "Du kan bruke feltverdier i \"%\" markører." 168 169 #: classes/class-cpt-wplf-form.php:487 170 msgid "This form preview URL is not public and cannot be shared." 171 msgstr "" 172 173 #: classes/class-cpt-wplf-form.php:488 174 msgid "Non-logged in visitors will see a 404 error page instead." 175 msgstr "" 164 176 165 177 #: classes/class-cpt-wplf-submission.php:37 … … 224 236 msgstr "Skjema" 225 237 226 #: classes/class-cpt-wplf-submission.php:1 58238 #: classes/class-cpt-wplf-submission.php:172 227 239 msgid "Submission" 228 240 msgstr "Svar" 229 241 230 #: classes/class-cpt-wplf-submission.php:1 78242 #: classes/class-cpt-wplf-submission.php:193 231 243 msgid "Field" 232 244 msgstr "Felt" 233 245 234 #: classes/class-cpt-wplf-submission.php:1 79246 #: classes/class-cpt-wplf-submission.php:194 235 247 msgid "Value" 236 248 msgstr "Verdi" … … 264 276 265 277 #. Description of the plugin/theme 266 msgid " HTML form builder for WordPress"278 msgid "A minimal HTML form builder for WordPress; made for developers" 267 279 msgstr "" 268 280 -
wp-libre-form/tags/1.1/lang/wp-libre-form.pot
r1359097 r1522309 4 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 5 "Project-Id-Version: WP Libre Form\n" 6 "POT-Creation-Date: 2016- 02-21 23:16+0100\n"6 "POT-Creation-Date: 2016-10-26 10:29+0100\n" 7 7 "PO-Revision-Date: 2016-02-21 14:22+0100\n" 8 8 "Last-Translator: Antti Kuosmanen <antti@seravo.fi>\n" … … 11 11 "Content-Type: text/plain; charset=UTF-8\n" 12 12 "Content-Transfer-Encoding: 8bit\n" 13 "X-Generator: Poedit 1.8. 6\n"13 "X-Generator: Poedit 1.8.8\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-WPHeader: wp-libre-form.php\n" … … 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 22 23 #: classes/class-cpt-wplf-form.php:5 323 #: classes/class-cpt-wplf-form.php:56 24 24 msgctxt "post type general name" 25 25 msgid "Forms" 26 26 msgstr "" 27 27 28 #: classes/class-cpt-wplf-form.php:5 428 #: classes/class-cpt-wplf-form.php:57 29 29 msgctxt "post type singular name" 30 30 msgid "Form" 31 31 msgstr "" 32 32 33 #: classes/class-cpt-wplf-form.php:5 533 #: classes/class-cpt-wplf-form.php:58 34 34 msgctxt "admin menu" 35 35 msgid "Forms" 36 36 msgstr "" 37 37 38 #: classes/class-cpt-wplf-form.php:5 638 #: classes/class-cpt-wplf-form.php:59 39 39 msgctxt "add new on admin bar" 40 40 msgid "Form" 41 41 msgstr "" 42 42 43 #: classes/class-cpt-wplf-form.php: 5743 #: classes/class-cpt-wplf-form.php:60 44 44 msgctxt "form" 45 45 msgid "New Form" 46 46 msgstr "" 47 47 48 #: classes/class-cpt-wplf-form.php: 5848 #: classes/class-cpt-wplf-form.php:61 49 49 msgid "Add New Form" 50 50 msgstr "" 51 51 52 #: classes/class-cpt-wplf-form.php: 5952 #: classes/class-cpt-wplf-form.php:62 53 53 msgid "New Form" 54 54 msgstr "" 55 55 56 #: classes/class-cpt-wplf-form.php:6 056 #: classes/class-cpt-wplf-form.php:63 57 57 msgid "Edit Form" 58 58 msgstr "" 59 59 60 #: classes/class-cpt-wplf-form.php:6 160 #: classes/class-cpt-wplf-form.php:64 61 61 msgid "View Form" 62 62 msgstr "" 63 63 64 #: classes/class-cpt-wplf-form.php:6 265 #: classes/class-cpt-wplf-submission.php:1 2164 #: classes/class-cpt-wplf-form.php:65 65 #: classes/class-cpt-wplf-submission.php:135 66 66 msgid "All Forms" 67 67 msgstr "" 68 68 69 #: classes/class-cpt-wplf-form.php:6 369 #: classes/class-cpt-wplf-form.php:66 70 70 msgid "Search Forms" 71 71 msgstr "" 72 72 73 #: classes/class-cpt-wplf-form.php:6 473 #: classes/class-cpt-wplf-form.php:67 74 74 msgid "No forms found." 75 75 msgstr "" 76 76 77 #: classes/class-cpt-wplf-form.php:6 577 #: classes/class-cpt-wplf-form.php:68 78 78 msgid "No forms found in Trash." 79 79 msgstr "" 80 80 81 #: classes/class-cpt-wplf-form.php:148 81 #: classes/class-cpt-wplf-form.php:105 82 msgid "Permalink is for preview purposes only." 83 msgstr "" 84 85 #: classes/class-cpt-wplf-form.php:163 82 86 msgid "Please enter your name" 83 87 msgstr "" 84 88 85 #: classes/class-cpt-wplf-form.php:1 4989 #: classes/class-cpt-wplf-form.php:164 86 90 msgctxt "Default placeholder name" 87 91 msgid "John Doe" 88 92 msgstr "" 89 93 90 #: classes/class-cpt-wplf-form.php:1 5194 #: classes/class-cpt-wplf-form.php:166 91 95 msgid "Please enter your email address" 92 96 msgstr "" 93 97 94 #: classes/class-cpt-wplf-form.php:1 51 classes/class-cpt-wplf-form.php:15498 #: classes/class-cpt-wplf-form.php:166 classes/class-cpt-wplf-form.php:169 95 99 msgid "(required)" 96 100 msgstr "" 97 101 98 #: classes/class-cpt-wplf-form.php:1 52102 #: classes/class-cpt-wplf-form.php:167 99 103 msgctxt "Default placeholder email" 100 104 msgid "example@email.com" 101 105 msgstr "" 102 106 103 #: classes/class-cpt-wplf-form.php:1 54107 #: classes/class-cpt-wplf-form.php:169 104 108 msgid "Write your message below" 105 109 msgstr "" 106 110 107 #: classes/class-cpt-wplf-form.php:1 55111 #: classes/class-cpt-wplf-form.php:170 108 112 msgctxt "Default placeholder message" 109 113 msgid "I wanted to ask about..." 110 114 msgstr "" 111 115 112 #: classes/class-cpt-wplf-form.php:1 57116 #: classes/class-cpt-wplf-form.php:172 113 117 msgid "Submit" 114 118 msgstr "" 115 119 116 #: classes/class-cpt-wplf-form.php:1 59120 #: classes/class-cpt-wplf-form.php:174 117 121 msgctxt "The HTML comment at the end of the example form" 118 122 msgid "Any valid HTML form can be used here!" 119 123 msgstr "" 120 124 121 #: classes/class-cpt-wplf-form.php: 175 classes/class-cpt-wplf-form.php:212125 #: classes/class-cpt-wplf-form.php:201 classes/class-cpt-wplf-form.php:240 122 126 msgid "Shortcode" 123 127 msgstr "" 124 128 125 #: classes/class-cpt-wplf-form.php: 176129 #: classes/class-cpt-wplf-form.php:202 126 130 #: classes/class-cpt-wplf-submission.php:46 127 131 msgid "Submissions" 128 132 msgstr "" 129 133 130 #: classes/class-cpt-wplf-form.php:2 22134 #: classes/class-cpt-wplf-form.php:250 131 135 msgid "Success Message" 132 136 msgstr "" 133 137 134 #: classes/class-cpt-wplf-form.php:2 32138 #: classes/class-cpt-wplf-form.php:260 135 139 msgid "Form Fields Detected" 136 140 msgstr "" 137 141 138 #: classes/class-cpt-wplf-form.php:2 41142 #: classes/class-cpt-wplf-form.php:269 139 143 msgid "Emails" 140 144 msgstr "" 141 145 142 #: classes/class-cpt-wplf-form.php:2 50146 #: classes/class-cpt-wplf-form.php:278 143 147 msgid "Submission Title Format" 144 148 msgstr "" 145 149 146 #: classes/class-cpt-wplf-form.php: 273150 #: classes/class-cpt-wplf-form.php:301 147 151 msgctxt "Default success message" 148 152 msgid "Thank you! :)" 149 153 msgstr "" 150 154 151 #: classes/class-cpt-wplf-form.php: 294155 #: classes/class-cpt-wplf-form.php:322 152 156 msgid "Fields marked with * are required" 153 157 msgstr "" 154 158 155 #: classes/class-cpt-wplf-form.php:3 15159 #: classes/class-cpt-wplf-form.php:343 156 160 msgid "Send an email copy when a form is submitted?" 157 161 msgstr "" 158 162 159 #: classes/class-cpt-wplf-form.php:3 31163 #: classes/class-cpt-wplf-form.php:359 160 164 msgid "Submissions from this form will use this formatting in their title." 161 165 msgstr "" 162 166 163 #: classes/class-cpt-wplf-form.php:3 32167 #: classes/class-cpt-wplf-form.php:360 164 168 msgid "You may use any field values enclosed in \"%\" markers." 169 msgstr "" 170 171 #: classes/class-cpt-wplf-form.php:487 172 msgid "This form preview URL is not public and cannot be shared." 173 msgstr "" 174 175 #: classes/class-cpt-wplf-form.php:488 176 msgid "Non-logged in visitors will see a 404 error page instead." 165 177 msgstr "" 166 178 … … 226 238 msgstr "" 227 239 228 #: classes/class-cpt-wplf-submission.php:1 58240 #: classes/class-cpt-wplf-submission.php:172 229 241 msgid "Submission" 230 242 msgstr "" 231 243 232 #: classes/class-cpt-wplf-submission.php:1 78244 #: classes/class-cpt-wplf-submission.php:193 233 245 msgid "Field" 234 246 msgstr "" 235 247 236 #: classes/class-cpt-wplf-submission.php:1 79248 #: classes/class-cpt-wplf-submission.php:194 237 249 msgid "Value" 238 250 msgstr "" … … 266 278 267 279 #. Description of the plugin/theme 268 msgid " HTML form builder for WordPress"280 msgid "A minimal HTML form builder for WordPress; made for developers" 269 281 msgstr "" 270 282 -
wp-libre-form/tags/1.1/readme.md
r1450731 r1522309 90 90 ``` 91 91 92 ### Add own css classes to form output92 ### Client side callbacks 93 93 94 You can use the attribute xclass inside the shortcode to set own extra css classes. 94 WP Libre Form supports client side callbacks after form submission using window.wplf object. Example usage: 95 96 ``` 97 window.wplf.successCallbacks.push(function(response){ 98 alert("You succesfully submitted form " + response.form_id); 99 }); 100 101 window.wplf.errorCallbacks.push(function(response){ 102 alert("Form submission failed!"); 103 }); 104 ``` 105 106 These callbacks are executed in the order they appear. 107 108 ### Add CSS classes to form output 109 110 You can use the xclass attribute inside the shortcode to add your own extra classes. 95 111 96 112 ``` … … 124 140 } 125 141 ``` 142 143 ### wplf_validate_submission example: Google ReCaptcha integration 144 145 ```php 146 /** 147 * ReCaptcha for WP Libre Form 148 */ 149 add_filter( 'wplf_validate_submission', 'wplf_recaptcha' ); 150 function wplf_recaptcha( $return ) { 151 // skip this validation if submission has already failed 152 if( ! $return->ok ) { 153 return $return; 154 } 155 156 $form = get_post( (int) $_POST['_form_id'] ); 157 if( false === strpos( $form->post_content, 'g-recaptcha' ) ) { 158 // this form doesn't have recaptcha 159 return $return; 160 } 161 162 $secret = 'XXXX'; // substitute with your own secret recaptcha key 163 164 $options = [ 165 'http' => [ 166 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 167 'method' => 'POST', 168 'content' => http_build_query([ 169 'secret' => $secret, 170 'response' => $_POST['g-recaptcha-response'], 171 ]) 172 ], 173 ]; 174 $context = stream_context_create( $options ); 175 $result = file_get_contents( 'https://www.google.com/recaptcha/api/siteverify', false, $context ); 176 177 $captcha_obj = json_decode( $result ); 178 179 if( false === $captcha_obj->success ) { 180 $return->ok = 0; 181 $return->error = sprintf( __("Please prove you're not a robot before submitting."), intval( $_POST['_form_id'] ) ); 182 } 183 184 return $return; 185 } 186 ``` -
wp-libre-form/tags/1.1/readme.txt
r1450731 r1522309 4 4 Donate link: https://github.com/anttiviljami 5 5 Requires at least: 4.2 6 Tested up to: 4. 4.47 Stable tag: 1. 0.26 Tested up to: 4.6.1 7 Stable tag: 1.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
wp-libre-form/tags/1.1/wp-libre-form.php
r1450731 r1522309 4 4 * Plugin URI: https://github.com/anttiviljami/wp-libre-form 5 5 * Description: A minimal HTML form builder for WordPress; made for developers 6 * Version: 1. 0.26 * Version: 1.1 7 7 * Author: @anttiviljami 8 8 * Author URI: https://github.com/anttiviljami/ … … 31 31 32 32 if ( ! class_exists( 'WP_Libre_Form' ) ) : 33 34 define( 'WPLF_VERSION', '1.1' ); 33 35 34 36 class WP_Libre_Form { … … 75 77 */ 76 78 public static function load_our_textdomain() { 77 load_plugin_textdomain( 'wp-libre-form', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 79 $loaded = load_plugin_textdomain( 'wp-libre-form', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 80 81 if( !$loaded ) { 82 $loaded = load_muplugin_textdomain( 'wp-libre-form', dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 83 } 78 84 } 79 85 -
wp-libre-form/trunk/assets/scripts/wplf-form.js
r1359097 r1522309 3 3 */ 4 4 5 (function($) { 5 // Fetch polyfill: https://github.com/github/fetch 6 !function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return y.iterable&&(e[Symbol.iterator]=function(){return e}),e}function n(t){this.map={},t instanceof n?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function s(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function i(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function a(t){var e=new FileReader;return e.readAsArrayBuffer(t),i(e)}function h(t){var e=new FileReader;return e.readAsText(t),i(e)}function u(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(y.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(y.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(y.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(t){if(!y.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):y.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},y.blob?(this.blob=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(a)},this.text=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return h(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=s(this);return t?t:Promise.resolve(this._bodyText)},y.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(t){var e=t.toUpperCase();return b.indexOf(e)>-1?e:t}function d(t,e){e=e||{};var r=e.body;if(d.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new n(t.headers)),this.method=t.method,this.mode=t.mode,r||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",(e.headers||!this.headers)&&(this.headers=new n(e.headers)),this.method=f(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function c(t){var e=new n,r=(t.getAllResponseHeaders()||"").trim().split("\n");return r.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function l(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof n?e.headers:new n(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var y={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};n.prototype.append=function(t,o){t=e(t),o=r(o);var n=this.map[t];n||(n=[],this.map[t]=n),n.push(o)},n.prototype["delete"]=function(t){delete this.map[e(t)]},n.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},n.prototype.getAll=function(t){return this.map[e(t)]||[]},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(t,o){this.map[e(t)]=[r(o)]},n.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)},n.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},n.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},n.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},y.iterable&&(n.prototype[Symbol.iterator]=n.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},u.call(d.prototype),u.call(l.prototype),l.prototype.clone=function(){return new l(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},l.error=function(){var t=new l(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];l.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new l(null,{status:e,headers:{location:t}})},t.Headers=n,t.Request=d,t.Response=l,t.fetch=function(t,e){return new Promise(function(r,o){function n(){return"responseURL"in i?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):void 0}var s;s=d.prototype.isPrototypeOf(t)&&!e?t:new d(t,e);var i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:c(i),url:n()},e="response"in i?i.response:i.responseText;r(new l(e,t))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(s.method,s.url,!0),"include"===s.credentials&&(i.withCredentials=!0),"responseType"in i&&y.blob&&(i.responseType="blob"),s.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof s._bodyInit?null:s._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this); 6 7 7 $(document).ready(function() { 8 // Promise polyfill: https://github.com/taylorhakes/promise-polyfill 9 !function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function r(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void a(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?i:f)(e.promise,t._value);var o;try{o=n(t._value)}catch(r){return void f(e.promise,r)}i(e.promise,o)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof o)return t._state=3,t._value=e,void u(t);if("function"==typeof r)return void s(n(r,e),t)}t._state=1,t._value=e,u(t)}catch(i){f(t,i)}}function f(t,e){t._state=2,t._value=e,u(t)}function u(t){2===t._state&&0===t._deferreds.length&&a(function(){t._handled||d(t._value)});for(var e=0,n=t._deferreds.length;n>e;e++)r(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,i(e,t))},function(t){n||(n=!0,f(e,t))})}catch(o){if(n)return;n=!0,f(e,o)}}var l=setTimeout,a="function"==typeof setImmediate&&setImmediate||function(t){l(t,0)},d=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new c(t,n,o)),o},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){function o(i,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(t){o(i,t)},n)}e[i]=f,0===--r&&t(e)}catch(c){n(c)}}if(0===e.length)return t([]);for(var r=e.length,i=0;i<e.length;i++)o(i,e[i])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var o=0,r=t.length;r>o;o++)t[o].then(e,n)})},o._setImmediateFn=function(t){a=t},o._setUnhandledRejectionFn=function(t){d=t},"undefined"!=typeof module&&module.exports?module.exports=o:t.Promise||(t.Promise=o)}(this); 8 10 9 // ajax form submissions10 $('.libre-form').submit(function(e) {11 11 12 var $form = $(this); 12 (function(){ 13 13 14 // add class to enable css changes to indicate ajax loading 15 $form.addClass('sending'); 14 window.wplf = { 15 successCallbacks: [], 16 errorCallbacks: [] 17 }; 16 18 17 // reset errors 18 $form.find('.wplf-error').remove();19 document.addEventListener("DOMContentLoaded", function(){ 20 [].forEach.call(document.querySelectorAll(".libre-form"), function(form){ 19 21 20 // submit form to ajax handler in admin-ajax.php 21 $.post( ajax_object.ajax_url + '?action=wplf_submit', 22 $(this).serialize(), 23 function(response) { 24 console.log(response); 22 form.addEventListener("submit", function(e){ 23 24 // add class to enable css changes to indicate ajax loading 25 form.classList.add("sending"); 26 27 [].forEach.call(form.querySelectorAll(".wplf-error"), function(error){ 28 // reset errors 29 error.parentNode.removeChild(error); 30 }); 31 32 var data = new FormData(form); 33 34 window.data = data; 35 36 fetch(ajax_object.ajax_url + '?action=wplf_submit', { 37 method: "POST", 38 body: data 39 }).then(function(response){ 40 41 return response.text(); 42 43 }).then(function(response){ 44 45 response = JSON.parse(response); 46 25 47 if( 'success' in response ) { 26 48 // show success message if one exists 27 $form.after(response.success); 28 } 49 50 var success = document.createElement("p"); 51 success.className = "wplf-success"; 52 success.innerHTML = response.success; 53 54 form.parentNode.insertBefore(success, form.nextSibling); 55 } 56 29 57 if( 'ok' in response && response.ok ) { 30 58 // submit succesful! 31 $form.remove(); 59 form.parentNode.removeChild(form); 60 61 window.wplf.successCallbacks.forEach(function(func){ 62 func(response); 63 }); 32 64 } 65 33 66 if( 'error' in response ) { 34 67 // show error message in form 35 $form.append('<p class="wplf-error error">' + response.error + '</p>'); 68 69 var error = document.createElement("p"); 70 error.className = "wplf-error error"; 71 error.textContent = response.error; 72 73 form.appendChild(error); 74 75 window.wplf.errorCallbacks.forEach(function(func){ 76 func(response); 77 }); 36 78 } 37 }38 ).always(function() {39 // finished XHR request40 $form.removeClass('sending');41 });;42 79 43 // don't actually submit the form, causing a page reload 44 e.preventDefault(); 45 return false; 80 form.classList.remove('sending'); 81 82 }).catch(function(error){ 83 84 console.warn("Fetch error: ", error); 85 form.classList.remove("sending"); 86 87 }); 88 89 // don't actually submit the form, causing a page reload 90 91 e.preventDefault(); 92 }); 46 93 47 94 }); 48 95 }); 49 50 })(jQuery); 51 96 })(); -
wp-libre-form/trunk/classes/class-cpt-wplf-form.php
r1450731 r1522309 24 24 25 25 // post.php / post-new.php view 26 add_filter( 'get_sample_permalink_html', array( $this, 'modify_permalink_html' ), 10, 2 ); 26 27 add_action( 'save_post', array( $this, 'save_cpt' ) ); 27 28 add_filter( 'content_save_pre' , array( $this, 'strip_form_tags' ), 10, 1 ); … … 30 31 31 32 // edit.php view 33 add_filter( 'post_row_actions', array( $this, 'remove_row_actions' ), 10, 2 ); 32 34 add_filter( 'manage_edit-wplf-form_columns' , array( $this, 'custom_columns_cpt' ), 100, 1 ); 33 35 add_action( 'manage_posts_custom_column' , array( $this, 'custom_columns_display_cpt' ), 10, 2 ); … … 38 40 // front end 39 41 add_shortcode( 'libre-form', array( $this, 'shortcode' ) ); 42 add_action( 'wp', array( $this, 'maybe_set_404_for_single_form' ) ); 40 43 add_filter( 'the_content', array( $this, 'use_shortcode_for_preview' ) ); 41 44 add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_frontend_script' ) ); … … 93 96 } 94 97 98 /** 99 * Modify post.php permalink html to show notice if form isn't publicly visible. 100 */ 101 function modify_permalink_html( $html, $post_id ) { 102 $publicly_visible = $this->get_publicly_visible_state( $post_id ); 103 104 if( get_post_type( $post_id ) === 'wplf-form' && !$publicly_visible ) { 105 $html .= '<span>' . __( 'Permalink is for preview purposes only.', 'wp-libre-form' ) . '</span>'; 106 } 107 108 return $html; 109 } 95 110 96 111 /** … … 165 180 } 166 181 182 /** 183 * Remove view action in edit.php for forms 184 */ 185 function remove_row_actions( $actions, $post ) { 186 $publicly_visible = $this->get_publicly_visible_state( $post->ID ); 187 188 if( $post->post_type === 'wplf-form' && !$publicly_visible ) 189 unset( $actions['view'] ); 190 191 return $actions; 192 } 167 193 168 194 /** … … 315 341 <label for="wplf_email_copy_enabled"> 316 342 <input type="checkbox" <?php echo $email_enabled ? 'checked="checked"' : ''; ?> id="wplf_email_copy_enabled" name="wplf_email_copy_enabled"> 317 <?php _e( 'Send an email copy when a form is submitted?' ); ?>343 <?php _e( 'Send an email copy when a form is submitted?', 'wp-libre-form' ); ?> 318 344 </label> 319 345 </p> … … 333 359 <p><?php _e('Submissions from this form will use this formatting in their title.', 'wp-libre-form'); ?></p> 334 360 <p><?php _e('You may use any field values enclosed in "%" markers.', 'wp-libre-form');?></p> 335 <p><input type="text" name="wplf_title_format" value="<?php echo esc_attr( $format ); ?>" placeholder="<?php echo esc_attr( $default ); ?>" class="code" style="width:100%"></p> 336 <?php 337 } 338 361 <p><input type="text" name="wplf_title_format" value="<?php echo esc_attr( $format ); ?>" placeholder="<?php echo esc_attr( $default ); ?>" class="code" style="width:100%" autocomplete="off"></p> 362 <?php 363 } 339 364 340 365 /** … … 385 410 // save email copy 386 411 if ( isset( $_POST['wplf_email_copy_to'] ) ) { 387 update_post_meta( $post_id, '_wplf_email_copy_to', sanitize_email( $_POST['wplf_email_copy_to'] ) ); 412 $emailField = $_POST['wplf_email_copy_to']; 413 $to = ''; 414 415 if( strpos( $emailField, "," ) > 0 ) { 416 // Intentional. Makes no sense if the first character is a comma, so pass it along as a single address. 417 // sanitize_email() should take care of the rest. 418 $emailArray = explode( ",", $emailField ); 419 foreach($emailArray as $email){ 420 $email = trim($email); 421 $email = sanitize_email( $email ) . ", "; 422 $to .= $email; 423 } 424 $to = rtrim( $to, ", " ); 425 } 426 else { 427 $to = sanitize_email( $emailField ); 428 } 429 430 if( !empty( $to ) ) { 431 update_post_meta( $post_id, '_wplf_email_copy_to', $to ); 432 } else { 433 delete_post_meta( $post_id, '_wplf_email_copy_to' ); 434 } 388 435 } 389 436 … … 423 470 $content = get_post( $id )->post_content; 424 471 } 472 473 $multipart = ""; 474 // check if form contains file inputs 475 if(strpos($content, "type='file'") > -1 || strpos($content, "type=\"file\"") > -1){ 476 $multipart = "enctype='multipart/form-data'"; 477 } 478 425 479 ob_start(); 426 480 ?> 427 <form class="libre-form libre-form-<?php echo $id . ' ' . $xclass; ?>"> 481 <form class="libre-form libre-form-<?php echo $id . ' ' . $xclass; ?>" <?php echo $multipart; ?>> 482 <?php if( is_singular( 'wplf-form' ) && current_user_can( 'edit_post', $id ) ) { 483 $publicly_visible = $this->get_publicly_visible_state( $id ); 484 if( !$publicly_visible ) { 485 ?> 486 <p style="background:#f5f5f5;border-left:4px solid #dc3232;padding:6px 12px;"> 487 <b style="color:#dc3232;"><?php _e( 'This form preview URL is not public and cannot be shared.', 'wp-libre-form' ) ?>.</b><br /> 488 <?php _e( 'Non-logged in visitors will see a 404 error page instead.', 'wp-libre-form' ) ?> 489 </p> 490 <?php 491 } 492 } ?> 428 493 <?php echo apply_filters( 'wplf_form', $content ); ?> 429 494 <input type="hidden" name="referrer" value="<?php the_permalink(); ?>"> 495 <input type="hidden" name="_referrer_id" value="<?php esc_attr_e( get_the_id() ) ?>"> 430 496 <input type="hidden" name="_form_id" value="<?php esc_attr_e( $id ); ?>"> 431 497 </form> … … 447 513 448 514 // register the script, but only enqueue it if the current post contains a form in it 449 wp_register_script( 'wplf-form-js', plugins_url( 'assets/scripts/wplf-form.js', dirname(__FILE__) ), array( 'jquery' ));515 wp_register_script( 'wplf-form-js', plugins_url( 'assets/scripts/wplf-form.js', dirname(__FILE__) ), array(), WPLF_VERSION, true ); 450 516 451 517 if( is_a( $post, 'WP_Post' ) && ( has_shortcode( $post->post_content, 'libre-form') || $post->post_type === 'wplf-form') ) { … … 480 546 return $content; 481 547 } 548 549 /** 550 * Set and show 404 page for visitors trying to see single form. 551 * And yes, it is a global $post. That's right. 552 */ 553 function maybe_set_404_for_single_form() { 554 global $post; 555 556 if( !is_singular( 'wplf-form' ) ) 557 return; 558 559 $publicly_visible = $this->get_publicly_visible_state( $post->ID ); 560 if( $publicly_visible ) 561 return; 562 563 if( !current_user_can( 'edit_post', $post->ID ) ) { 564 global $wp_query; 565 $wp_query->set_404(); 566 } 567 } 568 569 /** 570 * Wrapper function to check if form is publicly visible. 571 */ 572 function get_publicly_visible_state( $id ) { 573 return apply_filters( 'wplf-form-publicly-visible', false, $id ); 574 } 482 575 } 483 576 -
wp-libre-form/trunk/classes/class-cpt-wplf-submission.php
r1359097 r1522309 107 107 global $pagenow; 108 108 109 if( 'edit.php' != $pagenow ) { 109 $allowed = array("wplf-submission"); // show filter on these post types (currently only one?) 110 $allowed = apply_filters("wplf-dropdown-filter", $allowed); 111 $post_type = get_query_var("post_type"); 112 113 if( 'edit.php' != $pagenow || !in_array($post_type, $allowed)) { 110 114 return; 111 115 } 112 116 113 // TODO: put this in a transient 114 $forms = get_posts( array( 115 'post_per_page' => '-1', 116 'post_type' => 'wplf-form', 117 ) ); 117 $transient = get_transient("wplf-form-filter"); 118 119 if($transient){ 120 $forms = $transient; 121 } 122 123 else{ 124 $forms = get_posts( array( 125 'post_per_page' => '-1', 126 'post_type' => 'wplf-form', 127 ) ); 128 129 set_transient("wplf-form-filter", $forms, 15 * MINUTE_IN_SECONDS); 130 } 131 118 132 ?> 119 133 <label for="filter-by-form" class="screen-reader-text">Filter by form</label> … … 171 185 $postmeta = get_post_meta( $post->ID ); 172 186 $fields = array_keys( $postmeta ); 187 $home_path = get_home_path(); 173 188 ?> 174 189 <p> … … 183 198 <?php foreach( $fields as $field ) : ?> 184 199 <?php if( '_' != $field[0] ) : ?> 185 <?php $value = $postmeta[ $field ][0]; ?> 200 <?php 201 $value = $postmeta[ $field ][0]; 202 $possible_link = ''; 203 $attachment_url = wp_get_attachment_url( $value ); // get_edit_post_link returns something awkward. 204 205 // Maybe add a filter for target="_blank"? Wouldn't enable by default. 206 207 if ( $attachment_url ) { 208 // If this is true, $value was a valid attachment_id. 209 // Caveat: if user enters a numeric value here, it could be interpreted as attachment. 210 $attachment_url = get_edit_post_link($value); 211 $possible_link = "<a href='$attachment_url' style='float: right;'>Edit attachment</a>"; 212 } elseif ( file_exists( $home_path . substr( $value, 1 ) ) ) { 213 // This is bit less ambiguous. Check if there's a file, and if there is, get link for it. 214 $attachment_url = get_home_url() . $value; 215 $possible_link = "<a href='$attachment_url' style='float: right;'>Open file</a>"; 216 } 217 ?> 186 218 <tr> 187 <th><strong><?php echo $field; ?></strong> </th>219 <th><strong><?php echo $field; ?></strong> <?php echo $possible_link; ?></th> 188 220 <?php if( strlen( $value ) > 60 || strpos( $value, "\n" ) ) : ?> 189 221 <td><textarea style="width:100%" readonly><?php echo esc_textarea( $value ); ?></textarea></td> … … 202 234 203 235 endif; 204 -
wp-libre-form/trunk/inc/wplf-ajax.php
r1359097 r1522309 19 19 if( $return->ok ) { 20 20 // form existence has already been validated via filters 21 22 21 23 $form = get_post( intval( $_POST['_form_id'] ) ); 22 24 … … 53 55 } 54 56 57 // handle files 58 foreach( $_FILES as $key => $file) { 59 // Is this enough security wise? 60 // Currenly only supports 1 file per input 61 $attach_id = media_handle_upload( $key, 0, array(), array( "test_form" => false ) ); 62 add_post_meta( $post_id, $key, wp_get_attachment_url($attach_id) ); 63 add_post_meta( $post_id, $key . "_attachment", $attach_id ); 64 } 65 66 67 55 68 $return->submission_id = $post_id; 56 69 $return->submission_title = $post_title; 70 $return->form_id = $form->ID; 57 71 58 72 // return the success message for the form … … 69 83 wp_die(); 70 84 } 71 -
wp-libre-form/trunk/inc/wplf-form-actions.php
r1365849 r1522309 19 19 $to = isset($form_meta['_wplf_email_copy_to']) ? $form_meta['_wplf_email_copy_to'][0] : get_option( 'admin_email' ); 20 20 $subject = wp_sprintf( __('New submission from %s', 'wp-libre-form'), $referrer ); 21 $content = wp_sprintf( __('Form "%s" (ID %d) was submitted with values below: ', 'wp-libre-form'), $form_title, $form_id ) . "\n\n"; 21 $content = wp_sprintf( __('Form "%s" (ID %d) was submitted with values below: ', 'wp-libre-form'), $form_title, $form_id ); 22 $content = apply_filters( 'wplf_email_copy_content_start', $content, $form_title, $form_id ). "\n\n"; 23 22 24 foreach( $_POST as $key => $value ) { 23 25 if( '_' === $key[0] ) { … … 26 28 $content .= esc_html( $key ) . ': ' . esc_html( print_r( $value, true ) ) . "\n"; 27 29 } 28 wp_mail( $to, $subject, $content ); 30 31 wp_mail( 32 apply_filters( 'wplf_email_copy_to', $to ), 33 apply_filters( 'wplf_email_copy_subject', $subject ), 34 apply_filters( 'wplf_email_copy_content', $content ), 35 apply_filters( 'wplf_email_copy_headers', '' ), 36 apply_filters( 'wplf_email_copy_attachments', array() ) 37 ); 29 38 } 30 39 } 31 -
wp-libre-form/trunk/lang/wp-libre-form-fi.po
r1359097 r1522309 2 2 msgstr "" 3 3 "Project-Id-Version: WP Libre Form\n" 4 "POT-Creation-Date: 2016- 02-21 23:16+0100\n"5 "PO-Revision-Date: 2016- 02-21 23:16+0100\n"4 "POT-Creation-Date: 2016-10-26 10:29+0100\n" 5 "PO-Revision-Date: 2016-10-26 10:30+0100\n" 6 6 "Last-Translator: Antti Kuosmanen <antti@seravo.fi>\n" 7 7 "Language-Team: Antti Kuosmanen <antti@seravo.fi>\n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 1.8. 6\n"13 "X-Generator: Poedit 1.8.8\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-WPHeader: wp-libre-form.php\n" … … 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 22 23 #: classes/class-cpt-wplf-form.php:5 323 #: classes/class-cpt-wplf-form.php:56 24 24 msgctxt "post type general name" 25 25 msgid "Forms" 26 26 msgstr "Lomakkeet" 27 27 28 #: classes/class-cpt-wplf-form.php:5 428 #: classes/class-cpt-wplf-form.php:57 29 29 msgctxt "post type singular name" 30 30 msgid "Form" 31 31 msgstr "Lomake" 32 32 33 #: classes/class-cpt-wplf-form.php:5 533 #: classes/class-cpt-wplf-form.php:58 34 34 msgctxt "admin menu" 35 35 msgid "Forms" 36 36 msgstr "Lomakkeet" 37 37 38 #: classes/class-cpt-wplf-form.php:5 638 #: classes/class-cpt-wplf-form.php:59 39 39 msgctxt "add new on admin bar" 40 40 msgid "Form" 41 41 msgstr "Lomake" 42 42 43 #: classes/class-cpt-wplf-form.php: 5743 #: classes/class-cpt-wplf-form.php:60 44 44 msgctxt "form" 45 45 msgid "New Form" 46 46 msgstr "Uusi lomake" 47 47 48 #: classes/class-cpt-wplf-form.php: 5848 #: classes/class-cpt-wplf-form.php:61 49 49 msgid "Add New Form" 50 50 msgstr "Luo uusi lomake" 51 51 52 #: classes/class-cpt-wplf-form.php: 5952 #: classes/class-cpt-wplf-form.php:62 53 53 msgid "New Form" 54 54 msgstr "Uusi lomake" 55 55 56 #: classes/class-cpt-wplf-form.php:6 056 #: classes/class-cpt-wplf-form.php:63 57 57 msgid "Edit Form" 58 58 msgstr "Muokkaa lomaketta" 59 59 60 #: classes/class-cpt-wplf-form.php:6 160 #: classes/class-cpt-wplf-form.php:64 61 61 msgid "View Form" 62 62 msgstr "Näytä lomake" 63 63 64 #: classes/class-cpt-wplf-form.php:6 2 classes/class-cpt-wplf-submission.php:12164 #: classes/class-cpt-wplf-form.php:65 classes/class-cpt-wplf-submission.php:135 65 65 msgid "All Forms" 66 66 msgstr "Kaikki lomakkeet" 67 67 68 #: classes/class-cpt-wplf-form.php:6 368 #: classes/class-cpt-wplf-form.php:66 69 69 msgid "Search Forms" 70 70 msgstr "Etsi lomakkeita" 71 71 72 #: classes/class-cpt-wplf-form.php:6 472 #: classes/class-cpt-wplf-form.php:67 73 73 msgid "No forms found." 74 74 msgstr "Lomakkeita ei löytynt." 75 75 76 #: classes/class-cpt-wplf-form.php:6 576 #: classes/class-cpt-wplf-form.php:68 77 77 msgid "No forms found in Trash." 78 78 msgstr "Roskakorissa ei ole lomakkeita." 79 79 80 #: classes/class-cpt-wplf-form.php:148 80 #: classes/class-cpt-wplf-form.php:105 81 msgid "Permalink is for preview purposes only." 82 msgstr "Kestolinkki toimii vain esikatseluna." 83 84 #: classes/class-cpt-wplf-form.php:163 81 85 msgid "Please enter your name" 82 86 msgstr "Kirjoita nimesi" 83 87 84 #: classes/class-cpt-wplf-form.php:1 4988 #: classes/class-cpt-wplf-form.php:164 85 89 msgctxt "Default placeholder name" 86 90 msgid "John Doe" 87 91 msgstr "Matti Meikäläinen" 88 92 89 #: classes/class-cpt-wplf-form.php:1 5193 #: classes/class-cpt-wplf-form.php:166 90 94 msgid "Please enter your email address" 91 95 msgstr "Kirjoita sähköpostiosoitteesi" 92 96 93 #: classes/class-cpt-wplf-form.php:1 51 classes/class-cpt-wplf-form.php:15497 #: classes/class-cpt-wplf-form.php:166 classes/class-cpt-wplf-form.php:169 94 98 msgid "(required)" 95 99 msgstr "(pakollinen)" 96 100 97 #: classes/class-cpt-wplf-form.php:1 52101 #: classes/class-cpt-wplf-form.php:167 98 102 msgctxt "Default placeholder email" 99 103 msgid "example@email.com" 100 104 msgstr "esimerkki@esimerkki.fi" 101 105 102 #: classes/class-cpt-wplf-form.php:1 54106 #: classes/class-cpt-wplf-form.php:169 103 107 msgid "Write your message below" 104 108 msgstr "Kirjoita viestisi alle" 105 109 106 #: classes/class-cpt-wplf-form.php:1 55110 #: classes/class-cpt-wplf-form.php:170 107 111 msgctxt "Default placeholder message" 108 112 msgid "I wanted to ask about..." 109 113 msgstr "Halusin kysyä..." 110 114 111 #: classes/class-cpt-wplf-form.php:1 57115 #: classes/class-cpt-wplf-form.php:172 112 116 msgid "Submit" 113 117 msgstr "Lähetä" 114 118 115 #: classes/class-cpt-wplf-form.php:1 59119 #: classes/class-cpt-wplf-form.php:174 116 120 msgctxt "The HTML comment at the end of the example form" 117 121 msgid "Any valid HTML form can be used here!" 118 122 msgstr "Tässä toimii mikä tahansa HTML-lomake!" 119 123 120 #: classes/class-cpt-wplf-form.php: 175 classes/class-cpt-wplf-form.php:212124 #: classes/class-cpt-wplf-form.php:201 classes/class-cpt-wplf-form.php:240 121 125 msgid "Shortcode" 122 126 msgstr "Lyhytkoodi" 123 127 124 #: classes/class-cpt-wplf-form.php: 176classes/class-cpt-wplf-submission.php:46128 #: classes/class-cpt-wplf-form.php:202 classes/class-cpt-wplf-submission.php:46 125 129 msgid "Submissions" 126 130 msgstr "Vastaukset" 127 131 128 #: classes/class-cpt-wplf-form.php:2 22132 #: classes/class-cpt-wplf-form.php:250 129 133 msgid "Success Message" 130 134 msgstr "Onnistumisviesti" 131 135 132 #: classes/class-cpt-wplf-form.php:2 32136 #: classes/class-cpt-wplf-form.php:260 133 137 msgid "Form Fields Detected" 134 138 msgstr "Lomakekentät" 135 139 136 #: classes/class-cpt-wplf-form.php:2 41140 #: classes/class-cpt-wplf-form.php:269 137 141 msgid "Emails" 138 142 msgstr "Sähköpostit" 139 143 140 #: classes/class-cpt-wplf-form.php:2 50144 #: classes/class-cpt-wplf-form.php:278 141 145 msgid "Submission Title Format" 142 146 msgstr "Nimi lähetetylle lomakkeelle" 143 147 144 #: classes/class-cpt-wplf-form.php: 273148 #: classes/class-cpt-wplf-form.php:301 145 149 msgctxt "Default success message" 146 150 msgid "Thank you! :)" 147 151 msgstr "Kiitos! :)" 148 152 149 #: classes/class-cpt-wplf-form.php: 294153 #: classes/class-cpt-wplf-form.php:322 150 154 msgid "Fields marked with * are required" 151 155 msgstr "Tähdelliset * kentät on pakollisia" 152 156 153 #: classes/class-cpt-wplf-form.php:3 15157 #: classes/class-cpt-wplf-form.php:343 154 158 msgid "Send an email copy when a form is submitted?" 155 159 msgstr "Lähetä kopio sähköpostiin kun lomake lähetetään?" 156 160 157 #: classes/class-cpt-wplf-form.php:3 31161 #: classes/class-cpt-wplf-form.php:359 158 162 msgid "Submissions from this form will use this formatting in their title." 159 163 msgstr "" … … 161 165 "mukaisesti." 162 166 163 #: classes/class-cpt-wplf-form.php:3 32167 #: classes/class-cpt-wplf-form.php:360 164 168 msgid "You may use any field values enclosed in \"%\" markers." 165 169 msgstr "" 166 170 "Voit käyttää otsikossa mitä tahansa kenttiä arvoja \"%\"-merkkien sisällä." 171 172 #: classes/class-cpt-wplf-form.php:487 173 msgid "This form preview URL is not public and cannot be shared." 174 msgstr "Tämä esikatselusivu ei ole julkinen, eikä sitä voi jakaa." 175 176 #: classes/class-cpt-wplf-form.php:488 177 msgid "Non-logged in visitors will see a 404 error page instead." 178 msgstr "Kirjautumattomille vierailijoille näytetään 404-sivu." 167 179 168 180 #: classes/class-cpt-wplf-submission.php:37 … … 227 239 msgstr "Lomake" 228 240 229 #: classes/class-cpt-wplf-submission.php:1 58241 #: classes/class-cpt-wplf-submission.php:172 230 242 msgid "Submission" 231 243 msgstr "Vastaus" 232 244 233 #: classes/class-cpt-wplf-submission.php:1 78245 #: classes/class-cpt-wplf-submission.php:193 234 246 msgid "Field" 235 247 msgstr "Kenttä" 236 248 237 #: classes/class-cpt-wplf-submission.php:1 79249 #: classes/class-cpt-wplf-submission.php:194 238 250 msgid "Value" 239 251 msgstr "Arvo" … … 267 279 268 280 #. Description of the plugin/theme 269 msgid " HTML form builder for WordPress"270 msgstr " HTML form builder for WordPress"281 msgid "A minimal HTML form builder for WordPress; made for developers" 282 msgstr "Minimalistinen HTML lomakerakentaja WordPressille; tehty kehittäjille." 271 283 272 284 #. Author of the plugin/theme … … 278 290 msgstr "https://github.com/anttiviljami/" 279 291 292 #~ msgid "Form is not publicly visible" 293 #~ msgstr "Lomake ei näy julkisesti" 294 295 #~ msgid ", permalink will not work for visitors." 296 #~ msgstr ", eikä kestolinkki toimi käyttäjillä." 297 298 #~ msgid "Visibility" 299 #~ msgstr "Näkyvyys" 300 301 #~ msgid "Make this form publicly visible with permalink?" 302 #~ msgstr "Näytä lomake julkisesti kestolinkillä?" 303 304 #~ msgid "Subscriber or visitor will see a 404 error page instead of form." 305 #~ msgstr "Tilaaja tai käyttäjä näkee lomakkeen sijaan 404-virhesivun." 306 307 #~ msgid "Make this form publicly visible with direct link?" 308 #~ msgstr "Näytä lomake julkisesti suoralla linkillä?" 309 310 #~ msgid "HTML form builder for WordPress" 311 #~ msgstr "HTML form builder for WordPress" 312 280 313 #~ msgid "referrer" 281 314 #~ msgstr "lähde" -
wp-libre-form/trunk/lang/wp-libre-form-nb_NO.po
r1359097 r1522309 2 2 msgstr "" 3 3 "Project-Id-Version: WP Libre Form\n" 4 "POT-Creation-Date: 2016- 02-21 23:16+0100\n"5 "PO-Revision-Date: 2016- 02-22 15:12+0100\n"4 "POT-Creation-Date: 2016-10-26 10:29+0100\n" 5 "PO-Revision-Date: 2016-10-26 10:29+0100\n" 6 6 "Last-Translator: Antti Kuosmanen <antti@seravo.fi>\n" 7 7 "Language-Team: Antti Kuosmanen <antti@seravo.fi>\n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 1.8. 6\n"13 "X-Generator: Poedit 1.8.8\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-WPHeader: wp-libre-form.php\n" … … 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 22 23 #: classes/class-cpt-wplf-form.php:5 323 #: classes/class-cpt-wplf-form.php:56 24 24 msgctxt "post type general name" 25 25 msgid "Forms" 26 26 msgstr "Skjemaer" 27 27 28 #: classes/class-cpt-wplf-form.php:5 428 #: classes/class-cpt-wplf-form.php:57 29 29 msgctxt "post type singular name" 30 30 msgid "Form" 31 31 msgstr "Skjema" 32 32 33 #: classes/class-cpt-wplf-form.php:5 533 #: classes/class-cpt-wplf-form.php:58 34 34 msgctxt "admin menu" 35 35 msgid "Forms" 36 36 msgstr "Skjemaer" 37 37 38 #: classes/class-cpt-wplf-form.php:5 638 #: classes/class-cpt-wplf-form.php:59 39 39 msgctxt "add new on admin bar" 40 40 msgid "Form" 41 41 msgstr "Skjema" 42 42 43 #: classes/class-cpt-wplf-form.php: 5743 #: classes/class-cpt-wplf-form.php:60 44 44 msgctxt "form" 45 45 msgid "New Form" 46 46 msgstr "nytt skjema" 47 47 48 #: classes/class-cpt-wplf-form.php: 5848 #: classes/class-cpt-wplf-form.php:61 49 49 msgid "Add New Form" 50 50 msgstr "Lag nytt skjema" 51 51 52 #: classes/class-cpt-wplf-form.php: 5952 #: classes/class-cpt-wplf-form.php:62 53 53 msgid "New Form" 54 54 msgstr "nytt skjema" 55 55 56 #: classes/class-cpt-wplf-form.php:6 056 #: classes/class-cpt-wplf-form.php:63 57 57 msgid "Edit Form" 58 58 msgstr "Rediger skjema" 59 59 60 #: classes/class-cpt-wplf-form.php:6 160 #: classes/class-cpt-wplf-form.php:64 61 61 msgid "View Form" 62 62 msgstr "Vis skjema" 63 63 64 #: classes/class-cpt-wplf-form.php:6 2 classes/class-cpt-wplf-submission.php:12164 #: classes/class-cpt-wplf-form.php:65 classes/class-cpt-wplf-submission.php:135 65 65 msgid "All Forms" 66 66 msgstr "Alle skjemaer" 67 67 68 #: classes/class-cpt-wplf-form.php:6 368 #: classes/class-cpt-wplf-form.php:66 69 69 msgid "Search Forms" 70 70 msgstr "Søk etter skjema" 71 71 72 #: classes/class-cpt-wplf-form.php:6 472 #: classes/class-cpt-wplf-form.php:67 73 73 msgid "No forms found." 74 74 msgstr "Ingen skjemaer funnet." 75 75 76 #: classes/class-cpt-wplf-form.php:6 576 #: classes/class-cpt-wplf-form.php:68 77 77 msgid "No forms found in Trash." 78 78 msgstr "Ingen skjema ble funnet i papirkurven" 79 79 80 #: classes/class-cpt-wplf-form.php:148 80 #: classes/class-cpt-wplf-form.php:105 81 msgid "Permalink is for preview purposes only." 82 msgstr "" 83 84 #: classes/class-cpt-wplf-form.php:163 81 85 msgid "Please enter your name" 82 86 msgstr "Vennligst skriv inn ditt navn" 83 87 84 #: classes/class-cpt-wplf-form.php:1 4988 #: classes/class-cpt-wplf-form.php:164 85 89 msgctxt "Default placeholder name" 86 90 msgid "John Doe" 87 91 msgstr "Ola Nordmann" 88 92 89 #: classes/class-cpt-wplf-form.php:1 5193 #: classes/class-cpt-wplf-form.php:166 90 94 msgid "Please enter your email address" 91 95 msgstr "Vennligst skriv inn din e-postadresse" 92 96 93 #: classes/class-cpt-wplf-form.php:1 51 classes/class-cpt-wplf-form.php:15497 #: classes/class-cpt-wplf-form.php:166 classes/class-cpt-wplf-form.php:169 94 98 msgid "(required)" 95 99 msgstr "(påkrevd)" 96 100 97 #: classes/class-cpt-wplf-form.php:1 52101 #: classes/class-cpt-wplf-form.php:167 98 102 msgctxt "Default placeholder email" 99 103 msgid "example@email.com" 100 104 msgstr "eksempel@e-mail.no" 101 105 102 #: classes/class-cpt-wplf-form.php:1 54106 #: classes/class-cpt-wplf-form.php:169 103 107 msgid "Write your message below" 104 108 msgstr "Skriv din melding nedenfor" 105 109 106 #: classes/class-cpt-wplf-form.php:1 55110 #: classes/class-cpt-wplf-form.php:170 107 111 msgctxt "Default placeholder message" 108 112 msgid "I wanted to ask about..." 109 113 msgstr "Jeg ønsket å spørre om ..." 110 114 111 #: classes/class-cpt-wplf-form.php:1 57115 #: classes/class-cpt-wplf-form.php:172 112 116 msgid "Submit" 113 117 msgstr "Send" 114 118 115 #: classes/class-cpt-wplf-form.php:1 59119 #: classes/class-cpt-wplf-form.php:174 116 120 msgctxt "The HTML comment at the end of the example form" 117 121 msgid "Any valid HTML form can be used here!" 118 122 msgstr "Alle gyldig skjema med HTML kan brukes her!" 119 123 120 #: classes/class-cpt-wplf-form.php: 175 classes/class-cpt-wplf-form.php:212124 #: classes/class-cpt-wplf-form.php:201 classes/class-cpt-wplf-form.php:240 121 125 msgid "Shortcode" 122 126 msgstr "Shortcode" 123 127 124 #: classes/class-cpt-wplf-form.php: 176classes/class-cpt-wplf-submission.php:46128 #: classes/class-cpt-wplf-form.php:202 classes/class-cpt-wplf-submission.php:46 125 129 msgid "Submissions" 126 130 msgstr "Svar" 127 131 128 #: classes/class-cpt-wplf-form.php:2 22132 #: classes/class-cpt-wplf-form.php:250 129 133 msgid "Success Message" 130 134 msgstr "Suksessmelding" 131 135 132 #: classes/class-cpt-wplf-form.php:2 32136 #: classes/class-cpt-wplf-form.php:260 133 137 msgid "Form Fields Detected" 134 138 msgstr "Skjemafelt oppdaget" 135 139 136 #: classes/class-cpt-wplf-form.php:2 41140 #: classes/class-cpt-wplf-form.php:269 137 141 msgid "Emails" 138 142 msgstr "E-post" 139 143 140 #: classes/class-cpt-wplf-form.php:2 50144 #: classes/class-cpt-wplf-form.php:278 141 145 msgid "Submission Title Format" 142 146 msgstr "Tittel på svar" 143 147 144 #: classes/class-cpt-wplf-form.php: 273148 #: classes/class-cpt-wplf-form.php:301 145 149 msgctxt "Default success message" 146 150 msgid "Thank you! :)" 147 151 msgstr "Tusen takk! :)" 148 152 149 #: classes/class-cpt-wplf-form.php: 294153 #: classes/class-cpt-wplf-form.php:322 150 154 msgid "Fields marked with * are required" 151 155 msgstr "Feltene merket med * er obligatoriske" 152 156 153 #: classes/class-cpt-wplf-form.php:3 15157 #: classes/class-cpt-wplf-form.php:343 154 158 msgid "Send an email copy when a form is submitted?" 155 159 msgstr "Send en e-post når et skjema er sendt?" 156 160 157 #: classes/class-cpt-wplf-form.php:3 31161 #: classes/class-cpt-wplf-form.php:359 158 162 msgid "Submissions from this form will use this formatting in their title." 159 163 msgstr "Svar fra dette skjemaet vil bruke denne formateringen i tittelen." 160 164 161 #: classes/class-cpt-wplf-form.php:3 32165 #: classes/class-cpt-wplf-form.php:360 162 166 msgid "You may use any field values enclosed in \"%\" markers." 163 167 msgstr "Du kan bruke feltverdier i \"%\" markører." 168 169 #: classes/class-cpt-wplf-form.php:487 170 msgid "This form preview URL is not public and cannot be shared." 171 msgstr "" 172 173 #: classes/class-cpt-wplf-form.php:488 174 msgid "Non-logged in visitors will see a 404 error page instead." 175 msgstr "" 164 176 165 177 #: classes/class-cpt-wplf-submission.php:37 … … 224 236 msgstr "Skjema" 225 237 226 #: classes/class-cpt-wplf-submission.php:1 58238 #: classes/class-cpt-wplf-submission.php:172 227 239 msgid "Submission" 228 240 msgstr "Svar" 229 241 230 #: classes/class-cpt-wplf-submission.php:1 78242 #: classes/class-cpt-wplf-submission.php:193 231 243 msgid "Field" 232 244 msgstr "Felt" 233 245 234 #: classes/class-cpt-wplf-submission.php:1 79246 #: classes/class-cpt-wplf-submission.php:194 235 247 msgid "Value" 236 248 msgstr "Verdi" … … 264 276 265 277 #. Description of the plugin/theme 266 msgid " HTML form builder for WordPress"278 msgid "A minimal HTML form builder for WordPress; made for developers" 267 279 msgstr "" 268 280 -
wp-libre-form/trunk/lang/wp-libre-form.pot
r1359097 r1522309 4 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 5 "Project-Id-Version: WP Libre Form\n" 6 "POT-Creation-Date: 2016- 02-21 23:16+0100\n"6 "POT-Creation-Date: 2016-10-26 10:29+0100\n" 7 7 "PO-Revision-Date: 2016-02-21 14:22+0100\n" 8 8 "Last-Translator: Antti Kuosmanen <antti@seravo.fi>\n" … … 11 11 "Content-Type: text/plain; charset=UTF-8\n" 12 12 "Content-Transfer-Encoding: 8bit\n" 13 "X-Generator: Poedit 1.8. 6\n"13 "X-Generator: Poedit 1.8.8\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-WPHeader: wp-libre-form.php\n" … … 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 22 23 #: classes/class-cpt-wplf-form.php:5 323 #: classes/class-cpt-wplf-form.php:56 24 24 msgctxt "post type general name" 25 25 msgid "Forms" 26 26 msgstr "" 27 27 28 #: classes/class-cpt-wplf-form.php:5 428 #: classes/class-cpt-wplf-form.php:57 29 29 msgctxt "post type singular name" 30 30 msgid "Form" 31 31 msgstr "" 32 32 33 #: classes/class-cpt-wplf-form.php:5 533 #: classes/class-cpt-wplf-form.php:58 34 34 msgctxt "admin menu" 35 35 msgid "Forms" 36 36 msgstr "" 37 37 38 #: classes/class-cpt-wplf-form.php:5 638 #: classes/class-cpt-wplf-form.php:59 39 39 msgctxt "add new on admin bar" 40 40 msgid "Form" 41 41 msgstr "" 42 42 43 #: classes/class-cpt-wplf-form.php: 5743 #: classes/class-cpt-wplf-form.php:60 44 44 msgctxt "form" 45 45 msgid "New Form" 46 46 msgstr "" 47 47 48 #: classes/class-cpt-wplf-form.php: 5848 #: classes/class-cpt-wplf-form.php:61 49 49 msgid "Add New Form" 50 50 msgstr "" 51 51 52 #: classes/class-cpt-wplf-form.php: 5952 #: classes/class-cpt-wplf-form.php:62 53 53 msgid "New Form" 54 54 msgstr "" 55 55 56 #: classes/class-cpt-wplf-form.php:6 056 #: classes/class-cpt-wplf-form.php:63 57 57 msgid "Edit Form" 58 58 msgstr "" 59 59 60 #: classes/class-cpt-wplf-form.php:6 160 #: classes/class-cpt-wplf-form.php:64 61 61 msgid "View Form" 62 62 msgstr "" 63 63 64 #: classes/class-cpt-wplf-form.php:6 265 #: classes/class-cpt-wplf-submission.php:1 2164 #: classes/class-cpt-wplf-form.php:65 65 #: classes/class-cpt-wplf-submission.php:135 66 66 msgid "All Forms" 67 67 msgstr "" 68 68 69 #: classes/class-cpt-wplf-form.php:6 369 #: classes/class-cpt-wplf-form.php:66 70 70 msgid "Search Forms" 71 71 msgstr "" 72 72 73 #: classes/class-cpt-wplf-form.php:6 473 #: classes/class-cpt-wplf-form.php:67 74 74 msgid "No forms found." 75 75 msgstr "" 76 76 77 #: classes/class-cpt-wplf-form.php:6 577 #: classes/class-cpt-wplf-form.php:68 78 78 msgid "No forms found in Trash." 79 79 msgstr "" 80 80 81 #: classes/class-cpt-wplf-form.php:148 81 #: classes/class-cpt-wplf-form.php:105 82 msgid "Permalink is for preview purposes only." 83 msgstr "" 84 85 #: classes/class-cpt-wplf-form.php:163 82 86 msgid "Please enter your name" 83 87 msgstr "" 84 88 85 #: classes/class-cpt-wplf-form.php:1 4989 #: classes/class-cpt-wplf-form.php:164 86 90 msgctxt "Default placeholder name" 87 91 msgid "John Doe" 88 92 msgstr "" 89 93 90 #: classes/class-cpt-wplf-form.php:1 5194 #: classes/class-cpt-wplf-form.php:166 91 95 msgid "Please enter your email address" 92 96 msgstr "" 93 97 94 #: classes/class-cpt-wplf-form.php:1 51 classes/class-cpt-wplf-form.php:15498 #: classes/class-cpt-wplf-form.php:166 classes/class-cpt-wplf-form.php:169 95 99 msgid "(required)" 96 100 msgstr "" 97 101 98 #: classes/class-cpt-wplf-form.php:1 52102 #: classes/class-cpt-wplf-form.php:167 99 103 msgctxt "Default placeholder email" 100 104 msgid "example@email.com" 101 105 msgstr "" 102 106 103 #: classes/class-cpt-wplf-form.php:1 54107 #: classes/class-cpt-wplf-form.php:169 104 108 msgid "Write your message below" 105 109 msgstr "" 106 110 107 #: classes/class-cpt-wplf-form.php:1 55111 #: classes/class-cpt-wplf-form.php:170 108 112 msgctxt "Default placeholder message" 109 113 msgid "I wanted to ask about..." 110 114 msgstr "" 111 115 112 #: classes/class-cpt-wplf-form.php:1 57116 #: classes/class-cpt-wplf-form.php:172 113 117 msgid "Submit" 114 118 msgstr "" 115 119 116 #: classes/class-cpt-wplf-form.php:1 59120 #: classes/class-cpt-wplf-form.php:174 117 121 msgctxt "The HTML comment at the end of the example form" 118 122 msgid "Any valid HTML form can be used here!" 119 123 msgstr "" 120 124 121 #: classes/class-cpt-wplf-form.php: 175 classes/class-cpt-wplf-form.php:212125 #: classes/class-cpt-wplf-form.php:201 classes/class-cpt-wplf-form.php:240 122 126 msgid "Shortcode" 123 127 msgstr "" 124 128 125 #: classes/class-cpt-wplf-form.php: 176129 #: classes/class-cpt-wplf-form.php:202 126 130 #: classes/class-cpt-wplf-submission.php:46 127 131 msgid "Submissions" 128 132 msgstr "" 129 133 130 #: classes/class-cpt-wplf-form.php:2 22134 #: classes/class-cpt-wplf-form.php:250 131 135 msgid "Success Message" 132 136 msgstr "" 133 137 134 #: classes/class-cpt-wplf-form.php:2 32138 #: classes/class-cpt-wplf-form.php:260 135 139 msgid "Form Fields Detected" 136 140 msgstr "" 137 141 138 #: classes/class-cpt-wplf-form.php:2 41142 #: classes/class-cpt-wplf-form.php:269 139 143 msgid "Emails" 140 144 msgstr "" 141 145 142 #: classes/class-cpt-wplf-form.php:2 50146 #: classes/class-cpt-wplf-form.php:278 143 147 msgid "Submission Title Format" 144 148 msgstr "" 145 149 146 #: classes/class-cpt-wplf-form.php: 273150 #: classes/class-cpt-wplf-form.php:301 147 151 msgctxt "Default success message" 148 152 msgid "Thank you! :)" 149 153 msgstr "" 150 154 151 #: classes/class-cpt-wplf-form.php: 294155 #: classes/class-cpt-wplf-form.php:322 152 156 msgid "Fields marked with * are required" 153 157 msgstr "" 154 158 155 #: classes/class-cpt-wplf-form.php:3 15159 #: classes/class-cpt-wplf-form.php:343 156 160 msgid "Send an email copy when a form is submitted?" 157 161 msgstr "" 158 162 159 #: classes/class-cpt-wplf-form.php:3 31163 #: classes/class-cpt-wplf-form.php:359 160 164 msgid "Submissions from this form will use this formatting in their title." 161 165 msgstr "" 162 166 163 #: classes/class-cpt-wplf-form.php:3 32167 #: classes/class-cpt-wplf-form.php:360 164 168 msgid "You may use any field values enclosed in \"%\" markers." 169 msgstr "" 170 171 #: classes/class-cpt-wplf-form.php:487 172 msgid "This form preview URL is not public and cannot be shared." 173 msgstr "" 174 175 #: classes/class-cpt-wplf-form.php:488 176 msgid "Non-logged in visitors will see a 404 error page instead." 165 177 msgstr "" 166 178 … … 226 238 msgstr "" 227 239 228 #: classes/class-cpt-wplf-submission.php:1 58240 #: classes/class-cpt-wplf-submission.php:172 229 241 msgid "Submission" 230 242 msgstr "" 231 243 232 #: classes/class-cpt-wplf-submission.php:1 78244 #: classes/class-cpt-wplf-submission.php:193 233 245 msgid "Field" 234 246 msgstr "" 235 247 236 #: classes/class-cpt-wplf-submission.php:1 79248 #: classes/class-cpt-wplf-submission.php:194 237 249 msgid "Value" 238 250 msgstr "" … … 266 278 267 279 #. Description of the plugin/theme 268 msgid " HTML form builder for WordPress"280 msgid "A minimal HTML form builder for WordPress; made for developers" 269 281 msgstr "" 270 282 -
wp-libre-form/trunk/readme.md
r1450731 r1522309 90 90 ``` 91 91 92 ### Add own css classes to form output92 ### Client side callbacks 93 93 94 You can use the attribute xclass inside the shortcode to set own extra css classes. 94 WP Libre Form supports client side callbacks after form submission using window.wplf object. Example usage: 95 96 ``` 97 window.wplf.successCallbacks.push(function(response){ 98 alert("You succesfully submitted form " + response.form_id); 99 }); 100 101 window.wplf.errorCallbacks.push(function(response){ 102 alert("Form submission failed!"); 103 }); 104 ``` 105 106 These callbacks are executed in the order they appear. 107 108 ### Add CSS classes to form output 109 110 You can use the xclass attribute inside the shortcode to add your own extra classes. 95 111 96 112 ``` … … 124 140 } 125 141 ``` 142 143 ### wplf_validate_submission example: Google ReCaptcha integration 144 145 ```php 146 /** 147 * ReCaptcha for WP Libre Form 148 */ 149 add_filter( 'wplf_validate_submission', 'wplf_recaptcha' ); 150 function wplf_recaptcha( $return ) { 151 // skip this validation if submission has already failed 152 if( ! $return->ok ) { 153 return $return; 154 } 155 156 $form = get_post( (int) $_POST['_form_id'] ); 157 if( false === strpos( $form->post_content, 'g-recaptcha' ) ) { 158 // this form doesn't have recaptcha 159 return $return; 160 } 161 162 $secret = 'XXXX'; // substitute with your own secret recaptcha key 163 164 $options = [ 165 'http' => [ 166 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 167 'method' => 'POST', 168 'content' => http_build_query([ 169 'secret' => $secret, 170 'response' => $_POST['g-recaptcha-response'], 171 ]) 172 ], 173 ]; 174 $context = stream_context_create( $options ); 175 $result = file_get_contents( 'https://www.google.com/recaptcha/api/siteverify', false, $context ); 176 177 $captcha_obj = json_decode( $result ); 178 179 if( false === $captcha_obj->success ) { 180 $return->ok = 0; 181 $return->error = sprintf( __("Please prove you're not a robot before submitting."), intval( $_POST['_form_id'] ) ); 182 } 183 184 return $return; 185 } 186 ``` -
wp-libre-form/trunk/readme.txt
r1450731 r1522309 4 4 Donate link: https://github.com/anttiviljami 5 5 Requires at least: 4.2 6 Tested up to: 4. 4.47 Stable tag: 1. 0.26 Tested up to: 4.6.1 7 Stable tag: 1.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
wp-libre-form/trunk/wp-libre-form.php
r1450731 r1522309 4 4 * Plugin URI: https://github.com/anttiviljami/wp-libre-form 5 5 * Description: A minimal HTML form builder for WordPress; made for developers 6 * Version: 1. 0.26 * Version: 1.1 7 7 * Author: @anttiviljami 8 8 * Author URI: https://github.com/anttiviljami/ … … 31 31 32 32 if ( ! class_exists( 'WP_Libre_Form' ) ) : 33 34 define( 'WPLF_VERSION', '1.1' ); 33 35 34 36 class WP_Libre_Form { … … 75 77 */ 76 78 public static function load_our_textdomain() { 77 load_plugin_textdomain( 'wp-libre-form', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 79 $loaded = load_plugin_textdomain( 'wp-libre-form', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 80 81 if( !$loaded ) { 82 $loaded = load_muplugin_textdomain( 'wp-libre-form', dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 83 } 78 84 } 79 85
Note: See TracChangeset
for help on using the changeset viewer.