/** * Build a navigation permalink. * * @param string $direction * @param null|SEOSlides_Slide $slide * * @return string */ public static function slide_nav_link($direction, $slide = null) { if (null !== $slide) { return $slide->permalink($direction); } return '#'; }
} reset($slides); $first_id = key($slides); /** @var SEOSlides_Slide $slide */ $slide = $slides[$first_id]; header("HTTP/1.1 307 Temporary Redirect"); header("Location: " . trailingslashit(trailingslashit(get_permalink()) . $slide->slug)); die; } else { // Get the slide based on its slug $found = get_posts(array('name' => $slide_slug, 'post_type' => 'seoslides-slide', 'post_status' => 'publish', 'numberposts' => 1)); if (count($found) === 0) { SEOSlides_Util::redirect_404(); } $slide = $found[0]; $slide = new SEOSlides_Slide($slide); $slideset_bg = $slide->parent('default_fill_color'); } ?> <!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" <?php language_attributes(); ?> ><![endif]--> <!--[if IE 8]> <html class="ie ie8" <?php language_attributes(); ?> ><![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!-->
/** * Validate an oembed endpoint. * * Result will be cached by the server for future lookup. */ public function check_oembed() { $valid = array('success' => false); $embed = SEOSlides_Slide::get_embed_url($_POST['seoslides_video_oembed']); if (!is_wp_error($embed)) { $valid = array('success' => true); } wp_send_json($valid); }
/** * Filter the slide permalinks such that they return something useful. * * @since 1.0.3 * * @param string $url Original permalink * @param WP_Post $post Post object * * @return string */ public function slide_permalink($url, $post) { if ('seoslides-slide' !== get_post_type($post)) { return $url; } // Build pretty permalink $slide = new SEOSlides_Slide($post); $url = trailingslashit(get_permalink($slide->parent('ID'))) . $slide->slug . '/'; return $url; }