WordPress永久链接插件Permalink Manager Pro v2.4.3

WordPress永久链接插件Permalink Manager Pro

WordPress永久链接插件Permalink Manager Pro是最先进但用户友好的 WordPress 永久链接插件。 可以轻松控制帖子、页面、自定义帖子类型、类别、标签、自定义分类法和 WooCommerce 商店的所有永久链接。 只需单击几下,它还可以帮助您恢复永久链接或替换 URL 中的任何单词。

永久链接用于链接到特定的博客或论坛帖子,以及社交网络上的用户个人资料。 常规链接有时包含大量服务信息(会话编号、站点的当前部分等)。 永久链接更简洁、易于阅读,并且只包含转到所需页面的信息。

演示: https://permalinkmanager.pro/

主题:多功能WordPress主题Qwery + RTL

  • 自定义 WooCommerce 永久链接
  • 自定义帖子类型和分类永久链接
  • 一次编辑多个固定链接
  • 自动重定向旧的永久链接
  • 将自定义字段添加到 WordPress 永久链接
  • 重复的永久链接蛞蝓

推荐:WordPress优化插件WP-Optimize Premium 

= 2.2.20 (October 10, 2022) =
* Fix - The URLs with duplicated slashes (eg. example.com/sample-page////) are now handled correctly and forwarded to the canonical URL.
* Fix - The redirect problem was resolved with WPForo versions after 2.0.1
* Dev - Improved compatibility with the WP All Import plugin functions
* Dev - Improved compatibility with Polylang plugin
* Dev - Better support for ACF Relationship fields
* Dev - The plugin no longer (by default) supports custom post types & taxonomies that do not have the "query_var" and "rewrite" properties
* Enhancement - In "Exclude drafts" mode, the URI Editor field in the "Quick Edit" section becomes "read-only" for the "Draft" posts.

= v2.2.19.3 (August 11, 2022) =
* Dev - New filter added - 'permalink_manager_pre_sanitize_title'
* Fix - The old slugs are saved in the '_wp_old_slug' meta key even if the native slugs are changed in the URI Editor in the Gutenberg mode.
* Fix - Extra security check in the "Debug" section to prevent unauthorized users (CSRF) from removing the plugin's data.

= v2.2.19.2 (July 8, 2022) =
* Fix - JS conflict fixed ("Cannot read properties of null (reading 'isSavingMetaBoxes')")

= v2.2.19.1 (June 27, 2022) =
* Fix - JS conflict fixed ("Cannot read property 'isSavingPost' of null")

/*
* Code Remove /product/ or /shop/ ... that supports the %product_cat% format
* Replace /shop/ with your current slug
*/
function devvn_remove_slug( $post_link, $post ) {
    if ( !in_array( get_post_type($post), array( 'product' ) ) || 'publish' != $post->post_status ) {
        return $post_link;
    }
    if('product' == $post->post_type){
        $post_link = str_replace( '/cua-hang/', '/', $post_link ); //Replace shop with your current slug
    }else{
        $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
    }
    return $post_link;
}
add_filter( 'post_type_link', 'devvn_remove_slug', 10, 2 );
/*Fix 404 error after removing product slug or shop*/
function devvn_woo_product_rewrite_rules($flash = false) {
    global $wp_post_types, $wpdb;
    $siteLink = esc_url(home_url('/'));
    foreach ($wp_post_types as $type=>$custom_post) {
        if($type == 'product'){
            if ($custom_post->_builtin == false) {
                $querystr = "SELECT {$wpdb->posts}.post_name, {$wpdb->posts}.ID
                            FROM {$wpdb->posts} 
                            WHERE {$wpdb->posts}.post_status="publish" 
                            AND {$wpdb->posts}.post_type="{$type}"";
                $posts = $wpdb->get_results($querystr, OBJECT);
                foreach ($posts as $post) {
                    $current_slug = get_permalink($post->ID);
                    $base_product = str_replace($siteLink,'',$current_slug);
                    add_rewrite_rule($base_product.'?
/*
* Remove product-category in URL
* Replace product-category with your current slug. Default is product-category
*/
add_filter( 'term_link', 'devvn_product_cat_permalink', 10, 3 );
function devvn_product_cat_permalink( $url, $term, $taxonomy ){
    switch ($taxonomy):
        case 'product_cat':
            $taxonomy_slug = 'product-category'; //Replace it with your current slug. Default is product-category
            if(strpos($url, $taxonomy_slug) === FALSE) break;
            $url = str_replace('/' . $taxonomy_slug, '', $url);
            break;
    endswitch;
    return $url;
}
// Add our custom product cat rewrite rules
function devvn_product_category_rewrite_rules($flash = false) {
    $terms = get_terms( array(
        'taxonomy' => 'product_cat',
        'post_type' => 'product',
        'hide_empty' => false,
    ));
    if($terms && !is_wp_error($terms)){
        $siteurl = esc_url(home_url('/'));
        foreach ($terms as $term){
            $term_slug = $term->slug;
            $baseterm = str_replace($siteurl,'',get_term_link($term->term_id,'product_cat'));
            add_rewrite_rule($baseterm.'?

⭐另请参阅:免费高级 WordPress 插件摘要、每日更新

笔记: 也许你需要在安装插件之前解压缩。 如果任何主题/插件包含病毒,我们不提供任何保证。 在 localhost 上使用之前,请检查 Virustotal。


发表评论