ajax

Update particular key and its value in wp_option table in wordpress

//first get all the value by get option   $saved_lisc_data = get_option( ‘lisc_settings’); //then put the update the key and its value $saved_lisc_data[‘lisc_match_status’] = ‘complete’; //then update the option update_option( ‘lisc_settings’ , $saved_lisc_data); //for multiple value update $lisc_updated_data = get_option( ‘lisc_settings’); $lisc_updated_data[‘lisc_enable_status’] = $lisc_enable_status; $lisc_updated_data[‘lisc_api_url’] = $_POST[‘lisc_api_url’]; $lisc_updated_data[‘lisc_interval’] = $_POST[‘lisc_interval’]; $lisc_updated_data[‘lisc_total_timing’] = $_POST[‘lisc_total_timing’]; update_option( ‘lisc_settings’ , …

Update particular key and its value in wp_option table in wordpress Read More »

use wp_ajax in wordpress

  Wp Ajax – WordPress Hook to Handle Ajax Request wp_ajax is not a hook or callback, rather it is just a prefix of hooks or callbacks. Those callbacks  are usually available while making ajax call. When a browser or web-client request with an action query parameter to http://example.com/wp–admin/admin–ajax.php file, a hook becomes available to use. Which use wp_ajax_ as prefix. Brief …

use wp_ajax in wordpress Read More »

add ajax url in wordpress

function dbk_enqueue_scripts() { wp_enqueue_script( ‘debugger_custom_js’, plugins_url( ‘js/debugger-kanha.js’, __FILE__ ), array() ); //load jquery wp_enqueue_script( ‘jquery’ ); //add ajax url wp_localize_script( ‘debugger_custom_js’, ‘dbk’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ))); } add_action( ‘admin_enqueue_scripts’, ‘dbk_enqueue_scripts’ ); //for ajax call add_action( ‘wp_ajax_dbk_ajax’, ‘dbk_ajax_subscribe’ ); output function function dbk_ajax_subscribe(){ echo ‘this is ajax subscribe form’; } <script> jQuery(document).ready(function() { // …

add ajax url in wordpress Read More »