htmlburger/carbon-fields-yoast
最新稳定版本:v2.0.0-alpha.1
Composer 安装命令:
composer require htmlburger/carbon-fields-yoast
包简介
Helper library that allows developers to choose which fields from Carbon Fields to include in the Yoast readability score meter
README 文档
README
Carbon Fields Yoast is an addon to Carbon Fields that allows developers to choose which fields from Carbon Fields to include in the Yoast readability score meter.
How to use?
Install via composer:
composer require htmlburger/carbon-fields-yoast
In functions.php, add the following:
add_action( 'after_setup_theme', 'crb_initialize_carbon_yoast' ); function crb_initialize_carbon_yoast() { include_once __DIR__ . '/vendor/autoload.php'; new \Carbon_Fields_Yoast\Carbon_Fields_Yoast; } add_action( 'admin_enqueue_scripts', 'crb_enqueue_admin_scripts' ); function crb_enqueue_admin_scripts() { wp_enqueue_script( 'crb-admin', get_stylesheet_directory_uri() . '/js/admin.js', array( 'carbon-fields-yoast' ) ); }
In js/admin.js in your theme, add the following:
var $doc = $(document); var $win = $(window); $doc.ready(function () { $win.on('YoastSEO:ready', function () { new CarbonFieldsYoast(); }); });
This will initialize the Carbon Fields Yoast addon. The CarbonFieldsYoast object accepts the following arguments:
[Number] refreshInterval - Defaults to 300ms
This is the time interval on which the meta fields are being parsed.
[Array] fieldsByTypeToExclude
This contains the type of fields that shouldn't be parsed. By default, only text, textarea and rich text fields are being parsed.
[Array] fieldsByNameToExclude
This contains the name of the fields that shouldn't be parsed. By default, there aren't excluded fields.
统计信息
- 总下载量: 3.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2019-02-25