Category: Nashville
No Comments

Read the story @SarahSanfino.com

Category: Photo
No Comments

Here are my latest random photo’s of last month. Enjoy! :)

Sarah's finger
Sarah's finger and her sucker
Whole Foods
our plumb trees
our plumb trees
hmmm dinner
Sarah giving me the stair
wine and reflections
talking on the phone
Sarah's odd face :)
The woods
Freya's Parents
Tossed
Driving
Frisky berry
Target
Dots
Me and Sarah driving
Trees
The office
Sarahs eye
Sarahs sucker
Sarahs pantleg
Sandles
Charts
Big mug
Cloudy day
Green filds
Crema
Gas station
Lady in a shopping cart
Bubbles in the window
Margaret
Oranges
Dinner
Sarah prepping for the zoo
The sun
Sarah goes to the zoo
Nashville Zoo
Nashville Zoo
Nashville Zoo
Nashville Zoo
Me and Sarah in the reflection
Sarahs big forhead
Me and sarah
Me and sarah
Me and sarah
Me and Sarah
A camel
Sarah the giraff
Randy the tiger
Sarah and her frog
Nashville Zoo
The scoot
Sarahs tatoo
Sarah and sonic ice's
Seal coating
Me and Margaret
Me and Margaret
Me and Margaret
Me and Margaret
Me and Margaret
Sarah and Margaret
Sarah and Margaret
Sarah and Margaret
A green bird
Chinchilla
Chinchilla
Our newest Rat!
Randy and his dirt
Out garden
Car on the grass
The back of our house
Earth day festival
Earth day festival
Sarah and her lemonaid
Earth day crowd
Bella flec
Bella flec
Machine Gun Sarah
Machine Gun Sarah
Waffle station
Salmon dinner
Plant and cup
Kieth and Freya's bird
Pincels
Dr Skechies
Sarah drawing
Sarah drawing
Pirate with beer
Noshville
Logans
Yellow slide
My shoes
Sarahs cute dress
House for sail
Win a rabbit
Win a rabbit
Win a rabbit
Marathon
Sarah mixing blood
Zombi Randy
Zombie Sarah
Zombie Randy and Sarah
Zombie Sarah
Zombie Prom
Zombie Prom
Zombie prom
Zombie Head
Zombie Sarah
Zombie Sarah
Olive Hell
Olive Hell
Olives are bad
Olive Hell
Classico
Icecream Sudays!!!
Icecream Sundays!!!
Blury Bubbles
Category: WordPress
No Comments

I’ve been developing with WordPress for about 2.5 yrs and this morning I really wanted to write something about all the work that I do, but am realizing that I just don’t know what to say with out writing a freaking book on the DevTime of WordPress. Not to mention there are so many people out there who have already laid down the law on what WordPress is.

So to curb my need to publish I though I would share a WP function that I have found to be a huge time saver, and something WP uses a lot. As you’ll see below it’s not much to speak of and it’s fairly basic in the scheme of things, but it will save a lot of time when comparing incoming variables with default variables.

wp_parse_args()

You can find this in wp-includes/functions.php -> line 2887 wp3.0 beta1


/**
* Merge user defined arguments into defaults array.
*
* This function is used throughout WordPress to allow for both string or array
* to be merged into another array.
*
* @since 2.2.0
*
* @param string|array $args Value to merge with $defaults
* @param array $defaults Array that serves as the defaults.
* @return array Merged user defined values with defaults.
*/
function wp_parse_args( $args, $defaults = '' ) {
if ( is_object( $args ) )
$r = get_object_vars( $args );
elseif ( is_array( $args ) )
$r =& $args;
else
wp_parse_str( $args, $r );

if ( is_array( $defaults ) )
return array_merge( $defaults, $r );
return $r;
}

Here is an example being used in the form function of a widget class, which is a great place to set defaults variables.


function form( $instance ) {

$widget_options = get_option('_my_widget_options');

//Defaults
$defaults = array(
'title_display' => 'Text',
'text_title' => '',
'image_title' => '',
'link' => '',
'post_cat' => $widget_options['post_cat'],
'post_count' => $widget_options['post_count'],
'word_count' => $widget_options['word_count'],
'read_more' => $widget_options['read_more'],
'strip_tags' => $widget_options['strip_tags'],
'show_thumbnail' => '',
'show_video' => '',
'css_class' => ''
);

$r = wp_parse_args( $instance, $defaults );
extract( $r, EXTR_SKIP );

echo 'do cool stuff here...';
}

So yeah, really exciting stuff right? Maybe not, but hey if you’re into php & WordPress you should check this out for sure. It’s been around for while so there is really no excuse.