php - Constant expression contains invalid operations plugin class properties visibility

I have declared a private variable to hold a custom post type arguments array. I can't understabd why when I try to

I have declared a private variable to hold a custom post type arguments array. I can't understabd why when I try to activate the plugin I get always this error: Constant expression contains invalid operations.

Is there a fix?

code example

<?php
class CustomPostType {

public $services = array( ... );


 public function init()
 {
  register_post_type( 'services', $this->services );
 }

}
?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744876275a4598563.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信