Skip to content

Commit f28652a

Browse files
committed
add active source to help tab
1 parent ac7991d commit f28652a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

classes/ActionScheduler_AdminView.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ public function add_help_tabs() {
251251
}
252252

253253
$as_version = ActionScheduler_Versions::instance()->latest_version();
254+
$as_source = ActionScheduler_Versions::instance()->active_source();
255+
254256
$screen->add_help_tab(
255257
array(
256258
'id' => 'action_scheduler_about',
@@ -261,6 +263,11 @@ public function add_help_tabs() {
261263
'<p>' .
262264
__( 'Action Scheduler is a scalable, traceable job queue for background processing large sets of actions. Action Scheduler works by triggering an action hook to run at some time in the future. Scheduled actions can also be scheduled to run on a recurring schedule.', 'action-scheduler' ) .
263265
'</p>' .
266+
'<h3>' . esc_html__( 'Source', 'action-scheduler' ) . '</h3>' .
267+
'<p>' .
268+
esc_html__( 'Because Action Scheduler can be included as a library in plugins and themes, the code block below indicates from where Action Scheduler is being loaded.', 'action-scheduler' ) .
269+
'</p>' .
270+
'<p><code>' . $as_source . '</code></p>' .
264271
'<h3>' . esc_html__( 'WP CLI', 'action-scheduler' ) . '</h3>' .
265272
'<p>' .
266273
sprintf(

classes/ActionScheduler_Versions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,8 @@ public static function initialize_latest_version() {
8686
$self = self::instance();
8787
call_user_func( $self->latest_version_callback() );
8888
}
89+
90+
public function active_source() {
91+
return trailingslashit( dirname( __DIR__ ) );
92+
}
8993
}

0 commit comments

Comments
 (0)