In this short article, I am going to explain the way to use third party libraries in Codeigniter 3. As it is well know Codeigniter is a very flexible MVC. In Codeigniter, there is a folder called third_party in application folder. It is recommended to keep all your third party libraries in the third_party folder. […]
PHP
Search product by multiple SKU in wordpress admin
This small plugin provide the functionality to add a button to upload CSV and then search the products by sku which are in first column of csv. Create a folder by name ‘multiple-sku-search’ under plugins directory of wordpress site. In this folder create a file ‘multiple-sku-search.php’ and copy-paste the above code in this file. Now […]
Delete all attribute name in woocommerce
To delete all attribute names in woocommerce
Display all hooks functions added to hook
Sometime it is required to list all the functions added to a hook in WordPress, Below in the given code, add this code to functions.php of theme and hit the site on front-end it will display all the added functions add to that hook with the priority of hooked function.
WordPress page template to access htaccess protected pdf file
WordPress page template to access htaccess protected pdf file: <?php /* pdf file download provision */ $download_success = false; $file_found = false; if(current_user_can( ‘manage_options’ )){ $doc = esc_url($_GET[‘doc’]); echo $file = str_replace(‘https://wma.ie/’,ABSPATH ,$doc); if (file_exists($file)) { $file_found = true; ob_clean(); flush(); header(‘Content-Description: File Transfer’); header(‘Content-Type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=’.basename($file)); header(‘Content-Transfer-Encoding: binary’); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate’); […]
Base64 encoded image save by PHP
How to save base64 encoded image in a file using PHP <?php /// define upload directory define(‘UPLOAD_DIR’, ‘images/’); /// explode on ;base64 to know image type from encoded string $image_parts = explode(“;base64,”, $_POST[‘image’]); $image_type_aux = explode(“image/”, $image_parts[0]); $image_type = $image_type_aux[1]; $image_base64 = base64_decode($image_parts[1]); /// create file path with file name $filepath = UPLOAD_DIR .’img_’. […]