This repository was archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO
71 lines (48 loc) · 2.4 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
2013-2-7
Use new WP_Image_Editor class
http://codex.wordpress.org/Class_Reference/WP_Image_Editor
$image = wp_get_image_editor( 'cool_image.jpg' );
// Return an implementation that extends <tt>WP_Image_Editor</tt>
if ( ! is_wp_error( $image ) ) {
$image->rotate( 90 );
$image->crop(src_x, src_y, src_width, src_height);
$image->resize( 300, 300, true );
$image->save( 'new_image.jpg' );
}
-- note, save() with no arguments automatically uses the original filename and extension,
but appends the "-300x300" at the appropriate place (thereby eliminating quite a bit of
our code). (~~~ VERIFY!)
http://codex.wordpress.org/Function_Reference/wp_get_image_editor
-- note, you can retrieve an image by URL! However save() requires a local filename...
which probably ought to live under the uploads/ directory... somehow?
~~~ Find best practices.
Another example, although recommend using wp_get_image_editor() instead:
http://markoheijnen.com/wordpress-new-image-manipulation/
-----------
2013-04-10
Support version 3.6 functions to grab images from galleries, not just actually Attached images
As per http://core.trac.wordpress.org/ticket/22960
As of 2013-07-07: get_content_galleries() grabs [gallery]s from passed
content and returns structured data, which currently is only one
node: src ,which contains a list of image URLs. In the future, more
nodes can hold more data about the gallery
Note 2015:
https://developer.wordpress.org/reference/functions/get_attached_media/
e.g., get_attached_media('image', $post) returns the list of
attached images.
----------
2014-09-06
Version 3.6 obsoleted get_content_galleries() so it's good we didn't
use it. Here are the functions added to 3.6 according to
http://weston.ruter.net/2013/07/30/list-of-functions-removed-from-wordpress-3-6-rc2-since-beta-3/
---begin---
function get_attached_media( $type, $post = 0 ) {
function get_media_embedded_in_content( $content, $types = null ) {
function get_post_galleries( $post, $html = true ) {
function get_post_galleries_images( $post = 0 ) {
function get_post_gallery( $post = 0, $html = true ) {
function get_post_gallery_images( $post = 0 ) {
---end---
From the Codex http://codex.wordpress.org/Function_Reference/get_post_galleries
get_post_galleries returns a list of arrays, each containing gallery
data and srcs parsed from the expanded shortcode.