This topic has 1 reply, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #16256
     vasikgreif
    Participant

    I’m creating custom image albums/gallery plugin – while RTMedia is really cool, it’s too difficult to hack it for my needs, as I need many custom fields on albums etc.

    Anyway, I just added kleo_show_love to attachments, but I had to add following to item-likes.php line 29 to make it work:

    if('post' == get_post_type() || 'attachment' == get_post_type()) {

    Is there any reason for the post type check? If so, could you please add filter for this, so I don’t have to hack core files?

    Thanks!

    #16481
     Abe
    Keymaster

    Hi, Yes we already added a filter to the post types. Here is the change function that will be available in 1.4.2 version:

    COPY CODE
    
    	function show_likes()
    	{
    		$ids = str_replace(' ', '', trim(strip_tags(sq_option('likes_exclude'))));
    		$ids = explode(',', $ids);
    		if(in_array(get_the_ID(), $ids)) return;
    		
    		$post_types = array( 'post', 'attachment' );
    		$post_types = apply_filters( 'kleo_likes_post_types', $post_types );
    		$current_post_type = get_post_type();
    		
    		if( in_array( $current_post_type, $post_types ) ) {
    			echo $this->do_likes();
    		}
    	}
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?