Making WordPress.org

Changeset 2625


Ignore:
Timestamp:
02/25/2016 11:56:12 PM (8 years ago)
Author:
obenland
Message:

Plugins Directory: Introduce plugin uploader.

Happy iterating!

Props dd32, obenland.
See #1569.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 added
2 edited

Legend:

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

    r2621 r2625  
    2323    private function __construct() {
    2424        add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ) );
     25        add_action( 'edit_form_after_title', array( $this, 'edit_form_after_title' ) );
    2526    }
    2627
     
    3637        );
    3738    }
     39
     40    /**
     41     * Displays a link to the plugins zip file.
     42     *
     43     * @param \WP_Post $post
     44     */
     45    public function edit_form_after_title( $post ) {
     46        $zip_files = get_attached_media( 'application/zip', $post );
     47        $zip_file  = current( $zip_files );
     48
     49        if ( $zip_file ) :
     50            ?>
     51
     52            <p style="padding: 0 10px;">
     53                <?php printf( __( '<strong>Zip file:</strong> %s' ), sprintf( '<a href="%s">%s</a>', esc_url( $zip_file->guid ), $zip_file->guid ) ); ?>
     54            </p>
     55
     56        <?php
     57        endif;
     58    }
    3859}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r2621 r2625  
    108108     */
    109109    public function register_shortcodes() {
     110        add_shortcode( 'wporg-plugin-upload',       array( __NAMESPACE__ . '\\Shortcodes\\Upload',      'display' ) );
    110111        add_shortcode( 'wporg-plugins-screenshots', array( __NAMESPACE__ . '\\Shortcodes\\Screenshots', 'display' ) );
    111112    //  add_shortcode( 'wporg-plugins-stats',       array( __NAMESPACE__ . '\\Shortcodes\\Stats',       'display' ) );
Note: See TracChangeset for help on using the changeset viewer.