Advertisement
Dibba7

custom filed output

Aug 29th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. function imd_portfolio_meta_box() {
  2. global $post;
  3. // get the custom field values as an array
  4. $values = get_post_custom( $post->ID );
  5. // extract the members of the $values array to their own variables (which you can see below, in the HTML code)
  6. extract( $values, EXTR_SKIP );
  7.  
  8. // escape the output, just in case
  9. $allowed_html = array(
  10. 'a' => array(
  11. 'href' => array(),
  12. 'title' => array()
  13. ),
  14. 'em' => array(),
  15. 'strong' => array()
  16. );
  17. $_imd_portfolio_details_output = wp_kses($_imd_portfolio_details[0], $allowed_html);
  18. $_imd_portfolio_client_output = wp_kses($_imd_portfolio_client[0], $allowed_html);
  19. $_imd_portfolio_website_output = wp_kses($_imd_portfolio_website[0], $allowed_html);
  20. $_imd_portfolio_quote_output = wp_kses($_imd_portfolio_quote[0], $allowed_html);
  21. $output = '<div class="review-box">
  22. <ul class="review-box-list">
  23. <li><strong>Details:</strong> '.$_imd_portfolio_details_output.'</li>
  24. <li><strong>Client:</strong> '.$_imd_portfolio_client_output.'</li>
  25. <li><strong>Website:</strong> '.$_imd_portfolio_website_output.'</li>
  26. <li><strong>Quote:</strong>'.$_imd_portfolio_quote_output.'></li>
  27. </ul>
  28. </div>';
  29. return $output;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement