SlideShare a Scribd company logo
1 of 22
Download to read offline
What we can learn from
                            WordPress

                            Chandra Maharzan
                              tweet @maharzan



Sunday, March 25, 12
Sunday, March 25, 12
Sunday, March 25, 12
What we ignore
                       • Most simplest parts
                        • Comments
                        • White Space
                        • Proper Names
Sunday, March 25, 12
CSS



Sunday, March 25, 12
/* =Quote
       ----------------------------- */
       .format-quote blockquote {
       ! color: #555; /* red color */
       ! font-size: 17px;
       ! margin: 0;
       }




       /* =Image
       ----------------------------- */

Sunday, March 25, 12
/* =Menu
       ----------------------------- */
       #access ul ul ul {
       ! left: 100%;
       ! top: 0;
       }
       /* Search Form */
       #branding #searchform {
       ! position: absolute;
       ! top: 3.8em;
       ! right: 7.6%;
       }

Sunday, March 25, 12
selector {
              property: value;
          }
          #selector-1,
          #selector-2,
          #selector-3 {
              background: #fff;
              color: #000;
          }
          #selector-1 { background: #fff; color: #000; }

Sunday, March 25, 12
Class names
                       #comment-form {
                           margin: 0;
                       }

                       #commentForm {}
                       #comment_form {}
                       #abc-12 {}

Sunday, March 25, 12
Property : Value
       #comment-form {
         -moz-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
         -webkit-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
         box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
         font-size: 1em;
         position: absolute;
         top: 0;
         right: 0;
         bottom: 0;
         left: 0;
         width: 500px;
         height: auto;
       }


Sunday, March 25, 12
Useful Resources

                       •Firebug
                       • http://codex.wordpress.org/
                        CSS_Coding_Standards



Sunday, March 25, 12
PHP



Sunday, March 25, 12
Comments
       /**
        * Tell WordPress to run twentyeleven_setup() when the
        * 'after_setup_theme' hook is run.
        */
       add_action( 'after_setup_theme', 'twentyeleven_setup' );


       /**
        * Sets the post excerpt length to 40 words.
        *
        * To override this length in a child theme,
        * remove the filter and add your own
        * function tied to the excerpt_length filter hook.
        */
       function twentyeleven_excerpt_length( $length ) {



Sunday, March 25, 12
Comments
       // Turn on random header image rotation by default.
       add_theme_support( 'custom-header', array( 'random-
       default' => true ) );


       // Has the text been hidden?
       if ( 'blank' == get_header_textcolor() ) :
         ...
         ...
       // If the user has set a custom color for the text use
       else :
         ....
         ....
       endif;




Sunday, March 25, 12
Comments
       /**
        * The Template for displaying all single posts.
        *
        * @package WordPress
        * @subpackage Twenty_Eleven
        * @since Twenty Eleven 1.0
        */

       <div id="primary">
       ! <div id="content" role="main">
         .....
         .....
         </div><!-- #content -->
       </div><!-- #primary -->




Sunday, March 25, 12
Variables
       $foo='somevalue';
       $foo2='somevalue2';
       $foo34var='somevalue3';
       $nicevar=somevalue4';


       $my_array=array(
          'foo'=>'somevalue',
          'foo2'=>'somevalue2',
          'foo3'=>'somevalue3',
          'foo34'=>'somevalue3'
       );



Sunday, March 25, 12
Better?
                $foo        =   'somevalue';
                $foo2       =   'somevalue2';
                $foo34var   =   'somevalue3';
                $nicevar    =   somevalue4';


                $my_array = array(
                   'foo'   => 'somevalue',
                   'foo2' => 'somevalue2',
                   'foo3' => 'somevalue3',
                   'foo34' => 'somevalue3'
                );



Sunday, March 25, 12
HTML

         <?php if ( ! have_posts() ) : ?>
            <div id="post-1" class="post">
               <h1 class="entry-title">Not Found</h1>
               <div class="entry-content">
                  <p>Apologies, but no results were found.</p>
                  <?php get_search_form(); ?>
               </div>
             </div>
         <?php endif; ?>




Sunday, March 25, 12
White Space
      function te_custom_excerpt( $output ) {
      !   if ( has_excerpt() && ! is_attachment() ) {
      !     $output .= te_continue_reading_link();
      !   }
      !   return $output;
      }
      add_filter( 'get_the_excerpt', 'te_custom_excerpt' );




Sunday, March 25, 12
In General
                       •x == 23
                       •foo && bar
                       •! foo
                       •function( $a, $b,   $c )
                       •$concat . '-5'
                       •$term .= 'X'
Sunday, March 25, 12
Reference

                       • http://codex.wordpress.org/
                         WordPress_Coding_Standards




Sunday, March 25, 12
Thank you



Sunday, March 25, 12

More Related Content

What's hot

Using shortcode in plugin development
Using shortcode in plugin developmentUsing shortcode in plugin development
Using shortcode in plugin development
gskhanal
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
Wynn Netherland
 
JS.Chi CSS Animations
JS.Chi CSS AnimationsJS.Chi CSS Animations
JS.Chi CSS Animations
Justin Meyer
 

What's hot (20)

Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
 
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たちDBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たち
 
Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019Let's write secure drupal code! - Drupal Camp Pannonia 2019
Let's write secure drupal code! - Drupal Camp Pannonia 2019
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle theme
 
Let's write secure Drupal code! - Drupal Camp Poland 2019
Let's write secure Drupal code! - Drupal Camp Poland 2019Let's write secure Drupal code! - Drupal Camp Poland 2019
Let's write secure Drupal code! - Drupal Camp Poland 2019
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
HTML5 and CSS3 Refresher
HTML5 and CSS3 RefresherHTML5 and CSS3 Refresher
HTML5 and CSS3 Refresher
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the Backend
 
Let's write secure Drupal code! DUG Belgium - 08/08/2019
Let's write secure Drupal code! DUG Belgium - 08/08/2019Let's write secure Drupal code! DUG Belgium - 08/08/2019
Let's write secure Drupal code! DUG Belgium - 08/08/2019
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gem
 
Using shortcode in plugin development
Using shortcode in plugin developmentUsing shortcode in plugin development
Using shortcode in plugin development
 
JavaScript for Flex Devs
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex Devs
 
LESS
LESSLESS
LESS
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
JS.Chi CSS Animations
JS.Chi CSS AnimationsJS.Chi CSS Animations
JS.Chi CSS Animations
 
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)
 
18. images in symfony 4
18. images in symfony 418. images in symfony 4
18. images in symfony 4
 
Let's write secure Drupal code! - 13.09.2018 @ Drupal Europe, Darmstadt, Germany
Let's write secure Drupal code! - 13.09.2018 @ Drupal Europe, Darmstadt, GermanyLet's write secure Drupal code! - 13.09.2018 @ Drupal Europe, Darmstadt, Germany
Let's write secure Drupal code! - 13.09.2018 @ Drupal Europe, Darmstadt, Germany
 

Viewers also liked

Chandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPressChandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPress
wpnepal
 

Viewers also liked (7)

Interesting Theme Shop Stats
Interesting Theme Shop StatsInteresting Theme Shop Stats
Interesting Theme Shop Stats
 
Maxxconnect Presentation
Maxxconnect PresentationMaxxconnect Presentation
Maxxconnect Presentation
 
Be HTML5-ready today
Be HTML5-ready todayBe HTML5-ready today
Be HTML5-ready today
 
Thucydides - /by Igor Rozdobudko
Thucydides - /by Igor RozdobudkoThucydides - /by Igor Rozdobudko
Thucydides - /by Igor Rozdobudko
 
Chandra Maharzan: The Future of Web Design Experience
Chandra Maharzan: The Future of Web Design ExperienceChandra Maharzan: The Future of Web Design Experience
Chandra Maharzan: The Future of Web Design Experience
 
WordPress Security Implementation Guideline - Presentation for OWASP Romania ...
WordPress Security Implementation Guideline - Presentation for OWASP Romania ...WordPress Security Implementation Guideline - Presentation for OWASP Romania ...
WordPress Security Implementation Guideline - Presentation for OWASP Romania ...
 
Chandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPressChandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPress
 

Similar to What we can learn from WordPress as a developer

Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1
Jano Suchal
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
Kaz Watanabe
 

Similar to What we can learn from WordPress as a developer (20)

Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1
 
Obscure Wordpress Functions That Are Actually Quite Useful
Obscure Wordpress Functions That Are Actually Quite UsefulObscure Wordpress Functions That Are Actually Quite Useful
Obscure Wordpress Functions That Are Actually Quite Useful
 
php2.pptx
php2.pptxphp2.pptx
php2.pptx
 
Why Hacking WordPress Search Isn't Some Big Scary Thing
Why Hacking WordPress Search Isn't Some Big Scary ThingWhy Hacking WordPress Search Isn't Some Big Scary Thing
Why Hacking WordPress Search Isn't Some Big Scary Thing
 
veracruz
veracruzveracruz
veracruz
 
veracruz
veracruzveracruz
veracruz
 
veracruz
veracruzveracruz
veracruz
 
veracruz
veracruzveracruz
veracruz
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
 
Extending Moose
Extending MooseExtending Moose
Extending Moose
 
Ruby AST Tools
Ruby AST ToolsRuby AST Tools
Ruby AST Tools
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
 
Fluent14
Fluent14Fluent14
Fluent14
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
メタプログラミングPerl nagoya rubykaigi02
メタプログラミングPerl nagoya rubykaigi02メタプログラミングPerl nagoya rubykaigi02
メタプログラミングPerl nagoya rubykaigi02
 
Perl object ?
Perl object ?Perl object ?
Perl object ?
 
Corinna Status 2022.pptx
Corinna Status 2022.pptxCorinna Status 2022.pptx
Corinna Status 2022.pptx
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

What we can learn from WordPress as a developer

  • 1. What we can learn from WordPress Chandra Maharzan tweet @maharzan Sunday, March 25, 12
  • 4. What we ignore • Most simplest parts • Comments • White Space • Proper Names Sunday, March 25, 12
  • 6. /* =Quote ----------------------------- */ .format-quote blockquote { ! color: #555; /* red color */ ! font-size: 17px; ! margin: 0; } /* =Image ----------------------------- */ Sunday, March 25, 12
  • 7. /* =Menu ----------------------------- */ #access ul ul ul { ! left: 100%; ! top: 0; } /* Search Form */ #branding #searchform { ! position: absolute; ! top: 3.8em; ! right: 7.6%; } Sunday, March 25, 12
  • 8. selector { property: value; } #selector-1, #selector-2, #selector-3 { background: #fff; color: #000; } #selector-1 { background: #fff; color: #000; } Sunday, March 25, 12
  • 9. Class names #comment-form { margin: 0; } #commentForm {} #comment_form {} #abc-12 {} Sunday, March 25, 12
  • 10. Property : Value #comment-form { -moz-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2); box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2); font-size: 1em; position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 500px; height: auto; } Sunday, March 25, 12
  • 11. Useful Resources •Firebug • http://codex.wordpress.org/ CSS_Coding_Standards Sunday, March 25, 12
  • 13. Comments /** * Tell WordPress to run twentyeleven_setup() when the * 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'twentyeleven_setup' ); /** * Sets the post excerpt length to 40 words. * * To override this length in a child theme, * remove the filter and add your own * function tied to the excerpt_length filter hook. */ function twentyeleven_excerpt_length( $length ) { Sunday, March 25, 12
  • 14. Comments // Turn on random header image rotation by default. add_theme_support( 'custom-header', array( 'random- default' => true ) ); // Has the text been hidden? if ( 'blank' == get_header_textcolor() ) : ... ... // If the user has set a custom color for the text use else : .... .... endif; Sunday, March 25, 12
  • 15. Comments /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ <div id="primary"> ! <div id="content" role="main"> ..... ..... </div><!-- #content --> </div><!-- #primary --> Sunday, March 25, 12
  • 16. Variables $foo='somevalue'; $foo2='somevalue2'; $foo34var='somevalue3'; $nicevar=somevalue4'; $my_array=array( 'foo'=>'somevalue', 'foo2'=>'somevalue2', 'foo3'=>'somevalue3', 'foo34'=>'somevalue3' ); Sunday, March 25, 12
  • 17. Better? $foo = 'somevalue'; $foo2 = 'somevalue2'; $foo34var = 'somevalue3'; $nicevar = somevalue4'; $my_array = array( 'foo' => 'somevalue', 'foo2' => 'somevalue2', 'foo3' => 'somevalue3', 'foo34' => 'somevalue3' ); Sunday, March 25, 12
  • 18. HTML <?php if ( ! have_posts() ) : ?> <div id="post-1" class="post"> <h1 class="entry-title">Not Found</h1> <div class="entry-content"> <p>Apologies, but no results were found.</p> <?php get_search_form(); ?> </div> </div> <?php endif; ?> Sunday, March 25, 12
  • 19. White Space function te_custom_excerpt( $output ) { ! if ( has_excerpt() && ! is_attachment() ) { ! $output .= te_continue_reading_link(); ! } ! return $output; } add_filter( 'get_the_excerpt', 'te_custom_excerpt' ); Sunday, March 25, 12
  • 20. In General •x == 23 •foo && bar •! foo •function( $a, $b, $c ) •$concat . '-5' •$term .= 'X' Sunday, March 25, 12
  • 21. Reference • http://codex.wordpress.org/ WordPress_Coding_Standards Sunday, March 25, 12