Skip to content

Commit 33f6000

Browse files
authored
Merge pull request #66 from circuscode/develop
CPT in Activity Widget
2 parents 263d207 + 1f0cad0 commit 33f6000

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Following standard features of the WordPress Core are manipulated or extended.
5353
### Dashboard
5454

5555
* Add Custom Post Types to At a Glance Widget
56+
* Add Custom Post Types to Activity Widget
5657

5758
### Editor
5859

@@ -214,6 +215,7 @@ Release pending.
214215
* Added: Block Editor Support Custom Post Type Pinseldisko
215216
* Added: Block Editor Support Custom Post Type Raketenstaub
216217
* Added: Fade Out UpdraftPlus Upgrade Message
218+
* Added: CPT in Activity Widget
217219
* Changed: Maintenance Mode Internal Processing
218220
* Changed: Depreciated TSF Filters replaced with the_seo_framework_meta_render_data
219221
* Removed: Adding Current Menu Item

unmus.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
require_once('unmus_menu.php');
4646
require_once('unmus_me.php');
4747
require_once('unmus_activitypub.php');
48+
require_once('unmus_widgets.php');
4849

4950
// Ensure that all required functions are available during setup
5051
require_once( ABSPATH . 'wp-admin/includes/upgrade.php');

unmus_widgets.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/**
4+
* Widgets
5+
*
6+
* @package unmus
7+
* @since 0.8
8+
*/
9+
10+
// Security: Stops code execution if WordPress is not loaded
11+
if (!defined('ABSPATH')) { exit; }
12+
13+
/**
14+
* Add Custom Post Types to Activity Widget
15+
*
16+
* @since 0.8
17+
*
18+
* @param query ?
19+
*
20+
*/
21+
22+
function add_cpt_to_dashboard_activity( $query ) {
23+
24+
$post_types = ['post', 'ello', 'podcast', 'pinseldisko'];
25+
$query['post_type'] = $post_types;
26+
return $query;
27+
28+
}
29+
add_filter( 'dashboard_recent_posts_query_args', 'add_cpt_to_dashboard_activity' );
30+
31+
?>

0 commit comments

Comments
 (0)