Plugin Directory

Changeset 3398661


Ignore:
Timestamp:
11/19/2025 08:59:29 AM (4 months ago)
Author:
infility
Message:

v2.14.33 (20251119) Ben: 修改导入term的seo标题和描述

Location:
infility-global/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • infility-global/trunk/infility_global.php

    r3398651 r3398661  
    44Plugin URI: https://www.infility.cn/
    55Description: Infility公共插件
    6 Version: 2.14.32
     6Version: 2.14.33
    77Author: Infility
    88Author URI: https://www.infility.cn/
     
    138138    function __construct()
    139139    {
    140         define( 'INFILITY_GLOBAL_VERSION', '2.14.32' );
     140        define( 'INFILITY_GLOBAL_VERSION', '2.14.33' );
    141141        define( 'INFILITY_GLOBAL_PATH', plugin_dir_path( __FILE__ ) ); // fullpath/wp-content/plugins/infility-global/ // 有斜杠
    142142        define( 'INFILITY_GLOBAL_URL', plugins_url( '/', __FILE__ ) ); // https://the_domain/wp-content/plugins/infility-global/ // 斜杠是自己加的
  • infility-global/trunk/widgets/infility-import-data/include/infility-import-seo.php

    r3398651 r3398661  
    485485                    }
    486486
    487                     $post_id = self::get_post_id_by_url($address);
    488                     if ($post_id) {
    489                         $updated_keys = self::update_seo_meta($post_id, $title, $desc);
    490                         if (!empty($updated_keys)) {
    491                             $summary['updated']++;
    492                             $updated_posts++;
    493                             if (count($summary['samples']) < 10) {
    494                                 $summary['samples'][] = [
    495                                     'type' => 'post',
    496                                     'post_id' => $post_id,
    497                                     'address' => $address,
    498                                     'title' => $title,
    499                                     'description' => $desc,
    500                                     'keys' => $updated_keys,
    501                                 ];
    502                             }
    503                         } else {
    504                             $summary['skipped_blank']++;
    505                         }
    506                         continue;
    507                     }
    508 
    509487                    list($term_id, $taxonomy) = self::get_term_by_url($address);
    510488                    if ($term_id) {
     
    513491                            $summary['updated']++;
    514492                            $updated_terms++;
    515                             if (count($summary['samples']) < 10) {
     493                            // if (count($summary['samples']) < 10) {
    516494                                $summary['samples'][] = [
    517495                                    'type' => 'term',
     
    523501                                    'keys' => $updated_keys,
    524502                                ];
    525                             }
     503                            // }
     504                        } else {
     505                            $summary['skipped_blank']++;
     506                        }
     507                        continue;
     508                    }
     509
     510                    $post_id = self::get_post_id_by_url($address);
     511                    if ($post_id) {
     512                        $updated_keys = self::update_seo_meta($post_id, $title, $desc);
     513                        if (!empty($updated_keys)) {
     514                            $summary['updated']++;
     515                            $updated_posts++;
     516                            // if (count($summary['samples']) < 10) {
     517                                $summary['samples'][] = [
     518                                    'type' => 'post',
     519                                    'post_id' => $post_id,
     520                                    'address' => $address,
     521                                    'title' => $title,
     522                                    'description' => $desc,
     523                                    'keys' => $updated_keys,
     524                                ];
     525                            // }
    526526                        } else {
    527527                            $summary['skipped_blank']++;
     
    547547            }
    548548            if (!empty($summary['samples'])) {
    549                 $message[] = '<p>示例(最多10条):</p>';
     549                $message[] = '<p>成功更新的链接:</p>';
    550550                foreach ($summary['samples'] as $s) {
    551551                    if (!empty($s['type']) && $s['type'] === 'term') {
Note: See TracChangeset for help on using the changeset viewer.