Title: permalink
Last modified: August 21, 2016

---

# permalink

 *  Resolved [KrissieV](https://wordpress.org/support/users/krissiev/)
 * (@krissiev)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/)
 * I’m wondering if there is a way to have a permalink to each individual video 
   without having to create a new page and drop in the shortcode. I can put
    `<?
   php echo do_shortcode( '[flowplayer id="33"]' ) ?>` in my template file and use
   a variable to get the id to use. I thought I might be able to tweak this myself,
   but I’m not having much luck.
 * [http://wordpress.org/plugins/flowplayer5/](http://wordpress.org/plugins/flowplayer5/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Ulrich](https://wordpress.org/support/users/grapplerulrich/)
 * (@grapplerulrich)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/#post-4305552)
 * At the moment not, I will be adding this in a future release. I need to rethink
   a few a things.
 *  Thread Starter [KrissieV](https://wordpress.org/support/users/krissiev/)
 * (@krissiev)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/#post-4305553)
 * Thanks! For the time being, I’ve got a script in my functions.php that’s automatically
   adding a new page (if one doesn’t exist already) with the same title as the video
   when the video is saved, and inputs the shortcode into the page and saves the
   video id as a variable for use in pulling out some custom fields I’ve added. 
   Not ideal, but it’s working for this instance.
 *  Plugin Author [Ulrich](https://wordpress.org/support/users/grapplerulrich/)
 * (@grapplerulrich)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/#post-4305554)
 * Could you share this code? I would be interested.
 *  Thread Starter [KrissieV](https://wordpress.org/support/users/krissiev/)
 * (@krissiev)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/#post-4305555)
 * A friend helped me put it together, so I can’t take credit for it, but here it
   is. Hasn’t really been tested very adequately, just in my unique instance.
 *     ```
       //Generate New Page from Video
       function copy_videos_to_pages( $post_id ) {
       	// Only if we're saving a flowplayer5 video
       	if ( 'flowplayer5' !== get_post_type( $post_id ) )
       		return;
   
       	// Get $post object for video currently being saved
       	$video = get_post( $post_id );
   
       	$page_title = get_page_by_title( $video->post_title, '', 'page' );
   
       	//Prevent Infinite Loop -  http://codex.wordpress.org/Plugin_API/Action_Reference/save_post#Avoiding_infinite_loops
       	remove_action( 'save_post', 'copy_videos_to_pages' );
   
       	/**
       	 * Check to see if a Page with the same title as this Video exists.
       	 * If not, create a new Page
       	 * Not totally foolproof, but a simple check.
       	 */
       	if ( is_null( $page_title ) ) {
   
       		//Create new Page that includes content from Video
       		$my_post = array(
       			'post_title'   => $video->post_title,
       			'post_date'    => $video->post_date,
       			'post_content' => '[flowplayer id="' . $video->ID . '"]',
       			'post_type'    => 'page',
       			'post_status'  => 'publish',
       			);
   
       		$post_id = wp_insert_post($my_post);
   
       		add_post_meta($post_id, 'related_video', $video->ID, true);
   
       	} else {
   
       		//do nothing
   
       	}
   
       	add_action( 'save_post', 'copy_videos_to_pages', 10, 1 );
   
       }
       add_action( 'save_post', 'copy_videos_to_pages', 10, 1 );
       ```
   
 *  Plugin Author [Ulrich](https://wordpress.org/support/users/grapplerulrich/)
 * (@grapplerulrich)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/#post-4305556)
 * Thanks, it looks good.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘permalink’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/flowplayer5_cce0e6.svg)
 * [Flowplayer HTML5 for WordPress](https://wordpress.org/plugins/flowplayer5/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flowplayer5/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flowplayer5/)
 * [Active Topics](https://wordpress.org/support/plugin/flowplayer5/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flowplayer5/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flowplayer5/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ulrich](https://wordpress.org/support/users/grapplerulrich/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/permalink-45/#post-4305556)
 * Status: resolved