Changeset 3030676
- Timestamp:
- 02/02/2024 04:29:01 PM (2 years ago)
- Location:
- drive-wp/trunk
- Files:
-
- 3 edited
-
includes/admin-ui.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
wp-drive.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
drive-wp/trunk/includes/admin-ui.php
r2544222 r3030676 147 147 public function post_types_select_callback() { 148 148 $rest_post_types=get_post_types(array("show_in_rest" => true),'objects'); 149 $rest_post_types=array_filter($rest_post_types,function($post_type) { 150 return !in_array($post_type->name, $this->wordpress_drive_options['post_types_select']); 151 }); 149 150 if(!empty($this->wordpress_drive_options['post_types_select']) && is_array($this->wordpress_drive_options['post_types_select'])) { 151 $rest_post_types=array_filter($rest_post_types,function($post_type) { 152 return !in_array($post_type->name, $this->wordpress_drive_options['post_types_select']); 153 }); 154 } 152 155 153 156 $post_types=get_post_types(array( "_builtin" => false),'objects'); … … 157 160 }); 158 161 159 ?> <select name="wordpress_drive_option_name[post_types_select][]" id="post_types_select" size="<?php echo count($post_types) ?>" style="height: 100%; padding-bottom: 0.5em; padding-top: 0.5em;" multiple> <?php 160 foreach($post_types as $post_type) 161 { 162 $selected=(isset( $this->wordpress_drive_options['post_types_select'] ) && in_array($post_type->name, $this->wordpress_drive_options['post_types_select'])) ? 'selected' : '' ; 163 echo "<option {$selected} value='{$post_type->name}'>{$post_type->label}</option>"; 162 if(!empty($post_types)) { 163 ?> <select name="wordpress_drive_option_name[post_types_select][]" id="post_types_select" size="<?php echo count($post_types) ?>" style="height: 100%; padding-bottom: 0.5em; padding-top: 0.5em;" multiple> <?php 164 foreach($post_types as $post_type) 165 { 166 $selected=(isset( $this->wordpress_drive_options['post_types_select'] ) && in_array($post_type->name, $this->wordpress_drive_options['post_types_select'])) ? 'selected' : '' ; 167 echo "<option {$selected} value='{$post_type->name}'>{$post_type->label}</option>"; 168 } 169 echo "</select>"; 164 170 } 165 echo "</select>";166 171 167 172 echo "<p><b>" . __('Already populated post types (by system)','wp-drive') . "</b></p><p>"; -
drive-wp/trunk/readme.txt
r2818493 r3030676 3 3 Tags: windows drive, rest api, change attachment file 4 4 Requires at least: 4.7 5 Tested up to: 6. 15 Tested up to: 6.4.3 6 6 Requires PHP: 5.4 7 Stable tag: 0.5. 07 Stable tag: 0.5.1 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 52 52 53 53 == Changelog == 54 = 0.5.1 = 55 * Bugfix admin screen if there are none custom posttypes 56 * tested with wp 6.4.3 57 54 58 = 0.5 = 55 59 * Allow to populate custom post types to REST API … … 65 69 66 70 == Version history == 71 0.5.1 - Bugfix release 67 72 0.5 - Initial release. -
drive-wp/trunk/wp-drive.php
r2544222 r3030676 6 6 * Text Domain: wp-drive 7 7 * Domain Path: /languages/ 8 * Version: 0.5. 08 * Version: 0.5.1 9 9 * Author: The Ripper 10 10 * Author URI: https://profiles.wordpress.org/theripper 11 11 * Requires at least: 4.7 12 * Tested up to: 5.712 * Tested up to: 6.4.3 13 13 * Requires PHP: 5.4 14 14 * License: GPLv3 or later
Note: See TracChangeset
for help on using the changeset viewer.