Skip to content

Instantly share code, notes, and snippets.

@marcelo2605
marcelo2605 / gist:b195243976cb9c7f3f53
Last active September 25, 2015 17:13 — forked from LinzardMac/gist:4b4bcbef09d72b777619
[WordPress] Override author drop down to include all users from all roles/ caps in post creation screens
/**
* override output of author drop down to include ALL user roles
*/
add_filter('wp_dropdown_users', 'include_all_users');
function include_all_users($output)
{
//set the $post global for checking user against author
global $post;
$users = get_users();
@marcelo2605
marcelo2605 / scroll div detect
Created October 1, 2014 12:17
Detectar o id de uma div durante scroll horizontal
var windowWidth = $( window ).width();
$(window).scroll(function() {
var winLeft = $(this).scrollLeft();
var left = $.grep($('.section'), function(item) {
return $(item).position().left <= winLeft + windowWidth/2;
});
var current = left.slice(-1)[0];
var currentId = $(current).attr('id');
if(!$('a[href$="'+currentId+'"]').hasClass('ativo')){