} foreach ($listitems as $position => $item) { $sql .= sprintf('WHEN %d THEN %d ', $item, $position); } $sql .= $endQuery; $wpdb->query($sql); } exitAction(''); } /** Admin action Ends Here * * Video Search Starts Here */ $video_search = filter_input(INPUT_GET, 'video_search'); /** Get parmalink URL */ $wp_rewrite = new WP_Rewrite(); $link = $wp_rewrite->get_page_permastruct(); /** Check video search is exist */ if (!empty($video_search) && !empty($link)) { /** Convert non-sef URL to seo friendly URL for video serach */ $location = home_url() . '/search/' . urlencode($video_search); /** Redirect to the search url */ header("Location: {$location}", true, 301); exitAction(''); } /** Video Search Ends Here * * Video Detail Page action Starts Here * Fucntion to include rss file */ add_action('wp_ajax_rss', 'rss_function'); add_action('wp_ajax_nopriv_rss', 'rss_function'); function rss_function()