WordPress.org

Plugin Directory

Changeset 628945


Ignore:
Timestamp:
11/23/12 10:29:56 (17 months ago)
Author:
donncha
Message:

Users must be at least an editor to delete rating results

File:
1 edited

Legend:

Unmodified
Added
Removed
  • polldaddy/trunk/polldaddy.php

    r614612 r628945  
    4242        $this->is_admin               = (bool) current_user_can( 'manage_options' ); 
    4343        $this->is_author              = (bool) current_user_can( 'edit_posts' ); 
     44        $this->is_editor              = (bool) current_user_can( 'delete_others_pages' ); 
    4445        $this->user_code              = null; 
    4546        $this->rating_user_code       = null; 
     
    45514552                <div class="tablenav"> 
    45524553                    <div class="alignleft actions"> 
     4554                        <?php if ( $this->is_editor ) { ?> 
    45534555                        <select name="action"> 
    45544556                            <option selected="selected" value=""><?php _e( 'Actions', 'polldaddy' ); ?></option> 
     
    45584560                        <input class="button-secondary action" type="submit" name="doaction" value="<?php _e( 'Apply', 'polldaddy' ); ?>" /> 
    45594561                        <?php wp_nonce_field( 'action-rating_bulk' ); ?> 
     4562                        <?php } ?> 
    45604563                        <select name="change-report-to"><?php 
    45614564        $select = array( __( 'Posts', 'polldaddy' ) => "posts", __( 'Pages', 'polldaddy' ) => "pages", __( 'Comments', 'polldaddy' ) => "comments" ); 
     
    46224625                            <strong><a href="<?php echo esc_url( $rating->permalink ); ?>"><?php echo strlen( esc_html( $rating->title ) ) > 75 ? substr( esc_html( $rating->title ), 0, 72 ) . '&hellip' : esc_html( $rating->title ); ?></a></strong> 
    46234626                            <div class="row-actions"> 
    4624                             <?php if ( $delete_link ) { ?> 
     4627                            <?php if ( $this->is_editor && $delete_link ) { ?> 
    46254628                                <span class="delete"><a class="delete-rating delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span> 
    46264629                            <?php } ?> 
Note: See TracChangeset for help on using the changeset viewer.