SlideShare a Scribd company logo
1 of 18
Download to read offline
Extending BuddyPress
           Plugin & Temi




 Francesco Laffi – WordCamp Milano – 27 Maggio 2011
Cos’è BuddyPress

             Blog    Bacheca
    Utenti                     Profili
Commenti                         Amicizie
Taxonomy                         Gruppi
  Templates                  Forum (bbPress)
        Plugin API   Messaggi Privati
Non un semplice plugin
-------------------------------------
Lines of code    WP 3.2b2    BP 1.2.8
-------------------------------------
PHP                102400       57363
JS                  23760        2810
CSS                 20955        5562
HTML                 1952           0
XML                    37           0
-------------------------------------
SUM:               149104       65735
-------------------------------------
Extending BuddyPress

   Componenti (plugins)

 bp-custom.php (snippets)

          Temi
Plugin per BuddyPress
  • sono plugin per WP ma usano le API di
     BP (funzioni, azioni, filtri)
  • eseguire il codice di BP solo dopo che
     viene caricato:
/* Only load code that needs BuddyPress to run once BP is
loaded and initialized. */
function my_plugin_init()
{
    require( dirname( __FILE__ ) . '/my-plugin.php' );
}
add_action( 'bp_include', 'my_plugin_init' );
Componenti
     example.org/groups/my-group/forum/topic/test-topic/


current_component                             action_variables

               current_item        current_action

      example.org/members/francesco/messages/1/view


          Accessibili tramite la variabile globale $bp
   http://codex.buddypress.org/developer-docs/the-bp-global/
Struttura dei componenti


            • Struttura standard
            • Usata anche per le
              funzionalità base di
              BuddyPress
BP Skeleton Component


   • Esempio di componente “high five”
   • Buona base di partenza per
      componenti personalizzati


http://wordpress.org/extend/plugins/buddypress-skeleton-component/
Extending BuddyPress

   Componenti (plugins)

 bp-custom.php (snippets)

          Temi
bp-custom.php
•   wp-content/plugins/bp-custom.php

•   snippets di codice, piccole modifiche

•   cambiare slug ai forum:
          define('BP_FORUMS_SLUG', 'board');


•   rimuovere i link cliccabili dal profilo:

       function remove_xprofile_links()
       {
       	 remove_filter('bp_get_the_profile_field_value',
                 'xprofile_filter_link_profile_data', 50, );
       }
       add_action('plugins_loaded', 'remove_xprofile_links');
Extending BuddyPress

   Componenti (plugins)

 bp-custom.php (snippets)

          Temi
bp-default theme
URL                    Template
URL: example.org/members/francesco/messages/compose/

Template: bp-default/members/single/messages/compose.php
i “Loop”
    •   The Activity Stream Loop / bp_has_activities()
    •   The Forum Topics Loop / bp_has_forum_topics()
    •   The Members Loop / bp_has_members()
    •   The Groups Loop / bp_has_groups()
    •   The Blogs Loop / bp_has_blogs()
    •   The Group Members Loop / bp_group_has_members()
    •   The Private Messages Loop / bp_has_message_threads()
    •   The Profile Data Loop / bp_has_profile()


http://codex.buddypress.org/developer-docs/custom-buddypress-loops/
Group Members Loop
  <?php if ( bp_group_has_members() ) : ?>
    <div id="member-count" class="pag-count">
      <?php bp_group_member_pagination_count() ?>
    </div>
    <div id="member-pagination" class="pagination-links">
      <?php bp_group_member_pagination() ?>
    </div>
    <ul id="member-list" class="item-list">
    <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
      <li>
        <!-- Example template tags you can use -->
        <?php bp_group_member_avatar() ?>
  	     <?php bp_group_member_link() ?>
        <?php bp_group_member_joined_since() ?>
  	   </li>
    <?php endwhile; ?>
    </ul>
  <?php else: ?>
    <div id="message" class="info">
      <p>This group has no members.</p>
    </div>
  <?php endif;?>
Temi personalizzati

• bp-default child theme
 • si aggiorna con buddypress
• WP->BP: BuddyPress Template Pack
 http://wordpress.org/extend/plugins/bp-template-pack/
Risorse
•   BP Codex: http://codex.buddypress.org/home/

•   Forums: http://buddypress.org/community/
    groups/creating-extending/forum/

•   IRC: #buddypress-dev su Freenode

•   BP Dev Blog: http://bpdevel.wordpress.com/

•   PHPXref e Doxygen

•   Trac: http://buddypress.trac.wordpress.org/
Q&A
     Francesco Laffi
   francesco@flweb.it

twitter.com/francescolaffi
      http://flweb.it

More Related Content

What's hot

Build a WordPress theme from HTML5 template @ Telerik
Build a WordPress theme from HTML5 template @ TelerikBuild a WordPress theme from HTML5 template @ Telerik
Build a WordPress theme from HTML5 template @ TelerikMario Peshev
 
WordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPWordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPandrewnacin
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Richard Calderon
 
Bjvenus getting-started
Bjvenus getting-startedBjvenus getting-started
Bjvenus getting-startedBy Joomla
 
Introduction to building joomla! components using FOF
Introduction to building joomla! components using FOFIntroduction to building joomla! components using FOF
Introduction to building joomla! components using FOFTim Plummer
 

What's hot (6)

Daughter Themes
Daughter ThemesDaughter Themes
Daughter Themes
 
Build a WordPress theme from HTML5 template @ Telerik
Build a WordPress theme from HTML5 template @ TelerikBuild a WordPress theme from HTML5 template @ Telerik
Build a WordPress theme from HTML5 template @ Telerik
 
WordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPWordPress 3.0 at DC PHP
WordPress 3.0 at DC PHP
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
 
Bjvenus getting-started
Bjvenus getting-startedBjvenus getting-started
Bjvenus getting-started
 
Introduction to building joomla! components using FOF
Introduction to building joomla! components using FOFIntroduction to building joomla! components using FOF
Introduction to building joomla! components using FOF
 

Similar to Extending BuddyPress – WordCamp Milano 2011 [italian]

Buddy Press 10-19-2012
Buddy Press 10-19-2012Buddy Press 10-19-2012
Buddy Press 10-19-2012Thomas Carney
 
Theming for BuddyPress
Theming for BuddyPressTheming for BuddyPress
Theming for BuddyPressboonebgorges
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
Buddypress Pasadena Meetup
Buddypress Pasadena MeetupBuddypress Pasadena Meetup
Buddypress Pasadena MeetupSuzette Franck
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress PluginBrad Williams
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteBrendan Sera-Shriar
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
Arizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress ThemeArizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress Themecertainstrings
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentKapil Dev Singh
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Themecertainstrings
 
WordPress
WordPressWordPress
WordPressrisager
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Bastian Grimm
 
Customizing a BuddyPress community website
Customizing a BuddyPress community websiteCustomizing a BuddyPress community website
Customizing a BuddyPress community websiteSylvie Clément
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentSitdhibong Laokok
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3David Bisset
 

Similar to Extending BuddyPress – WordCamp Milano 2011 [italian] (20)

Buddy Press 10-19-2012
Buddy Press 10-19-2012Buddy Press 10-19-2012
Buddy Press 10-19-2012
 
Theming for BuddyPress
Theming for BuddyPressTheming for BuddyPress
Theming for BuddyPress
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Buddypress Pasadena Meetup
Buddypress Pasadena MeetupBuddypress Pasadena Meetup
Buddypress Pasadena Meetup
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
Arizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress ThemeArizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress Theme
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Theme
 
WordPress
WordPressWordPress
WordPress
 
Write Your First WordPress Plugin
Write Your First WordPress PluginWrite Your First WordPress Plugin
Write Your First WordPress Plugin
 
Theming 101
Theming 101Theming 101
Theming 101
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012
 
Customizing a BuddyPress community website
Customizing a BuddyPress community websiteCustomizing a BuddyPress community website
Customizing a BuddyPress community website
 
Optimize wordpress
Optimize wordpressOptimize wordpress
Optimize wordpress
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
Ci2
Ci2Ci2
Ci2
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 

Recently uploaded (20)

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 

Extending BuddyPress – WordCamp Milano 2011 [italian]

  • 1. Extending BuddyPress Plugin & Temi Francesco Laffi – WordCamp Milano – 27 Maggio 2011
  • 2. Cos’è BuddyPress Blog Bacheca Utenti Profili Commenti Amicizie Taxonomy Gruppi Templates Forum (bbPress) Plugin API Messaggi Privati
  • 3. Non un semplice plugin ------------------------------------- Lines of code WP 3.2b2 BP 1.2.8 ------------------------------------- PHP 102400 57363 JS 23760 2810 CSS 20955 5562 HTML 1952 0 XML 37 0 ------------------------------------- SUM: 149104 65735 -------------------------------------
  • 4. Extending BuddyPress Componenti (plugins) bp-custom.php (snippets) Temi
  • 5. Plugin per BuddyPress • sono plugin per WP ma usano le API di BP (funzioni, azioni, filtri) • eseguire il codice di BP solo dopo che viene caricato: /* Only load code that needs BuddyPress to run once BP is loaded and initialized. */ function my_plugin_init() {     require( dirname( __FILE__ ) . '/my-plugin.php' ); } add_action( 'bp_include', 'my_plugin_init' );
  • 6. Componenti example.org/groups/my-group/forum/topic/test-topic/ current_component action_variables current_item current_action example.org/members/francesco/messages/1/view Accessibili tramite la variabile globale $bp http://codex.buddypress.org/developer-docs/the-bp-global/
  • 7. Struttura dei componenti • Struttura standard • Usata anche per le funzionalità base di BuddyPress
  • 8. BP Skeleton Component • Esempio di componente “high five” • Buona base di partenza per componenti personalizzati http://wordpress.org/extend/plugins/buddypress-skeleton-component/
  • 9. Extending BuddyPress Componenti (plugins) bp-custom.php (snippets) Temi
  • 10. bp-custom.php • wp-content/plugins/bp-custom.php • snippets di codice, piccole modifiche • cambiare slug ai forum: define('BP_FORUMS_SLUG', 'board'); • rimuovere i link cliccabili dal profilo: function remove_xprofile_links() { remove_filter('bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 50, ); } add_action('plugins_loaded', 'remove_xprofile_links');
  • 11. Extending BuddyPress Componenti (plugins) bp-custom.php (snippets) Temi
  • 13. URL Template URL: example.org/members/francesco/messages/compose/ Template: bp-default/members/single/messages/compose.php
  • 14. i “Loop” • The Activity Stream Loop / bp_has_activities() • The Forum Topics Loop / bp_has_forum_topics() • The Members Loop / bp_has_members() • The Groups Loop / bp_has_groups() • The Blogs Loop / bp_has_blogs() • The Group Members Loop / bp_group_has_members() • The Private Messages Loop / bp_has_message_threads() • The Profile Data Loop / bp_has_profile() http://codex.buddypress.org/developer-docs/custom-buddypress-loops/
  • 15. Group Members Loop <?php if ( bp_group_has_members() ) : ?> <div id="member-count" class="pag-count"> <?php bp_group_member_pagination_count() ?> </div> <div id="member-pagination" class="pagination-links"> <?php bp_group_member_pagination() ?> </div> <ul id="member-list" class="item-list"> <?php while ( bp_group_members() ) : bp_group_the_member(); ?> <li> <!-- Example template tags you can use --> <?php bp_group_member_avatar() ?> <?php bp_group_member_link() ?> <?php bp_group_member_joined_since() ?> </li> <?php endwhile; ?> </ul> <?php else: ?> <div id="message" class="info"> <p>This group has no members.</p> </div> <?php endif;?>
  • 16. Temi personalizzati • bp-default child theme • si aggiorna con buddypress • WP->BP: BuddyPress Template Pack http://wordpress.org/extend/plugins/bp-template-pack/
  • 17. Risorse • BP Codex: http://codex.buddypress.org/home/ • Forums: http://buddypress.org/community/ groups/creating-extending/forum/ • IRC: #buddypress-dev su Freenode • BP Dev Blog: http://bpdevel.wordpress.com/ • PHPXref e Doxygen • Trac: http://buddypress.trac.wordpress.org/
  • 18. Q&A Francesco Laffi francesco@flweb.it twitter.com/francescolaffi http://flweb.it