htmlburger/carbon-fields-yoast 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

htmlburger/carbon-fields-yoast

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.

统计信息

  • 总下载量: 4.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 7
  • Forks: 6
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2019-02-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固