Skip to content

Create Background Processing Infrastructure: Create perflab_create_background_job function #479

@mxbclang

Description

@mxbclang

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions