This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DateFormat { | |
const DATE_SHORT = 'Y-m-d'; | |
const DATE_LONG = 'F j, Y'; | |
const DATETIME_SHORT = 'Y-m-d H:i'; | |
const DATETIME_LONG = 'F j, Y, g:i a'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$host = 'localhost'; // MYSQL database host adress | |
$db = ''; // MYSQL database name | |
$user = ''; // Mysql Datbase user | |
$pass = ''; // Mysql Datbase password | |
// Connect to the database | |
$link = mysql_connect($host, $user, $pass); | |
mysql_select_db($db); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Widget_Setup | |
{ | |
public $widget_class = ''; | |
public $admin_styles = array(); | |
public $admin_scripts = array(); | |
public $front_styles = array(); | |
public $front_scripts = array(); | |
public $script_defaults = array( | |
'handle' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. | |
* $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* requires jQuery | |
* usage: | |
* Scroller.to({ offset: 100 }); | |
* Scroller.to({ target: $('#main') }); | |
* | |
* advanced usage (with additional easing function not provided here) | |
* Scroller.to({ target: $('#main'), delay: 500, multiplier: 1.5, easing: 'easeOutQuad' }); | |
*/ | |
var Scroller = (function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Google+ Feed | |
*/ | |
/** | |
* A WordPress page template for a Google+ feed. | |
* | |
* @author Dominik Schilling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once(ABSPATH . WPINC . '/feed.php'); | |
if(function_exists('fetch_feed')) { | |
$feed = fetch_feed('http://example.com/feed/'); | |
if (!is_wp_error($feed)) : $feed->init(); | |
$feed->set_output_encoding('UTF-8'); // set encoding | |
$feed->handle_content_type(); // ensure encoding | |
$feed->set_cache_duration(21600); // six hours in seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'manage_posts_columns', 'your_custom_cols' ); //Filter out Post Columns with 2 custom columns | |
function your_custom_cols($defaults) { | |
$defaults['language'] = __('Language'); //Language and Films is name of column | |
$defaults['film'] = __('Films'); | |
return $defaults; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//We can add a field as follows: | |
function add_comment_fields($fields) { | |
$fields['age'] = '<p class="comment-form-age"><label for="age">' . __( 'Age' ) . '</label>' . | |
'<input id="age" name="age" type="text" size="30" /></p>'; | |
return $fields; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Authenticate Users Remotely | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.net/ | |
License: GPL2 | |
*/ | |
add_filter('xmlrpc_methods', 'wpse39662_add_login_method' ); | |
/** |
OlderNewer