5 Cze 2008

Przypisanie usera i uparanień między tabelami bazy wordpress

insert into vi_users (
    user_login,
    user_pass,
    user_nicename,
    user_email,
    user_url,
    user_registered,
    user_activation_key,
    user_status,
    display_name
  )
SELECT user_login,
  user_pass,
  user_nicename,
  user_email,
  user_url,
  user_registered,
  user_activation_key,
  user_status,
  display_name
from kd_users
where ID = 1
insert into vi_usermeta (umeta_id user_id meta_key meta_value)
SELECT umeta_id user_id meta_key meta_value
from kd_usermeta
where user_id = 1
5 Cze 2008

Mój pierwszy plugin do wordpress

<a rel="nofollow" href='http://kody.wig.pl' class='tag-link-42' title='1 topics' rel="tag">Kody</a>
<?php 

function title_add_tag($text) {
  $text = preg_replace("/title='[^']*'/i", '', $text);
  return preg_replace('/>([^<]*)<\/a>/i', " title='$1'>$1</a>",  $text); 
}
add_filter('wp_tag_cloud', title_add_tag');
?>