Create a new perflab_create_background_job() function that creates a new job. The job will be a new term within the background_job taxonomy.
Acceptance Criteria
- Create a new
perflab_create_background_job() function
- Function accepts the following parameters
$job_name - A string the defines the job action to be run. This is required.
$job_data - An array of additional data to pass to the job action. This is optional and defaults to an empty array.
- The function will process the parameters and create a new
background_job term as follows.
- The
$job_name is used as the term name.
- The
$job_data will be assigned to the term as term meta with the key job_data.
- The function will return the following depending on success or failure.
- On failure, the function returns the
WP_Error from wp_insert_term.
- On success, the function returns the newly created Term ID.
Create a new
perflab_create_background_job()function that creates a new job. The job will be a new term within thebackground_jobtaxonomy.Acceptance Criteria
perflab_create_background_job()function$job_name- A string the defines the job action to be run. This is required.$job_data- An array of additional data to pass to the job action. This is optional and defaults to an empty array.background_jobterm as follows.$job_nameis used as the term name.$job_datawill be assigned to the term as term meta with the keyjob_data.WP_Errorfromwp_insert_term.