Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Hi,

    what post type has the shop page? Is this a custom post type?

    Cheers,
    Dennis.

    Thread Starter Francesco Grasso

    (@francgrasso)

    YITH Support Representative

    Hi there,
    simple wordpress pages

    Francesco

    Plugin Author Dennis Ploetner

    (@realloc)

    Do you use some of the filters provided by the Multisite Language Switcher? You could try to correct the URL like this:

    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'https://kiw.ee/blog/shop/' == $url ) {
            $url = 'https://kiw.ee/shop/';
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );

    Let me know!

    Thread Starter Francesco Grasso

    (@francgrasso)

    YITH Support Representative

    Hi Dennis,
    I cannot use your solution because is too much specific and I think that will not solve all the problems.

    Reading the plugin’s code I have found this in MslsOptions.php:

    /**
    	 * Factory method
    	 *
    	 * @param int $id
    	 *
    	 * @return MslsOptions
    	 */
    	public static function create( $id = 0 ) {
    		if ( is_admin() ) {
    			$id = (int) $id;
    
    			if ( MslsContentTypes::create()->is_taxonomy() ) {
    				return MslsOptionsTax::create( $id );
    			}
    
    			return new MslsOptionsPost( $id );
    		}
    
    		if ( self::is_main_page() ) {
    			$options = new MslsOptions();
    		} elseif ( self::is_tax_page() ) {
    			$options = MslsOptionsTax::create();
    		} elseif ( self::is_query_page() ) {
    			$options = MslsOptionsQuery::create();
    		} else {
    			$options = new MslsOptionsPost( get_queried_object_id() );
    		}
    		add_filter( 'check_url', array( $options, 'check_for_blog_slug' ), 10, 2 );
    
    		return $options;
    	}

    If I comment the add_filter line all the issue seems to be fixed, and, most important, I can’t see any other problem between links.

    Can you take a look at the code? Is the add_filter really necessary for any purpose? What does it do? Can you also provide me a solution to exclude it?

    Thanks,
    Francesco

    Plugin Author Dennis Ploetner

    (@realloc)

    Yes, it is necessary if you use the blog slug in your posts … it isn’t necessary for pages.

    Thread Starter Francesco Grasso

    (@francgrasso)

    YITH Support Representative

    In my particular case this filter in unnecessary, can you please tell me how to remove the filter? Your help will be much apreciated.

    Thanks,
    Francesco

    Plugin Author Dennis Ploetner

    (@realloc)

    I gave you a solution for the current version of the plugin. Feel free to use things like remove_filter. ??

    Thread Starter Francesco Grasso

    (@francgrasso)

    YITH Support Representative

    Ok . I thought you wanted to propose me to use the filter in another way . Then I will use remove_filter.

    Thanks for the quick support!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Issue between shop pages from different sites’ is closed to new replies.