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' );
@fritids
fritids / woocomerceplugin
Last active August 29, 2015 13:57
woocomerceplugin creation links
http://docs.woothemes.com/document/create-a-plugin/
http://www.mrova.com/lets-create-a-payment-gateway-plugin-payu-for-woocommerce/
http://phptrends.com/dig_in/woocommerce?page=12
http://www.kris3d.com/2012/08/20/woocommerce-le-guide-complet/#.UyDmytL3H0s
https://github.com/jopathprojects/MKPartnair-Wordpress/blob/7ab856facb3e13fd6cbf4480e2db1aa6f2aa5a43/page-resa-final.php
cmcic.php
https://github.com/brice-websailors/Shopsailors/tree/c9a0a968521266fa073a4e444392d79d6d706d38/classes/sh_payment_cic
https://github.com/jopathprojects/MKPartnair-Wordpress/blob/7ab856facb3e13fd6cbf4480e2db1aa6f2aa5a43/page-resa-final.php
http://www.absoluteweb.net/prestations/wordpress-woocommerce-extensions-traductions/woocommerce-cm-cic/installation-api-manager/
http://test-shop.alerteapero.com/docs/installation-tpe.pdf
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());