- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
| <?php | |
| /** | |
| * Client wants only logged in users to see prices and buy non-sale items while allowing all users to see prices and buy | |
| * on sale items | |
| */ | |
| /** | |
| * | |
| * filters woocommerce_is_purchasable for not onsale items | |
| * | 
| <?php | |
| /** | |
| * Order product collections by stock status, instock products first. | |
| */ | |
| class iWC_Orderby_Stock_Status | |
| { | |
| public function __construct() | |
| { | 
| <?php | |
| /* | |
| * @version 1.1.0 | |
| */ | |
| add_action( 'woocommerce_after_shop_loop_item_title', 'lpb_wc_add_product_options', 9 ); | |
| function lpb_wc_add_product_options () { | |
| global $post; | |
| $product = wc_get_product( $post->ID ); | |
| if ( ! $product->is_type( 'variable' ) ) return; | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="Overlay color using pseudo-element ::after"> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" rel="stylesheet" type="text/css" /> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| .bg { | 
| <?php | |
| class My_Custom_My_Account_Endpoint { | |
| /** | |
| * Custom endpoint name. | |
| * | |
| * @var string | |
| */ | |
| public static $endpoint = 'my-custom-endpoint'; | 
| <?php | |
| /** | |
| *Reduce the strength requirement on the woocommerce password. | |
| * | |
| * Strength Settings | |
| * 3 = Strong (default) | |
| * 2 = Medium | |
| * 1 = Weak | |
| * 0 = Very Weak / Anything | |
| */ | 
| function mysite_pending($order_id) { | |
| error_log("$order_id set to PENDING", 0); | |
| } | |
| function mysite_failed($order_id) { | |
| error_log("$order_id set to FAILED", 0); | |
| } | |
| function mysite_hold($order_id) { | |
| error_log("$order_id set to ON HOLD", 0); | |
| } | |
| function mysite_processing($order_id) { | 
| <?php | |
| // Insert into your functions.php and have fun by creating login error msgs | |
| function guwp_error_msgs() { | |
| // insert how many msgs you want as array items. it will be shown randomly (html is allowed) | |
| $custom_error_msgs = [ | |
| '<strong>YOU</strong> SHALL NOT PASS!', | |
| '<strong>HEY!</strong> GET OUT OF HERE!', | |
| ]; | |
| // get and returns a random array item to show as the error msg | |
| return $custom_error_msgs[array_rand($custom_error_msgs)]; |