PluginProbe
Document Gallery / 1.4.1
Document Gallery v1.4.1
trunk 0.8 0.8.5 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 2.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 94 releases
document-gallery / document-gallery.php

document-gallery.php in Document Gallery 1.4.1, at document-gallery.php

41 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 Plugin Name: Document Gallery
5 Description: Display non-images (and images) in gallery format on a page or post with the [dg] shortcode.
6 Version: 1.4.1
7 Author: Dan Rossiter
8 Author URI: http://danrossiter.org/
9 License: GPLv2
10 */
11
12 define('DG_URL', plugin_dir_url(__FILE__));
13 define('DG_PATH', dirname(__FILE__).'/');
14
15 /**
16 * Takes values passed from attributes and returns sutable HTML to represent
17 * all valid attachments requested.
18 *
19 * @param array $atts Arguments from the user.
20 * @return string HTML for the Document Gallery.
21 */
22 function dg_get_attachment_icons($atts) {
23 include_once(DG_PATH . 'models/class-gallery.php');
24
25 // empty string is passed when no arguments are given, but constructor expects an array
26 return (string)(new DG_Gallery(empty($atts) ? array() : $atts));
27 }
28
29 /**
30 * 'document gallery' shortcode depreciated as of v1.0. left for backward compatibility
31 */
32 add_shortcode('document gallery', 'dg_get_attachment_icons');
33 add_shortcode('dg', 'dg_get_attachment_icons');
34
35 /**
36 * Include stylesheet for some basic design.
37 */
38 function dg_add_header_css() {
39 wp_enqueue_style('document-gallery-css', DG_URL . 'style.css');
40 }
41 add_action('wp_print_styles', 'dg_add_header_css');