Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function changeChannel(channelID){
- jQuery(document).ready(function($) {
- var data = {
- 'action': 'watchme_change_channel',
- 'whatever': channelID
- };
- jQuery.post(ajaxurl, data, function(response) {
- alert(response);
- });
- });
- add_action('wp_ajax_watchme_change_channel','watchme_change_channel_callback');
- add_action('wp_ajax_nopriv_watchme_change_channel','watchme_change_channel_callback');
- function watchme_change_channel_callback() {
- global $wpdb; // this is how you get access to the database
- global $videos_meta;
- global $programming_meta;
- $whatever = $_POST['whatever'];
- $echo_var[0]=get_user_meta($whatever, $videos_meta)[0];
- $echo_var[1]=get_user_meta($whatever, $programming_meta)[1];
- echo "life is not easy";
- wp_die(); // this is required to terminate immediately and return a proper response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement