• Resolved Frank

    (@frankoutsole)


    I’m using Filter Everything Pro, which doesn’t work anymore after using your (pro) plugin. Please help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @frankoutsole,

    Unfortunately, the Filter Everything Pro uses its own permalink system based on dynamic URL segments and that is not compatible with the one used by Permalink Manager.

    To make them work together, you can try adding a below code snippet. This should help Permalink Manager detect filter URLs without needing an exact match:

    function pm_detect_filter_everything_url( $element_id, $uri_parts, $request_url ) {
    global $permalink_manager_uris;

    if ( empty( $element_id ) && ! empty( $uri_parts['uri'] ) && strpos( $uri_parts['uri'], '/' ) !== false ) {
    $uri = $uri_parts['uri'];
    $path_segments = explode( '/', trim( $uri, '/' ) );
    $loop_counter = 0; // Counter for loop iterations

    // Loop through the path segments in reverse order
    while ( ! empty( $path_segments ) && $loop_counter < 6 ) {
    $candidate_uri = implode( '/', $path_segments );

    if ( in_array( $candidate_uri, $permalink_manager_uris ) ) {
    $new_element_id = array_search( $candidate_uri, $permalink_manager_uris );

    // Check if the new element ID contains 'tax-'
    if ( strpos( $new_element_id, 'tax-' ) !== false ) {
    $element_id = $new_element_id;
    }

    break;
    }

    // Remove the last path segment and continue the loop
    array_pop( $path_segments );

    // Increment the loop counter
    $loop_counter ++;
    }
    }

    return $element_id;
    }
    add_filter( 'permalink_manager_detected_element_id', 'pm_detect_filter_everything_url', 10, 3 );

    function pm_maybe_disable_wpc_filter_request( $do_filter ) {
    global $pm_query;

    if ( ! empty( $pm_query['id'] ) && empty( $pm_query['endpoint'] ) ) {
    return false;
    }

    return $do_filter;
    }
    add_filter( 'wpc_do_filter_request', 'pm_maybe_disable_wpc_filter_request', 10, 1 );
    Thread Starter Frank

    (@frankoutsole)

    This seems to work at first sight, that would be amazing! Will let you know asap.

    Thread Starter Frank

    (@frankoutsole)

    It worked perfectly fine, but having issues on the English pages (polylang) again. It works now and then, but at this moment everything’s giving 404s agan. Any advice? I regenerated the permalinks, but no success. At the english taxonomies, i see the permalink slug field is filled with dutch slugs sometimes. Something’s wrong here I think…

    Plugin Author Maciej Bis

    (@mbis)

    Hi @frankoutsole,

    The snippet I sent should work automatically and no extra action was needed. Please make sure that the code snippet is added to a child theme functions.php file, not the original theme – otherwise the snippet placed there will be removed from there after the theme is updated.

    Could you possibly send me a sample screenshot showing the incorrect taxonomy slug? If you used “native slugs” mode during regenerating process, you might have accidentally overwritten them.

    As you are using Permalink Manager Pro, you can also use the contact form on the official website – this would make the troubleshooting process quicker:

    https://permalinkmanager.pro/contact/

    • This reply was modified 9 months, 1 week ago by Maciej Bis.
    • This reply was modified 9 months, 1 week ago by Maciej Bis.
    Thread Starter Frank

    (@frankoutsole)

    It helped avoiding the 404s, but except one filters the filters simply didn’t actually filter.

    I’ve opened a case there two days ago, but support is not as fast as here 🙂

    Plugin Author Maciej Bis

    (@mbis)

    Hi @frankoutsole,

    I am sorry for the inconvenience! To be honest, I am a single developer (not a full team), and I personally respond to support requests both on permalinkmanager.pro and here. For some reason, the email with your message was moved to the spam folder and therefore ignored by the ticket system.

    Actually, the problem with the snippet is that the second function (pm_maybe_disable_wpc_filter_request()) is obsolete. Could you try to use only the first part of the code:

    function pm_detect_filter_everything_url( $element_id, $uri_parts, $request_url ) {
    global $permalink_manager_uris;

    if ( empty( $element_id ) && ! empty( $uri_parts['uri'] ) && strpos( $uri_parts['uri'], '/' ) !== false ) {
    $uri = $uri_parts['uri'];
    $path_segments = explode( '/', trim( $uri, '/' ) );
    $loop_counter = 0; // Counter for loop iterations

    // Loop through the path segments in reverse order
    while ( ! empty( $path_segments ) && $loop_counter < 6 ) {
    $candidate_uri = implode( '/', $path_segments );

    if ( in_array( $candidate_uri, $permalink_manager_uris ) ) {
    $new_element_id = array_search( $candidate_uri, $permalink_manager_uris );

    // Check if the new element ID contains 'tax-'
    if ( strpos( $new_element_id, 'tax-' ) !== false ) {
    $element_id = $new_element_id;
    }

    break;
    }

    // Remove the last path segment and continue the loop
    array_pop( $path_segments );

    // Increment the loop counter
    $loop_counter ++;
    }
    }

    return $element_id;
    }
    add_filter( 'permalink_manager_detected_element_id', 'pm_detect_filter_everything_url', 10, 3 );

    Best regards,
    Maciej

    Thread Starter Frank

    (@frankoutsole)

    Thank you for your reply. It seems like this is not compatible with Polylang or mulltilingual. The filters now seem to work on /nl/sneakers/, but /en/sneakers/ disappeared and most other pages get 404s now.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Conflixt Filter Everything Pro’ is closed to new replies.