Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../includes/admin/settings
File: class-wc-settings-integrations.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WooCommerce Integration Settings
[2] Fix | Delete
*
[3] Fix | Delete
* @package WooCommerce\Admin
[4] Fix | Delete
* @version 2.1.0
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
use Automattic\Jetpack\Constants;
[8] Fix | Delete
[9] Fix | Delete
defined( 'ABSPATH' ) || exit;
[10] Fix | Delete
[11] Fix | Delete
if ( ! class_exists( 'WC_Settings_Integrations', false ) ) :
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* WC_Settings_Integrations.
[15] Fix | Delete
*/
[16] Fix | Delete
class WC_Settings_Integrations extends WC_Settings_Page {
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Constructor.
[20] Fix | Delete
*/
[21] Fix | Delete
public function __construct() {
[22] Fix | Delete
$this->id = 'integration';
[23] Fix | Delete
$this->label = __( 'Integration', 'woocommerce' );
[24] Fix | Delete
[25] Fix | Delete
if ( isset( WC()->integrations ) && WC()->integrations->get_integrations() ) {
[26] Fix | Delete
parent::__construct();
[27] Fix | Delete
}
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
/**
[31] Fix | Delete
* Setting page icon.
[32] Fix | Delete
*
[33] Fix | Delete
* @var string
[34] Fix | Delete
*/
[35] Fix | Delete
public $icon = 'plugins';
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Get own sections.
[39] Fix | Delete
*
[40] Fix | Delete
* @return array
[41] Fix | Delete
*/
[42] Fix | Delete
protected function get_own_sections() {
[43] Fix | Delete
global $current_section;
[44] Fix | Delete
[45] Fix | Delete
$sections = array();
[46] Fix | Delete
[47] Fix | Delete
if ( ! $this->wc_is_installing() ) {
[48] Fix | Delete
$integrations = $this->get_integrations();
[49] Fix | Delete
[50] Fix | Delete
if ( ! $current_section && ! empty( $integrations ) ) {
[51] Fix | Delete
$current_section = current( $integrations )->id;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
if ( count( $integrations ) > 1 ) {
[55] Fix | Delete
foreach ( $integrations as $integration ) {
[56] Fix | Delete
$title = empty( $integration->method_title ) ? ucfirst( $integration->id ) : $integration->method_title;
[57] Fix | Delete
$sections[ strtolower( $integration->id ) ] = esc_html( $title );
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
return $sections;
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
/**
[66] Fix | Delete
* Is WC_INSTALLING constant defined?
[67] Fix | Delete
* This method exists to ease unit testing.
[68] Fix | Delete
*
[69] Fix | Delete
* @return bool True is the WC_INSTALLING constant is defined.
[70] Fix | Delete
*/
[71] Fix | Delete
protected function wc_is_installing() {
[72] Fix | Delete
return Constants::is_defined( 'WC_INSTALLING' );
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Get the currently available integrations.
[77] Fix | Delete
* This method exists to ease unit testing.
[78] Fix | Delete
*
[79] Fix | Delete
* @return array Currently available integrations.
[80] Fix | Delete
*/
[81] Fix | Delete
protected function get_integrations() {
[82] Fix | Delete
return WC()->integrations->get_integrations();
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* Output the settings.
[87] Fix | Delete
*/
[88] Fix | Delete
public function output() {
[89] Fix | Delete
global $current_section;
[90] Fix | Delete
[91] Fix | Delete
$integrations = $this->get_integrations();
[92] Fix | Delete
[93] Fix | Delete
if ( isset( $integrations[ $current_section ] ) ) {
[94] Fix | Delete
$integrations[ $current_section ]->admin_options();
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
endif;
[100] Fix | Delete
[101] Fix | Delete
return new WC_Settings_Integrations();
[102] Fix | Delete
[103] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function