The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Revised by Bytes Unlimited : Feb 3rd 2020
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| insert_final_newline = true | |
| indent_style = space | |
| indent_size = 4 | |
| trim_trailing_whitespace = true |
| { | |
| "preset": "psr12", | |
| "rules": { | |
| "align_multiline_comment": true, | |
| "array_indentation": true, | |
| "array_syntax": true, | |
| "blank_line_after_namespace": true, | |
| "blank_line_after_opening_tag": true, | |
| "combine_consecutive_issets": true, | |
| "combine_consecutive_unsets": true, |
| <?php | |
| /** | |
| * Validate our custom text input field value | |
| */ | |
| function plugin_republic_add_to_cart_validation( $passed, $product_id, $quantity, $variation_id=null ) { | |
| if( empty( $_POST['pr-field'] ) ) { | |
| $passed = false; | |
| wc_add_notice( __( 'Your name is a required field.', 'plugin-republic' ), 'error' ); | |
| } | |
| return $passed; |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.php$ - [L] | |
| # add a trailing slash to /wp-admin | |
| RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | |
| RewriteCond %{REQUEST_FILENAME} -f [OR] | |
| RewriteCond %{REQUEST_FILENAME} -d | |
| RewriteRule ^ - [L] | |
| RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] | |
| RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] |
| { | |
| "Name": "Navn", | |
| "Email": "E-mail adresse", | |
| "Password": "Kodeord", | |
| "Confirm Password": "Bekræft Kodeord", | |
| "Already registered?": "Allerede registreret?", | |
| "Register": "Opret", | |
| "Remember me": "Husk mig", | |
| "Forgot your password?": "Glemt dit kodeord?", | |
| "Log in": "Log ind", |
| expect 100-continue | |
| content-length 1998 | |
| connection close | |
| x-wc-webhook-delivery-id 36e520ebabc2fa725092ff4a47acedf2 | |
| x-wc-webhook-id 3 | |
| x-wc-webhook-signature 5poyFy4qB6fdvvT5pGbefZmfkpL48uD47F0WYwfmpo4= | |
| x-wc-webhook-event created | |
| x-wc-webhook-resource order | |
| x-wc-webhook-topic order.created | |
| x-wc-webhook-source https://www.website.com/ |
Using the REST API to upload a file to WordPress is
quite simple. All you need is to send the file in a
POST-Request to the wp/v2/media route.
There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:
| <?php | |
| // Part 1 | |
| // Display Radio Buttons | |
| add_action( 'woocommerce_review_order_before_payment', 'bbloomer_checkout_radio_choice' ); | |
| function bbloomer_checkout_radio_choice() { | |
| $chosen = WC()->session->get( 'radio_chosen' ); |