Skip to content

Instantly share code, notes, and snippets.

View milanarandjelovic's full-sized avatar

Milan Arandjelovic milanarandjelovic

View GitHub Profile
@milanarandjelovic
milanarandjelovic / multiple-insert-on-duplicate-update.php
Last active January 11, 2021 11:50 — forked from techslides/multiple-insert-on-duplicate-update.php
WordPress - INSERT on duplicate update PHP function for WordPress multiple or batch operation
<?php
//based on Wordpress Multiple Insert https://github.com/mirzazeyrek/wordpress-multiple-insert
function wp_insert_update_rows($row_arrays = array(), $wp_table_name) {
global $wpdb;
$wp_table_name = esc_sql($wp_table_name);
$update = "";
$query = "";
$query_columns = "";
$query. = "INSERT INTO {$wp_table_name} (";
@milanarandjelovic
milanarandjelovic / App\Exceptions\Handler.php
Last active November 27, 2018 09:10 — forked from jacurtis/App\Exceptions\Handler.php
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
<?php
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {