Notice: bp_setup_current_user was called incorrectly [FIX]

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /…/wp-includes/functions.php on line 3622

If you’re getting the above notice, you’re going to need to disable _doing_it_wrong for the bbp_setup_current_user() function, here’s how!

/**
 * Disables trigger_error for doing_it_wrong_trigger_error filter.
 *
 * @return boolean false disables the if condition to trigger the error display.
 */
function remove_bbp_setup_current_user_notice_filter() {
    return false; // Disable trigger_error.
}

/**
 * If bbp_setup_current_user() runs _doing_it_wrong(), disable trigger_error.
 *
 * @param  string $function The function, here we test for bbp_setup_current_user().
 * @param  string $message  The message (no modifications here).
 * @param  string $version  Version (not used here).
 */
function remove_bbp_setup_current_user_notice( $function, $message, $version ) {
    if( 'bbp_setup_current_user' === $function ) {

        // Filter trigger_error
        add_filter( 'doing_it_wrong_trigger_error', 'remove_bbp_setup_current_user_notice_filter' );
    }
}
add_action( 'doing_it_wrong_run', 'remove_bbp_setup_current_user_notice', 10, 3 );

How to fix issue where external drive (non-NTFS) is being mounted as Read Only

This is what I did anyhow…

Here my external disk is Sling and it has the proper permissions root:admin. Before it had root:wheel which wasn’t allowing me to write to the disk as I did before.

To get the right permissions I used sudo chown root:admin Sling/. I thought that this permission would only apply one time, but I ejected and re-mounted and it kept the permission.

Hopefully this helps.

Add Show / Hide Hidden Files Menu in OS X

Finder View of Hidden Files

If you’re like me you work with those (dot) folders and files quite often, but don’t really enjoy the clutter. Plus, you’re probably going to mess with them in Terminal most of the time.

We can use Automator (an app build into your Mac) to create a new Service and add Run Shell Script with the following code (make sure and save it) that will add a Menu item to the application’s menu (right next to the Apple logo). Just navigate to Services sub-menu.

https://gist.github.com/aubreypwd/3997ab447f65db49a029

Automator Setup

Where it's located when you save...

You can also add a quick Keyboard Shortcut to it by going to your Keyboard Preferences > Shortcuts.

Keyboard Shortcut

Load your .bash_profile (.bashrc) when you load Conque in Vim

I recently installed Conque in my Vim configuration and wasn’t able to load by .bash_profile when I launched bash. I was Googeling around trying to find a solution, but couldn’t find it.

Hope this helps someone.

nnoremap <Leader>tt :ConqueTermSplit bash --rcfile ~/.bash_profile<CR>

You can see this example in my .vimrc.after too.

Nginx and Post Preview (Preview Changes) not working [DigitalOcean/Fix]

Recently I have been experiencing an issue with Preview Changes not working in WordPress on a Nginx VPS over at DigitalOcean. I use a few common config files from nginx-common-config. Before, the configuration did not fix the problem, but after it did. Thanks to the /VVV guys for a configuration that solved the problem.

To fix you can just clone down nginx-common-config and include the nginx.wp.conf file.

How to create a stroke around a number with CSS

I recently had to find out how to do this while working on a site a couple weeks ago and thought I’d share. So, what we’re making is this.

Screen Shot 2014-10-26 at 9.25.07 PM

HTML

https://gist.github.com/anonymous/f92fdf33d279c725f435

From the above HTML you can see we first create three layers:

  1. a background (black solid background with rounded corners)
  2. a stroke (a white circle)
  3. another inner-circle with a number in it (black circle inside of the white one

CSS

https://gist.github.com/anonymous/45ad0a806120d297f5db

There are essentially three layers here. The background is an obvious one. The stroke is a white background <div> that is made into a circle with border-radius and some padding. This allows us to fit the inner circle (also a <div> made into a circle)  into the previous white circle which creates the illusion of a stroke with some padding. So, black square, white circle (with padding), black circle.

You can fiddle with this.