Upload
wordcamp-sydney
View
173
Download
1
Embed Size (px)
Citation preview
Dr. Mirko Junge / Wikimedia Commons (CC)
Public domain
Brooklyn Museum / Wikimedia Commons
Brooklyn Museum / Wikimedia Commons
Christophe Finot / Wikimedia Commons (CC)
Contributing to WordPress CorePeter Wilson • peterwilson.cc • @pwcc
Contributing to WordPressPeter Wilson • peterwilson.cc • @pwcc
Contributing to WordPress CorePeter Wilson • peterwilson.cc • @pwcc
} else {
$classes[] = 'page-template-default';
Index:/trunk/wp-includes/post-template.php
===================================================================
---/trunk/wp-includes/post-template.php(revision18411)
+++/trunk/wp-includes/post-template.php(revision18412)
@@-490,4+490,6@@
$classes[]='page-template';
$classes[]='page-template-'.sanitize_html_class(str_replace('.','-',get_post_meta($page_id,'_wp_page_template',true)),'');
+}else{
+$classes[]='page-template-default';
}
}elseif(is_search()){
Sites using WordPressJan 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 Traccore.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 CoreA version control love story.
Checkout WordPress via SVN
wordpress-develop
https://develop.svn.wordpress.org/trunk/ ↩svn checkout ↩
Checkout WordPress CoreA 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 pullUpdating 470a9fa..e7a6afcFast-forwardsrc/wp-includes/js/swfupload/swfupload.js|2 +-1 file changed, 1 insertion(+), 1 deletion(-)
~$
WordCamp Easter Egg<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney")
$classes[]="September,2016";
WordCamp Easter Egg<bodyclass="singlesingle-postpostid-1316single-format-
standardSeptember2016logged-inadmin-barno-customize-
support">
WordCamp Easter Egg<bodyclass="singlesingle-postpostid-1316single-format-
standardSeptember2016logged-inadmin-barno-customize-
support">
<bodyclass="singlesingle-postpostid-1316single-format-
standardSeptember,2016logged-inadmin-barno-customize-
support">
WordCamp Easter Egg<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney")
$classes[]=sanitize_html_class("September,2016");
<bodyclass="singlesingle-postpostid-1316single-format-
standardSeptember2016logged-inadmin-barno-customize-
support">
WordCamp Easter Egg
<bodyclass="singlesingle-postpostid-1316single-format-
standardSeptember2016logged-inadmin-barno-customize-
support">
<bodyclass="singlesingle-postpostid-1316single-format-
standardSeptember2016logged-inadmin-barno-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
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney")
$classes[]=sanitize_html_class("September,2016");
make.wordpress.org/core/coding-standards/
WordPress Coding Standards<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney")
$classes[]=sanitize_html_class("September,2016");
Spaces<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney")
$classes[]=sanitize_html_class("September,2016");
No inline control structures<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney"){
$classes[]=sanitize_html_class("September,2016");
}
No inline control structures<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney"){
$classes[]=sanitize_html_class("September,2016");
$classes[]=sanitize_html_class("all-welcome");
}
No inline control structures<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=="WordCampSydney"){
$classes[]=sanitize_html_class("September,2016");
}
Single quotes preferred<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if($title=='WordCampSydney'){
$classes[]=sanitize_html_class('September,2016');
}
Yoda Conditions<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if('WordCampSydney'==$title){
$classes[]=sanitize_html_class('September,2016');
}
=== != ==<?php
//Insideget_body_class()
$title=get_the_title($post_id);
if('WordCampSydney'===$title){
$classes[]=sanitize_html_class('September,2016');
}
Uploading a patch
WordCamp Easter Egg }
}
$title=get_the_title($post_id);
if('WordCampSydney'===$title){
$classes[]=sanitize_html_class('September,2016');
}
if(is_attachment()){
$mime_type=get_post_mime_type($post_id);
$mime_prefix=array('application/','image/','text/',
WordCamp Easter Egg }
}
$title=get_the_title($post_id);
if('WordCampSydney'===$title){
$classes[]=sanitize_html_class('September,2016');
}
if(is_attachment()){
$mime_type=get_post_mime_type($post_id);
$mime_prefix=array('application/','image/','text/',
src/wp-includes/post-template.php
WordCamp Easter Egg
git diff
WordCamp Easter Eggdiff--gita/src/wp-includes/post-template.phpb/src/wp-includes/post-template.phpindex7994f89..f1a0cad100644---a/src/wp-includes/post-template.php+++b/src/wp-includes/post-template.php@@-614,6+614,11@@functionget_body_class($class=''){}}
+$title=get_the_title($post_id);+if('WordCampSydney'===$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 Eggdiff--gita/src/wp-includes/post-template.phpb/src/wp-includes/post-template.phpindex7994f89..f1a0cad100644---a/src/wp-includes/post-template.php+++b/src/wp-includes/post-template.php@@-614,6+614,11@@functionget_body_class($class=''){}}
+$title=get_the_title($post_id);+if('WordCampSydney'===$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 Eggdiff--gita/src/wp-includes/post-template.phpb/src/wp-includes/post-template.phpindex7994f89..f1a0cad100644---a/src/wp-includes/post-template.php+++b/src/wp-includes/post-template.php@@-614,6+614,11@@functionget_body_class($class=''){}}
+$title=get_the_title($post_id);+if('WordCampSydney'===$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 Eggdiff--gita/src/wp-includes/post-template.phpb/src/wp-includes/post-template.phpindex7994f89..f1a0cad100644---a/src/wp-includes/post-template.php+++b/src/wp-includes/post-template.php@@-614,6+614,11@@functionget_body_class($class=''){}}
+$title=get_the_title($post_id);+if('WordCampSydney'===$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 Eggdiff--gita/src/wp-includes/post-template.phpb/src/wp-includes/post-template.phpindex7994f89..f1a0cad100644---a/src/wp-includes/post-template.php+++b/src/wp-includes/post-template.php@@-614,6+614,11@@functionget_body_class($class=''){}}
+$title=get_the_title($post_id);+if('WordCampSydney'===$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 Eggdiff--gita/src/wp-includes/post-template.phpb/src/wp-includes/post-template.phpindex7994f89..f1a0cad100644---a/src/wp-includes/post-template.php+++b/src/wp-includes/post-template.php@@-614,6+614,11@@functionget_body_class($class=''){}}
+$title=get_the_title($post_id);+if('WordCampSydney'===$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
gitdiff
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 youPeter Wilson • peterwilson.cc • @pwcc