Plugin Directory

Changeset 3496294


Ignore:
Timestamp:
04/01/2026 08:35:55 AM (13 hours ago)
Author:
kasuga16
Message:

Update 1.0.4 -> 1.0.5

Location:
pv-sort-plus-for-cocoon
Files:
8 added
2 edited

Legend:

Unmodified
Added
Removed
  • pv-sort-plus-for-cocoon/trunk/pv-sort-plus-for-cocoon.php

    r3476356 r3496294  
    33 * Plugin Name: PV Sort Plus for Cocoon
    44 * Description: Enables sorting by periodic page views, modified dates, and elapsed days (modified/published) by adding custom columns to the post list.
    5  * Version: 1.0.4
     5 * Version: 1.0.5
    66 * Author: Kasuga
    77 * License: GPLv2 or later
     
    1919
    2020/**
    21  * Check whether the Cocoon theme is active.
    22  *
    23  * @return bool True if Cocoon theme is active, false otherwise.
     21 * Check whether Cocoon (parent or child) is active.
     22 *
     23 * @return bool
    2424 */
    2525function cpts_is_cocoon_active() {
    26     return defined( 'COCOON_VERSION' );
     26    return 'cocoon-master' === get_template();
    2727}
    2828
     
    4444    return $columns;
    4545}
    46 add_filter( 'manage_posts_columns', 'cpts_add_custom_columns', 99 );
    4746
    4847/**
     
    107106    echo esc_html( number_format_i18n( $count ) );
    108107}
    109 add_action( 'manage_posts_custom_column', 'cpts_render_custom_columns', 99, 2 );
    110108
    111109/**
     
    126124    return $columns;
    127125}
    128 add_filter( 'manage_edit-post_sortable_columns', 'cpts_add_custom_sortable_columns' );
    129126
    130127/**
     
    185182    }
    186183}
    187 add_action( 'pre_get_posts', 'cpts_sort_handler', 99 );
    188184
    189185/**
     
    219215    <?php
    220216}
    221 add_action( 'admin_head', 'cpts_admin_column_width_css' );
     217
     218// Register hooks after the theme is loaded so COCOON_VERSION is available.
     219add_action( 'after_setup_theme', function() {
     220    if ( ! cpts_is_cocoon_active() ) {
     221        return;
     222    }
     223    add_filter( 'manage_posts_columns', 'cpts_add_custom_columns', 99 );
     224    add_action( 'manage_posts_custom_column', 'cpts_render_custom_columns', 99, 2 );
     225    add_filter( 'manage_edit-post_sortable_columns', 'cpts_add_custom_sortable_columns' );
     226    add_action( 'pre_get_posts', 'cpts_sort_handler', 99 );
     227    add_action( 'admin_head', 'cpts_admin_column_width_css' );
     228} );
  • pv-sort-plus-for-cocoon/trunk/readme.txt

    r3476361 r3496294  
    66Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 1.0.4
     8Stable tag: 1.0.5
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3131
    3232---
     33
    3334== 説明 ==
    3435
     
    3738WordPress管理画面の「投稿一覧」に以下のカスタムカラムを追加し、**クリックによる並び替え(ソート)**を可能にします。
    3839
    39 *  **PV/日**(PV/D)
    40 * **PV/週**(PV/W)
    41 * **PV/月**(PV/M
    42 * **PV/全**(PV/All)
    43 * **更新日**(Modified)
    44 *  **経過日数**(Mod-D)※ 最終更新からの経過日数
    45 *  **公開日数**(Pub-D)※ 公開からの経過日数
     40*  **PV/日**
     41* **PV/週**
     42* **PV/月**
     43* **PV/全**
     44* **更新日**
     45*  **経過日数** ※ 最終更新からの経過日数
     46*  **公開日数** ※ 公開からの経過日数
    4647
    4748Cocoonが内部で使用しているcocoon_accessesテーブルを参照し、**外部サービスや追加設定なし**でPV集計を行います。
     
    106107
    107108== Changelog ==
     109
     110= 1.0.5 =
     111* Fixed: The changes in 1.0.4 to Cocoon theme detection were insufficient, so additional fixes were applied.
     112
    108113= 1.0.4 =
    109114* Improved Cocoon theme detection logic for better parent/child theme compatibility.
Note: See TracChangeset for help on using the changeset viewer.