PluginProbe
Document Gallery / 1.4
Document Gallery v1.4
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, at document-gallery.php

39 lines 1.1 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
7 Author: Dan Rossiter
8 Author URI: http://danrossiter.org/
9 License: GPL2
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 return (string)(new DG_Gallery($atts));
25 }
26
27 /**
28 * 'document gallery' shortcode depreciated as of v1.0. left for backward compatibility
29 */
30 add_shortcode('document gallery', 'dg_get_attachment_icons');
31 add_shortcode('dg', 'dg_get_attachment_icons');
32
33 /**
34 * Include stylesheet for some basic design.
35 */
36 function dg_add_header_css() {
37 wp_enqueue_style('document-gallery-css', DG_URL . 'style.css');
38 }
39 add_action('wp_print_styles', 'dg_add_header_css');