WordPress – source link plugin – how to modify it?

You can add the extra (link/URL label) field like so: In the wpse_source_meta_box() function, add the (HTML of the) extra field: echo ‘<input type=”text” id=”source-link-label”” name=”source_link_label” value=”‘. get_post_meta( $post->ID, ‘_source_link_label’, true ) .'” size=”25″ />’; so as you can see, the field name is _source_link_label as used in the get_post_meta() call when retrieving the field … Read more

Woocomerce add info after order email prouct item

you can do this with a differnent woocommerce hook: woocommerce_order_item_meta_end ($item_id, $item, $order, $plain_text) use it similarly to the cart filter above. For a visual representation if you want the additional information somewhere else see this link: https://businessbloomer.com/woocommerce-visual-hook-guide-emails/ You can also always go right to the source and see all the hooks/filters/actions in woocommerce: https://docs.woocommerce.com/wc-apidocs/hook-docs.html … Read more

Programatically upload a file to be stored inside blob field in database, NOT on filesystem

After some further experimenting and talking to a colleague, we found the answer (team effort!) altering how the file handler deals with the file content. // Assign values required $wx_fileName = $_FILES[‘file’][‘name’][$i]; $wx_fileMime = $_FILES[‘file’][‘type’][$i]; $wx_fileSize = $_FILES[‘file’][‘size’][$i]; $wx_tmpf = $_FILES[‘file’][‘tmp_name’][$i]; //$wx_file = fopen($_FILES[‘file’][‘tmp_name’][$i], “rb”); $wx_file = base64_encode(file_get_contents($_FILES[‘file’][‘tmp_name’][$i])); Basically replacing fopen() with file_get_contents() and base64 … Read more