WordPress.org

Making WordPress.org

Changeset 3350


Ignore:
Timestamp:
06/14/2016 09:59:58 AM (2 years ago)
Author:
obenland
Message:

Plugin Directory: Show plugin's permalink in wp-admin.

Gives plugin authors a convenient way to view their plugin on the front-end.

See #1571.

File:
1 edited

Legend:

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

    r3335 r3350  
    3333        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
    3434        add_filter( 'admin_head-edit.php', array( $this, 'plugin_posts_list_table' ) );
     35        add_action( 'edit_form_top', array( $this, 'show_permalink' ) );
    3536        add_action( 'admin_notices', array( $this, 'add_post_status_notice' ) );
    3637        add_action( 'all_admin_notices', array( $this, 'admin_notices' ) );
     
    285286        wp_redirect( add_query_arg( array( 'settings-updated' => true ), $send_back ) );
    286287        exit;
     288    }
     289
     290    /**
     291     * Displays a link to the plugin page when it's published.
     292     *
     293     * @param \WP_Post $post The current post object.
     294     */
     295    public function show_permalink( $post ) {
     296        if ( 'publish' === $post->post_status ) {
     297            echo get_sample_permalink_html( $post );
     298        }
    287299    }
    288300
Note: See TracChangeset for help on using the changeset viewer.