Plugin Directory

Changeset 3030676


Ignore:
Timestamp:
02/02/2024 04:29:01 PM (2 years ago)
Author:
theripper
Message:

Version 0.5.1

Location:
drive-wp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • drive-wp/trunk/includes/admin-ui.php

    r2544222 r3030676  
    147147    public function post_types_select_callback() {
    148148        $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        }
    152155       
    153156        $post_types=get_post_types(array( "_builtin" => false),'objects');
     
    157160        });
    158161       
    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>";
    164170        }
    165         echo "</select>";
    166171
    167172        echo "<p><b>" . __('Already populated post types (by system)','wp-drive') . "</b></p><p>";
  • drive-wp/trunk/readme.txt

    r2818493 r3030676  
    33Tags: windows drive, rest api, change attachment file
    44Requires at least: 4.7
    5 Tested up to: 6.1
     5Tested up to: 6.4.3
    66Requires PHP: 5.4
    7 Stable tag: 0.5.0
     7Stable tag: 0.5.1
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5252
    5353== Changelog ==
     54= 0.5.1 =
     55* Bugfix admin screen if there are none custom posttypes
     56* tested with wp 6.4.3
     57
    5458= 0.5 =
    5559* Allow to populate custom post types to REST API
     
    6569
    6670== Version history ==
     710.5.1 - Bugfix release
    67720.5 - Initial release.
  • drive-wp/trunk/wp-drive.php

    r2544222 r3030676  
    66 * Text Domain: wp-drive
    77 * Domain Path: /languages/
    8  * Version: 0.5.0
     8 * Version: 0.5.1
    99 * Author: The Ripper
    1010 * Author URI: https://profiles.wordpress.org/theripper
    1111 * Requires at least: 4.7
    12  * Tested up to: 5.7
     12 * Tested up to: 6.4.3
    1313 * Requires PHP: 5.4
    1414 * License: GPLv3 or later
Note: See TracChangeset for help on using the changeset viewer.