Fixed permalink for video post

parent 42362899
...@@ -104,7 +104,9 @@ div.etn-single-event-media img.wp-post-image { ...@@ -104,7 +104,9 @@ div.etn-single-event-media img.wp-post-image {
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
border-radius: 15px; border-radius: 15px;
min-width:400px; min-width:300px;
max-height:83%;
overflow-y:auto;
} }
.site-header-shmlogin:hover > li.shmlogin > a { .site-header-shmlogin:hover > li.shmlogin > a {
......
...@@ -24,6 +24,15 @@ namespace wp_SexHackMe; ...@@ -24,6 +24,15 @@ namespace wp_SexHackMe;
// Exit if accessed directly // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit; if ( ! defined( 'ABSPATH' ) ) exit;
/*
function replace__permalink( $post_link, $post, $leavename, $sample ) {
if ( 'custom_post_type' === $post->post_type ) {
$slug = 'custom-post-type';
$post_link = str_replace( '%' . $post->post_type . '%', $slug, $post_link );
}
return $post_link;
}
*/
if(!class_exists('SH_PostTypes')) { if(!class_exists('SH_PostTypes')) {
class SH_PostTypes class SH_PostTypes
...@@ -56,6 +65,8 @@ if(!class_exists('SH_PostTypes')) { ...@@ -56,6 +65,8 @@ if(!class_exists('SH_PostTypes')) {
add_filter( 'manage_sexhackadv_posts_columns', 'wp_SexHackMe\advert_add_id_column', 5 ); add_filter( 'manage_sexhackadv_posts_columns', 'wp_SexHackMe\advert_add_id_column', 5 );
add_action( 'manage_sexhackadv_posts_custom_column', 'wp_SexHackMe\advert_id_column_content', 5, 2 ); add_action( 'manage_sexhackadv_posts_custom_column', 'wp_SexHackMe\advert_id_column_content', 5, 2 );
// Fix the permalink for video pages
add_filter( 'post_type_link', __CLASS__."::replace_permalink", 10, 4 );
// SexHack Videos // SexHack Videos
// TODO: the idea is to have custom post type for models profiles and for videos. // TODO: the idea is to have custom post type for models profiles and for videos.
...@@ -124,7 +135,17 @@ if(!class_exists('SH_PostTypes')) { ...@@ -124,7 +135,17 @@ if(!class_exists('SH_PostTypes')) {
//sexhack_log($rules); //sexhack_log($rules);
} }
} }
public static function replace_permalink( $post_link, $post, $leavename, $sample )
{
if ( 'sexhack_video' === $post->post_type ) {
$video = sh_get_video_from_post($post);
$post_link=get_site_url()."/".get_option('sexhack_gallery_slug', 'v')."/".$video->slug;
}
return $post_link;
}
public static function add_rewrites() public static function add_rewrites()
{ {
......
...@@ -313,7 +313,9 @@ if(!class_exists('SH_Shortcodes')) { ...@@ -313,7 +313,9 @@ if(!class_exists('SH_Shortcodes')) {
} }
if($popup) { if($popup) {
$script.=" shinc.addClass('".$shmclass."');"; $script.=" shinc.addClass('".$shmclass."');";
if($campaign!='') $script.=" shinc.find('form').submit(function(){\$.post('/content/plugins/matomo/app/matomo.php', {'idsite':1, 'rec': '1','mtm_campaign': '".$campaign."','mtm_kwd': shinc.attr('data-shmname') })});"; if($campaign!='') $action="function(){\$.post('/content/plugins/matomo/app/matomo.php', {'idsite':1, 'rec': '1','mtm_campaign': '".$campaign."','mtm_kwd': shinc.attr('data-shmname') })}";
if($campaign!='') $script.=" shinc.find('form').submit(".$action.");";
if($campaign!='') $script.=" shinc.find('a').click(".$action.");";
} }
if($random || $popup) { if($random || $popup) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment