This file contains hidden or 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: Custom Login Error | |
Plugin URI: http://www.thoughtrefinery.com/ | |
Description: Customize error messages on login form | |
Version: 0.1 | |
Author: Nick Ciske | Thought Refinery | |
Author URI: http://www.thoughtrefinery.com/ | |
*/ |
This file contains hidden or 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 | |
/** | |
Backup the database of a given WordPress site. | |
using http://www.bin-co.com/blog/2008/10/remote-database-backup-wordpress-plugin/ | |
*/ | |
$site_url = 'http://yoursite.com'; //The URL of the online wordpress site | |
$username = 'admin'; // Admin username | |
$password = 'not_my_password'; // Admin password |
This file contains hidden or 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 | |
/** | |
* Carrega a API do WordPress | |
*/ | |
define('WP_USE_THEMES', false); // Não utiliza nenhum tema | |
require('./wordpress/wp-load.php'); | |
?> |
This file contains hidden or 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 | |
function insert_term($term, $taxonomy, $args = array()) { | |
if (isset ( $args ['parent'] )) { | |
$parent = $args ['parent']; | |
} else { | |
$parent = 0; | |
} | |
$result = term_exists ( $term, $taxonomy, $parent ); | |
if ($result == false || $result == 0) { | |
return wp_insert_term ( $term, $taxonomy, $args ); |
This file contains hidden or 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
<? | |
function checkPhone($int_dial_code, $area_code, $local_number) { | |
//try to check and reformat australian numbers | |
if ($int_dial_code == "61") { | |
//combine the area code and local number | |
$full_phone = $area_code.$local_number; | |
//strip spaces and hyphens | |
$full_phone = str_replace(array(" ", "-"), "", $full_phone); | |
This file contains hidden or 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
<? | |
function make_salt($salt_size=32) { | |
//list of possible characters from which to cerate the salt | |
$sea = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
//how many possible characters are there | |
$sea_size = strlen($sea); | |
$salt = ""; |
This file contains hidden or 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 | |
/* BEGIN: add user info | |
---------------------------------------------------------------------------------------------------- */ | |
add_action( 'show_user_profile', 'show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'show_extra_profile_fields' ); | |
function show_extra_profile_fields( $user ) { ?> | |
This file contains hidden or 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
//Enable sessions i wordpress | |
if ( !session_id() ) | |
add_action( 'init', 'session_start' ); |
This file contains hidden or 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
/** | |
* mm_register function. | |
* Register a new user. | |
* @access public | |
* @return User errors or user is logged in. | |
*/ | |
function mm_register() { | |
if(!is_user_logged_in()) { | |
if(!empty($_POST)) { |