https://github.com/sleeplessbyte/wp-dj-thumbnails
Wordpress plugin for an thumbnail fallback system. Will only display thumbnails when of the required thumbnail size.
https://github.com/sleeplessbyte/wp-dj-thumbnails
Last synced: 4 months ago
JSON representation
Wordpress plugin for an thumbnail fallback system. Will only display thumbnails when of the required thumbnail size.
- Host: GitHub
- URL: https://github.com/sleeplessbyte/wp-dj-thumbnails
- Owner: SleeplessByte
- Created: 2013-02-04T21:30:27.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-05T19:26:40.000Z (over 12 years ago)
- Last Synced: 2024-10-18T19:46:51.455Z (8 months ago)
- Language: PHP
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
wp-dj-thumbnails
================Wordpress plugin for an thumbnail fallback system. Will only display thumbnails when of the required
thumbnail size.Filters:
* `get_fallback_tree_items` : runs before the fallback tree is created
* `get_required_thumbsize` : runs on the admin page. requires this sizeYou can use the first filter to add new fallback items. Simply provide a name, a function and a name
after which this item is inserted.````php
function get_fallback_tree_items( $fallback_items ) {
$fallback_items[ ::name:: ] = array('function' => ::function::, 'after' => ::name:: or null );
return $fallback_items;
}
````The function header for fallback_items is
````php
function function_name( $post_id, $args = array() )
````And should return an `array` or `NULL`.
You can use the second filter to change the required thumbsize. It should return a `string` or and `array` with sizes.
This will be used by default when querying for thumbnails.