custom post types – How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?

I am toying around with WordPress capabilities, and having some difficulty understanding where I am going wrong. Right now, I have an admin menu that appears for all administrators with STUDENTS as a submenu of SCHOOL: each of those link to http://example.com/wp-admin/edit.php?post_type=student. (When the user is in the HEADMASTER role, the link to the built-in UI for TEACHER appears and SCHOOL mimics its link). So far, all is well.

The bump in the road is when a non-HEADMASTER administrator clicks either SCHOOL or STUDENTS, the error “Sorry, you are not allowed to access this page” appears. (As expected, when that same admin accesses http://example.com/wp-admin/edit.php?post_type=teacher, the errors “You need a higher level of permission” and “Sorry, you are not allowed to edit posts in this post type” appear.) The issue is that the STUDENTS built-in UI is not accessible to all administrators. (As expected, there are no problems for HEADMASTERs.) How can this be resolved in such a way as to give all site admins access to STUDENTS and only HEADMASTERs access to TEACHERS while at the same time preserving the layout and functionality of the admin menu and built-in UI?

What I’ve Tried: When the 'show_in_menu' => 'edit.php?post_type=teacher' line is removed from the STUDENTS CPT, everything works as expected but STUDENTS becomes a top-level menu item instead of SCHOOL. I tried putting TEACHERS as a sub-menu item as STUDENTS, but SCHOOL does not change its link when the user is in the HEADMASTER role (also the ordering of TEACHERS and STUDENTS is backwards). I also tried add_menu_page() for SCHOOL and adding the slug returned for the show_in_menu argument of the TEACHERS and STUDENTS register_post_type args, respectively, but that didn’t work because it created a page instead of forwarding to the appropriate built-in UI.

class School {
    public static function init() {
        add_action('init', array(__CLASS__, 'register_cpt'));
        add_action('init', array(__CLASS__, 'add_role'));
        add_action('admin_menu', array(__CLASS__, 'modify_menu'));
    }

    public static function register_cpt() {
        register_post_type('teacher', array(
            'labels' => array(
                'name'          => __('TEACHER'),
                'all_items'     => __('TEACHERS'),
                'menu_name'     => __('SCHOOL'),
            ),
            'show_ui'           => TRUE,
            'capability_type'   => 'educator',
            'map_meta_cap'      => TRUE,
        ));
        register_post_type('student', array(
            'labels' => array(
                'name'          => __('STUDENT'),
                'menu_name'     => __('STUDENTS'),
            ),
            'show_ui'           => TRUE,
            'show_in_menu'      => 'edit.php?post_type=teacher',
        ));
    }

    public static function add_role() {
        if(get_role('headmaster') === NULL) {
            $caps = array();
            foreach(get_role('administrator')->capabilities as $cap => $tmp) {
                $pos = strpos($cap, 'post');
                if($pos !== FALSE) {
                    $cap = str_replace('post', 'educator', $cap);
                    $caps($cap) = TRUE;
                }
            }
            add_role('headmaster', 'HEADMASTER', $caps);
        }
    }

    public static function modify_menu() {
        global $submenu;
        unset($submenu('edit.php?post_type=teacher')(10));
    }
} School::init();

azure – Generic Service role on a Windows Failover Cluster – Destination Host Unreachable and Request Timed Out

I’m trying to setup a Generic Service role on a Windows Failover Cluster in Azure. The below is the setup:

Cluster: 2 Nodes, 1 Cloud Witness

  • VNET: 10.0.0.0/24, dcsubnet: 10.0.0.0/26, nodesubnet: 10.0.0.64/26, clientsubnet: 10.0.0.128/64
  • Domain Controller: Windows Server 2012, Nodes: Windows Server 2016 Datacenter
  • Node 1 IP (static): 10.0.0.68, Node 2 IP (Static): 10.0.0.73, Cluster
    IP (Static): 10.0.0.70, Cluster role (Generic Service) (Static):
    10.0.0.71

The issue is that when I ping both the Cluster and the Role from the node which is not the Owner Node, and the VMs in the other subnets, I always get “Destination Host Unreachable” (other VMs in the same subnet) or “Request Timed Out” (from other subnet VMs). I see that the CNO and VCO is created successfully in the AD, in DNS the A records are created correctly (I deleted and re-created it again).

Nslookup of both the cluster and the role gives the results from all machines.

In the Failover Cluster Manager, both the Cluster and the Role has an “Online” Status. What could be the reason why the ping is not working?

8 – Does the core always come with an administrator role? If so, is it safe to share the role with other users?

The administrator The role is part of the standard profile (and the Umami profile) and is created when the site is installed with one of these profiles. As you can see, the administrator role is missing. It is not available if the minimal profile site is installed.

However, defining a role as an administrator role is a core Drupal function. It is a configuration at /admin/config/people/accountsand it would look like this:

Enter the image description here

Any role assigned here as an administrator role would dynamically receive all authorizations of all activated modules.

Is the Drupal 8 core always delivered with the role of "administrator"? If so, is it safe to share the role with other users?

The administrator The role is part of the standard profile (and the Umami profile) and is created when the site is installed with one of these profiles. As you can see, the administrator role is missing. It is not available if the minimal profile site is installed.

However, defining a role as an administrator role is a core Drupal function. It is a configuration at /admin/config/people/accountsand it would look like this:

Enter the image description here

Any role assigned here as an administrator role would dynamically receive all authorizations of all activated modules.

Features – Remove features from the user role

I have an issue where a custom user role "member" somehow functions as a "subscriber". Example:

nb

Custom user role added via:

add_role( 'member', 'Member', array( 'read' => true, 'level_0' => true ) );

Subscriber removal code – this completely destroys my website and I don't know 100% why:

add_action( 'init', 'wc_remove_subscriber_cap' );
function wc_remove_subscriber_cap() {

    $args = array(
        'role' => 'member',
    );

    // The User Query
    $user_query = new WP_User_Query( $args );

    $members = $wp_user_query->get_results();

    // Check for results
    if (!empty($members)) {

        foreach ($members as $member) {
            $member->remove_cap( 'subscriber');
        }
    }

}

Any idea how I can fix the problem – delete subscriber ability from all members?

Dream City Role Playing Game Forum promotion

Live your dreams.

Dream city, a modern fantasy world that you can only visit when you are deeply asleep. Usually, a country where you can explore the innermost parts of your dreams is taken over by the darkness and your worst nightmares.

Prophet, sweetie, nightmare and special agent Felicity Aisling fight with you to save the city and restore balance. Acquire special powers and abilities to fight the evil that takes over. However, don't forget to take a break and explore the different parts of the city and the surrounding area with your new companions.

With Dream City RPG, members can fully explore their dreams. Dreamers can band together and help save the city with their newly found powers, skills and friends.

Home | History | The Guardians | OOC.

Product identification – role play with core mechanics based on the grouping of dice under a certain sum

A few years ago, I was reading an RPG where core dice mechanics were used to roll a number of dice and then arrange the dice in sets so that the dice in each set did not exceed a certain limit. Both the number of sets and the number of dice in each set were involved in determining the end result, but I'm pretty sure that the actual numbers on the dice and their sum were not relevant, apart from being limited, which cubes could be grouped together.

Many / most examples of the use of dice mechanics have been presented in the context of a fight, emphasizing that multiple groups of only two dice each would represent a flood of several quick, weak strokes, while a single group of six dice, for example, is one powerful blow.

I know that "rolling and grouping a few d10s" may sound like ORE, but this system was definitely not an ORE. In ORE, grouping is determined by which dice roll the same number as the others, while in the system I am trying to remember, the player chooses how to group the dice and, in the case of opposing rolls, how to group the dice and how the grouping is done in secret, which creates a strategic element that tries to guess how the other person groups their cubes (many small groups, one large group, or a mixture of small and large ones) so that you can group your cubes the most effective way to counteract them.