Download the PHP package jmichaelward/set-post-thumbs without Composer

On this page you can find all versions of the php package jmichaelward/set-post-thumbs. 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 set-post-thumbs

Set Post Thumbs

A simple WP-CLI command to query posts for their content and set the first found image as the post thumbnail.

Installation

Preferred

There are two preferred ways to install this package:

First, using WP-CLI's package installer command. Simply run wp package install jmichaelward/set-post-thumbs in the command line, then you're good to go.

Second, you can similarly install it using Composer. In the terminal, enter:

Assuming you're already using Composer's class autoloader in your WordPress project, then you can then call the function JMichaelWard\SetPostThumbs\init_thumbnail_command() inside an mu-plugins PHP file, an active plugin, or your theme's functions.php file.

Alternate

Alternately, you can clone down this repository. Then, require the set-post-thumbs.php file relative to your file path. This will make the JMichaelWard\SetPostThumbs\init_thumbnail_command() method available to your project.

Usage

Once active, this package registers a thumbnail command with WP-CLI. A brief synopsis of the available subcommands is below. Please run wp help thumbnail to see the full set of options.

Without options, this will attempt to set a post thumbnail on the first 500 posts WordPress can find without a featured image. You may request that this processes on all posts by passing the --all flag, or a specified amount of posts by using --amount=<amount>. Posts are the default post type, but you can specify other post types with the --post_type flag.

Passing unset will return a list of post IDs that were processed, but which the command was unable to set a featured image.

Passing multiple will return a list of post IDs that were processed and where a featured image was set, but where the posts contained multiple images in the content.

As before, passing the --post_type flag will query the selected post type.

This command queries all posts which have metadata generated by the above commands, then subsequently removes that metadata. I recommend running this command after assigning your featured images with this tool to clear out the unnecessary metadata, as it's primarily used for reporting with the wp thumbnail show command.

Extending the command

The ThumbnailCommand class located in the src/ directory makes the above commands available to you. By default, the thumbnail command looks for images within your post content and assigns the first one it finds as the post's featured image. However, your site may have image data located in other places that you may wish to use to set as a featured image. The ThumbnailCommand class is designed to be extended so that you can create your own command from this scenario. The maybe_set_featured_image method should be your primary starting point for extension.


All versions of set-post-thumbs with dependencies

PHP Build Version
Package Version
Requires wp-cli/wp-cli Version ^2.4
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 jmichaelward/set-post-thumbs contains the following files

Loading the files please wait ....