Plugin Directory


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • feedzy-rss-feeds/tags/4.4.3/includes/admin/feedzy-rss-feeds-admin.php

    r3030538 r3033749  
    267267            'title',
    268268        );
    269         $capability = feedzy_current_user_can();
    270269        $args     = array(
    271270            'labels'                => $labels,
     
    284283            'map_meta_cap'          => true,
    285284            'capabilities' => array(
    286                 'publish_posts'         => $capability,
    287                 'edit_posts'            => $capability,
    288                 'edit_others_posts'     => $capability,
    289                 'delete_posts'          => $capability,
    290                 'delete_others_posts'   => $capability,
    291                 'read_private_posts'    => $capability,
     285                'edit_post'          => 'edit_feedzy_category',
     286                'read_post'          => 'read_feedzy_category',
     287                'delete_post'        => 'delete_feedzy_category',
     288                'edit_posts'         => 'edit_feedzy_categories',
     289                'edit_others_posts'  => 'edit_others_feedzy_categories',
     290                'publish_posts'      => 'publish_feedzy_categories',
     291                'read_private_posts' => 'read_private_feedzy_categories',
    292292            ),
    293293        );
    294294        $args     = apply_filters( 'feedzy_post_type_args', $args );
    295295        register_post_type( 'feedzy_categories', $args );
     296    }
     297
     298    /**
     299     * Only allow admin to modify or delete categories.
     300     *
     301     * @return void
     302     */
     303    public function register_admin_capabilities() {
     304        $admin_role = get_role( 'administrator' );
     305        $admin_role->add_cap( 'edit_feedzy_category' );
     306        $admin_role->add_cap( 'read_feedzy_category' );
     307        $admin_role->add_cap( 'delete_feedzy_category' );
     308        $admin_role->add_cap( 'edit_feedzy_categories' );
     309        $admin_role->add_cap( 'edit_others_feedzy_categories' );
     310        $admin_role->add_cap( 'publish_feedzy_categories' );
     311        $admin_role->add_cap( 'read_private_feedzy_categories' );
    296312    }
    297313
     
    877893        switch ( $post->post_type ) {
    878894            case 'feedzy_categories':
    879                 $text    = __( 'We found the following invalid URLs that we have removed from the list', 'feedzy-rss-feeds' );
     895                $text    = __( 'We found the following invalid or unreachable by WordPress SimplePie URLs that we have removed from the list', 'feedzy-rss-feeds' );
    880896                $invalid = get_post_meta( $post->ID, '__transient_feedzy_category_feed', true );
    881897                delete_post_meta( $post->ID, '__transient_feedzy_category_feed' );
     
    886902                $invalid_source_errors = get_post_meta( $post->ID, '__transient_feedzy_invalid_source_errors', true );
    887903                if ( $invalid_source ) {
    888                     $text = __( 'This source has invalid URLs. Please correct/remove the following', 'feedzy-rss-feeds' );
     904                    $text = __( 'This source has invalid or unreachable by WordPress SimplePie URLs. Please correct/remove the following', 'feedzy-rss-feeds' );
    889905                    $invalid = $invalid_source;
    890906                    delete_post_meta( $post->ID, '__transient_feedzy_invalid_source' );
     
    10811097     */
    10821098    public function feedzy_wizard_step_process() {
     1099        if ( ! feedzy_current_user_can() ) {
     1100            return wp_send_json( array( 'status' => 0 ) );
     1101        }
     1102
    10831103        check_ajax_referer( FEEDZY_BASEFILE, 'security' );
    10841104        $step = ! empty( $_POST['step'] ) ? filter_input( INPUT_POST, 'step', FILTER_UNSAFE_RAW ) : 1;
Note: See TracChangeset for help on using the changeset viewer.