| @@ -1,21 +1,21 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -namespace FL\Assistant\Helpers; | |
| 4 | - | |
| 5 | -class PreviewHelper { | |
| 6 | - | |
| 7 | - /** | |
| 8 | - * Retrieve the preview url for a post. | |
| 9 | - * | |
| 10 | - * @param object $post | |
| 11 | - * @return string | |
| 12 | - */ | |
| 13 | - public static function get_post_preview_url( $post ) { | |
| 14 | - $post = get_post( $post ); | |
| 15 | - $post_id = $post->ID; | |
| 16 | - $post_type = $post->post_type; | |
| 17 | - $var_name = 'page' === $post_type ? 'page_id' : 'p'; | |
| 18 | - | |
| 19 | - return home_url( "/?post_type=$post_type&$var_name=$post_id&fl_asst_post_preview=1" ); | |
| 20 | - } | |
| 21 | -} | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace FL\Assistant\Helpers; | |
| 4 | + | |
| 5 | +class PreviewHelper { | |
| 6 | + | |
| 7 | + /** | |
| 8 | + * Retrieve the preview url for a post. | |
| 9 | + * | |
| 10 | + * @param object $post | |
| 11 | + * @return string | |
| 12 | + */ | |
| 13 | + public static function get_post_preview_url( $post ) { | |
| 14 | + $post = get_post( $post ); | |
| 15 | + $post_id = $post->ID; | |
| 16 | + $post_type = $post->post_type; | |
| 17 | + $var_name = 'page' === $post_type ? 'page_id' : 'p'; | |
| 18 | + | |
| 19 | + return home_url( "/?post_type=$post_type&$var_name=$post_id&fl_asst_post_preview=1" ); | |
| 20 | + } | |
| 21 | +} | |