WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/get post galleries"

m (Return)
(Added basic info about this function)
Line 1: Line 1:
 
==Description==
 
==Description==
  +
Retrieve galleries from the passed post's content.
   
 
==Parameters==
 
==Parameters==
{{Parameter|$var|TYPE|Description.}}
+
{{Parameter|$post|mixed|Post ID or object.|optional}}
{{Parameter|$var|TYPE|Description.|optional|DEFAULT}}
+
{{Parameter|$html|boolean|Whether to return HTML or data in the array.|optional|true}}
   
 
== Return ==
 
== Return ==
{{Return||TYPE|Description.}}
+
{{Return||array|A list of arrays, each containing gallery data and srcs parsed from the expanded shortcode.}}
   
 
== Usage ==
 
== Usage ==
%%% <?php ?> %%%
+
%%% <?php $galleries = get_post_galleries($post); ?> %%%
   
==Example==
+
<!--==Example==
 
Description text
 
Description text
 
<pre>
 
<pre>
 
Example code
 
Example code
 
</pre>
 
</pre>
+
-->
 
==Change Log==
 
==Change Log==
 
* Since: [[Version 3.6|3.6.0]]
 
* Since: [[Version 3.6|3.6.0]]
Line 22: Line 23:
 
== Source File ==
 
== Source File ==
 
<!-- Need links to current source code files -->
 
<!-- Need links to current source code files -->
<tt>get_post_galleries()</tt> is located in {{Trac|wp-whatever/file.php}}.
+
<tt>get_post_galleries()</tt> is located in {{Trac|wp-includes/media.php}}.
   
 
==Related==
 
==Related==

Revision as of 17:17, 6 August 2013

Description

Retrieve galleries from the passed post's content.

Parameters

$post
(mixed) (optional) Post ID or object.
Default: None
$html
(boolean) (optional) Whether to return HTML or data in the array.
Default: true

Return

(array) 
A list of arrays, each containing gallery data and srcs parsed from the expanded shortcode.

Usage

 <?php $galleries get_post_galleries($post); ?> 

Change Log

Source File

get_post_galleries() is located in wp-includes/media.php.

Related

Function ref links

This article is marked as in need of editing. You can help Codex by editing it.