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 / WordPressMultisiteValetDriver.php
Last active January 11, 2021 11:50
WordPress - MultiSite Valet Drivers
<?php
/*
Valet driver for Wordpress Multisite
Usage: Drop this file into your ~/.valet/Drivers/ directory
*/
class WordPressMultisiteValetDriver extends WordPressValetDriver
{
@milanarandjelovic
milanarandjelovic / bootstrap-pagination.php
Last active January 11, 2021 11:50
WordPress - Bootstrap 4 pagination
<?php
/**
* Template for displaying bootstrap 4 post pagination.
*
* @package WordPress
* @subpackage Bootstrap
* @author Milan Arandjelovic
*/
if ( ! function_exists( 'bootstrap_pagination' ) ) {
@milanarandjelovic
milanarandjelovic / wp-bootstrap-paging-nav.php
Last active January 11, 2021 11:51
WordPress - Template for displaying post pagination (Bootstrap Pager).
<?php
/**
* Template for displaying post pagination.
*
* @package WordPress
* @subpackage WPBootstrap
* @author Milan Arandjelovic
*/
?>
@milanarandjelovic
milanarandjelovic / KeyGenerateCommand.php
Last active May 29, 2017 18:14
Laravel\Lumen Key Generator Commands
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class KeyGenerateCommand extends Command
{
/**
@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')) {