HEX
Server: Apache
System: Linux digivps 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: www (1000)
PHP: 8.3.15
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/healthyton.com/wp-content/plugins/wp-subtitle/plugin/includes/compat/woocommerce.php
<?php

/**
 * @package     WP Subtitle
 * @subpackage  WooCommerce
 *
 * @since  3.1
 *
 * Compatibility for the WooCommerce plugin:
 * https://wordpress.org/plugins/woocommerce/
 */

class WPSubtitle_WooCommerce {

	/**
	 * Constructor
	 *
	 * @since  3.1
	 *
	 * @internal  Do not create multiple instances.
	 */
	public function __construct() {

		if ( 'yes' === get_option( 'wp_subtitle_woocommerce_enabled' ) ) {

			add_action( 'init', array( $this, 'add_product_post_type_support' ) );

			if ( 'yes' === get_option( 'wp_subtitle_woocommerce_show_on_single' ) ) {
				add_action( 'woocommerce_single_product_summary', array( $this, 'single_product_summary' ), 6 );
			}

			if ( 'yes' === get_option( 'wp_subtitle_woocommerce_show_in_loop' ) ) {
				add_action( 'woocommerce_shop_loop_item_title', array( $this, 'shop_loop_item_title' ) );
			}
		}

		add_filter( 'woocommerce_product_settings', array( $this, 'product_settings' ) );

	}

	/**
	 * Add Product Post Type Support
	 *
	 * @since  3.1
	 *
	 * @internal  Private. Called via the `init` action.
	 */
	public function add_product_post_type_support() {

		add_post_type_support( 'product', 'wps_subtitle' );

	}

	/**
	 * Single Product Summary
	 *
	 * @since  3.1
	 *
	 * @internal  Private. Called via the `woocommerce_single_product_summary` action.
	 */
	public function single_product_summary() {

		do_action(
			'plugins/wp_subtitle/the_subtitle',
			array(
				'before' => '<h2 class="product_subtitle entry-subtitle wp-subtitle">',
				'after'  => '</h2>',
			)
		);

	}

	/**
	 * Shop Loop Item Title
	 *
	 * @since  3.1
	 *
	 * @internal  Private. Called via the `woocommerce_shop_loop_item_title` action.
	 */
	public function shop_loop_item_title() {

		do_action(
			'plugins/wp_subtitle/the_subtitle',
			array(
				'before' => '<p class="woocommerce-loop-product__subtitle wp-subtitle">',
				'after'  => '</p>',
			)
		);

	}

	/**
	 * Product Settings
	 *
	 * @since  3.1
	 *
	 * @param   array $settings  Settings.
	 * @return  array             Settings.
	 *
	 * @internal  Private. Called via the `woocommerce_product_settings` filter.
	 */
	public function product_settings( $settings ) {

		$subtitle_settings = array(

			array(
				'title' => __( 'WP Subtitle', 'wp-subtitle' ),
				'type'  => 'title',
				'desc'  => '',
				'id'    => 'wp_subtitle_options',
			),

			array(
				'title'   => __( 'Enable Product Subtitles', 'wp-subtitle' ),
				'desc'    => __( 'Add subtitle field to product edit screen', 'wp-subtitle' ),
				'id'      => 'wp_subtitle_woocommerce_enabled',
				'default' => 'no',
				'type'    => 'checkbox',
			),

			array(
				'title'         => __( 'Subtitle Display', 'wp-subtitle' ),
				'desc'          => __( 'Show on single product pages', 'wp-subtitle' ),
				'id'            => 'wp_subtitle_woocommerce_show_on_single',
				'default'       => 'yes',
				'type'          => 'checkbox',
				'checkboxgroup' => 'start',
			),

			array(
				'desc'          => __( 'Show on product archives', 'wp-subtitle' ),
				'id'            => 'wp_subtitle_woocommerce_show_in_loop',
				'default'       => 'yes',
				'type'          => 'checkbox',
				'checkboxgroup' => 'end',
			),

			array(
				'type' => 'sectionend',
				'id'   => 'wp_subtitle_options',
			),

		);

		return array_merge( $settings, $subtitle_settings );

	}

}