Your SlideShare is downloading. ×
0
‫התוסף הראשון שלי‬   ‫יואב פרחי, ‪yoav@farhi.org‬‬
‫התוסף הראשון שלי‬   ‫יואב פרחי, ‪yoav@farhi.org‬‬
‫התוסף הראשון שלי‬
RTL Tester<?php/*Plugin Name: RTL TesterPlugin URI: http://wordpress.org/extend/plugins/rtl-tester/Description: This plugi...
‫תשתית‬class RTLTester {    function __construct() {        load_plugin_textdomain( rtl-tester );        // Hooks and filt...
‫תשתית‬class RTLTester {    function __construct() {        load_plugin_textdomain( rtl-tester );        // Hooks and filt...
‫ווים‬hooks
<?php wp_footer(); ?></body></html>
function wp_footer() {    do_action(wp_footer);}
add_action( wp_footer, my_add_credit );
add_action( wp_footer, my_add_credit );function my_add_credit() {    echo "I did this!";}
‫פילטרים‬‫‪filters‬‬
function the_content($more_link_text = null, $stripteaser = 0) {    $content = get_the_content($more_link_text, $stripteas...
function the_content($more_link_text = null, $stripteaser = 0) {    $content = get_the_content($more_link_text, $stripteas...
function the_content($more_link_text = null, $stripteaser = 0) {    $content = get_the_content($more_link_text, $stripteas...
function the_content($more_link_text = null, $stripteaser = 0) {    $content = get_the_content($more_link_text, $stripteas...
function the_content($more_link_text = null, $stripteaser = 0) {    $content = get_the_content($more_link_text, $stripteas...
‫ביצוע פעולה‬   ‫פעולה על משתנה‬ add_action      add_filter do_action      apply_filters
‫תשתית‬class RTLTester {    function __construct() {        load_plugin_textdomain( rtl-tester );        // Hooks and filt...
‫פונקציות עזר‬class RTLTester {    function __construct() { . . .}new RTLTester;
‫פונקציות עזר‬class RTLTester {    function __construct() { . . .    function get_direction() {        if ( is_rtl() )    ...
‫פונקציות עזר‬class RTLTester {    function __construct() { . . .    function get_direction() {        $direction = is_rtl...
function admin_bar_rtl_switcher() {
function admin_bar_rtl_switcher() {    global $wp_admin_bar;
function admin_bar_rtl_switcher() {    global $wp_admin_bar;   if ( !is_super_admin() || !is_admin_bar_showing() )     ret...
function admin_bar_rtl_switcher() {    global $wp_admin_bar;   if ( !is_super_admin() || !is_admin_bar_showing() )     ret...
function admin_bar_rtl_switcher() {    global $wp_admin_bar;   if ( !is_super_admin() || !is_admin_bar_showing() )     ret...
function admin_bar_rtl_switcher() {    global $wp_admin_bar;   if ( !is_super_admin() || !is_admin_bar_showing() )     ret...
function admin_bar_rtl_switcher() {    global $wp_admin_bar;   if ( !is_super_admin() || !is_admin_bar_showing() )     ret...
function admin_bar_rtl_switcher() {        global $wp_admin_bar;       if ( !is_super_admin() || !is_admin_bar_showing() )...
function admin_bar_rtl_switcher() {        global $wp_admin_bar;       if ( !is_super_admin() || !is_admin_bar_showing() )...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direc...
function admin_bar_rtl_switcher() {        global $wp_admin_bar;       if ( !is_super_admin() || !is_admin_bar_showing() )...
function admin_bar_rtl_switcher() {       global $wp_admin_bar;       if ( !is_super_admin() || !is_admin_bar_showing() ) ...
function admin_bar_rtl_switcher() {       global $wp_admin_bar;       if ( !is_super_admin() || !is_admin_bar_showing() ) ...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;          if ( !is_super_admin() || !is_admin_bar_showin...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;          if ( !is_super_admin() || !is_admin_bar_showin...
function admin_bar_rtl_switcher() {          global $wp_admin_bar;          if ( !is_super_admin() || !is_admin_bar_showin...
function admin_bar_rtl_switcher() {       global $wp_admin_bar;       if ( !is_super_admin() || !is_admin_bar_showing() ) ...
‫קריאה לפונקציה‬class RTLTester {    function __construct() {    }    function admin_bar_rtl_switcher() {   ...    functio...
‫קריאה לפונקציה‬class RTLTester {    function __construct() {            add_action( admin_bar_menu, array( $this,    admi...
function set_direction() {
function set_direction() {    global $wp_locale;
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {      $d...
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {      $d...
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {      $d...
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {      $d...
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {      $d...
function set_direction() {    global $wp_locale;   $_user_id = get_current_user_id();   if ( isset( $_GET[d] ) ) {      $d...
function set_direction() {    global $wp_locale;    $_user_id = get_current_user_id();    if ( isset( $_GET[d] ) ) {      ...
‫קריאה לפונקציה‬class RTLTester {    function __construct() {        add_action( admin_bar_menu, array( $this,admin_bar_rt...
‫קריאה לפונקציה‬class RTLTester {    function __construct() {        add_action( admin_bar_menu, array( $this,admin_bar_rt...
One last thing...class RTLTester {    function __construct() {        add_action( admin_bar_menu, array( $this,admin_bar_r...
One last thing...class RTLTester {    function __construct() {       load_plugin_textdomain( rtl-tester );        add_acti...
http://wordpress.org/extend/plugins/about/
? ‫שאלות‬      yoav@farhi.org          @yoavfhttp://yoav.wordpress.com
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
התוסף הראשון שלי - וורדפרס
Upcoming SlideShare
Loading in...5
×

התוסף הראשון שלי - וורדפרס

3,149

Published on

מצגת למפגש קהילת הוורדפרס הישראלית, 5.5.2010
איך לבנות תוסף לוורדפרס

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,149
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "התוסף הראשון שלי - וורדפרס"

  1. 1. ‫התוסף הראשון שלי‬ ‫יואב פרחי, ‪yoav@farhi.org‬‬
  2. 2. ‫התוסף הראשון שלי‬ ‫יואב פרחי, ‪yoav@farhi.org‬‬
  3. 3. ‫התוסף הראשון שלי‬
  4. 4. RTL Tester<?php/*Plugin Name: RTL TesterPlugin URI: http://wordpress.org/extend/plugins/rtl-tester/Description: This plugin can be used to test WordPress themesand plugins with Right To Left (RTL) text direction. Simplyactivate this plugin to enable RTL and deactivate to return tonormal operation. Yes, this is simplest plugin in the world.Author: <a href="http://blog.yoavfarhi.com">Yoav Farhi</a>, <ahref="http://automattic.com">Automattic</a>Version: 0.2*/$text_direction = rtl;
  5. 5. ‫תשתית‬class RTLTester { function __construct() { load_plugin_textdomain( rtl-tester ); // Hooks and filters }}new RTLTester;
  6. 6. ‫תשתית‬class RTLTester { function __construct() { load_plugin_textdomain( rtl-tester ); // Hooks and filters }}new RTLTester;
  7. 7. ‫ווים‬hooks
  8. 8. <?php wp_footer(); ?></body></html>
  9. 9. function wp_footer() { do_action(wp_footer);}
  10. 10. add_action( wp_footer, my_add_credit );
  11. 11. add_action( wp_footer, my_add_credit );function my_add_credit() { echo "I did this!";}
  12. 12. ‫פילטרים‬‫‪filters‬‬
  13. 13. function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters(the_content, $content); echo $content;}
  14. 14. function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters(the_content, $content); echo $content;}
  15. 15. function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters(the_content, $content); echo $content;}add_filter( the_content, my_wordpress_link );
  16. 16. function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters(the_content, $content); echo $content;}add_filter( the_content, my_wordpress_link );function my_wordpress_link( $content ){}
  17. 17. function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters(the_content, $content); echo $content;}add_filter( the_content, my_wordpress_link );function my_wordpress_link( $content ){ $content = str_replace( WordPress, <a href="http://wordpress.org">WordPress</a>, $content ); return $content}
  18. 18. ‫ביצוע פעולה‬ ‫פעולה על משתנה‬ add_action add_filter do_action apply_filters
  19. 19. ‫תשתית‬class RTLTester { function __construct() { load_plugin_textdomain( rtl-tester ); // Hooks and filters }}new RTLTester;
  20. 20. ‫פונקציות עזר‬class RTLTester { function __construct() { . . .}new RTLTester;
  21. 21. ‫פונקציות עזר‬class RTLTester { function __construct() { . . . function get_direction() { if ( is_rtl() ) $direction = rtl; else $direction = ltr; return $direction; }}new RTLTester;
  22. 22. ‫פונקציות עזר‬class RTLTester { function __construct() { . . . function get_direction() { $direction = is_rtl() ? rtl : ltr; return $direction; }}new RTLTester;
  23. 23. function admin_bar_rtl_switcher() {
  24. 24. function admin_bar_rtl_switcher() { global $wp_admin_bar;
  25. 25. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return;
  26. 26. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction();
  27. 27. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = ( $direction == rtl ) ? ltr : rtl;
  28. 28. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = ( $direction == rtl ) ? ltr : rtl; $wp_admin_bar->add_menu(array(
  29. 29. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = ( $direction == rtl ) ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL,
  30. 30. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = ( $direction == rtl ) ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl-tester), strtoupper( $direction ) ),
  31. 31. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl-tester), strtoupper( $direction ) ),
  32. 32. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ),
  33. 33. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester); $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ),
  34. 34. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester);// $translation = "-‫% לעבור ל‬s" $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ),
  35. 35. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester);// $translation = "-‫% לעבור ל‬s" $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl;$direction = ltr; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ),
  36. 36. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester);// $translation = "-‫% לעבור ל‬s" $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl;$direction = ltr;$direction = strtoupper( $direction ); $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ),
  37. 37. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester);// $translation = "-‫% לעבור ל‬s" $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl;$direction = ltr;$direction = strtoupper( $direction ); $wp_admin_bar->add_menu(array(// $direction = LTR id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ),
  38. 38. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester);// $translation = "-‫% לעבור ל‬s" $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl;$direction = ltr;$direction = strtoupper( $direction ); $wp_admin_bar->add_menu(array(// $direction = LTR id => RTL, title => sprintf( __(Switch to %s, rtl-$title = sprintf( $translation, $direction ) tester), strtoupper( $direction ) ),
  39. 39. function admin_bar_rtl_switcher() { global $wp_admin_bar;sprintf( __(Switch to %s, rtl-tester), strtoupper($direction) ); if ( !is_super_admin() || !is_admin_bar_showing() ) return;$translation = __(Switch to %s, rtl-tester);// $translation = "-‫% לעבור ל‬s" $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl;$direction = ltr;$direction = strtoupper( $direction ); $wp_admin_bar->add_menu(array(// $direction = LTR id => RTL, title => sprintf( __(Switch to %s, rtl-$title = sprintf( $translation, $direction ) tester), strtoupper( $direction ) ),// $title = "-‫ לעבור ל‬LTR"
  40. 40. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl-tester), strtoupper( $direction ) ), ) ); }
  41. 41. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl-tester), strtoupper( $direction ) ), href => add_query_arg( array( d => $direction ) ) ) ); }
  42. 42. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl-tester), strtoupper( $direction ) ), href => add_query_arg( array( d => $direction ) ) ) ); }
  43. 43. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction();$url = http://mysite.com $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ), href => add_query_arg( array( d => $direction ) ) ) ); }
  44. 44. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction();$url = http://mysite.comadd_query_arg( array( =d => rtl), $url ) ? ltr : rtl; $direction $direction == rtl $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ), href => add_query_arg( array( d => $direction ) ) ) ); }
  45. 45. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction();$url = http://mysite.comadd_query_arg( array( =d => rtl), $url ) ? ltr : rtl; $direction $direction == rtl $wp_admin_bar->add_menu(array(// $url = http://mysite.com/?d=rtl id => RTL, title => sprintf( __(Switch to %s, rtl- tester), strtoupper( $direction ) ), href => add_query_arg( array( d => $direction ) ) ) ); }
  46. 46. function admin_bar_rtl_switcher() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $direction = $this->get_direction(); $direction = $direction == rtl ? ltr : rtl; $wp_admin_bar->add_menu(array( id => RTL, title => sprintf( __(Switch to %s, rtl-tester), strtoupper( $direction ) ), href => add_query_arg( array( d => $direction ) ) ) ); }
  47. 47. ‫קריאה לפונקציה‬class RTLTester { function __construct() { } function admin_bar_rtl_switcher() { ... function get_direction() { ...}new RTLTester;
  48. 48. ‫קריאה לפונקציה‬class RTLTester { function __construct() { add_action( admin_bar_menu, array( $this, admin_bar_rtl_switcher ), 999 ); } function admin_bar_rtl_switcher() { ... function get_direction() { ...}new RTLTester;
  49. 49. function set_direction() {
  50. 50. function set_direction() { global $wp_locale;
  51. 51. function set_direction() { global $wp_locale; $_user_id = get_current_user_id();
  52. 52. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) {
  53. 53. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr;
  54. 54. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr; update_user_meta( $_user_id, rtladminbar, $direction );
  55. 55. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr; update_user_meta( $_user_id, rtladminbar, $direction ); } else {
  56. 56. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr; update_user_meta( $_user_id, rtladminbar, $direction ); } else { $direction = get_user_meta($_user_id, rtladminbar, true);
  57. 57. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr; update_user_meta( $_user_id, rtladminbar, $direction ); } else { $direction = get_user_meta($_user_id, rtladminbar, true); if ( false === $direction )
  58. 58. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr; update_user_meta( $_user_id, rtladminbar, $direction ); } else { $direction = get_user_meta($_user_id, rtladminbar, true); if ( false === $direction ) $direction = $wp_locale->text_direction; }
  59. 59. function set_direction() { global $wp_locale; $_user_id = get_current_user_id(); if ( isset( $_GET[d] ) ) { $direction = ( $_GET[d] == rtl ) ? rtl : ltr; update_user_meta( $_user_id, rtladminbar, $direction ); } else { $direction = get_user_meta($_user_id, rtladminbar, true); if ( false === $direction ) $direction = $wp_locale->text_direction; } $wp_locale->text_direction = $direction;}
  60. 60. ‫קריאה לפונקציה‬class RTLTester { function __construct() { add_action( admin_bar_menu, array( $this,admin_bar_rtl_switcher ), 999 ); } function admin_bar_rtl_switcher() { ... function set_direction() { ... function get_direction() {}new RTLTester;
  61. 61. ‫קריאה לפונקציה‬class RTLTester { function __construct() { add_action( admin_bar_menu, array( $this,admin_bar_rtl_switcher ), 999 ); add_action( init, array( $this, set_direction ) ); } function admin_bar_rtl_switcher() { ... function set_direction() { ... function get_direction() {}new RTLTester;
  62. 62. One last thing...class RTLTester { function __construct() { add_action( admin_bar_menu, array( $this,admin_bar_rtl_switcher ), 999 ); add_action( init, array( $this, set_direction ) ); } function admin_bar_rtl_switcher() { ... function set_direction() { ... function get_direction() { ...}new RTLTester;
  63. 63. One last thing...class RTLTester { function __construct() { load_plugin_textdomain( rtl-tester ); add_action( admin_bar_menu, array( $this,admin_bar_rtl_switcher ), 999 ); add_action( init, array( $this, set_direction ) ); } function admin_bar_rtl_switcher() { ... function set_direction() { ... function get_direction() { ...}new RTLTester;
  64. 64. http://wordpress.org/extend/plugins/about/
  65. 65. ? ‫שאלות‬ yoav@farhi.org @yoavfhttp://yoav.wordpress.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×