Making WordPress.org


Ignore:
Timestamp:
01/15/2024 05:23:52 AM (9 months ago)
Author:
dd32
Message:

Plugin Directory: Allow plugins to upload additional versions for review.

This is currently limited to new plugins, which is prior to the first human review.

Iterations upon this will open it to plugins in the pending state as well, which is during the human review.

See #7384.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php

    r13033 r13109  
    77use \WordPressdotorg\Plugin_Directory\Readme\Validator;
    88use \WordPressdotorg\Plugin_Directory\Admin\List_Table\Plugin_Posts;
     9
     10use const \WordPressdotorg\Plugin_Directory\PLUGIN_FILE;
     11use const \WordPressdotorg\Plugin_Directory\PLUGIN_DIR;
    912
    1013/**
     
    3740        add_filter( 'admin_head-edit.php', array( $this, 'plugin_posts_list_table' ) );
    3841        add_action( 'edit_form_top', array( $this, 'show_permalink' ) );
     42        add_action( 'post_edit_form_tag', array( $this, 'post_edit_form_tag' ) );
    3943        add_action( 'admin_notices', array( $this, 'add_post_status_notice' ) );
    4044        add_action( 'all_admin_notices', array( $this, 'admin_notices' ) );
     
    7074        add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Author_Notice', 'save_post' ) );
    7175        add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Reviewer', 'save_post' ) );
     76        add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Review_Tools', 'save_post' ) );
    7277    }
    7378
     
    129134            switch ( $hook_suffix ) {
    130135                case 'post.php':
    131                     wp_enqueue_style( 'plugin-admin-post-css', plugins_url( 'css/edit-form.css', Plugin_Directory\PLUGIN_FILE ), array( 'edit' ), 7 );
    132                     wp_enqueue_script( 'plugin-admin-post-js', plugins_url( 'js/edit-form.js', Plugin_Directory\PLUGIN_FILE ), array( 'wp-util', 'wp-lists' ), 5 );
     136                    wp_enqueue_style( 'plugin-admin-post-css', plugins_url( 'css/edit-form.css', PLUGIN_FILE ), array( 'edit' ), filemtime( PLUGIN_DIR . '/css/edit-form.css') );
     137                    wp_enqueue_script( 'plugin-admin-post-js', plugins_url( 'js/edit-form.js',PLUGIN_FILE ), array( 'wp-util', 'wp-lists', 'wp-api' ), filemtime( PLUGIN_DIR . '/js/edit-form.js') );
     138
    133139                    wp_localize_script( 'plugin-admin-post-js', 'pluginDirectory', array(
    134140                        'approvePluginAYS'    => __( 'Are you sure you want to approve this plugin?', 'wporg-plugins' ),
     
    400406        if ( 'plugin' === $post->post_type && 'publish' === $post->post_status ) {
    401407            echo get_sample_permalink_html( $post );
     408        }
     409    }
     410
     411    /**
     412     * Allow file uploads within the plugin edit screen.
     413     */
     414    public function post_edit_form_tag( $post ) {
     415        if ( 'plugin' === $post->post_type ) {
     416            echo ' enctype="multipart/form-data"';
    402417        }
    403418    }
Note: See TracChangeset for help on using the changeset viewer.