Title: Jacek's Replies | WordPress.org

---

# Jacek

  [  ](https://wordpress.org/support/users/jzbydev/)

 *   [Profile](https://wordpress.org/support/users/jzbydev/)
 *   [Topics Started](https://wordpress.org/support/users/jzbydev/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jzbydev/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jzbydev/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jzbydev/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jzbydev/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jzbydev/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Administrator lost it’s role on CPT](https://wordpress.org/support/topic/administrator-lost-its-role-on-cpt/)
 *  [Jacek](https://wordpress.org/support/users/jzbydev/)
 * (@jzbydev)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/administrator-lost-its-role-on-cpt/#post-12257474)
 * It looks like ogles_role does not have “read” capability, as is is required to
   access dashboard. Please check it by placing this code i functions.php or plugin:
 *     ```
       global $wp_roles;
       print_r($wp_roles->roles);
       ```
   
 * You should see:
 *     ```
       ...
       [oglasi_role] => Array
               (
                   [name] => Oglasi role
                   [capabilities] => Array
                       (
                           ...
                           [read] => 1
                           ...
                       )
   
               )
       ...
       ```
   
 * Can you see it?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [gutenberg change html attributes of custom block](https://wordpress.org/support/topic/gutenberg-change-html-attributes-of-custom-block/)
 *  [Jacek](https://wordpress.org/support/users/jzbydev/)
 * (@jzbydev)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/gutenberg-change-html-attributes-of-custom-block/#post-12229047)
 * JS is not necessary, beacuse you can always access any single HTML node with 
   proper selector. Still the question for me is what do you want to acheive. Do
   you want to:
    – make a border around some columns in some posts/pages? You can
   do that by adding class in theme and specyfing it in Gutenberg (select column,
   then click Advanced, enter class name in ‘Additional CSS Class(es)’) – make a
   border around all columns in all WP posts and pages? – make a border around all
   columns in single WP post or page? – something else?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [gutenberg change html attributes of custom block](https://wordpress.org/support/topic/gutenberg-change-html-attributes-of-custom-block/)
 *  [Jacek](https://wordpress.org/support/users/jzbydev/)
 * (@jzbydev)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/gutenberg-change-html-attributes-of-custom-block/#post-12228886)
 * I do not understand what do you want to achieve. If you want to change the look
   of columns in the frontend globally then you can do it with CSS, you can also
   do it per page/post using body.page-id-XXX or body.postid-XXX in selector. Is
   that what you want to do?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Administrator lost it’s role on CPT](https://wordpress.org/support/topic/administrator-lost-its-role-on-cpt/)
 *  [Jacek](https://wordpress.org/support/users/jzbydev/)
 * (@jzbydev)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/administrator-lost-its-role-on-cpt/#post-12228760)
 * The main problem is that you mix two different approaches to create capabilities
   for your post type, you pass capability_type and capabilities in args array to
   register_post_type. Passing string as capability_type will cause creation of 
   capabilities based on string or array of strings (singular and plural). For example
   if you pass
    `capability_type' => array('oglas', 'oglase')` then capabilities
   edit_oglas, edit_oglase and so on will be created automatically. And in this 
   case you should not pass capabilities. So code for your post type should look
   like this:
 *     ```
       add_action( 'init', 'oglasi_custom_post_type', 0 );
       // Creating a Deals Custom Post Type
       function oglasi_custom_post_type() {
             $labels = array(
               'name'                => __( 'Oglasi' ),
               'singular_name'       => __( 'Oglas'),
               'menu_name'           => __( 'Oglasi'),
               'parent_item_colon'   => __( 'Roditelj Oglas'),
               'all_items'           => __( 'Svi Oglasi'),
               'view_item'           => __( 'Pregledaj Oglas'),
               'add_new_item'        => __( 'Dodaj Novi Oglas'),
               'add_new'             => __( 'Dodaj Nov'),
               'edit_item'           => __( 'Izmeni Oglas'),
               'update_item'         => __( 'Ažuriraj Oglas'),
               'search_items'        => __( 'Traži Oglas'),
               'not_found'           => __( 'Nije Pronađen'),
               'not_found_in_trash'  => __( 'Nije Pronađen U Obrisanim')
             );
             $args = array(
               'label'               => __( 'oglasi'),
               'description'         => __( 'Vaši Oglasi'),
               'labels'              => $labels,
               'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields'),
               'public'              => true,
               'hierarchical'        => false,
               'show_ui'             => true,
               'show_in_menu'        => true,
               'show_in_nav_menus'   => true,
               'show_in_admin_bar'   => true,
               'has_archive'         => true,
               'can_export'          => true,
               'exclude_from_search' => false,
               'yarpp_support'       => true, 
               'publicly_queryable'  => true,
               'capability_type'     => array('oglas', 'oglase'),
           );
   
           register_post_type( 'oglasi', $args );
   
   
       }
       ```
   
 * Now you should assign capabilities to admin, create custom role and assign capabilities
   to it too.
 *     ```
       function add_oglasi_caps() {
   
           $role = get_role( 'administrator' );
   
           $role->add_cap( 'edit_oglas' ); 
           $role->add_cap( 'read_oglas' ); 
           $role->add_cap( 'delete_oglas' ); 
           $role->add_cap( 'edit_oglase' ); 
           $role->add_cap( 'edit_others_oglase' ); 
           $role->add_cap( 'publish_oglase' ); 
           $role->add_cap( 'read_private_oglase' ); 
           $role->add_cap( 'edit_oglase' ); 
   
   
           add_role( 'oglasi_role', 'Oglasi role', array('read')); 
   
           $role = get_role( 'oglasi_role' );
           $role->add_cap( 'edit_oglas' ); 
           $role->add_cap( 'read_oglas' ); 
           $role->add_cap( 'delete_oglas' ); 
           $role->add_cap( 'edit_oglase' ); 
           $role->add_cap( 'edit_others_oglase' ); 
           $role->add_cap( 'publish_oglase' ); 
           $role->add_cap( 'read_private_oglase' ); 
           $role->add_cap( 'edit_oglase' ); 
   
       }
       add_action( 'admin_init', 'add_oglasi_caps');
       ```
   
 * Remember that the code for custom role creation and adding capabilities should
   be executed once.
    -  This reply was modified 6 years, 5 months ago by [Jacek](https://wordpress.org/support/users/jzbydev/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [URGENCE, input box probleme](https://wordpress.org/support/topic/urgence-input-box-probleme/)
 *  [Jacek](https://wordpress.org/support/users/jzbydev/)
 * (@jzbydev)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/urgence-input-box-probleme/#post-12058102)
 * Can you get some details from customer like device, web browser (name, version),
   OS?

Viewing 5 replies - 1 through 5 (of 5 total)