/**
 * Theme template tag to get link
 *
 * @param  integer $post_id  The post ID to check
 *
 * @return sting   $link  The permalink with our "all" included.
 */
function svo_link($post_id = 0)
{
    // If we have not activated it, return the original canonical.
    if (false === ($check = RKV_SVO_Helper::check_post_active($post_id))) {
        return get_permalink($post_id);
    }
    // Return the updated link.
    return RKV_SVO_Helper::all_permalink($post_id);
}
Beispiel #2
0
 /**
  * Remove the paginated output if requested.
  *
  * @param  array $args  The original pagination args.
  *
  * @return array $args  The updated pagination args.
  */
 public function link_args($args)
 {
     // Bail if we aren't on a supported type.
     if (false === ($types = RKV_SVO_Helper::check_post_types())) {
         return $args;
     }
     // Call the $wp_query global.
     global $wp_query;
     // Check the content for the `nextpage` tag.
     if (false === ($tag = RKV_SVO_Helper::check_post_content($wp_query->post->ID))) {
         return $args;
     }
     // If we have not activated it, return the original content.
     if (!isset($wp_query->query['all']) || false === ($check = RKV_SVO_Helper::check_post_active($wp_query->post->ID))) {
         return $args;
     }
     // Set the 'echo' arg to false.
     $args['echo'] = 0;
     // Return our array of args.
     return $args;
 }