Changeset 3496294
- Timestamp:
- 04/01/2026 08:35:55 AM (13 hours ago)
- Location:
- pv-sort-plus-for-cocoon
- Files:
-
- 8 added
- 2 edited
-
tags/1.0.5 (added)
-
tags/1.0.5/languages (added)
-
tags/1.0.5/languages/pv-sort-plus-for-cocoon-ja.mo (added)
-
tags/1.0.5/languages/pv-sort-plus-for-cocoon-ja.po (added)
-
tags/1.0.5/languages/pv-sort-plus-for-cocoon.pot (added)
-
tags/1.0.5/pv-sort-plus-for-cocoon.php (added)
-
tags/1.0.5/readme.txt (added)
-
tags/1.0.5/screenshot-1.png (added)
-
trunk/pv-sort-plus-for-cocoon.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pv-sort-plus-for-cocoon/trunk/pv-sort-plus-for-cocoon.php
r3476356 r3496294 3 3 * Plugin Name: PV Sort Plus for Cocoon 4 4 * 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. 45 * Version: 1.0.5 6 6 * Author: Kasuga 7 7 * License: GPLv2 or later … … 19 19 20 20 /** 21 * Check whether the Cocoon themeis 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 24 24 */ 25 25 function cpts_is_cocoon_active() { 26 return defined( 'COCOON_VERSION');26 return 'cocoon-master' === get_template(); 27 27 } 28 28 … … 44 44 return $columns; 45 45 } 46 add_filter( 'manage_posts_columns', 'cpts_add_custom_columns', 99 );47 46 48 47 /** … … 107 106 echo esc_html( number_format_i18n( $count ) ); 108 107 } 109 add_action( 'manage_posts_custom_column', 'cpts_render_custom_columns', 99, 2 );110 108 111 109 /** … … 126 124 return $columns; 127 125 } 128 add_filter( 'manage_edit-post_sortable_columns', 'cpts_add_custom_sortable_columns' );129 126 130 127 /** … … 185 182 } 186 183 } 187 add_action( 'pre_get_posts', 'cpts_sort_handler', 99 );188 184 189 185 /** … … 219 215 <?php 220 216 } 221 add_action( 'admin_head', 'cpts_admin_column_width_css' ); 217 218 // Register hooks after the theme is loaded so COCOON_VERSION is available. 219 add_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 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1.0. 48 Stable tag: 1.0.5 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 31 31 32 32 --- 33 33 34 == 説明 == 34 35 … … 37 38 WordPress管理画面の「投稿一覧」に以下のカスタムカラムを追加し、**クリックによる並び替え(ソート)**を可能にします。 38 39 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 * **公開日数** ※ 公開からの経過日数 46 47 47 48 Cocoonが内部で使用しているcocoon_accessesテーブルを参照し、**外部サービスや追加設定なし**でPV集計を行います。 … … 106 107 107 108 == 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 108 113 = 1.0.4 = 109 114 * Improved Cocoon theme detection logic for better parent/child theme compatibility.
Note: See TracChangeset
for help on using the changeset viewer.