Make WordPress Core

Ticket #8663: custom_capabilities_prefix.diff

File custom_capabilities_prefix.diff, 585 bytes (added by hudatoriq, 16 years ago)

Adding a check whether a CUSTOM_CAPABILITIES_PREFIX is already defined

  • capabilities.php

     
    501501         */
    502502        function _init_caps() {
    503503                global $wpdb;
    504                 $this->cap_key = $wpdb->prefix . 'capabilities';
     504                if ( defined('CUSTOM_CAPABILITIES_PREFIX') ) {
     505                        $this->cap_key = CUSTOM_CAPABILITIES_PREFIX . 'capabilities';
     506                } else {
     507                        $this->cap_key = $wpdb->prefix . 'capabilities';
     508                }
    505509                $this->caps = &$this->{$this->cap_key};
    506510                if ( ! is_array( $this->caps ) )
    507511                        $this->caps = array();