skt_pathway_enhanced_image_navigation

Filter in a link to a content ID attribute for the next/previous image links on image attachment pages.

Description

skt_pathway_enhanced_image_navigation( $url, $id ); 

Parameters (2)

0. $url
The url.
1. $id
The id.

Usage

  1. if ( !function_exists( 'skt_pathway_enhanced_image_navigation' ) ) { 
  2. require_once '/inc/extras.php'; 
  3.  
  4. // The url. 
  5. $url = null; 
  6.  
  7. // The id. 
  8. $id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = skt_pathway_enhanced_image_navigation($url, $id); 
  12.  

Defined (1)

The function is defined in the following location(s).

/inc/extras.php  
  1. function skt_pathway_enhanced_image_navigation( $url, $id ) { 
  2. if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) 
  3. return $url; 
  4.  
  5. $image = get_post( $id ); 
  6. if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) 
  7. $url .= '#main'; 
  8.  
  9. return $url;