bulk-edit.php
2 days ago
list-header.php
4 years ago
row-link.php
2 days ago
row.php
2 days ago
tool-list.php
4 years ago
wpml-translations.php
8 years ago
bulk-edit.php
170 lines
| 1 | <?php |
| 2 | $post_type_object = get_post_type_object( $this->post_type->name ); |
| 3 | $can_publish = current_user_can( $post_type_object->cap->publish_posts ); |
| 4 | $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false; |
| 5 | $has_menu_options = ( $this->user->canSortPosts($this->post_type->name) && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !$this->settings->menusDisabled() ) ? true : false; |
| 6 | ?> |
| 7 | <form data-np-bulk-edit-form class="nestedpages-bulk-edit" action="<?php echo admin_url('admin-post.php'); ?>" method="post"> |
| 8 | <input type="hidden" name="action" value="npBulkEdit"> |
| 9 | <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?> |
| 10 | <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>"> |
| 11 | <input type="hidden" name="post_type" value="<?php echo $this->post_type->name; ?>"> |
| 12 | |
| 13 | <h3><?php _e('Bulk Edit', 'wp-nested-pages'); ?></h3> |
| 14 | |
| 15 | <div class="np-bulk-edit-link-info"> |
| 16 | <div class="np-quickedit-info" data-bulk-edit-link-count><?php _e('There are links selected. Bulk edit will not apply to links.', 'wp-nested-pages'); ?></div> |
| 17 | </div> |
| 18 | |
| 19 | <ul class="np-bulk-titles" data-np-bulk-titles></ul> |
| 20 | |
| 21 | <div class="quick-edit"> |
| 22 | <div class="fields"> |
| 23 | <div class="left"> |
| 24 | <?php |
| 25 | $authors_dropdown = ''; |
| 26 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) : |
| 27 | $users_opt = [ |
| 28 | 'show_option_none' => '— ' . __('No Change', 'wp-nested-pages') . ' —', |
| 29 | 'hide_if_only_one_author' => false, |
| 30 | 'capability' => 'edit_posts', |
| 31 | 'name' => 'post_author', |
| 32 | 'id' => 'post_author', |
| 33 | 'class'=> 'authors', |
| 34 | 'multi' => 1, |
| 35 | 'echo' => 0 |
| 36 | ]; |
| 37 | if ( $authors = wp_dropdown_users( $users_opt ) ) : |
| 38 | $authors_dropdown = '<div class="form-control"><label>' . __( 'Author', 'wp-nested-pages') . '</label>'; |
| 39 | $authors_dropdown .= $authors; |
| 40 | $authors_dropdown .= '</div>'; |
| 41 | endif; |
| 42 | echo $authors_dropdown; |
| 43 | endif; |
| 44 | ?> |
| 45 | |
| 46 | <div class="form-control"> |
| 47 | <label><?php _e( 'Status', 'wp-nested-pages' ); ?></label> |
| 48 | <select name="_status"> |
| 49 | <option value="">— <?php _e('No Change', 'wp-nested-pages'); ?> —</option> |
| 50 | <?php if ( $can_publish ) : ?> |
| 51 | <option value="publish"><?php _e( 'Published', 'wp-nested-pages' ); ?></option> |
| 52 | <?php endif; ?> |
| 53 | <option value="private"><?php _e( 'Private', 'wp-nested-pages' ); ?></option> |
| 54 | <option value="pending"><?php _e( 'Pending Review', 'wp-nested-pages' ); ?></option> |
| 55 | <option value="draft"><?php _e( 'Draft', 'wp-nested-pages' ); ?></option> |
| 56 | </select> |
| 57 | </div> |
| 58 | |
| 59 | <?php if ( $this->post_type->hierarchical ) : ?> |
| 60 | <div class="form-control"> |
| 61 | <label><?php _e( 'Template', 'wp-nested-pages' ); ?></label> |
| 62 | <select name="page_template"> |
| 63 | <option value="">— <?php _e('No Change', 'wp-nested-pages'); ?> —</option> |
| 64 | <option value="default"><?php _e( 'Default Template', 'wp-nested-pages' ); ?></option> |
| 65 | <?php |
| 66 | if( is_page() ){ |
| 67 | page_template_dropdown(); |
| 68 | }else{ |
| 69 | page_template_dropdown('', $this->post_type->name); |
| 70 | } |
| 71 | ?> |
| 72 | </select> |
| 73 | </div> |
| 74 | <?php endif; ?> |
| 75 | |
| 76 | <?php if ( $this->user->canSortPosts($this->post_type->name) && $this->post_type->hierarchical ) : ?> |
| 77 | <div class="form-control"> |
| 78 | <label><?php echo sprintf(__('Parent %s', 'wp-nested-pages'), $this->post_type->labels->singular_name); ?></label> |
| 79 | <?php |
| 80 | wp_dropdown_pages([ |
| 81 | 'show_option_no_change'=> __('— No Change —', 'wp-nested-pages'), |
| 82 | 'sort_column' => 'menu_order', |
| 83 | 'hierarchical' => 1, |
| 84 | 'depth' => 0, |
| 85 | 'name' => 'post_parent', |
| 86 | 'post_type' => $this->post_type->name |
| 87 | ]); |
| 88 | ?> |
| 89 | </div> |
| 90 | <?php endif; ?> |
| 91 | |
| 92 | <?php |
| 93 | $custom_fields_left = $this->custom_fields_repo->outputBulkEditFields($this->post_type, 'left'); |
| 94 | if ( $custom_fields_left ) echo $custom_fields_left; |
| 95 | ?> |
| 96 | |
| 97 | </div><!-- .left --> |
| 98 | |
| 99 | <div class="right"> |
| 100 | |
| 101 | <div class="form-control"> |
| 102 | <label><?php _e( 'Comments', 'wp-nested-pages' ); ?></label> |
| 103 | <select name="comment_status"> |
| 104 | <option value="">— <?php _e('No Change', 'wp-nested-pages'); ?> —</option> |
| 105 | <option value="open"><?php _e('Allow', 'wp-nested-pages'); ?></option> |
| 106 | <option value="closed"><?php _e('Do not allow', 'wp-nested-pages'); ?></option> |
| 107 | </select> |
| 108 | </div> |
| 109 | |
| 110 | <?php if ( current_user_can('edit_theme_options') && !array_key_exists('hide_in_np', $this->disabled_standard_fields) ) : ?> |
| 111 | <div class="form-control"> |
| 112 | <label><?php _e( 'Display in Nested View', 'wp-nested-pages' ); ?></label> |
| 113 | <select name="nested_pages_status"> |
| 114 | <option value="">— <?php _e('No Change', 'wp-nested-pages'); ?> —</option> |
| 115 | <option value="hide"><?php _e('Hide', 'wp-nested-pages'); ?></option> |
| 116 | <option value="show"><?php _e('Show', 'wp-nested-pages'); ?></option> |
| 117 | </select> |
| 118 | </div> |
| 119 | |
| 120 | <?php if ( $this->user->canSortPosts($this->post_type->name) && $has_menu_options ) : ?> |
| 121 | <div class="form-control"> |
| 122 | <label><?php _e( 'Hide in Nav Menu', 'wp-nested-pages' ); ?></label> |
| 123 | <select name="nav_status"> |
| 124 | <option value="">— <?php _e('No Change', 'wp-nested-pages'); ?> —</option> |
| 125 | <option value="hide"><?php _e('Hide', 'wp-nested-pages'); ?></option> |
| 126 | <option value="show"><?php _e('Show', 'wp-nested-pages'); ?></option> |
| 127 | </select> |
| 128 | </div> |
| 129 | <?php endif; endif; // Edit theme options ?> |
| 130 | |
| 131 | <?php |
| 132 | $custom_fields_right = $this->custom_fields_repo->outputBulkEditFields($this->post_type, 'right'); |
| 133 | if ( $custom_fields_right ) echo $custom_fields_right; |
| 134 | ?> |
| 135 | |
| 136 | </div><!-- .right --> |
| 137 | </div><!-- .fields --> |
| 138 | |
| 139 | <?php if ( !empty($this->h_taxonomies) || !empty($this->f_taxonomies)) : ?> |
| 140 | <div class="np-taxonomies"> |
| 141 | <?php foreach ( $this->h_taxonomies as $taxonomy ) : ?> |
| 142 | <div class="np-taxonomy"> |
| 143 | <span class="title"><?php esc_html_e( $taxonomy->labels->name ) ?></span> |
| 144 | <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" /> |
| 145 | <ul class="cat-checklist <?php esc_attr_e( $taxonomy->name )?>-checklist"> |
| 146 | <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?> |
| 147 | </ul> |
| 148 | </div><!-- .np-taxonomy --> |
| 149 | <?php endforeach; ?> |
| 150 | |
| 151 | <?php foreach ( $this->f_taxonomies as $taxonomy ) : ?> |
| 152 | <div class="np-taxonomy"> |
| 153 | <span class="title"><?php esc_html_e( $taxonomy->labels->name ) ?></span> |
| 154 | <textarea id="<?php esc_attr_e($taxonomy->name); ?>" cols="22" rows="1" name="tax_input[<?php esc_attr_e( $taxonomy->name )?>]" class="tax_input_<?php esc_attr_e( $taxonomy->name )?>" data-autotag data-taxonomy="<?php esc_attr_e($taxonomy->name); ?>"></textarea> |
| 155 | </div><!-- .np-taxonomy --> |
| 156 | <?php endforeach; ?> |
| 157 | </div><!-- .taxonomies --> |
| 158 | <?php endif; // if taxonomies ?> |
| 159 | |
| 160 | <div class="np-bulk-footer"> |
| 161 | <button class="button pull-left" data-np-cancel-bulk-edit> |
| 162 | <?php _e('Cancel', 'wp-nested-pages'); ?> |
| 163 | </button> |
| 164 | <button type="submit" class="button button-primary"> |
| 165 | <?php _e('Update', 'wp-nested-pages'); ?> |
| 166 | </button> |
| 167 | </div><!-- .np-bulk-footer --> |
| 168 | |
| 169 | </div><!--.quickedit --> |
| 170 | </form><!-- .nestedpages-bulk-edit --> |