Skip to content

Instantly share code, notes, and snippets.

@RalfAlbert
RalfAlbert / themes_functions-php.part.php
Created December 31, 2012 11:19
themes_functions-php.part.php
<?php
/**
* Remove forgetmenot-checkbox on login screen
* Uses the hook 'after_theme_setup' instead of 'plugins_loaded' because
* first the theme have to be setup for get_template_directory_uri()
*
* @uses add_action()
* @hook after_setup_theme
*/
@RalfAlbert
RalfAlbert / functions-php.part.php
Last active December 10, 2015 08:38
Removing the Forgetmenot-checkbox on the WordPress login screen.
<?php
/**
* Remove forgetmenot-checkbox on login screen
* Uses the hook 'after_theme_setup' instead of 'plugins_loaded' because
* first the theme have to be setup for get_template_directory_uri()
*
* @uses add_action()
* @hook after_setup_theme
*/
@RalfAlbert
RalfAlbert / class-collectionmanager.php
Last active December 10, 2015 06:18
Managing complex datastructures with a class
<?php
class CollectionManagement
{
/**
* Option key
* @var string
*/
const OPTION_KEY = 'collection_settings';
/**
@RalfAlbert
RalfAlbert / class-safe_register_scripts.php
Created December 16, 2012 21:43
A class to safely registering scripts in WordPress
<?php
/**
* Safely registering scripts without script collisions
* @package WordPress
* @author Ralf Albert
*
*/
class Safe_Registering_Scripts
{
@RalfAlbert
RalfAlbert / index.php
Created December 2, 2012 14:05
Insert custom fields at user registration v2
<?php
/**
* Plugin Name: Custom user registration fields
* Plugin URI: http://yoda.neun12.de
* Description: Add custom fields to the user registration
* Version: 0.1
* Author: Ralf Albert
* Author URI: http://yoda.neun12.de
* Text Domain:
* Domain Path:
@RalfAlbert
RalfAlbert / index.php
Created December 2, 2012 12:39
Insert custom fields at user registration
<?php
/**
* Plugin Name: Custom user registration fields
* Plugin URI: http://yoda.neun12.de
* Description: Add custom fields to the user registration
* Version: 0.1
* Author: Ralf Albert
* Author URI: http://yoda.neun12.de
* Text Domain:
* Domain Path:
@RalfAlbert
RalfAlbert / index.php
Created December 1, 2012 20:10
Keyboard shortcuts for HTML editor in WordPress
<?php
/**
* Plugin Name: Keyboardshortcuts for html editor
* Plugin URI: http://yoda.neun12.de
* Description: Adding keyboardshortcuts to the html editor
* Version: 0.1
* Author: Ralf Albert
* Author URI: http://yoda.neun12.de
* Text Domain:
* Domain Path:
@RalfAlbert
RalfAlbert / switchtheme.php
Created November 25, 2012 21:17
Switch theme on specific page
<?php
/*
Plugin Name: Switch Theme
Plugin URI:
Description:
Version:
Author:
Author URI:
License:
*/
@RalfAlbert
RalfAlbert / wp_use_smtp.php
Created September 27, 2012 16:21
WordPress use SMTP instead of mail()
<?php
/**
* WordPress-Plugin use smtp instead of mail()
*
* PHP version 5.2
*
* @category PHP
* @package WordPress
* @subpackage UseSMTP
* @author Ralf Albert <me@neun12.de>
@RalfAlbert
RalfAlbert / wp_last_post_change.php
Created August 8, 2012 00:22
Date of last modification if at least one day later than the post creation date.
<?php
/**
* Date of last modification if at least one day later than the post creation date.
*
* @author Thomas Scholz
* @param string $template Parsed with sprintf(). Must contain a '%s'.
* @param string|int $time_diff Time difference as string for strtotime() or integer as seconds
* @return string|void
*/
function t5_post_last_mode( $template = '%s', $time_diff )