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 | |
// Force update our username (user_login) | |
global $wpdb; | |
$tablename = $wpdb->prefix . "users"; | |
// method 1 | |
//$sql = $wpdb->prepare("UPDATE %s SET user_login=%s WHERE ID=%d", $tablename, $user_email, $user_id); | |
//$wpdb->query($sql); | |
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
// Add Login Link in Navigation | |
add_filter( 'wp_nav_menu_items', 'we_nav_login_right', 10, 2 ); | |
function we_nav_login_right($menu, $args) { | |
$args = (array)$args; | |
$login = wp_loginout( $_SERVER['REQUEST_URI'], false ); | |
$profile = '<a class="profile" href=' . get_edit_profile_url($userid) . '>Profile</a>'; | |
//if not primary, return | |
//change primary to secondary for secondary menu (though will need some CSS done) | |
if ( $args['theme_location'] != 'primary' ) |
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
-- | |
-- Note: Make sure `wp_users` matches your user table. | |
-- | |
update wp_users set user_activation_key=''; |
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 fublo_gf_profile_update( $entry, $form ) | |
{ | |
// make sure that the user is logged in | |
// we shouldn't get here because the form should check for logged in users... | |
if ( !is_user_logged_in() ) | |
{ | |
wp_redirect( home_url() ); | |
exit; |
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
/* For devices with narrow screens, phones, tablets, etc. */ | |
/* support these sizes: 320,480, 600, 768, 1024, 1200 Ethan Marcotte */ | |
/* * 1. 1625px and above huge screens * */ | |
/* * 2. 1301px and above huge screens * */ | |
/* * 3. 1025px to 1300px * */ | |
/* * 4. 769px to 1024px * */ | |
/* * 5. 601px to 768px * */ | |
/* * 6. 600px and below * */ | |
/* * 7. 481px to 600px * */ | |
/* * 8. 480px wide and below * */ |
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
/* Non-Retina */ | |
@media screen and (-webkit-max-device-pixel-ratio: 1) { | |
} | |
/* Retina */ | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { | |
} |
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 | |
/** | |
* @Author Jonathon Byrd | |
* @link http://www.redrokk.com | |
* @Package Wordpress | |
* @SubPackage Red Rokk Library | |
* | |
* @version 0.1 | |
*/ | |
defined('ABSPATH') or die('You\'re not supposed to be here.'); |
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 loadVisibleImages() { | |
var placeholders = { | |
'meal': 'img/meal.png', | |
'avatar': 'img/blankpic.png' | |
}; | |
$('img').each(function() { | |
var $img = $(this); | |
var realUrl = $img.attr('data-src'); | |
if (!realUrl) return; |
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 | |
/** | |
* Handle file uploading and add attachment. | |
* | |
* @return array Uploaded file's details on success, error message on failure | |
*/ | |
function wp_import_handle_upload() { | |
if ( !isset($_FILES['filefield_name']) ) { | |
$file['error'] = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ); | |
return $file; |
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
<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> |