Download the PHP package waughj/wordpress-images without Composer

On this page you can find all versions of the php package waughj/wordpress-images. 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 wordpress-images

WordPress Images

Simple classes & shortcodes for easy image HTML generation from common image directories.

Description

This plugin has 6 main classes, with a shortcode for each 1.

Shorcodes:

Classes:

The regular image shortcode loads the exact source URL given, without a cache-corruption-breaking version parameter. It is mainly for use by other classes, like the next 2.

The regular picture shortcode loads %base%.%ext%, as well as extra sources based on the sizes given. Read https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture for mo' info on how the picture element works.

The theme image & picture shortcodes load images from the current theme directory.

The upload image & picture shortcodes load images from the uploads directory.

The thumbnail shortcode loads a post's thumbnail. If the post-id attribute is given, it loads the thumbnail o' that ID. If no ID is given, it tries to supply the ID o' whatever the current post is ( whatever get_the_ID() gives ). Img, source, & picture attributes can be given through %tag-name%-%attribute-name%. For example, to set the image's class, add img-class="%class%".

The HTML & Theme classes have near the same interface: a mandatory source & optional arguments. For the shortcodes, this means a "src" attribute as well as any other valid HTML attributes; for the classes, it means a hash map as an optional 2nd argument.

The WPUploadImage class takes a mandatory ID integer representing the ID o' the image in the media section o' the WordPress admin, the 2nd argument is an optional size string representing the slug o' the size type as registered in WordPress, with "responsive" for automatically an image that uses srcset to dynamically load the size for different window sizes, & the optional 3rd argument is a hash map for extra attributes, as 'bove.

The WPUploadPicture takes a mandatory ID integer & the optional attributes hash map.

In addition to any valid HTML attributes, the WPThemeImage & WPThemePicture classes also accept "directory" & they & the uploads classes accept the "show-version" attributes. The former, if set, will automatically put the source in the given directory; the "show-version" attribute, if set to false, won't try to find the image's last modified type to give it a version parameter for breaking cache corruption.

If "alt" attribute is not set, an empty 1 will automatically be added to the HTML generated, ensuring that all images made through these will have an alt tag.

To make working with theme image objects with minimal inconvenience for images that are all in the same directory that is not the topmost directory o' the theme directory, you can globally set the inner shared directory in the WordPress admin through Appearances -> Theme -> Directories, or directly in PHP with WPThemeImage's static setDefaultSharedDirectory method on the class itself. After that, all initialized WPThemeImage & WPThemePicture instances, including the shortcodes, will automatically use that shared directory if a different 1 isn't provided.

To add HTML attributes to WPThemePicture & WPUploadPicture shortcodes, prefix them with "img-", "picture-", or "source-" depending on what tag you want the attribute given to. For example, to apply a class to the img tag, give the shortcode the attribute "img-class".

Installation

Examples

use WaughJ\WPUploadImage\WPUploadImage;
echo new WPUploadImage
(
    31,
    [
        'class' => 'center-img portrait',
        'alt' => 'King'
    ]
);

&

[upload-image media-id="31" class="center-img portrait" alt="King"]

Will generate something like <img class="center-img portrait" alt="King" src="https://www.domain.com/wp-content/uploads/2018/12/demo-150x150.png?m=1543875777" />

use WaughJ\WPThemeImage\WPThemeImage;
WPThemeImage::setDefaultSharedDirectory( 'img' );
echo new WPThemeImage( 'photo.jpg' );

Will generate something like <img src="https://www.domain.com/wp-content/themes/theme-slug/img/photo.jpg?m=1543875777" alt="" />

[upload-picture media-id="8"]

Will generate something like <picture><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-150x150.jpg?m=1543875777" media="(max-width:150px)"><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-300x300.jpg?m=1543875781" media="(max-width:300px)"><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-768x768.jpg?m=1543875785" media="(max-width:768px)"><source srcset="https://www.example.com/wp-content/uploads/2018/12/photo-1024x1024.jpg?m=1543875831"><img src="https://www.example.com/wp-content/uploads/2018/12/photo-150x150.jpg?m=1543875777" alt="" /></picture>

For mo’ information on how each class works, check out their documentation @ https://github.com/waughjai?tab=repositories

Changelog

3.1.1

3.1.0

3.0.2

3.0.1

3.0.0

2.2.1

2.2.0

2.1.1

2.1.0

2.0.1

2.0

1.3

1.2

1.1

1.0


All versions of wordpress-images with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
waughj/wp-theme-image Version >=0.3.1
waughj/wp-theme-picture Version >=0.3.1
waughj/wp-upload-image Version >=0.5.3
waughj/wp-upload-picture Version >=0.5.3
waughj/wp-theme-option Version >=0.1.1
waughj/wp-post-thumbnail Version >=0.4.2
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 waughj/wordpress-images contains the following files

Loading the files please wait ....