Skip to content

Instantly share code, notes, and snippets.

View rajeebbanstola's full-sized avatar

Rajeeb rajeebbanstola

View GitHub Profile
<?php
/*
Plugin Name: Fullscreen Preview Button
Description: Add a preview button to the fullscreen editor toolbar.
Version: 1.2
Author: Alex King
Author URI: http://alexking.org
License: GPL2
*/
/* ==========================================================================
Custom Walker Menu
========================================================================== */
class mbt_split_nav_walker extends Walker_Nav_Menu {
var $current_menu = null;
var $break_point = null;
function start_el(&$output, $item, $depth, $args) {

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
function enqueue_my_styles() {
global $wp_styles;
// Load the main stylesheet
wp_enqueue_style( 'my-theme', get_stylesheet_uri() );

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

/* ==========================================================================
Custom Walker Menu
========================================================================== */
class mbt_split_nav_walker extends Walker_Nav_Menu {
var $current_menu = null;
var $break_point = null;
function start_el(&$output, $item, $depth, $args) {
@rajeebbanstola
rajeebbanstola / images.php
Last active September 11, 2015 05:24 — forked from BrandonShutter/images.php
Remove WordPress automatic cropping
<?php
/**
* Remove standard image sizes so that these sizes are not created during the Media Upload process
*
* @param $sizes, array of default images
* @return $sizes, new array of images
*/
function cn_image_sizes( $sizes) {
<?php
add_action( 'wp_enqueue_scripts', 'colormag_scripts_styles_method' );
/**
* Enqueues styles and scripts.
*/
function colormag_scripts_styles_method() {
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'colormag-bxslider', COLORMAG_JS_URL . '/jquery.bxslider' . $suffix . '.js', array( 'jquery' ), '4.1.2', true );