Skip to content

Instantly share code, notes, and snippets.

/**
* THOSE FUNCTIONS ARE TEMPORARY @todo: TO REMOVE
*/
/*
* Creating Guest authors from users
*/
$users = get_users();
$created = 0;
$skipped = 0;
foreach( $users as $user ) {
<?php
//Update profile for WP Users
add_action( 'profile_update', array( $this, 'bps_users_save_metadata' ), 10, 2 );
//Adding fields to normal user profile
add_action( 'show_user_profile', array( $this, 'bps_custom_user_profile_fields' ) );
add_action( 'edit_user_profile', array( $this, 'bps_custom_user_profile_fields' ) );
/**
<?php
//Add guest authors metaboxes
add_action( 'add_meta_boxes', array( $this, 'bps_add_metaboxes' ), 10, 2 );
//Adding custom fields to guest authors
add_filter( 'coauthors_guest_author_fields', array( $this, 'bps_filter_guest_author_fields' ), 10, 2 );
/**
* Adding metaboxes
*/
public function bps_add_metaboxes() {
@afuggetta
afuggetta / gist:f55a3360467235d65124
Created February 13, 2015 16:17
Ad temp solution
.ad {
background-color: $grey;
&.box-728x90 {
height: 90px;
width: 728px;
}
&.box-300x600 {
height: 600px;
}
&.box-300x250 {
@afuggetta
afuggetta / CustomTemplate.php
Last active August 29, 2015 14:15
Custom post type template loading
<?php
add_filter( 'single_template', array(
__CLASS__,
'get_custom_post_type_template'
), 10, 1 );
public function get_custom_post_type_template( $single_template ) {
global $post;
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.16 on 2014-12-24.
*
* @author Barry vd. Heuvel <[email protected]>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {