Skip to content

Commit

Permalink
Rename plugin, fix a few typos, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvanpatten committed Sep 26, 2018
1 parent 35c7406 commit 0333a6f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,21 @@ public function page()
$continue = ($_GET['repeating-task-runner-continue'] ?? false) ? ' checked' : '';

// Grab the available tasks
$tasks = $this->getTasks();
$tasks = $this->container['framework']->getTasks();

// Simplify the tasks into an array
$tasks = array_map(function ($task) {
$tasks = array_map(function ($task) use ($slug){
return [
'slug' => sanitize_title($task->slug),
'name' => esc_html($task->name),
'slug' => sanitize_title($task->slug),
'name' => esc_html($task->name),
'selected' => $task->slug === $slug,
];
}, $tasks);

$selectDefaultOption = empty($slug) ? 'selected' : '';

// Load the template
require dirname(__DIR__) . '../views/page.php';
require trailingslashit(dirname(__DIR__)) . 'views/page.php';

return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Framework extends Base
/**
* @var array
*/
public $tasks;
public $tasks = [];

/**
* Register a task
Expand Down
5 changes: 3 additions & 2 deletions views/page.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div class="wrap">
<h2>Bulk Tasks</h2>
<h2>Repeating Task Runner</h2>

<form method="post" action="admin-post.php" id="repeating-task-runner">
<h3>Execute a bulk task</h3>
<p>Executes a given task with a starting offset and iteration count</p>

<table class="form-table">
Expand All @@ -12,6 +11,8 @@
<select id="repeating-task-runner-task" name="repeating-task-runner-task">
<?php if (empty($tasks)) : ?>
<option value="" selected disabled>No tasks registered</option>
<?php else : ?>
<option value="" <?php echo $selectDefaultOption; ?> disabled>Select a task to run</option>
<?php endif; ?>

<?php foreach ($tasks as $task) : ?>
Expand Down
2 changes: 1 addition & 1 deletion wp-repeating-task-runner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Plugin Name: VPM Bulk Commands
* Plugin Name: Tomodomo › Repeating Task Runner
* Plugin URI: https://www.vanpattenmedia.com/
* Version: 3.0.0
* Description: Execute custom commands in bulk in the WordPress admin area
Expand Down

0 comments on commit 0333a6f

Please sign in to comment.