Dr. Mirko Junge / Wikimedia Commons (CC)
Public domain
Brooklyn Museum / Wikimedia Commons
Brooklyn Museum / Wikimedia Commons
Christophe Finot / Wikimedia Commons (CC)
Contributing to WordPress Core
Peter Wilson • peterwilson.cc • @pwcc
Contributing to WordPress
Peter Wilson • peterwilson.cc • @pwcc
Contributing to WordPress Core
Peter Wilson • peterwilson.cc • @pwcc
} else {
$classes[] = 'page-template-default';
Index:	/trunk/wp-includes/post-template.php	
=================================================================
---	/trunk/wp-includes/post-template.php	(revision	18411)	
+++	/trunk/wp-includes/post-template.php	(revision	18412)	
@@	-490,4	+490,6	@@	
				$classes[]	=	'page-template';	
				$classes[]	=	'page-template-'	.	sanitize_html_class(	str_repla
+		}	else	{	
+			$classes[]	=	'page-template-default';	
			}	
		}	elseif	(	is_search()	)	{
Sites using WordPress
Jan 2011 onward (%)
5.0%
10.0%
15.0%
20.0%
25.0%
30.0%
1 Jan 2011 1 Jan 2012 1 Jan 2013 1 Jan 2014 1 Jan 2015 1 Jan 2016 30 Jul 2016
w3techs.com, July 2016
wordpress.org/about/philosophy/
WordPress Core Trac
core.trac.wordpress.org
core.trac.wordpress.org
core.trac.wordpress.org/browser
make.wordpress.org/core/reports/
core.trac.wordpress.org/my-comments
core.trac.wordpress.org/tickets/major
Boring
Sites using WordPress
5.0%
10.0%
15.0%
20.0%
25.0%
30.0%
1 Jan 2011 1 Jan 2012 1 Jan 2013 1 Jan 2014 1 Jan 2015 1 Jan 2016 30 Jul 2016
Boring
Checkout WordPress Core
A version control love story.
Checkout WordPress via SVN
wordpress-develop
https://develop.svn.wordpress.org/trunk/ ↩
svn checkout ↩
Checkout WordPress Core
A version control love story.
Clone WordPress via Git
wordpress-develop
git://develop.git.wordpress.org ↩
git clone ↩
Contribute with
SVN or Git
Public domain
Public domain
Contributing within
five minutes
localhost/phpmyadmin
localhost/phpmyadmin
localhost/phpmyadmin
localhost/phpmyadmin
localhost/phpmyadmin
localhost/phpmyadmin
localhost
DB username: root
DB password: root
core.trac.wordpress.org/tickets/good-first-bugs
Creating a patch
~$
~$	git pull
~$	git pull
Updating 470a9fa..e7a6afc
Fast-forward
src/wp-includes/js/swfupload/swfupload.js|2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
~$
WordCamp Easter Egg
<?php
//	Inside	get_body_class()		
$title	=	get_the_title($post_id);	
if	($title	==	"WordCamp	Sydney")	
	 $classes[]	=	"September,	2016";
WordCamp Easter Egg
<body	class="single	single-post	postid-1316	single-format-
standard	September		2016	logged-in	admin-bar	no-customize-
support">
WordCamp Easter Egg
<body	class="single	single-post	postid-1316	single-format-
standard	September		2016	logged-in	admin-bar	no-customize-
support">	
<body	class="single	single-post	postid-1316	single-format-
standard	September,	2016	logged-in	admin-bar	no-customize-
support">
WordCamp Easter Egg
<?php
//	Inside	get_body_class()		
$title	=	get_the_title($post_id);	
if	($title	==	"WordCamp	Sydney")	
	 $classes[]	=	sanitize_html_class("September,	2016");
<body	class="single	single-post	postid-1316	single-format-
standard	September2016	logged-in	admin-bar	no-customize-
support">	
WordCamp Easter Egg
<body	class="single	single-post	postid-1316	single-format-
standard	September2016	logged-in	admin-bar	no-customize-
support">	
<body	class="single	single-post	postid-1316	single-format-
standard	September2016	logged-in	admin-bar	no-customize-
support">	
WordCamp Easter Egg
Public domain
Malcolm Best (CC)
This is what happens in a world
without standards.
Saroar Zubair (CC), flic.kr/p/a1ePPd
WordPress Coding Standards
<?php
//	Inside	get_body_class()		
$title	=	get_the_title($post_id);	
if	($title	==	"WordCamp	Sydney")	
	 $classes[]	=	sanitize_html_class("September,	2016");
make.wordpress.org/core/coding-standards/
WordPress Coding Standards
<?php
//	Inside	get_body_class()		
$title	=	get_the_title($post_id);	
if	($title	==	"WordCamp	Sydney")	
	 $classes[]	=	sanitize_html_class("September,	2016");
Spaces
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	$title	==	"WordCamp	Sydney"	)	
	 $classes[]	=	sanitize_html_class(	"September,	2016"	);
No inline control structures
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	$title	==	"WordCamp	Sydney"	)	{	
	 $classes[]	=	sanitize_html_class(	"September,	2016"	);	
}
No inline control structures
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	$title	==	"WordCamp	Sydney"	)	{	
	 $classes[]	=	sanitize_html_class(	"September,	2016"	);	
	 $classes[]	=	sanitize_html_class(	"all-welcome"	);	
}
No inline control structures
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	$title	==	"WordCamp	Sydney"	)	{	
	 $classes[]	=	sanitize_html_class(	"September,	2016"	);	
}
Single quotes preferred
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	$title	==	'WordCamp	Sydney'	)	{	
	 $classes[]	=	sanitize_html_class(	'September,	2016'	);	
}
Yoda Conditions
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	'WordCamp	Sydney'	==	$title	)	{	
	 $classes[]	=	sanitize_html_class(	'September,	2016'	);	
}
=== != ==
<?php
//	Inside	get_body_class()		
$title	=	get_the_title(	$post_id	);	
if	(	'WordCamp	Sydney'	===	$title	)	{	
	 $classes[]	=	sanitize_html_class(	'September,	2016'	);	
}
Uploading a patch
WordCamp Easter Egg
	 }	
}	
$title	=	get_the_title(	$post_id	);	
if	(	'WordCamp	Sydney'	===	$title	)	{	
	 $classes[]	=	sanitize_html_class(	'September,	2016'	);	
}	
if	(	is_attachment()	)	{	
	 $mime_type	=	get_post_mime_type($post_id);
WordCamp Easter Egg
	 }	
}	
$title	=	get_the_title(	$post_id	);	
if	(	'WordCamp	Sydney'	===	$title	)	{	
	 $classes[]	=	sanitize_html_class(	'September,	2016'	);	
}	
if	(	is_attachment()	)	{	
	 $mime_type	=	get_post_mime_type($post_id);	
src/wp-includes/post-template.php
WordCamp Easter Egg
git diff
WordCamp Easter Egg
diff	--git	a/src/wp-includes/post-template.php	b/src/wp-includes/post-template.php	
index	7994f89..f1a0cad	100644	
---	a/src/wp-includes/post-template.php	
+++	b/src/wp-includes/post-template.php	
@@	-614,6	+614,11	@@	function	get_body_class(	$class	=	''	)	{	
				}	
		}	
+	$title	=	get_the_title(	$post_id	);	
+	if	(	'WordCamp	Sydney'	===	$title	)	{	
+			$classes[]	=	sanitize_html_class(	'September,	2016'	);	
+	}	
+	
		if	(	is_attachment()	)	{	
				$mime_type	=	get_post_mime_type($post_id);	
				$mime_prefix	=	array(	'application/',	'image/',	'text/',	'audio/',	'video/'...
WordCamp Easter Egg
diff	--git	a/src/wp-includes/post-template.php	b/src/wp-includes/post-template.php	
index	7994f89..f1a0cad	100644	
---	a/src/wp-includes/post-template.php	
+++	b/src/wp-includes/post-template.php	
@@	-614,6	+614,11	@@	function	get_body_class(	$class	=	''	)	{	
				}	
		}	
+	$title	=	get_the_title(	$post_id	);	
+	if	(	'WordCamp	Sydney'	===	$title	)	{	
+			$classes[]	=	sanitize_html_class(	'September,	2016'	);	
+	}	
+	
		if	(	is_attachment()	)	{	
				$mime_type	=	get_post_mime_type($post_id);	
				$mime_prefix	=	array(	'application/',	'image/',	'text/',	'audio/',	'video/'...
WordCamp Easter Egg
diff	--git	a/src/wp-includes/post-template.php	b/src/wp-includes/post-template.php	
index	7994f89..f1a0cad	100644	
---	a/src/wp-includes/post-template.php	
+++	b/src/wp-includes/post-template.php	
@@	-614,6	+614,11	@@	function	get_body_class(	$class	=	''	)	{	
				}	
		}	
+	$title	=	get_the_title(	$post_id	);	
+	if	(	'WordCamp	Sydney'	===	$title	)	{	
+			$classes[]	=	sanitize_html_class(	'September,	2016'	);	
+	}	
+	
		if	(	is_attachment()	)	{	
				$mime_type	=	get_post_mime_type($post_id);	
				$mime_prefix	=	array(	'application/',	'image/',	'text/',	'audio/',	'video/'...
WordCamp Easter Egg
diff	--git	a/src/wp-includes/post-template.php	b/src/wp-includes/post-template.php	
index	7994f89..f1a0cad	100644	
---	a/src/wp-includes/post-template.php	
+++	b/src/wp-includes/post-template.php	
@@	-614,6	+614,11	@@	function	get_body_class(	$class	=	''	)	{	
				}	
		}	
+	$title	=	get_the_title(	$post_id	);	
+	if	(	'WordCamp	Sydney'	===	$title	)	{	
+			$classes[]	=	sanitize_html_class(	'September,	2016'	);	
+	}	
+	
		if	(	is_attachment()	)	{	
				$mime_type	=	get_post_mime_type($post_id);	
				$mime_prefix	=	array(	'application/',	'image/',	'text/',	'audio/',	'video/'...
WordCamp Easter Egg
diff	--git	a/src/wp-includes/post-template.php	b/src/wp-includes/post-template.php	
index	7994f89..f1a0cad	100644	
---	a/src/wp-includes/post-template.php	
+++	b/src/wp-includes/post-template.php	
@@	-614,6	+614,11	@@	function	get_body_class(	$class	=	''	)	{	
				}	
		}	
+	$title	=	get_the_title(	$post_id	);	
+	if	(	'WordCamp	Sydney'	===	$title	)	{	
+			$classes[]	=	sanitize_html_class(	'September,	2016'	);	
+	}	
+	
		if	(	is_attachment()	)	{	
				$mime_type	=	get_post_mime_type($post_id);	
				$mime_prefix	=	array(	'application/',	'image/',	'text/',	'audio/',	'video/'...
WordCamp Easter Egg
diff	--git	a/src/wp-includes/post-template.php	b/src/wp-includes/post-template.php	
index	7994f89..f1a0cad	100644	
---	a/src/wp-includes/post-template.php	
+++	b/src/wp-includes/post-template.php	
@@	-614,6	+614,11	@@	function	get_body_class(	$class	=	''	)	{	
				}	
		}	
+	$title	=	get_the_title(	$post_id	);	
+	if	(	'WordCamp	Sydney'	===	$title	)	{	
+			$classes[]	=	sanitize_html_class(	'September,	2016'	);	
+	}	
+	
		if	(	is_attachment()	)	{	
				$mime_type	=	get_post_mime_type($post_id);	
				$mime_prefix	=	array(	'application/',	'image/',	'text/',	'audio/',	'video/'...
Generating a patch
> ~/Downloads/37941.diffgit diff
git	diff
Generating a patch
>	 ~/Downloads/37941.diff
You retain the copyright.
You license your code to WordPress
Let the code reviews begin
flic.kr/p/y35dEE (CC)
Hack WordPress core,
contribute code back.
Hack WordPress docs,
contribute docs back.
Translate WordPress,
help spread the word.
Contribute however you can,
however you feel comfortable.
Thank you
Peter Wilson • peterwilson.cc • @pwcc

Contributing to WordPress Core - Peter Wilson