editor_button = new EditorButton(); $this->admin_backend = new AdminBackend(); } else { $this->callback_handler = new CallbackHandler(); $this->payment_form = new PaymentForm(); } // hook JS and CSS insertion. add_action('wp_enqueue_scripts', [$this, 'load_scripts']); } /** * Load custom JS and CSS. */ public function load_scripts() { // load payment form javascript wp_enqueue_script('adcoin-payments-form' , ADCOIN_PAYMENTS_BASE_URL . '/assets/form.js'); // load fonts wp_enqueue_style('adcoin-payments-fonts', 'http://fonts.googleapis.com/css?family=Dosis|Open+Sans'); // load icons (yes, this is a separate stylesheet, thank you WordPress for not providing us with the ability to provide a path with wp_add_inline_style) wp_enqueue_style('adcoin-payments-donate-icon', ADCOIN_PAYMENTS_BASE_URL . '/assets/icons.css'); // load default or custom CSS $css = Settings::get_css(); if (empty($css)) { wp_enqueue_style('adcoin-payments-style', ADCOIN_PAYMENTS_BASE_URL . '/default.css'); } else { wp_register_style('adcoin-payments-style-custom', false); wp_enqueue_style('adcoin-payments-style-custom'); wp_add_inline_style('adcoin-payments-style-custom', $css); } } } ?>