Skip to content

Instantly share code, notes, and snippets.

@RalfAlbert
RalfAlbert / _wp_environment_check.php
Created January 11, 2012 06:39
WordPress Environment Check - Checks the minimum needed versions (WP, PHP, MySQL)
<?php
/**
*
* Class to check the environment (WordPress-, PHP and MySQL-version)
* Test only on minimum or equal version
*
* @author Ralf Albert
* @version 1.0
* @link https://gist.github.com/1593410
* @license GPL
<?php
/**
* Meine Dokumentation zu der Funktion xyz die dafuer sorgt das XYZ etwas macht
*
* @autor Rene Reimann
* @package Theme XYZ
*/
if ( ! class_exists( 'register_custom_post_types' ) ) {
@RalfAlbert
RalfAlbert / multi_checkbox.php
Created February 11, 2012 14:14
Handling multiple checkboxes in an easy way
<?php
$mPost = array(
'action' => 'send',
'user' => 'Horst',
'a' => 'On',
'c' => 'On',
'foo' => 'bar',
'baz' => '',
);
@RalfAlbert
RalfAlbert / file1.php
Created March 20, 2012 17:20
Example 1 for Formatter
<?php
require_once 'class-formatter.php';
class Lister extends Formatter
{
public function get_list( $data = array() ){
$inner = new stdClass();
$values = new stdClass();
@RalfAlbert
RalfAlbert / file1.php
Created March 20, 2012 17:40
Example 2 for Formatter
<?php
require_once 'class-formatter.php';
class Lister extends Formatter
{
public $templates = array();
public function __construct(){
$this->templates = $this->get_templates();
@RalfAlbert
RalfAlbert / class-lister.php
Created March 21, 2012 09:35
Example 3 for Formatter
<?php
require_once 'class-formatter.php';
require_once 'class-templates.php';
interface Templates
{
public function get_templates();
}
class Lister extends Formatter
@RalfAlbert
RalfAlbert / file1.php
Created May 26, 2012 17:54
Simple-Templates: The Template-Classes
<?php
/**
*
* Abstract class Wp Simple Templates define one method to retrive the defined templates
* @author Ralf Albert
*
*/
abstract class WP_Simple_Templates
{
@RalfAlbert
RalfAlbert / file1.php
Created May 26, 2012 22:33
Simple-Templates: The Template-Engine
<?php
/**
*
* Abstract class WP Simple Templater creates a copy of the template-class and
* provide the templates to the template-engine
* @author Ralf Albert
*
*/
abstract class WP_Simple_Templater extends Formatter
{
@RalfAlbert
RalfAlbert / file1.php
Created May 26, 2012 22:37
Simple-Templates: The Demo
<?php
class Template_Engine_Test
{
/**
*
* Container for the different template-engines
* @var object $template_engine
*/
public static $template_engine;
@RalfAlbert
RalfAlbert / resize_thickbox.js
Created May 30, 2012 17:30
Groesse der Thickbox automatisch an den Inhalt anpassen. Thickbox automatically adjust the size of the content
jQuery(document).ready(
function($){
resize_thickbox_iframe();
/*
*
* some other jQuery code
*
*/