Repository navigation
Expand file tree
/
Copy pathto-faq.php
More file actions
57 lines (49 loc) · 2.15 KB
/
Copy pathto-faq.php
File metadata and controls
57 lines (49 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Plugin Name: Tour Operator FAQ
* Plugin URI: https://github.com/lightspeedwp/to-faq
* Description: FAQs for Tour Operator: a collapsible Yoast FAQ block, repeatable FAQ fields with a "TO FAQs" block variation, and an FAQ template part.
* Version: 0.1.0
* Requires at least: 6.7
* Requires PHP: 8.2
* Requires Plugins: tour-operator, wordpress-seo
* Author: LightSpeed
* Author URI: https://lightspeedwp.agency/
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: to-faq
* Domain Path: /languages
*
* @package TO_FAQ
*/
// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'LSX_TO_FAQ_VER', '0.1.0' );
define( 'LSX_TO_FAQ_CORE', __FILE__ );
define( 'LSX_TO_FAQ_PATH', plugin_dir_path( __FILE__ ) );
define( 'LSX_TO_FAQ_URL', plugin_dir_url( __FILE__ ) );
require_once LSX_TO_FAQ_PATH . 'includes/classes/class-faq.php';
require_once LSX_TO_FAQ_PATH . 'includes/classes/class-block-references.php';
require_once LSX_TO_FAQ_PATH . 'includes/classes/class-rendered-blocks.php';
require_once LSX_TO_FAQ_PATH . 'includes/classes/class-template-parts.php';
require_once LSX_TO_FAQ_PATH . 'includes/classes/class-faq-fields.php';
require_once LSX_TO_FAQ_PATH . 'includes/classes/class-template-faq-schema.php';
new lsx\to_faq\Faq();
/**
* Load the features that depend on other plugins, once they have loaded.
*/
function lsx_to_faq_init() {
// FAQ pattern and template part (requires Yoast SEO). The faq area is registered by Tour Operator core.
new lsx\to_faq\Template_Parts();
if ( lsx\to_faq\Faq_Fields::is_supported() ) {
// Repeatable FAQ fields and the "TO FAQs" Yoast FAQ block variation (requires Yoast SEO; the meta box uses Tour Operator's bundled CMB2).
new lsx\to_faq\Faq_Fields();
// Yoast FAQ blocks in templates and template parts, added to Yoast's FAQ schema (requires Yoast SEO).
new lsx\to_faq\Template_Faq_Schema();
// Tracks which FAQ blocks render visibly, so hidden ones stay out of the schema.
lsx\to_faq\Rendered_Blocks::init();
}
}
add_action( 'plugins_loaded', 'lsx_to_faq_init' );