Skip to content

Instantly share code, notes, and snippets.

@thefuxia
thefuxia / class.TTT_Contactfields.php
Created October 9, 2010 22:10 — forked from anonymous/class.TTT_Contactfields.php
Manager for WordPress’ contact fields
<?php
/**
* Manage WordPress contact fields.
* Usage:
require './class.TTT_Contactfields.php';
$TTT_Contactfields = new TTT_Contactfields(
array (
'Twitter'
, 'Facebook'
@thefuxia
thefuxia / strip-query-string.php
Created November 9, 2010 23:01
WordPress: Removes the version parameter from the script URI for the Google CDN.
<?php
// for the functions.php
add_filter('script_loader_src', 'toscho_script_loader_filter');
/**
* Removes the version parameter from the script URI for the Google CDN.
*
* @param string $src Original script URI
* @return string
*/
@thefuxia
thefuxia / upload-info-shortcode.php
Created November 16, 2010 11:24
WordPress-Plugin: Show Upload Info
<?php
/*
Plugin Name: Show Upload Info
Description: Insert [uploadinfo] into a page to get detailed information about your upload environment.
Version: 1.3
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL v2
*/
if ( ! function_exists( 'uploadinfo_shortcode' ) )
@thefuxia
thefuxia / class.TTT_User_Profile_Addon.php
Created January 2, 2011 03:28
Class to add custom fields to the user profile in WordPress.
<?php
/**
* Adds a form field to the edit profile page.
*
* Usage:
add_action( 'init', 'init_profile_addons' );
function init_profile_addons()
{
$GLOBALS['extended_author_text'] = new TTT_User_Profile_Addon(
array (
@thefuxia
thefuxia / extended-help.php
Created February 28, 2011 16:23
WP-Plugin Extended Help
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: Extended Help
Description: Help texts for super heroes
Version: 0.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
@thefuxia
thefuxia / placekitten.php
Created March 5, 2011 21:49
WordPress Plugin for kitten placeholders. Defines an action and a shortcode.
<?php
/*
Plugin Name: Placekitten
Description: Shortcode [placekitten w=100 h=300 g=1 alt=kitten] and action.
Version: 1.0
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
@thefuxia
thefuxia / utf8_truncate.php
Created March 10, 2011 16:09
function utf8_truncate() for WordPress
<?php
/**
* Shortens an UTF-8 encoded string without breaking words.
*
* @link http://wordpress.stackexchange.com/q/11085/11089#11089
* @param string $string string to shorten
* @param int $max_chars maximal length in characters
* @param string $append replacement for truncated words.
* @return string
*/
@thefuxia
thefuxia / list-comment-filters.php
Last active January 15, 2022 18:53
WordPress Plugin: List Comment Filters
<?php
/*
Plugin Name: List Comment Filters
Description: List all comment filters on wp_footer
Version: 1.1
Author: Fuxia Scholz
License: GPL v2
*/
add_action( 'wp_footer', 'list_comment_filters' );
@thefuxia
thefuxia / rename-cpt-sub.php
Created March 27, 2011 17:30
Renames the first submenu item for a custom post type
<?php
/*
Plugin Name: *WPSE13210
*/
! defined( 'ABSPATH' ) and exit;
add_action( 'init', 'register_academia' );
/**
* Registers te post type academias
@thefuxia
thefuxia / blog.fefe.css
Created March 31, 2011 11:59
User stylesheet for blog.fefe.de
body
{
padding: 30px 15%;
font-family: Georgia !important;
line-height: 1.45;
max-width: 40em;
background: #f5f5ee;
}
body>ul>li
{