Guest User

Untitled

a guest
Dec 11th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // Edit term page
  2. function summit_taxonomy_edit_meta_field($term) {
  3.  
  4. // put the term ID into a variable
  5. $t_id = $term->term_id;
  6.  
  7. // retrieve the existing value(s) for this meta field. This returns an array
  8. $term_meta = get_option( "taxonomy_$t_id" ); ?>
  9. <tr class="form-field">
  10. <th scope="row" valign="top"><label for="term_meta[displayed]"><?php _e( 'Display Category', 'summit' ); ?></label></th>
  11. <td>
  12. <input type="checkbox" name="term_meta[displayed]" id="term_meta[displayed]" value="1" <?php if( $term_meta['displayed'] == "1" ) { ?>checked="checked"<?php } ?> ">
  13. <p class="description"><?php _e( 'Check to have the Category to displayed on the Sales Page','summit' ); ?></p>
  14. </td>
  15. </tr>
  16. <?php
  17. }
  18. add_action( 'category_edit_form_fields', 'summit_taxonomy_edit_meta_field', 10, 2 );
Add Comment
Please, Sign In to add comment