bbPress1

BbPress 1.1 Converter.

Defined (1)

The class is defined in the following location(s).

/includes/admin/converters/bbPress1.php  
  1. class bbPress1 extends BBP_Converter_Base { 
  2.  
  3. /** 
  4. * Main constructor 
  5. * @uses bbPress1::setup_globals() 
  6. */ 
  7. function __construct() { 
  8. parent::__construct(); 
  9. $this->setup_globals(); 
  10.  
  11. /** 
  12. * Sets up the field mappings 
  13. */ 
  14. public function setup_globals() { 
  15.  
  16. /** Forum Section *****************************************************/ 
  17.  
  18. // Forum id (Stored in postmeta) 
  19. $this->field_map[] = array( 
  20. 'from_tablename' => 'forums',  
  21. 'from_fieldname' => 'forum_id',  
  22. 'to_type' => 'forum',  
  23. 'to_fieldname' => '_bbp_forum_id' 
  24. ); 
  25.  
  26. // Forum parent id (If no parent, then 0. Stored in postmeta) 
  27. $this->field_map[] = array( 
  28. 'from_tablename' => 'forums',  
  29. 'from_fieldname' => 'forum_parent',  
  30. 'to_type' => 'forum',  
  31. 'to_fieldname' => '_bbp_forum_parent_id' 
  32. ); 
  33.  
  34. // Forum topic count (Stored in postmeta) 
  35. $this->field_map[] = array( 
  36. 'from_tablename' => 'forums',  
  37. 'from_fieldname' => 'topics',  
  38. 'to_type' => 'forum',  
  39. 'to_fieldname' => '_bbp_topic_count' 
  40. ); 
  41.  
  42. // Forum reply count (Stored in postmeta) 
  43. $this->field_map[] = array( 
  44. 'from_tablename' => 'forums',  
  45. 'from_fieldname' => 'posts',  
  46. 'to_type' => 'forum',  
  47. 'to_fieldname' => '_bbp_reply_count' 
  48. ); 
  49.  
  50. // Forum total topic count (Stored in postmeta) 
  51. $this->field_map[] = array( 
  52. 'from_tablename' => 'forums',  
  53. 'from_fieldname' => 'topics',  
  54. 'to_type' => 'forum',  
  55. 'to_fieldname' => '_bbp_total_topic_count' 
  56. ); 
  57.  
  58. // Forum total reply count (Stored in postmeta) 
  59. $this->field_map[] = array( 
  60. 'from_tablename' => 'forums',  
  61. 'from_fieldname' => 'posts',  
  62. 'to_type' => 'forum',  
  63. 'to_fieldname' => '_bbp_total_reply_count' 
  64. ); 
  65.  
  66. // Forum title. 
  67. $this->field_map[] = array( 
  68. 'from_tablename' => 'forums',  
  69. 'from_fieldname' => 'forum_name',  
  70. 'to_type' => 'forum',  
  71. 'to_fieldname' => 'post_title' 
  72. ); 
  73.  
  74. // Forum slug (Clean name to avoid confilcts) 
  75. $this->field_map[] = array( 
  76. 'from_tablename' => 'forums',  
  77. 'from_fieldname' => 'forum_slug',  
  78. 'to_type' => 'forum',  
  79. 'to_fieldname' => 'post_name',  
  80. 'callback_method' => 'callback_slug' 
  81. ); 
  82.  
  83. // Forum description. 
  84. $this->field_map[] = array( 
  85. 'from_tablename' => 'forums',  
  86. 'from_fieldname' => 'forum_desc',  
  87. 'to_type' => 'forum',  
  88. 'to_fieldname' => 'post_content',  
  89. 'callback_method' => 'callback_null' 
  90. ); 
  91.  
  92. // Forum display order (Starts from 1) 
  93. $this->field_map[] = array( 
  94. 'from_tablename' => 'forums',  
  95. 'from_fieldname' => 'forum_order',  
  96. 'to_type' => 'forum',  
  97. 'to_fieldname' => 'menu_order' 
  98. ); 
  99.  
  100. // Forum type (bbPress v1.x Forum > 0 or Category = 0, Stored in postmeta) 
  101. $this->field_map[] = array( 
  102. 'from_tablename' => 'meta',  
  103. 'from_fieldname' => 'meta_value',  
  104. 'join_tablename' => 'forums',  
  105. 'join_type' => 'LEFT',  
  106. 'join_expression' => 'ON meta.object_id = forums.forum_id AND meta.meta_key = "forum_is_category"',  
  107. 'to_type' => 'forum',  
  108. 'to_fieldname' => '_bbp_forum_type',  
  109. 'callback_method' => 'callback_forum_type' 
  110. ); 
  111.  
  112. // Forum dates. 
  113. $this->field_map[] = array( 
  114. 'to_type' => 'forum',  
  115. 'to_fieldname' => 'post_date',  
  116. 'default' => date('Y-m-d H:i:s') 
  117. ); 
  118. $this->field_map[] = array( 
  119. 'to_type' => 'forum',  
  120. 'to_fieldname' => 'post_date_gmt',  
  121. 'default' => date('Y-m-d H:i:s') 
  122. ); 
  123. $this->field_map[] = array( 
  124. 'to_type' => 'forum',  
  125. 'to_fieldname' => 'post_modified',  
  126. 'default' => date('Y-m-d H:i:s') 
  127. ); 
  128. $this->field_map[] = array( 
  129. 'to_type' => 'forum',  
  130. 'to_fieldname' => 'post_modified_gmt',  
  131. 'default' => date('Y-m-d H:i:s') 
  132. ); 
  133.  
  134. /** Topic Section *****************************************************/ 
  135.  
  136. // Topic id (Stored in postmeta) 
  137. $this->field_map[] = array( 
  138. 'from_tablename' => 'topics',  
  139. 'from_fieldname' => 'topic_id',  
  140. 'to_type' => 'topic',  
  141. 'to_fieldname' => '_bbp_topic_id' 
  142. ); 
  143.  
  144. // Topic reply count (Stored in postmeta) 
  145. $this->field_map[] = array( 
  146. 'from_tablename' => 'topics',  
  147. 'from_fieldname' => 'topic_posts',  
  148. 'to_type' => 'topic',  
  149. 'to_fieldname' => '_bbp_reply_count',  
  150. 'callback_method' => 'callback_topic_reply_count' 
  151. ); 
  152.  
  153. // Topic total reply count (Includes unpublished replies, Stored in postmeta) 
  154. $this->field_map[] = array( 
  155. 'from_tablename' => 'topics',  
  156. 'from_fieldname' => 'topic_posts',  
  157. 'to_type' => 'topic',  
  158. 'to_fieldname' => '_bbp_total_reply_count',  
  159. 'callback_method' => 'callback_topic_reply_count' 
  160. ); 
  161.  
  162. // Topic parent forum id (If no parent, then 0. Stored in postmeta) 
  163. $this->field_map[] = array( 
  164. 'from_tablename' => 'topics',  
  165. 'from_fieldname' => 'forum_id',  
  166. 'to_type' => 'topic',  
  167. 'to_fieldname' => '_bbp_forum_id',  
  168. 'callback_method' => 'callback_forumid' 
  169. ); 
  170.  
  171. // Topic author. 
  172. $this->field_map[] = array( 
  173. 'from_tablename' => 'topics',  
  174. 'from_fieldname' => 'topic_poster',  
  175. 'to_type' => 'topic',  
  176. 'to_fieldname' => 'post_author',  
  177. 'callback_method' => 'callback_userid' 
  178. ); 
  179.  
  180. // Topic title. 
  181. $this->field_map[] = array( 
  182. 'from_tablename' => 'topics',  
  183. 'from_fieldname' => 'topic_title',  
  184. 'to_type' => 'topic',  
  185. 'to_fieldname' => 'post_title' 
  186. ); 
  187.  
  188. // Topic slug (Clean name to avoid conflicts) 
  189. $this->field_map[] = array( 
  190. 'from_tablename' => 'topics',  
  191. 'from_fieldname' => 'topic_slug',  
  192. 'to_type' => 'topic',  
  193. 'to_fieldname' => 'post_name',  
  194. 'callback_method' => 'callback_slug' 
  195. ); 
  196.  
  197. // Topic content. 
  198. // Note: We join the 'posts' table because 'topics' table does not include content. 
  199. $this->field_map[] = array( 
  200. 'from_tablename' => 'posts',  
  201. 'from_fieldname' => 'post_text',  
  202. 'join_tablename' => 'topics',  
  203. 'join_type' => 'INNER',  
  204. 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0, 1)',  
  205. 'to_type' => 'topic',  
  206. 'to_fieldname' => 'post_content',  
  207. 'callback_method' => 'callback_html' 
  208. ); 
  209.  
  210. // Topic status (Spam, Trash or Publish, bbPress v1.x publish = 0, trash = 1 & spam = 2) 
  211. $this->field_map[] = array( 
  212. 'from_tablename' => 'posts',  
  213. 'from_fieldname' => 'post_status',  
  214. 'join_tablename' => 'topics',  
  215. 'join_type' => 'INNER',  
  216. 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0, 1)',  
  217. 'to_type' => 'topic',  
  218. 'to_fieldname' => 'post_status',  
  219. 'callback_method' => 'callback_status' 
  220. ); 
  221.  
  222. // Topic author ip (Stored in postmeta) 
  223. // Note: We join the 'posts' table because 'topics' table does not include author ip. 
  224. $this->field_map[] = array( 
  225. 'from_tablename' => 'posts',  
  226. 'from_fieldname' => 'poster_ip',  
  227. 'join_tablename' => 'topics',  
  228. 'join_type' => 'INNER',  
  229. 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0, 1)',  
  230. 'to_type' => 'topic',  
  231. 'to_fieldname' => '_bbp_author_ip' 
  232. ); 
  233.  
  234. // Topic parent forum id (If no parent, then 0) 
  235. $this->field_map[] = array( 
  236. 'from_tablename' => 'topics',  
  237. 'from_fieldname' => 'forum_id',  
  238. 'to_type' => 'topic',  
  239. 'to_fieldname' => 'post_parent',  
  240. 'callback_method' => 'callback_forumid' 
  241. ); 
  242.  
  243. // Sticky status (Stored in postmeta)) 
  244. $this->field_map[] = array( 
  245. 'from_tablename' => 'topics',  
  246. 'from_fieldname' => 'topic_sticky',  
  247. 'to_type' => 'topic',  
  248. 'to_fieldname' => '_bbp_old_sticky_status',  
  249. 'callback_method' => 'callback_sticky_status' 
  250. ); 
  251.  
  252. // Topic dates. 
  253. $this->field_map[] = array( 
  254. 'from_tablename' => 'topics',  
  255. 'from_fieldname' => 'topic_start_time',  
  256. 'to_type' => 'topic',  
  257. 'to_fieldname' => 'post_date' 
  258. ); 
  259. $this->field_map[] = array( 
  260. 'from_tablename' => 'topics',  
  261. 'from_fieldname' => 'topic_start_time',  
  262. 'to_type' => 'topic',  
  263. 'to_fieldname' => 'post_date_gmt' 
  264. ); 
  265. $this->field_map[] = array( 
  266. 'from_tablename' => 'topics',  
  267. 'from_fieldname' => 'topic_time',  
  268. 'to_type' => 'topic',  
  269. 'to_fieldname' => 'post_modified' 
  270. ); 
  271. $this->field_map[] = array( 
  272. 'from_tablename' => 'topics',  
  273. 'from_fieldname' => 'topic_time',  
  274. 'to_type' => 'topic',  
  275. 'to_fieldname' => 'post_modified_gmt' 
  276. ); 
  277. $this->field_map[] = array( 
  278. 'from_tablename' => 'topics',  
  279. 'from_fieldname' => 'topic_time',  
  280. 'to_type' => 'topic',  
  281. 'to_fieldname' => '_bbp_last_active_time' 
  282. ); 
  283.  
  284. /** Tags Section ******************************************************/ 
  285.  
  286. // Topic id. 
  287. $this->field_map[] = array( 
  288. 'from_tablename' => 'term_relationships',  
  289. 'from_fieldname' => 'object_id',  
  290. 'to_type' => 'tags',  
  291. 'to_fieldname' => 'objectid',  
  292. 'callback_method' => 'callback_topicid' 
  293. ); 
  294.  
  295. // Taxonomy ID. 
  296. $this->field_map[] = array( 
  297. 'from_tablename' => 'term_taxonomy',  
  298. 'from_fieldname' => 'term_taxonomy_id',  
  299. 'join_tablename' => 'term_relationships',  
  300. 'join_type' => 'INNER',  
  301. 'join_expression' => 'USING (term_taxonomy_id)',  
  302. 'to_type' => 'tags',  
  303. 'to_fieldname' => 'taxonomy' 
  304. ); 
  305.  
  306. // Term text. 
  307. $this->field_map[] = array( 
  308. 'from_tablename' => 'terms',  
  309. 'from_fieldname' => 'name',  
  310. 'join_tablename' => 'term_taxonomy',  
  311. 'join_type' => 'INNER',  
  312. 'join_expression' => 'USING (term_id)',  
  313. 'to_type' => 'tags',  
  314. 'to_fieldname' => 'name' 
  315. ); 
  316.  
  317. // Term slug. 
  318. $this->field_map[] = array( 
  319. 'from_tablename' => 'terms',  
  320. 'from_fieldname' => 'slug',  
  321. 'join_tablename' => 'term_taxonomy',  
  322. 'join_type' => 'INNER',  
  323. 'join_expression' => 'USING (term_id)',  
  324. 'to_type' => 'tags',  
  325. 'to_fieldname' => 'slug',  
  326. 'callback_method' => 'callback_slug' 
  327. ); 
  328.  
  329. /** Reply Section *****************************************************/ 
  330.  
  331. // Reply id (Stored in postmeta) 
  332. $this->field_map[] = array( 
  333. 'from_tablename' => 'posts',  
  334. 'from_fieldname' => 'post_id',  
  335. 'to_type' => 'reply',  
  336. 'to_fieldname' => '_bbp_post_id' 
  337. ); 
  338.  
  339. // Reply parent topic id (If no parent, then 0. Stored in postmeta) 
  340. $this->field_map[] = array( 
  341. 'from_tablename' => 'posts',  
  342. 'from_fieldname' => 'topic_id',  
  343. 'to_type' => 'reply',  
  344. 'to_fieldname' => '_bbp_topic_id',  
  345. 'callback_method' => 'callback_topicid' 
  346. ); 
  347.  
  348. // Reply parent forum id (If no parent, then 0. Stored in postmeta) 
  349. $this->field_map[] = array( 
  350. 'from_tablename' => 'posts',  
  351. 'from_fieldname' => 'forum_id',  
  352. 'to_type' => 'reply',  
  353. 'to_fieldname' => '_bbp_forum_id',  
  354. 'callback_method' => 'callback_forumid' 
  355. ); 
  356.  
  357. // Reply title. 
  358. // Note: We join the 'topics' table because 'posts' table does not include topic title. 
  359. $this->field_map[] = array( 
  360. 'from_tablename' => 'topics',  
  361. 'from_fieldname' => 'topic_title',  
  362. 'join_tablename' => 'posts',  
  363. 'join_type' => 'INNER',  
  364. 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0, 1)',  
  365. 'to_type' => 'reply',  
  366. 'to_fieldname' => 'post_title',  
  367. 'callback_method' => 'callback_reply_title' 
  368. ); 
  369.  
  370. // Reply slug (Clean name to avoid conflicts) 
  371. // Note: We join the 'topics' table because 'posts' table does not include topic slug. 
  372. $this->field_map[] = array( 
  373. 'from_tablename' => 'topics',  
  374. 'from_fieldname' => 'topic_slug',  
  375. 'join_tablename' => 'posts',  
  376. 'join_type' => 'INNER',  
  377. 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0, 1)',  
  378. 'to_type' => 'reply',  
  379. 'to_fieldname' => 'post_name',  
  380. 'callback_method' => 'callback_slug' 
  381. ); 
  382.  
  383. // Reply author ip (Stored in postmeta) 
  384. $this->field_map[] = array( 
  385. 'from_tablename' => 'posts',  
  386. 'from_fieldname' => 'poster_ip',  
  387. 'to_type' => 'reply',  
  388. 'to_fieldname' => '_bbp_author_ip' 
  389. ); 
  390.  
  391. // Reply author. 
  392. $this->field_map[] = array( 
  393. 'from_tablename' => 'posts',  
  394. 'from_fieldname' => 'poster_id',  
  395. 'to_type' => 'reply',  
  396. 'to_fieldname' => 'post_author',  
  397. 'callback_method' => 'callback_userid' 
  398. ); 
  399.  
  400. // Reply status (Spam, Trash or Publish, bbPress v1.x publish = 0, trash = 1 & spam = 2) 
  401. $this->field_map[] = array( 
  402. 'from_tablename' => 'posts',  
  403. 'from_fieldname' => 'post_status',  
  404. 'to_type' => 'reply',  
  405. 'to_fieldname' => 'post_status',  
  406. 'callback_method' => 'callback_status' 
  407. ); 
  408.  
  409. // Reply content. 
  410. $this->field_map[] = array( 
  411. 'from_tablename' => 'posts',  
  412. 'from_fieldname' => 'post_text',  
  413. 'to_type' => 'reply',  
  414. 'to_fieldname' => 'post_content',  
  415. 'callback_method' => 'callback_html' 
  416. ); 
  417.  
  418. // Reply order. 
  419. $this->field_map[] = array( 
  420. 'from_tablename' => 'posts',  
  421. 'from_fieldname' => 'post_position',  
  422. 'to_type' => 'reply',  
  423. 'to_fieldname' => 'menu_order' 
  424. ); 
  425.  
  426. // Reply parent topic id (If no parent, then 0) 
  427. $this->field_map[] = array( 
  428. 'from_tablename' => 'posts',  
  429. 'from_fieldname' => 'topic_id',  
  430. 'to_type' => 'reply',  
  431. 'to_fieldname' => 'post_parent',  
  432. 'callback_method' => 'callback_topicid' 
  433. ); 
  434.  
  435. // Reply dates. 
  436. $this->field_map[] = array( 
  437. 'from_tablename' => 'posts',  
  438. 'from_fieldname' => 'post_time',  
  439. 'to_type' => 'reply',  
  440. 'to_fieldname' => 'post_date' 
  441. ); 
  442. $this->field_map[] = array( 
  443. 'from_tablename' => 'posts',  
  444. 'from_fieldname' => 'post_time',  
  445. 'to_type' => 'reply',  
  446. 'to_fieldname' => 'post_date_gmt' 
  447. ); 
  448. $this->field_map[] = array( 
  449. 'from_tablename' => 'posts',  
  450. 'from_fieldname' => 'post_time',  
  451. 'to_type' => 'reply',  
  452. 'to_fieldname' => 'post_modified' 
  453. ); 
  454. $this->field_map[] = array( 
  455. 'from_tablename' => 'posts',  
  456. 'from_fieldname' => 'post_time',  
  457. 'to_type' => 'reply',  
  458. 'to_fieldname' => 'post_modified_gmt' 
  459. ); 
  460.  
  461. /** User Section ******************************************************/ 
  462.  
  463. // Store old User id (Stored in usermeta) 
  464. $this->field_map[] = array( 
  465. 'from_tablename' => 'users',  
  466. 'from_fieldname' => 'ID',  
  467. 'to_type' => 'user',  
  468. 'to_fieldname' => '_bbp_user_id' 
  469. ); 
  470.  
  471. // Store old User password (Stored in usermeta) 
  472. $this->field_map[] = array( 
  473. 'from_tablename' => 'users',  
  474. 'from_fieldname' => 'user_pass',  
  475. 'to_type' => 'user',  
  476. 'to_fieldname' => '_bbp_password' 
  477. ); 
  478.  
  479. // User name. 
  480. $this->field_map[] = array( 
  481. 'from_tablename' => 'users',  
  482. 'from_fieldname' => 'user_login',  
  483. 'to_type' => 'user',  
  484. 'to_fieldname' => 'user_login' 
  485. ); 
  486.  
  487. // User nice name. 
  488. $this->field_map[] = array( 
  489. 'from_tablename' => 'users',  
  490. 'from_fieldname' => 'user_nicename',  
  491. 'to_type' => 'user',  
  492. 'to_fieldname' => 'user_nicename' 
  493. ); 
  494.  
  495. // User email. 
  496. $this->field_map[] = array( 
  497. 'from_tablename' => 'users',  
  498. 'from_fieldname' => 'user_email',  
  499. 'to_type' => 'user',  
  500. 'to_fieldname' => 'user_email' 
  501. ); 
  502.  
  503. // User homepage. 
  504. $this->field_map[] = array( 
  505. 'from_tablename' => 'users',  
  506. 'from_fieldname' => 'user_url',  
  507. 'to_type' => 'user',  
  508. 'to_fieldname' => 'user_url' 
  509. ); 
  510.  
  511. // User registered. 
  512. $this->field_map[] = array( 
  513. 'from_tablename' => 'users',  
  514. 'from_fieldname' => 'user_registered',  
  515. 'to_type' => 'user',  
  516. 'to_fieldname' => 'user_registered' 
  517. ); 
  518.  
  519. // User status. 
  520. $this->field_map[] = array( 
  521. 'from_tablename' => 'users',  
  522. 'from_fieldname' => 'user_status',  
  523. 'to_type' => 'user',  
  524. 'to_fieldname' => 'user_status' 
  525. ); 
  526.  
  527. // User display name. 
  528. $this->field_map[] = array( 
  529. 'from_tablename' => 'users',  
  530. 'from_fieldname' => 'display_name',  
  531. 'to_type' => 'user',  
  532. 'to_fieldname' => 'display_name' 
  533. ); 
  534.  
  535. /** 
  536. * This method allows us to indicates what is or is not converted for each 
  537. * converter. 
  538. */ 
  539. public function info() { 
  540. return ''; 
  541.  
  542. /** 
  543. * Translate the post status from bbPress 1's numeric's to WordPress's 
  544. * strings. 
  545. * @param int $status bbPress 1.x numeric post status 
  546. * @return string WordPress safe 
  547. */ 
  548. public function callback_status( $status = 0 ) { 
  549. switch ( $status ) { 
  550. case 2 : 
  551. $status = 'spam'; // bbp_get_spam_status_id() 
  552. break; 
  553.  
  554. case 1 : 
  555. $status = 'trash'; // bbp_get_trash_status_id() 
  556. break; 
  557.  
  558. case 0 : 
  559. default : 
  560. $status = 'publish'; // bbp_get_public_status_id() 
  561. break; 
  562. return $status; 
  563.  
  564. /** 
  565. * Translate the forum type from bbPress 1.x numeric's to WordPress's strings. 
  566. * @param int $status bbPress 1.x numeric forum type 
  567. * @return string WordPress safe 
  568. */ 
  569. public function callback_forum_type( $status = 0 ) { 
  570. if ( $status == 1 ) { 
  571. $status = 'category'; 
  572. } else { 
  573. $status = 'forum'; 
  574. return $status; 
  575.  
  576. /** 
  577. * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings. 
  578. * @param int $status bbPress 1.x numeric forum type 
  579. * @return string WordPress safe 
  580. */ 
  581. public function callback_sticky_status( $status = 0 ) { 
  582. switch ( $status ) { 
  583. case 2 : 
  584. $status = 'super-sticky'; // bbPress Super Sticky 'topic_sticky = 2' 
  585. break; 
  586.  
  587. case 1 : 
  588. $status = 'sticky'; // bbPress Sticky 'topic_sticky = 1' 
  589. break; 
  590.  
  591. case 0 : 
  592. default : 
  593. $status = 'normal'; // bbPress Normal Topic 'topic_sticky = 0' 
  594. break; 
  595. return $status; 
  596.  
  597. /** 
  598. * Verify the topic reply count. 
  599. * @param int $count bbPress 1.x topic and reply counts 
  600. * @return string WordPress safe 
  601. */ 
  602. public function callback_topic_reply_count( $count = 1 ) { 
  603. $count = absint( (int) $count - 1 ); 
  604. return $count; 
  605.  
  606. /** 
  607. * Set the reply title 
  608. * @param string $title bbPress 1.x topic title of this reply 
  609. * @return string Prefixed topic title, or empty string 
  610. */ 
  611. public function callback_reply_title( $title = '' ) { 
  612. $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : ''; 
  613. return $title; 
  614.  
  615. /** 
  616. * This method is to save the salt and password together. That 
  617. * way when we authenticate it we can get it out of the database 
  618. * as one value. Array values are auto sanitized by WordPress. 
  619. */ 
  620. public function callback_savepass( $field, $row ) { 
  621. return false; 
  622.  
  623. /** 
  624. * This method is to take the pass out of the database and compare 
  625. * to a pass the user has typed in. 
  626. */ 
  627. public function authenticate_pass( $password, $serialized_pass ) { 
  628. return false; 
  629.  
  630. /** 
  631. * This callback: 
  632. * - turns off smiley parsing 
  633. * - processes any custom parser.php attributes 
  634. * - decodes necessary HTML entities 
  635. */ 
  636. protected function callback_html( $field ) { 
  637. require_once( bbpress()->admin->admin_dir . 'parser.php' ); 
  638. $bbcode = BBCode::getInstance(); 
  639. $bbcode->enable_smileys = false; 
  640. $bbcode->smiley_regex = false; 
  641. return html_entity_decode( $bbcode->Parse( $field ) );