Making WordPress.org

Changeset 5193


Ignore:
Timestamp:
03/29/2017 01:25:18 PM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Don't show the Remove/Add new committer items for users who cannot manage committers.
Contributors to a plugin (as defined by the readme.txt) have access to the plugins "admin" (in addition to extra support forum capabilities) but can't manage committers, so showing the action links is pointless.

File:
1 edited

Legend:

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

    r5121 r5193  
    5555                        <?php echo Template::encode( $committer->display_name ); ?>
    5656                    </a><br>
     57
     58                    <?php if ( current_user_can( 'plugin_remove_committer', $post ) ) : ?>
    5759                    <small>
    5860                        <?php echo current_user_can( 'plugin_review' ) ? esc_html( $committer->user_email ) . ' ' : ''; ?>
    5961                        <button class="button-link remove"><?php _e( 'Remove', 'wporg-plugins' ); ?></button>
    6062                    </small>
     63                    <?php else: // This is a hack to avoid doing CSS to make the rows not stack badly. someone fix this please. ?>
     64                        <br>
     65                    <?php endif; ?>
    6166                </li>
    6267            <?php endforeach; ?>
    6368
     69            <?php if ( current_user_can( 'plugin_add_committer', $post ) ) : ?>
    6470            <li class="new">
    6571                <form id="add-committer" action="POST">
     
    6874                </form>
    6975            </li>
     76            <?php endif; ?>
    7077        </ul>
    7178        <script id="tmpl-new-committer" type="text/template">
Note: See TracChangeset for help on using the changeset viewer.