Guest User

Untitled

a guest
Jan 12th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. function benz_meta_box_markup($object) {
  2. wp_nonce_field(basename(__FILE__), "meta-box-nonce");
  3. global $post;
  4. $benz_tab_count = get_post_meta( $post->ID, '_tab_count', true );
  5. for ( $x = 0; $x < $benz_tab_count; $x++ ) {
  6. $y=$x+1;
  7. $benz_tab_content = get_post_meta( $post->ID, "_tabs_content_$y", true );
  8. if ( ! $benz_tab_content ) {
  9. $benz_tab_content = '';
  10. }
  11. $settings = array( 'textarea_name' => "benz-product-tabs-details_$y" );
  12. ?>
  13. <tr class="form-field">
  14. <th scope="row" valign="top"><label for="benz-product-tabs-details_<?php echo $y ;?>">Tab <?php echo $y ;?> Content: </label></th>
  15. <td>
  16. <?php wp_nonce_field( basename( __FILE__ ), "benz_product_tabs_details_nonce_$y" ); ?>
  17. <?php wp_editor( wp_kses_post( $benz_tab_content ), 'benz_tab_content', $settings ); ?>
  18. </td>
  19. </tr>
  20. <?php
  21. } // end for loop
  22. } //custom_meta_box_markup
Advertisement
Add Comment
Please, Sign In to add comment