Changeset 2683664
- Timestamp:
- 02/23/2022 11:10:57 AM (4 years ago)
- Location:
- jinx-fast-cache/trunk
- Files:
-
- 3 edited
-
index.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
src/Admin.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jinx-fast-cache/trunk/index.php
r2676369 r2683664 2 2 3 3 /** 4 * Plugin Name: Jinx Fast Cache4 * Plugin Name: Jinx Fast-Cache 5 5 * Plugin URI: https://wordpress.org/plugins/jixn-fast-cache/ 6 6 * Description: Blazing fast full page cache. 7 * Version: 0.3. 47 * Version: 0.3.5 8 8 * Author: SquareFlower Websolutions (Lukas Rydygel) <hallo@squareflower.de> 9 9 * Author URI: http://squareflower.de -
jinx-fast-cache/trunk/readme.txt
r2676385 r2683664 5 5 Tested up to: 5.9.0 6 6 Requires PHP: 7.0 7 Stable tag: 0.3. 47 Stable tag: 0.3.5 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
jinx-fast-cache/trunk/src/Admin.php
r2676361 r2683664 69 69 70 70 global $post; 71 72 $nodes = array_merge($nodes, self::createNodes('post', ['%s Post # %d', $post->ID], [ 73 'post_type' => $post->post_type, 74 $post->ID 75 ])); 71 72 if ($post->post_status === 'publish') { 73 74 $nodes = array_merge($nodes, self::createNodes('post', ['%s Post # %d', $post->ID], [ 75 'post_type' => $post->post_type, 76 $post->ID 77 ])); 78 79 } 76 80 77 81 } … … 276 280 public static function addPostColumnContent(string $key, int $pid) 277 281 { 278 282 279 283 if ($key === 'jinx-fast-cache') { 280 284 285 $post = get_post($pid); 281 286 $url = get_permalink($pid); 282 287 283 echo self::getColumnContent($url );288 echo self::getColumnContent($url, $post->post_status !== 'publish'); 284 289 285 290 } … … 311 316 * 312 317 * @param string $url 318 * @param bool $disabled 313 319 * @return string 314 320 */ 315 protected static function getColumnContent(string $url) : string 316 { 317 318 $status = Url::getStatus($url); 321 protected static function getColumnContent(string $url, bool $disabled = false) : string 322 { 323 324 if ($disabled === true) { 325 $status = 'disabled'; 326 } else { 327 $status = Url::getStatus($url); 328 } 319 329 320 330 $icons = [ 321 ' 🔴',331 'not cached' => '🔴', 322 332 'warming' => '🟡', 323 333 'cached' => '🟢', 334 'disabled' => '⚪' 324 335 ]; 325 336 326 return '<span title="'.Plugin::t($status).'">'.($icons[$status] ?? $icons[ 0]).'</span>';337 return '<span title="'.Plugin::t($status).'">'.($icons[$status] ?? $icons['not cached']).'</span>'; 327 338 328 339 } … … 338 349 { 339 350 340 return array_merge($actions, self::createActions([ 341 'post_type' => $post->post_type, 342 $post->ID 343 ])); 351 if ($post->post_status === 'publish') { 352 353 $actions = array_merge($actions, self::createActions([ 354 'post_type' => $post->post_type, 355 $post->ID 356 ])); 357 358 } 359 360 return $actions; 344 361 345 362 }
Note: See TracChangeset
for help on using the changeset viewer.