在我这之前:
//ArticlesController::index
$articles = $this->Articles->find('all', [
'contain' => ['Comments']
]);
所以我设置了fields key
:
//ArticlesController::index
$articles = $this->Articles->find('all', [
'fields' => ['title', 'text],
'contain' => ['Comments']
]);
由于我设置了fields key
,find
的结果不再带来comments
。
答案 0 :(得分:1)
/**
* Enqueue Scripts with CF7 Dependencies
*/
function so30727367_enqueue_scripts() {
wp_enqueue_script( 'stackoverflow-scripts', plugin_dir_url(__FILE__) . 'scripts.js', array('jquery'), null, true );
}
add_action( 'wpcf7_enqueue_scripts', 'so30727367_enqueue_scripts' );