Modulo per integrare la Yii con Wordpress
Documentazione API WP https://developer.wordpress.org/rest-api/
The preferred way to install this extension is through composer.
Run
php composer.phar require magicalella/yii2-wswordpress
or add
"magicalella/yii2-wswordpress": "*"
to the require section of your composer.json
file.
- Add component to your config file
'components' => [
// ...
'wswordpress' => [
'class' => 'magicalella\wswordpress\Wswordpress',
'endpoint' => 'URL API Wordpress',
'method' => 'GET'
],
]
- Get dato to WP
$wswordpress = Yii::$app->wswordpress;
$result = $wswordpress->call('wp/v2/...',[
'param'=>value_param
]
);