Download the PHP package humanmade/publication-checklist without Composer

On this page you can find all versions of the php package humanmade/publication-checklist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package publication-checklist

Publication Checklist

Run checks and enforce conditions before posts are published. Built and designed for the WordPress block editor.

Publication Checklist provides a framework for building out prepublish checks, with flexibility to fit your workflows.

Demo Plugin

If you prefer to get a boilerplate plugin to add checks and start playing with existing code directly you can download, install and activate the demo plugin available here:

https://github.com/humanmade/demo-publication-checklist

Creating checks

The core of a check is a function that receives the post's data and meta, and returns a Status object. This status object indicates whether publish should be blocked or not.

For example, to enforce setting a value for the "foo" meta key:

Checks are registered via the Altis\Workflow\PublicationChecklist\register_prepublish_check function with a unique ID. This function should be called on the altis.publication-checklist.register_prepublish_checks action.

Note: the altis.publication-checklist.register_prepublish_checks action runs on the plugins_loaded hook so you should make sure your add_action() call is run as soon as your custom plugin file is included or in your theme functions.php. Do not wrap it in a hook such as init or after_setup_theme.

Your check function receives the post data as an array, and the post's meta data as an array. Your function should only use this data to run the check, as this may represent data before it is saved to the database. Specifically, your function's signature should be:

Your function must return an Altis\Workflow\PublicationChecklist\Status object. This object is marked as either complete (allow publishing), incomplete (block publishing), or informational (show as failed, but allow publishing). This status object takes the status type (which should be either Status::COMPLETE, Status::INCOMPLETE, or Status::INFO) and a human-readable message.

$post is an array of post data, matching the shape returned by get_post( $id, ARRAY_A ). $meta is an array of meta data, in the format string $key => mixed|mixed[] $value. $terms is an array of terms, in the format string $taxonomy => int[] $terms.

You can additionally pass data with the status object, which can be used on the frontend to assist with rendering.

By default, checks will only run against the post post type. You can pass the relevant type(s) as a type option:

Displaying check status

By default, Publication Checklist will render a simple checklist of all checks.

You can override a specific item to render richer UI if needed. For example, you may wish to integrate deeply into the block editor, or allow users to correct failing checks inline. This UI is directly inserted into the React element tree and replaces the default output.

Publication Checklist exposes a altis-publishing-workflow.item.{check_id} filter using withFilters to allow overriding the list item component.

For example, to wrap the default status message with a link to a documentation page for the foo check:

Your component receives the following props:

To enable advanced functionality, you may want to wrap this component in selectors which provide data about the post. Note that the backend acts as the canonical source of all check data, so changes to check status will require saving to the backend to take effect.

Enforcing checks

To enforce these checks and block publication, filter the altis.publication-checklist.block_on_failing value and return true from your callback. This will change the UI to disable the publish button, display a user-facing message that checks must be completed, and block requests to publish the post.

Modifying the list view

Publication Checklist will add a Tasks column to the Posts list screen showing the status of each post. This column is only shown if statuses have been registered.

Hiding the tasks column

To hide this column, filter the altis.publication-checklist.show_tasks_column value and return false from your callback. This will hide the Tasks column.

Changing the location of the tasks column

The tasks column appears after the title column by default on supported post types.

To change which column the tasks column appears after use the altis.publication-checklist.show_tasks_after_column filter and return the desired column slug such as title, author or tags for example.

License

Publication Checklist is licensed under the GPLv2 or later. Copyright 2019 Human Made and contributors.


All versions of publication-checklist with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package humanmade/publication-checklist contains the following files

Loading the files please wait ....