Force future event permalinks

This commit is contained in:
Brian Miyaji
2015-04-25 18:37:27 +10:00
parent 4d69291060
commit 6b06aa0995
5 changed files with 19 additions and 19 deletions

View File

@@ -51,7 +51,7 @@ class SP_WPML {
return $title;
}
public static function post_type_link( $url, $post = null, $leavename = false ) {
public static function post_type_link( $url, $post = null, $leavename = false, $sample = false ) {
if ( self::can_localize( $post ) ):
if ( ! $post ) global $post;
@@ -62,7 +62,7 @@ class SP_WPML {
$translated_id = icl_object_id( $id, 'any', false, ICL_LANGUAGE_CODE );
if ( $translated_id && $translated_id != $id && get_the_ID() != $translated_id ):
return get_permalink( $translated_id, $leavename );
return get_post_permalink( $translated_id, $leavename, $sample );
endif;
endif;
@@ -88,7 +88,7 @@ class SP_WPML {
// Get URL
$translated_id = icl_object_id( $id, 'any', false, $code );
if ( ! $translated_id ) continue;
$url = get_permalink( $translated_id );
$url = get_post_permalink( $translated_id, false, true );
// Get native name;
$native_name = sp_array_value( $v, 'native_name' );