Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* Plugin Name: Custom E-mail
* Description: Enabling this module will initialize custom e-mails. You will then have to configure the settings via the "E-mail" tab.
*
* Holds Theme My Login Custom E-mail class
*
* @package Theme_My_Login
* @subpackage Theme_My_Login_Custom_Email
* @since 6.0
if( ! get_role('simple_user')){
add_role(
'simple_user',
__( 'Użytkownik' ),
array(
'read' => true, // true allows this capability
)
);
}
<?php
/**
* Plugin Name: Replace WordPress Dashboard
* Description: Replaces the default WordPress dashboard with a custom one.
* Author: Micah Wood
* Author URI: http://micahwood.me
* Version: 0.1
* License: GPL3
*/
function login_with_email_address($username) {
$user = get_user_by('email',$username);
if(!empty($user->user_login))
$username = $user->user_login;
return $username;
}
add_action('wp_authenticate','login_with_email_address');
function change_username_wps_text($text){
if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){
if ($text == 'Username'){$text = 'Username / Email';}
<?php
//password resetter
include("wp-config.php");
include("wp-blog-header.php");
if (empty($_POST['emergency_pass'])) {
?>
<form method="post">
set admin password: <input name="emergency_pass" type="password" />
<input type="submit" />
</form>
//How to edit a user profile on the front end?
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end
//Forcing nickname as display_name in custom edit profile template
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template
///////
<?php
/* Pierre de la Martinière
*
* display all languages avalaible for a Wordpress Theme using WPML
* directly echo something like "en fr it ru" ...
*
* more info at http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/
*
*/
function language_selector_flags(){
<?php
add_action( 'admin_enqueue_scripts', 'admin_print_js' );
public function admin_print_js() {
global $wp_locale;
//add the jQuery UI elements shipped with WP
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-datepicker' );
processTimes: function() {
var startDate = '';
var startDisplay = 'Date to be announced';
var startDisplayShort = 'TBA';
var startCountdown = '';
var startTime = 4100745600000; // Change this in 2099
var startDiff = 99999999;
var duration = '';
var durationWeeks = 1000;
var today = moment(new Date());
@fritids
fritids / view.html
Created February 20, 2014 18:43 — forked from pamelafox/view.html
<div class="control-group">
<label class="control-label">Location</label>
<div class="controls">
<input name="location" type="text" placeholder="City, State, Country" value="">
<input name="location_city" type="hidden" value="">
<input name="location_state" type="hidden" value="">
<input name="location_country" type="hidden" value="">
<input name="location_lat" type="hidden">
<input name="location_lng" type="hidden">
</div>