我正在尝试将类别名称放入以下数组
$args = array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories = get_categories($args);
$this->settings['categoriesmain1'] = array(
'section' => 'general',
'title' => __( 'Example Select' ),
'desc' => __( 'This is a description for the drop-down.' ),
'type' => 'select',
'std' => '',
'choices' => array(
$categories => $categories // here i am trying to echo them
)
);
choices
默认情况下它们是这样的
'choices' => array(
'Choice 1' => 'Other Choice 1',
'Choice 2' => 'Other Choice 2',
'Choice 3' => 'Other Choice 3'
)
但是当我尝试用它们来呼应它们时,$categories => $categories
我得到了错误Illegal offset type