HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpbiancoarte/wp-content/plugins/hiroshi-core/inc/roles/administrator/helper.php
<?php

if ( ! function_exists( 'hiroshi_core_add_administrator_role_caps' ) ) {
	/**
	 * Function that add user role capabilities for custom post types
	 */
	function hiroshi_core_add_administrator_role_caps() {

		// Add the roles you'd like to administer the custom post types
		$roles = apply_filters( 'hiroshi_core_filter_administrator_roles', array( 'editor', 'administrator' ) );

		// Allowed custom post types
		$cpt_items = apply_filters( 'hiroshi_core_filter_administrator_cpts', array() );

		// Loop through each role and assign capabilities
		foreach ( $roles as $the_role ) {
			$role = get_role( $the_role );

			if ( count( $cpt_items ) ) {

				foreach ( $cpt_items as $cpt ) {
					$role->add_cap( 'read_' . $cpt );
					$role->add_cap( 'read_private_' . $cpt . 's' );
					$role->add_cap( 'edit_' . $cpt );
					$role->add_cap( 'edit_' . $cpt . 's' );
					$role->add_cap( 'edit_others_' . $cpt . 's' );
					$role->add_cap( 'edit_published_' . $cpt . 's' );
					$role->add_cap( 'publish_' . $cpt . 's' );
					$role->add_cap( 'delete_' . $cpt . 's' );
					$role->add_cap( 'delete_others_' . $cpt . 's' );
					$role->add_cap( 'delete_private_' . $cpt . 's' );
					$role->add_cap( 'delete_published_' . $cpt . 's' );
				}
			}
		}
	}

	add_action( 'hiroshi_core_action_plugin_loaded', 'hiroshi_core_add_administrator_role_caps' );
}