2608 f022c07ac9 goto server 5 anni fa 2608_fsm ad01fc0d19 find places 5 anni fa 2608_vm a4345e5759 first commit 5 anni fa 2609 a4345e5759 first commit 5 anni fa 2609_fsm a4345e5759 first commit 5 anni fa 2609_vm a4345e5759 first commit 5 anni fa 2610 f022c07ac9 goto server 5 anni fa 2610_fsm a4345e5759 first commit 5 anni fa 2610_vm a4345e5759 first commit 5 anni fa 2611 a4345e5759 first commit 5 anni fa 2612 a4345e5759 first commit 5 anni fa 2612_fsm a4345e5759 first commit 5 anni fa 2612_vm a4345e5759 first commit 5 anni fa 2613 a4345e5759 first commit 5 anni fa 2615 a4345e5759 first commit 5 anni fa 2615_fsm a4345e5759 first commit 5 anni fa 2615_vm a4345e5759 first commit 5 anni fa 2616 a4345e5759 first commit 5 anni fa 2616_fsm a4345e5759 first commit 5 anni fa 2616_vm a4345e5759 first commit 5 anni fa 2617 a4345e5759 first commit 5 anni fa 2617_fsm a4345e5759 first commit 5 anni fa 2617_vm a4345e5759 first commit 5 anni fa 2618 a4345e5759 first commit 5 anni fa 2618_fsm a4345e5759 first commit 5 anni fa 2618_vm a4345e5759 first commit 5 anni fa 2619 ad01fc0d19 find places 5 anni fa 2619_fsm a4345e5759 first commit 5 anni fa 2619_vm ad01fc0d19 find places 5 anni fa 2620 f022c07ac9 goto server 5 anni fa 2620_fsm a4345e5759 first commit 5 anni fa 2650 a4345e5759 first commit 5 anni fa 2651 a4345e5759 first commit 5 anni fa 2652 a4345e5759 first commit 5 anni fa 2653 a4345e5759 first commit 5 anni fa 2654 a4345e5759 first commit 5 anni fa 2655 a4345e5759 first commit 5 anni fa 2656 f022c07ac9 goto server 5 anni fa 2657 f022c07ac9 goto server 5 anni fa 2658 f022c07ac9 goto server 5 anni fa 2659 f022c07ac9 goto server 5 anni fa 2660 a4345e5759 first commit 5 anni fa 2661 a4345e5759 first commit 5 anni fa 2662 f022c07ac9 goto server 5 anni fa 2663 f022c07ac9 goto server 5 anni fa 2664 f022c07ac9 goto server 5 anni fa 2665 f022c07ac9 goto server 5 anni fa 2666 f022c07ac9 goto server 5 anni fa 2667 f022c07ac9 goto server 5 anni fa 2668 a4345e5759 first commit 5 anni fa 2669 a4345e5759 first commit 5 anni fa 2670 a4345e5759 first commit 5 anni fa 2673 f022c07ac9 goto server 5 anni fa 2674 f022c07ac9 goto server 5 anni fa 2675 a4345e5759 first commit 5 anni fa 2678 f022c07ac9 goto server 5 anni fa 2679 f022c07ac9 goto server 5 anni fa 2680 a4345e5759 first commit 5 anni fa 2681 a4345e5759 first commit 5 anni fa 2682 a4345e5759 first commit 5 anni fa 2683 a4345e5759 first commit 5 anni fa 2684 a4345e5759 first commit 5 anni fa 2685 a4345e5759 first commit 5 anni fa 2686 a4345e5759 first commit 5 anni fa 2687 a4345e5759 first commit 5 anni fa 2688 a4345e5759 first commit 5 anni fa 2689 a4345e5759 first commit 5 anni fa 2690 a4345e5759 first commit 5 anni fa 2691 a4345e5759 first commit 5 anni fa 2692 a4345e5759 first commit 5 anni fa 2693 a4345e5759 first commit 5 anni fa 2696 ad01fc0d19 find places 5 anni fa 2699 f022c07ac9 goto server 5 anni fa 2701 f022c07ac9 goto server 5 anni fa 2702 f022c07ac9 goto server 5 anni fa 2703 ad01fc0d19 find places 5 anni fa 2704 ad01fc0d19 find places 5 anni fa 2753 a4345e5759 first commit 5 anni fa 2753_fsm a4345e5759 first commit 5 anni fa 2753_vm a4345e5759 first commit 5 anni fa 2754 a4345e5759 first commit 5 anni fa 2755 a4345e5759 first commit 5 anni fa 2756 a4345e5759 first commit 5 anni fa 2757 a4345e5759 first commit 5 anni fa 2830 a4345e5759 first commit 5 anni fa 2831 a4345e5759 first commit 5 anni fa 2832 a4345e5759 first commit 5 anni fa 2833 a4345e5759 first commit 5 anni fa 2834 a4345e5759 first commit 5 anni fa 2835 a4345e5759 first commit 5 anni fa 2836 a4345e5759 first commit 5 anni fa 2837 a4345e5759 first commit 5 anni fa 2838 a4345e5759 first commit 5 anni fa 2838_fsm a4345e5759 first commit 5 anni fa 2838_vm a4345e5759 first commit 5 anni fa 2839 a4345e5759 first commit 5 anni fa 2840 ad01fc0d19 find places 5 anni fa 2840_fsm ad01fc0d19 find places 5 anni fa 2840_vm a4345e5759 first commit 5 anni fa 2841 ad01fc0d19 find places 5 anni fa 2995 a4345e5759 first commit 5 anni fa 2996 a4345e5759 first commit 5 anni fa 3079 a4345e5759 first commit 5 anni fa 3079_fsm a4345e5759 first commit 5 anni fa 3079_vm a4345e5759 first commit 5 anni fa 3080 a4345e5759 first commit 5 anni fa 3081 a4345e5759 first commit 5 anni fa 3085 a4345e5759 first commit 5 anni fa 3118 a4345e5759 first commit 5 anni fa 3119 a4345e5759 first commit 5 anni fa 3164 a4345e5759 first commit 5 anni fa 3256 a4345e5759 first commit 5 anni fa 3257 a4345e5759 first commit 5 anni fa 3258 a4345e5759 first commit 5 anni fa 3350 a4345e5759 first commit 5 anni fa 3351 a4345e5759 first commit 5 anni fa 3379 a4345e5759 first commit 5 anni fa 3380 a4345e5759 first commit 5 anni fa 3381 a4345e5759 first commit 5 anni fa 3394 a4345e5759 first commit 5 anni fa 3394_fsm a4345e5759 first commit 5 anni fa 3394_vm a4345e5759 first commit 5 anni fa 3395 a4345e5759 first commit 5 anni fa 3429 a4345e5759 first commit 5 anni fa 3430 a4345e5759 first commit 5 anni fa 3431 a4345e5759 first commit 5 anni fa 3433 a4345e5759 first commit 5 anni fa 3439 a4345e5759 first commit 5 anni fa 3440 a4345e5759 first commit 5 anni fa 3455 f022c07ac9 goto server 5 anni fa 3456 a4345e5759 first commit 5 anni fa 3456_fsm a4345e5759 first commit 5 anni fa 3456_vm a4345e5759 first commit 5 anni fa 3466 a4345e5759 first commit 5 anni fa 3467 a4345e5759 first commit 5 anni fa 3468 a4345e5759 first commit 5 anni fa 3501 a4345e5759 first commit 5 anni fa 3502 a4345e5759 first commit 5 anni fa 3503 a4345e5759 first commit 5 anni fa 3534 a4345e5759 first commit 5 anni fa 3541 a4345e5759 first commit 5 anni fa 3541_fsm a4345e5759 first commit 5 anni fa 3541_vm a4345e5759 first commit 5 anni fa 3542 a4345e5759 first commit 5 anni fa 3574 a4345e5759 first commit 5 anni fa 3575 a4345e5759 first commit 5 anni fa 3576 a4345e5759 first commit 5 anni fa 3596 a4345e5759 first commit 5 anni fa 3597 a4345e5759 first commit 5 anni fa 3598 a4345e5759 first commit 5 anni fa 3599 a4345e5759 first commit 5 anni fa 3600 a4345e5759 first commit 5 anni fa 3600_fsm a4345e5759 first commit 5 anni fa 3600_vm a4345e5759 first commit 5 anni fa 3601 a4345e5759 first commit 5 anni fa 3601_fsm a4345e5759 first commit 5 anni fa 3601_vm a4345e5759 first commit 5 anni fa 3602 a4345e5759 first commit 5 anni fa 3602_fsm a4345e5759 first commit 5 anni fa 3602_vm a4345e5759 first commit 5 anni fa 3603 a4345e5759 first commit 5 anni fa 3603_fsm a4345e5759 first commit 5 anni fa 3603_vm a4345e5759 first commit 5 anni fa 3604 a4345e5759 first commit 5 anni fa 3605 a4345e5759 first commit 5 anni fa 3606 a4345e5759 first commit 5 anni fa 3607 a4345e5759 first commit 5 anni fa 3608 a4345e5759 first commit 5 anni fa 3609 a4345e5759 first commit 5 anni fa 3712 a4345e5759 first commit 5 anni fa 3764 a4345e5759 first commit 5 anni fa 3764_fsm a4345e5759 first commit 5 anni fa 3764_vm a4345e5759 first commit 5 anni fa 3766 a4345e5759 first commit 5 anni fa 3767 a4345e5759 first commit 5 anni fa 3997 a4345e5759 first commit 5 anni fa 4143 a4345e5759 first commit 5 anni fa 4144 a4345e5759 first commit 5 anni fa 4145 a4345e5759 first commit 5 anni fa 4146 a4345e5759 first commit 5 anni fa 4147 a4345e5759 first commit 5 anni fa 4148 a4345e5759 first commit 5 anni fa 4149 a4345e5759 first commit 5 anni fa 4150 a4345e5759 first commit 5 anni fa 4151 a4345e5759 first commit 5 anni fa 4152 a4345e5759 first commit 5 anni fa 4153 a4345e5759 first commit 5 anni fa 4154 a4345e5759 first commit 5 anni fa 4155 a4345e5759 first commit 5 anni fa 4156 a4345e5759 first commit 5 anni fa 4157 a4345e5759 first commit 5 anni fa 4158 a4345e5759 first commit 5 anni fa 4159 a4345e5759 first commit 5 anni fa 4160 a4345e5759 first commit 5 anni fa 4161 a4345e5759 first commit 5 anni fa 4162 a4345e5759 first commit 5 anni fa 4163 a4345e5759 first commit 5 anni fa 4164 a4345e5759 first commit 5 anni fa 4165 a4345e5759 first commit 5 anni fa 4166 a4345e5759 first commit 5 anni fa 4167 a4345e5759 first commit 5 anni fa 4168 a4345e5759 first commit 5 anni fa 4169 a4345e5759 first commit 5 anni fa 4170 a4345e5759 first commit 5 anni fa 4171 a4345e5759 first commit 5 anni fa 4172 a4345e5759 first commit 5 anni fa 4173 a4345e5759 first commit 5 anni fa 4174 a4345e5759 first commit 5 anni fa 5002 ad01fc0d19 find places 5 anni fa 548 a4345e5759 first commit 5 anni fa 549 a4345e5759 first commit 5 anni fa 6102 a4345e5759 first commit 5 anni fa 6104 a4345e5759 first commit 5 anni fa 6106 a4345e5759 first commit 5 anni fa 6110 a4345e5759 first commit 5 anni fa 6111 a4345e5759 first commit 5 anni fa 6112 a4345e5759 first commit 5 anni fa 6113 a4345e5759 first commit 5 anni fa 6117 a4345e5759 first commit 5 anni fa 826 a4345e5759 first commit 5 anni fa 827 a4345e5759 first commit 5 anni fa 828 a4345e5759 first commit 5 anni fa PG_VERSION a4345e5759 first commit 5 anni fa pg_filenode.map a4345e5759 first commit 5 anni fa pg_internal.init a4345e5759 first commit 5 anni fa tum/whitesports - Gogs: Simplico Git Service

Nenhuma Descrição

class-wp-role.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /**
  3. * User API: WP_Role class
  4. *
  5. * @package WordPress
  6. * @subpackage Users
  7. * @since 4.4.0
  8. */
  9. /**
  10. * Core class used to extend the user roles API.
  11. *
  12. * @since 2.0.0
  13. */
  14. class WP_Role {
  15. /**
  16. * Role name.
  17. *
  18. * @since 2.0.0
  19. * @var string
  20. */
  21. public $name;
  22. /**
  23. * List of capabilities the role contains.
  24. *
  25. * @since 2.0.0
  26. * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values
  27. * represent whether the role has that capability.
  28. */
  29. public $capabilities;
  30. /**
  31. * Constructor - Set up object properties.
  32. *
  33. * The list of capabilities must have the key as the name of the capability
  34. * and the value a boolean of whether it is granted to the role.
  35. *
  36. * @since 2.0.0
  37. *
  38. * @param string $role Role name.
  39. * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values
  40. * represent whether the role has that capability.
  41. */
  42. public function __construct( $role, $capabilities ) {
  43. $this->name = $role;
  44. $this->capabilities = $capabilities;
  45. }
  46. /**
  47. * Assign role a capability.
  48. *
  49. * @since 2.0.0
  50. *
  51. * @param string $cap Capability name.
  52. * @param bool $grant Whether role has capability privilege.
  53. */
  54. public function add_cap( $cap, $grant = true ) {
  55. $this->capabilities[ $cap ] = $grant;
  56. wp_roles()->add_cap( $this->name, $cap, $grant );
  57. }
  58. /**
  59. * Removes a capability from a role.
  60. *
  61. * @since 2.0.0
  62. *
  63. * @param string $cap Capability name.
  64. */
  65. public function remove_cap( $cap ) {
  66. unset( $this->capabilities[ $cap ] );
  67. wp_roles()->remove_cap( $this->name, $cap );
  68. }
  69. /**
  70. * Determines whether the role has the given capability.
  71. *
  72. * @since 2.0.0
  73. *
  74. * @param string $cap Capability name.
  75. * @return bool Whether the role has the given capability.
  76. */
  77. public function has_cap( $cap ) {
  78. /**
  79. * Filters which capabilities a role has.
  80. *
  81. * @since 2.0.0
  82. *
  83. * @param bool[] $capabilities Array of key/value pairs where keys represent a capability name and boolean values
  84. * represent whether the role has that capability.
  85. * @param string $cap Capability name.
  86. * @param string $name Role name.
  87. */
  88. $capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
  89. if ( ! empty( $capabilities[ $cap ] ) ) {
  90. return $capabilities[ $cap ];
  91. } else {
  92. return false;
  93. }
  94. }
  95. }