public function createOptions()
    {
        // default options
        $options = [
            'public' => true,
            'rewrite' => [
                'slug' => $this->slug
            ]
        ];

        // replace defaults with the options passed
        $options = array_replace_recursive($options, $this->options);

        // create and set labels
        if (!isset($options['labels'])) {
            $options['labels'] = $this->createLabels();
        }

        // set the menu icon
        if (!isset($options['menu_icon']) && isset($this->icon)) {
            $options['menu_icon'] = $this->icon;
        }

        return $options;
    }
public function createOptions()
    {
        // default options
        $options = [
            'public' => true,
            'rewrite' => [
                'slug' => $this->slug
            ]
        ];

        // replace defaults with the options passed
        $options = array_replace_recursive($options, $this->options);

        // create and set labels
        if (!isset($options['labels'])) {
            $options['labels'] = $this->createLabels();
        }

        // set the menu icon
        if (!isset($options['menu_icon']) && isset($this->icon)) {
            $options['menu_icon'] = $this->icon;
        }

        return $options;
    }
public function createOptions ( ) { // default options $ options = [ 'public' => true , 'rewrite' => [ 'slug' => $ this -> slug ] ] ; // replace defaults with the options passed $ options = array_replace_recursive ( $ options , $ this -> options ) ; // create and set labels if ( ! isset ( $ options [ 'labels' ] ) ) { $ options [ 'labels' ] = $ this -> createLabels ( ) ; } // set the menu icon if ( ! isset ( $ options [ 'menu_icon' ] ) && isset ( $ this -> icon ) ) { $ options [ 'menu_icon' ] = $ this -> icon ; } return $ options ; }
Create options for PostType
@return array Options to pass to register_post_type
Create options for PostType