cwp_megar_enhanced_image_navigation
Filter in a link to a content ID attribute for the next/previous image links on image attachment pages.
Description
Parameters (2)
- 0. $url
- The url.
- 1. $id
- The id.
Usage
if ( !function_exists( 'cwp_megar_enhanced_image_navigation' ) ) { require_once '/inc/extras.php'; } // The url. $url = null; // The id. $id = null; // NOTICE! Understand what this does before running. $result = cwp_megar_enhanced_image_navigation($url, $id);
Defined (1)
The function is defined in the following location(s).
- /inc/extras.php
- function cwp_megar_enhanced_image_navigation( $url, $id ) {
- if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
- return $url;
- $image = get_post( $id );
- if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
- $url .= '#main';
- return $url;
- }