admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('taboola_pixel_nonce'), 'third_party_connect_host' => TABPX_THIRD_PARTY_CONNECT_HOST, 'api_host' => TABPX_API_HOST, 'platform' => $platform, 'plugin_url' => plugin_dir_url(__DIR__), 'loading_url' => plugin_dir_url(__DIR__) . 'assets/loading.html' )); } add_action('admin_enqueue_scripts', 'tabpx_enqueue_admin_scripts'); function tabpx_install_account_id() { if (!current_user_can('manage_options')) { wp_send_json_error('Unauthorized', 403); } check_ajax_referer('taboola_pixel_nonce', 'nonce'); if (isset($_POST['account_id'])) { $account_id = sanitize_text_field(wp_unslash($_POST['account_id'])); $tabpx_options = get_option('taboola_pixel_settings', array()); $tabpx_options['account_id'] = $account_id; update_option('taboola_pixel_settings', $tabpx_options); wp_send_json_success(); } else { wp_send_json_error(); } } function tabpx_uninstall_account_id() { if (!current_user_can('manage_options')) { wp_send_json_error('Unauthorized', 403); } check_ajax_referer('taboola_pixel_nonce', 'nonce'); $tabpx_options = get_option('taboola_pixel_settings', array()); unset($tabpx_options['account_id']); update_option('taboola_pixel_settings', $tabpx_options); wp_send_json_success(); } add_action('wp_ajax_tabpx_install_account_id', 'tabpx_install_account_id'); add_action('wp_ajax_tabpx_uninstall_account_id', 'tabpx_uninstall_account_id'); function tabpx_inject_topbar() { $screen = get_current_screen(); if ($screen && $screen->id === 'toplevel_page_taboola-pixel-admin') { ?>
Taboola Logo Taboola Pixel