This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get sections. | |
* | |
* @return array | |
*/ | |
public function get_sections() { | |
$sections = array( | |
'' => __( 'Settings', 'p3k-galactica' ), | |
'log' => __( 'Log', 'p3k-galactica' ), | |
'results' => __( 'Sale Results', 'p3k-galactica' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Output the settings | |
*/ | |
public function output() { | |
global $current_section; | |
switch ($current_section) { | |
case 'results': | |
include 'partials/p3k-galactica-settings-results.php'; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Displays a table in the WC Settings page | |
* | |
* @link https://paulmiller3000.com | |
* @since 1.0.0 | |
* | |
* @package P3k_Galactica | |
* @subpackage P3k_Galactica/admin | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load dependencies for additional WooCommerce settings | |
* | |
* @since 1.0.0 | |
* @access private | |
*/ | |
public function p3kg_add_settings( $settings ) { | |
$settings[] = include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-p3k-galactica-wc-settings.php'; | |
$settings[] = include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-p3k-galactica-wc-table.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Displays a table in the WC Settings page | |
* | |
* @link https://paulmiller3000.com | |
* @since 1.0.0 | |
* | |
* @package P3k_Galactica | |
* @subpackage P3k_Galactica/admin | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function() { | |
const currentUrl = window.location.pathname; | |
let parentCategory = false; | |
let productName = currentUrl.substr(18, (currentUrl.length - 18)); | |
let slashCount = productName.match(/\//g); | |
// Count the number of slashes. If 1, this is a parent category | |
slashCount = slashCount ? slashCount.length : 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Extend WC_Stripe_Webhook_Handler and override the check_for_webhook function | |
* | |
*/ | |
if (!class_exists('My_Stripe_Webhook_Handler')) : | |
class My_Stripe_Webhook_Handler extends WC_Stripe_Webhook_Handler { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>How to Return Two Values to a Function in ES6</title> | |
</head> | |
<body> | |
<div class='container'> | |
<form action='#' onsubmit='funFunction();return false'> | |
<select name='vehicle-selector' id='vehicle-selector' required /> | |
<option value='BaseStar'>BaseStar</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Register ACF fields to WordPress API | |
* Tutorial: https://battlestardigital.com/wp-admin/post.php?post=2838&action=edit | |
*/ | |
add_action( 'rest_api_init', 'bsd_register_acf_with_api' ); | |
function bsd_register_acf_with_api() { | |
if (!function_exists('get_fields')) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Display a map (saved from Advanced Custom Fields) in Quick View Pro modal | |
* Documentation: https://battlestardigital.com/adding-advanced-custom-fields-google-maps-to-woocommerce-quick-view-pro/ | |
* HTML Source: https://www.advancedcustomfields.com/resources/google-map/ | |
*/ | |
private function bsd_qvp_display_map( $map) { | |
if ( $map ) { | |
?> | |
<div id="map" class="acf-map"> | |
<div class="marker" data-lat="<?php echo esc_attr($map['lat']); ?>" data-lng="<?php echo esc_attr($map['lng']); ?>"></div> |