Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!empty($_REQUEST['menu-item-custom-category'][$menu_item_db_id])) {
- delete_post_meta($menu_item_db_id, '_menu_item_custom_category');
- $values = $_REQUEST['menu-item-custom-category'][$menu_item_db_id];
- foreach($values as $value) {
- add_post_meta($menu_item_db_id, '_menu_item_custom_category', $value);
- }
- }
- $item->custom_category = get_post_meta( $item->ID, '_menu_item_custom_content');
- <p class="field-custom-category description description-thin">
- <label for="edit-menu-item-custom-category-<?php echo $item_id; ?>">
- <?php _e( 'Custom Categories' ); ?><br />
- <select name="menu-item-custom-category[<?php echo $item_id; ?>][]" id="edit-menu-item-custom-category-<?php echo $item_id; ?>" class="widefat code edit-menu-item-custom-category" multiple>
- <?php
- $YPE_cats = get_categories();
- foreach ($YPE_cats as $YPE_cat) { ?>
- <option value="<?php echo $YPE_cat->slug; ?>" <?php echo selected(in_array($YPE_cat->slug, $item->custom_category)); ?>><?php echo $YPE_cat->name;?></option><?php
- }
- ?>
- </select>
- </label>
- </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement