Skip to content

Instantly share code, notes, and snippets.

View Firestorm-Graphics's full-sized avatar

Firestorm Graphics Firestorm-Graphics

View GitHub Profile
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
));
@Firestorm-Graphics
Firestorm-Graphics / options-backup.php
Last active December 17, 2015 00:58
Back up page add on for devins Options Framework, Inline styles added for portability, best solution is to replace them with a new css file and enqueue it.
<?php ob_start();
if(! class_exists('PUR_Backup')) {
class PUR_Backup {
public function __construct () {
if ( current_user_can( 'edit_theme_options' ) ) {
add_action( 'admin_menu', array(&$this, 'add_page'));
}
/**
* plugin.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* plugin.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
@Firestorm-Graphics
Firestorm-Graphics / example.html
Last active August 7, 2016 20:18 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@Firestorm-Graphics
Firestorm-Graphics / Shuttle_Dumper.php
Last active July 9, 2017 16:35
userspice 4 backup
<?php
//bold("<br><br>Shuttle Dumper included");
/**
* Abstract dump file: provides common interface for writing
* data to dump files.
*/
abstract class Shuttle_Dump_File {
/**
* File Handle
*/
@Firestorm-Graphics
Firestorm-Graphics / class.autoloader.php
Last active July 16, 2017 11:20
userspice 4 autoload
<?php
/*
UserSpice 4
An Open Source PHP User Management System
by the UserSpice Team at http://UserSpice.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@Firestorm-Graphics
Firestorm-Graphics / Autoloader.php
Last active February 6, 2021 22:46 — forked from Nilpo/Autoloader.php
A simple recursive PHP autoloader using the RecursiveDirectoryIterator.
<?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Rob Dunham
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@Firestorm-Graphics
Firestorm-Graphics / autoloader.php
Created July 7, 2017 11:04
Here’s an autoloader class I came up with for one of my framework-free PHP projects. Autoloading is a way to let PHP know how you’ve architected your class file locations hierarchy by supplying it with a function to run. This function will handle the including of the class file. This is awesome because we don’t need to hard code every file inclu…
<?php
class Autoloader {
static public function loader($className) {
$filename = "Classes/" . str_replace("\\", '/', $className) . ".php";
if (file_exists($filename)) {
include($filename);
if (class_exists($className)) {
return TRUE;
}
}
@Firestorm-Graphics
Firestorm-Graphics / Hooks.php
Created July 14, 2017 13:50
Hooks for userspice 4
<?php
/*
UserSpice 4
An Open Source PHP User Management System
by the UserSpice Team at http://UserSpice.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.