: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'LCW_Base_Class' ) ) {
const AJAX_PREFIX = 'wp_ajax_';
const AJAX_NOPRIV_PREFIX = 'wp_ajax_nopriv_';
const BASE_API_URL = 'https://apinew.cricket.com.au';
public function add_action($hook, $callback, $priority = 10, $accepted_args = 1) {
) , $priority, $accepted_args);
* Add ajax action for short
public function add_ajax($hook, $callback, $priv = true, $no_priv = true, $priority = 10, $accepted_args = 1) {
if ($priv) $this->add_action(self::AJAX_PREFIX . $hook, $callback, $priority, $accepted_args);
if ($no_priv) $this->add_action(self::AJAX_NOPRIV_PREFIX . $hook, $callback, $priority, $accepted_args);
public function add_filter($hook, $callback, $priority = 10, $accepted_args = 1) {
) , $priority, $accepted_args);
* Register script and add it into queue
public function enqueue_script($handle, $src, $deps = array() , $ver = false, $in_footer = true) {
'in_footer' => $in_footer
wp_register_script($scripts['handle'], $scripts['src'], $scripts['deps'], $scripts['ver'], $scripts['in_footer']);
wp_enqueue_script($scripts['handle']);
* enqueue an existed script
public function add_existed_script($handle, $src = '', $deps = array() , $ver = false, $in_footer = true) {
wp_enqueue_script($handle, $src, $deps, $ver, $in_footer);
public function register_script($handle, $src, $deps = array() , $ver = false, $in_footer = true) {
'in_footer' => $in_footer
wp_register_script($scripts['handle'], $scripts['src'], $scripts['deps'], $scripts['ver'], $scripts['in_footer']);
* Register style and add it into queue
public function enqueue_style($handle, $src = false, $deps = array() , $ver = false, $media = 'all') {
wp_register_style($style['handle'], $style['src'], $style['deps'], $style['ver'], $style['media']);
wp_enqueue_style($style['handle']);
public function register_style($handle, $src = false, $deps = array() , $ver = false, $media = 'all') {
wp_register_style($style['handle'], $style['src'], $style['deps'], $style['ver'], $style['media']);
wp_enqueue_style($style['handle']);
public function add_existed_style($handle) {
wp_enqueue_style($handle);
public function register_shortcode($shortcode_name,$callback_function) {
add_shortcode($shortcode_name,array(