Cain & Obenland — Episode 4

33

description

 

Transcript of Cain & Obenland — Episode 4

Page 1: Cain & Obenland — Episode 4
Page 2: Cain & Obenland — Episode 4

Episode 4:The real C’n’O in The OC

Page 3: Cain & Obenland — Episode 4

Do You _stand Themes?

The real C’n’O in The OC

Special Guest: Mike Schroder

Hooking Up with WordPress

Page 4: Cain & Obenland — Episode 4

Michael Cain!

Theme Generator at Automattic @michaeldcain

!mapandmenu.com

Page 5: Cain & Obenland — Episode 4

Konstantin Obenland!

Code Wrangler at Automattic!@obenland!

!konstantin.obenland.it

Page 6: Cain & Obenland — Episode 4

Do You _stand Themes?

Page 7: Cain & Obenland — Episode 4

Starter Themes

• Not a parent theme.

• Not a theme framework.

• Foundation of a new theme.

Page 8: Cain & Obenland — Episode 4

Why Underscores

• Just the right amount.

• Experience from five default themes.

• Experience from creating themes for millions of users on WordPress.com.

• Does everything the WordPress way.

Page 9: Cain & Obenland — Episode 4

Why Underscores

• Semi-standard for WordPress.org Theme Repository.

• Best feature is its lack of features! No tearing down necessary.

• Readable code with good documentation.

• Very active community.

Page 10: Cain & Obenland — Episode 4

2010 2011 2012 2013 2014

Pedigree

Twenty Eleven

Twenty Ten

Twenty Twelve

Twenty Thirteen

Toolbox

Twenty Fourteen

Further

Twenty Fifteen

Page 11: Cain & Obenland — Episode 4

300,000 Downloads

Page 12: Cain & Obenland — Episode 4

71 Contributorsfrom 18 countries

Page 13: Cain & Obenland — Episode 4

Most Popular WordPress Project**Starred PHP Projects on GitHub, excluding WordPress itself

Page 14: Cain & Obenland — Episode 4

Underscores.me@underscoresme

git.io/_s

Page 15: Cain & Obenland — Episode 4

Still to come:

Special Guest: Mike Schroder

Hooking Up with WordPress

Page 16: Cain & Obenland — Episode 4

In no every way affiliated with or and sponsored by…

Page 17: Cain & Obenland — Episode 4

WordCamp Ventura CountyNovember 8th, 2014

Page 18: Cain & Obenland — Episode 4
Page 19: Cain & Obenland — Episode 4

Mike SchroderSomewhat deep and superficially geeky

Page 20: Cain & Obenland — Episode 4

Mike Schroder!

Developer; WordPress Specialist at DreamHost @DH_Shredder

!getsource.net

Page 21: Cain & Obenland — Episode 4

Hooking Up with WordPress

There’s more:

Page 22: Cain & Obenland — Episode 4

In no every way affiliated with or and sponsored by…

Page 23: Cain & Obenland — Episode 4

WordCamp MaineAugust 16th, 2014

Page 24: Cain & Obenland — Episode 4
Page 25: Cain & Obenland — Episode 4

Hooking Up with WordPressGetting Started with Actions and Filters

Page 26: Cain & Obenland — Episode 4

WordPress Actions and Filters

Allow you to modify or add functionality

by calling functions at specific times.

Page 27: Cain & Obenland — Episode 4

WordPress Actions and Filters

Filters call functions that take some kind of input,

modify it, and return it.

Page 28: Cain & Obenland — Episode 4

function my_plugin_custom_content( $content ) { $search = 'Michael Cain'; $replace = 'Michael "The Great" Cain'; $content = preg_replace( $search, $replace, $content );! return $content;}add_filter( 'the_content', 'my_plugin_custom_content' );

Page 29: Cain & Obenland — Episode 4

WordPress Actions

Actions call functions and

don’t care about their returned value.

A filter without arguments or a returned value.

Page 30: Cain & Obenland — Episode 4

function my_theme_google_font() { wp_enqueue_style( 'my-theme-montserrat', '//fonts.googleapis.com/css?family=Montserrat', array(), null );}add_action( 'wp_enqueue_scripts', 'my_theme_google_font' );

Page 31: Cain & Obenland — Episode 4

Keep on Hookin’

Filter Functions

• add_action()

• has_action()

• do_action()

• do_action_ref_array()

• doing_action()

• did_action()

• remove_action()

• remove_all_actions()

Action Functions

• add_filter()

• has_filter()

• apply_filters()

• doing_filter()

• current_filter()

• remove_filter()

• remove_all_filters()

Page 32: Cain & Obenland — Episode 4

Keep on Hookin’

Filter Functions

• add_action()

• has_action()

• do_action()

• do_action_ref_array()

• doing_action()

• did_action()

• remove_action()

• remove_all_actions()

Action Functions

• add_filter()

• has_filter()

• apply_filters()

• doing_filter()

• current_filter()

• remove_filter()

• remove_all_filters()

Page 33: Cain & Obenland — Episode 4

The Endcain.obenland.it

!

@michaeldcain @obenland