Skip to content

Regenerate Existing Images Job: Create main settings screen #486

@mxbclang

Description

@mxbclang

Create a admin settings screen to start the Regenerate Existing Images background job. This will be a new screen available under the 'Tools' menu and display basic settings to start the Regenerate Existing Images background job.

Acceptance Criteria

  • Create a new admin settings screen under “Tools > Regenerate Images”
  • This screen is only accessible to users with the upload_files and manage_options capabilities.
  • The screen will display the following on the page
    • The title "Regenerate Existing Images"
    • A brief description explaining the feature
    • A basic form containing the following controls:
      • A "Regenerate Images" button that will start the Regenerate Existing Images background job.
      • A delete_images checkbox to delete old images. By default the checkbox is unchecked.
  • When the form is submitted, the POST request is handled by doing the following:
    • Validate the form submission with wp_verify_nonce
    • Check the delete_images checkbox value
    • Create a new background job with the perflab_create_background_job function passing the following
      • regenerate_images as the job name
      • array( 'delete_images' => $delete_images ) as the job data, passing the value of the delete_images checkbox as part of the data
    • Using the $job_id returned by perflab_start_background_job function
      • Passing the newly created $job_id returned by the perflab_create_background_job function

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions