Version Description
- New: In the
[mla_gallery]
shortcode, a newmla_target
parameter allows you to specify the HTMLtarget
attribute in the gallery item links, e.g.,mla_target="_blank"
will open the items in a new window or tab. - New: In the
[mla_gallery]
shortcode, a newtax_operator
parameter allows you to specify "AND" or "NOT IN" operators in the simpletax_name=term(s)
version of taxonomy queries. See the Settings/Media Library Assistant Documentation page for details. - New: In the
[mla_gallery]
shortcode,tax_query
corruption caused by the Visual mode of the post/page editor is now cleaned up before the query is submitted; Line breaks, HTML markup and escape sequences added by the Visual editor are removed. - Fix: IPTC/EXIF values containing an arrray, e.g., "2#025 keywords", will be converted to a comma-separated string before assignment to Standard fields or Custom fields.
- Fix: Custom Field Mapping will always ignore rules with Data Source set to "-- None (select a value) --".
- Fix: In the
[mla_gallery]
shortcode, theorderby
parameter will override the explicit order in theids
parameter. - Fix: In the
[mla_gallery]
shortcode, theids
andinclude
parameters no longer requirepost_parent=all
to match items not attached to the current post/page. - Fix: The
[mla_gallery]' shortcode can now be called without a current post, e.g., from a PHP file that contains
do_shortcode("[mla_gallery]");`. - Fix: The value in the Attachments column in the edit taxonomy screen(s) is now correct. In previous versions this value was not correct if a term appeared in more than ten (10) attachments.
- Fix: The Attachments column in the edit taxonomy screen(s) is now updated in response to the WordPress "Quick Edit" action for taxonomy terms. In previous versions the Attachments value was not returned and the Posts/Media value was used instead.
- Fix: The Attachments column in the edit taxonomy screen(s) is now center-justified, following the standard set by the WordPress Posts/Media column. In previous versions it was left-justified.
- Fix: Corrected
vertical-align
attribute in.gallery-caption
style of the defaultmla_style
template. - Fix: Better handling of minimum PHP and WordPress version violations; removed wp_die() calls.
Download this release
Release Info
Developer | dglingren |
Plugin | Media Library Assistant |
Version | 1.14 |
Comparing to | |
See all releases |
Code changes from version 0.1 to 1.14
- css/mla-edit-tags-style.css +12 -0
- css/mla-style.css +68 -0
- includes/class-mla-data.php +1537 -271
- includes/class-mla-edit-media.php +407 -0
- includes/class-mla-list-table.php +597 -306
- includes/class-mla-main.php +872 -377
- includes/class-mla-objects.php +196 -0
- includes/class-mla-options.php +2569 -0
- includes/class-mla-settings.php +1525 -330
- includes/class-mla-shortcodes.php +1508 -0
- includes/mla-objects.php +0 -172
- includes/mla-plugin-loader.php +110 -0
- includes/mla-shortcodes.php +0 -94
- index.php +86 -47
- js/mla-inline-edit-scripts.js +252 -0
- js/mla-inline-edit-scripts.min.js +1 -0
- js/{mla-scripts.js → mla-single-edit-scripts.js} +18 -20
- js/mla-single-edit-scripts.min.js +1 -0
- phpDocs/classes.svg +55 -27
- phpDocs/classes/MLA.html +171 -85
- phpDocs/classes/MLAData.html +524 -74
- phpDocs/classes/MLAEdit.html +348 -0
- phpDocs/classes/MLAObjects.html +173 -0
- phpDocs/classes/MLAOptions.html +1013 -0
- phpDocs/classes/MLASettings.html +453 -79
- phpDocs/classes/MLAShortcodes.html +326 -0
- phpDocs/classes/MLATest.html +38 -17
- phpDocs/classes/MLA_List_Table.html +217 -103
- phpDocs/deprecated.html +4 -7
- phpDocs/errors.html +7 -7
- phpDocs/graph_class.html +4 -7
- phpDocs/index.html +5 -8
- phpDocs/markers.html +4 -7
- phpDocs/namespaces/global.html +44 -114
- phpDocs/packages/Default.html +0 -71
- phpDocs/packages/Media Library Assistant.html +54 -132
- phpDocs/structure.xml +3216 -739
css/mla-edit-tags-style.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
/**
|
3 |
+
* CSS Document
|
4 |
+
*
|
5 |
+
* This file contains styling attributes for the taxonomy "edit-tags.php" page, adapted from wp-admin.css and given unique names
|
6 |
+
* to avoid conflicts.
|
7 |
+
*/
|
8 |
+
|
9 |
+
.column-attachments {
|
10 |
+
text-align: center;
|
11 |
+
}
|
12 |
+
|
css/mla-style.css
CHANGED
@@ -6,6 +6,19 @@
|
|
6 |
* to avoid conflicts.
|
7 |
*/
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
/*
|
10 |
* MLA List Table ID_parent column
|
11 |
*/
|
@@ -61,3 +74,58 @@ textarea[readonly] {
|
|
61 |
.mla-media-item .describe textarea {
|
62 |
width: 100%
|
63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
* to avoid conflicts.
|
7 |
*/
|
8 |
|
9 |
+
/*
|
10 |
+
* MLA List Table, single edit and settings page message DIV
|
11 |
+
*/
|
12 |
+
div.mla_messages {
|
13 |
+
background:#FFFFE0;
|
14 |
+
border:1px solid #CCC;
|
15 |
+
padding:0 10px;
|
16 |
+
margin-top:5px;
|
17 |
+
border-radius:5px;
|
18 |
+
-moz-border-radius:5px;
|
19 |
+
-webkit-border-radius:5px;
|
20 |
+
}
|
21 |
+
|
22 |
/*
|
23 |
* MLA List Table ID_parent column
|
24 |
*/
|
74 |
.mla-media-item .describe textarea {
|
75 |
width: 100%
|
76 |
}
|
77 |
+
|
78 |
+
/*
|
79 |
+
* MLA Inline editing - adapted from load-styles.php
|
80 |
+
*/
|
81 |
+
.mla_bulk_taxonomy_options {
|
82 |
+
margin-bottom: 10px
|
83 |
+
}
|
84 |
+
|
85 |
+
#wpbody-content .quick-edit-row-attachment .inline-edit-col-left,
|
86 |
+
#wpbody-content .bulk-edit-row-attachment .inline-edit-col-left {
|
87 |
+
width: 40%
|
88 |
+
}
|
89 |
+
|
90 |
+
#wpbody-content .quick-edit-row-attachment .inline-edit-col-center,
|
91 |
+
#wpbody-content .bulk-edit-row-attachment .inline-edit-col-center {
|
92 |
+
width: 20%
|
93 |
+
}
|
94 |
+
|
95 |
+
#wpbody-content .quick-edit-row-attachment .inline-edit-col-right,
|
96 |
+
#wpbody-content .bulk-edit-row-attachment .inline-edit-col-right {
|
97 |
+
width: 39%
|
98 |
+
}
|
99 |
+
|
100 |
+
.quick-edit-row-attachment fieldset.inline-edit-col-left label span.title,
|
101 |
+
.bulk-edit-row-attachment fieldset.inline-edit-col-right label span.title {
|
102 |
+
width: 6em
|
103 |
+
}
|
104 |
+
|
105 |
+
.quick-edit-row-attachment fieldset.inline-edit-col-left label span.input-text-wrap,
|
106 |
+
.bulk-edit-row-attachment fieldset.inline-edit-col-right label span.input-text-wrap {
|
107 |
+
margin-left: 6em
|
108 |
+
}
|
109 |
+
|
110 |
+
.quick-edit-row-attachment fieldset.inline-edit-col-left label.inline-edit-post-parent span.input-text-wrap,
|
111 |
+
.bulk-edit-row-attachment fieldset.inline-edit-col-right label.inline-edit-post-parent span.input-text-wrap {
|
112 |
+
width: 5em
|
113 |
+
}
|
114 |
+
|
115 |
+
.quick-edit-row-attachment fieldset.inline-edit-col-left label.inline-edit-menu-order span.input-text-wrap {
|
116 |
+
width: 5em
|
117 |
+
}
|
118 |
+
|
119 |
+
.quick-edit-row-attachment fieldset.inline-edit-col-right label span.title,
|
120 |
+
.bulk-edit-row-attachment fieldset.inline-edit-col-right label.inline-edit-tags span.title {
|
121 |
+
width: 99%
|
122 |
+
}
|
123 |
+
|
124 |
+
/*
|
125 |
+
* MLA Settings page
|
126 |
+
*/
|
127 |
+
|
128 |
+
ul.mla_settings {
|
129 |
+
list-style-type: disc;
|
130 |
+
list-style-position: inside
|
131 |
+
}
|
includes/class-mla-data.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Database and template file access for MLA needs
|
4 |
*
|
5 |
* @package Media Library Assistant
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
-
|
9 |
/**
|
10 |
-
* Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
11 |
*
|
12 |
* The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials."
|
13 |
* Templates separate HTML markup from PHP code for easier maintenance and localization.
|
@@ -16,13 +16,34 @@
|
|
16 |
* @since 0.1
|
17 |
*/
|
18 |
class MLAData {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
/**
|
20 |
* Initialization function, similar to __construct()
|
21 |
*
|
22 |
* @since 0.1
|
23 |
*/
|
24 |
public static function initialize() {
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
|
28 |
/**
|
@@ -34,21 +55,42 @@ class MLAData {
|
|
34 |
*
|
35 |
* @since 0.1
|
36 |
*
|
37 |
-
* @param string
|
|
|
38 |
*
|
39 |
-
* @return string
|
40 |
-
*
|
41 |
-
*
|
42 |
-
*
|
|
|
43 |
*/
|
44 |
-
public static function mla_load_template( $
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
$match_count = preg_match_all( '#\<!-- template=".+" --\>#', $template, $matches, PREG_OFFSET_CAPTURE );
|
@@ -64,24 +106,58 @@ class MLAData {
|
|
64 |
$template_key = preg_split( '#"#', $value[0] );
|
65 |
$template_key = $template_key[1];
|
66 |
$template_value = substr( $template, $value[1] + strlen( $value[0] ), $current_offset - ( $value[1] + strlen( $value[0] ) ) );
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
$current_offset = $value[1];
|
69 |
-
}
|
70 |
|
71 |
return $template_array;
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
-
* Expand a template, replacing place holders with their values
|
76 |
*
|
77 |
* A simple parsing function for basic templating.
|
78 |
*
|
79 |
* @since 0.1
|
80 |
*
|
81 |
-
* @param string
|
82 |
-
* @param array
|
83 |
*
|
84 |
-
* @return string Placeholders corresponding to the keys of the hash will be replaced with their values
|
85 |
*/
|
86 |
public static function mla_parse_template( $tpl, $hash ) {
|
87 |
foreach ( $hash as $key => $value ) {
|
@@ -93,185 +169,632 @@ class MLAData {
|
|
93 |
}
|
94 |
|
95 |
/**
|
96 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
*
|
98 |
* Prepare the arguments for WP_Query.
|
99 |
* Modeled after wp_edit_attachments_query in wp-admin/post.php
|
100 |
-
* NOTE: The caller must remove the 'posts_where' filter, if required.
|
101 |
*
|
102 |
* @since 0.1
|
103 |
*
|
104 |
-
* @param array
|
|
|
|
|
105 |
*
|
106 |
* @return array revised arguments suitable for WP_Query
|
107 |
*/
|
108 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/*
|
110 |
-
*
|
111 |
*/
|
112 |
-
|
|
|
|
|
|
|
113 |
|
114 |
/*
|
115 |
-
*
|
116 |
-
*
|
117 |
-
* cat = '0' is "All Categories", i.e., no filtering
|
118 |
-
* cat = '-1' is "No Categories"
|
119 |
*/
|
120 |
-
if ( isset( $
|
121 |
-
if ( $
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
|
147 |
-
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
array(
|
150 |
-
'taxonomy' => '
|
151 |
'field' => 'slug',
|
152 |
-
'terms' => $
|
153 |
'include_children' => false
|
154 |
)
|
155 |
);
|
156 |
|
157 |
-
unset( $
|
158 |
-
|
|
|
159 |
|
160 |
-
$
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
164 |
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
/*
|
168 |
-
*
|
|
|
|
|
169 |
*/
|
170 |
-
if (
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
|
176 |
/**
|
177 |
-
*
|
178 |
-
*
|
179 |
-
*
|
180 |
-
* Modeled after wp_edit_attachments_query in wp-admin/post.php
|
181 |
*
|
182 |
-
* @since 0.
|
183 |
*
|
184 |
-
* @param
|
185 |
-
* @param
|
186 |
-
* @param string $order ASC or DESC
|
187 |
-
* @param int $offset number of rows to skip over to reach desired page
|
188 |
-
* @param int $count number of rows on each page
|
189 |
*
|
190 |
-
* @return
|
191 |
*/
|
192 |
-
public static function
|
193 |
-
$
|
194 |
-
|
195 |
/*
|
196 |
-
*
|
197 |
-
* so we can't use the database column to identify the column but
|
198 |
-
* we actually sort on the database column.
|
199 |
*/
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
$request['orderby'] = $orderby;
|
204 |
-
$request['order'] = strtoupper( $order );
|
205 |
-
|
206 |
-
if ( ( (int) $count ) > 0 ) {
|
207 |
-
$request['offset'] = $offset;
|
208 |
-
$request['posts_per_page'] = $count;
|
209 |
-
}
|
210 |
-
|
211 |
-
$results = new WP_Query( $request );
|
212 |
-
|
213 |
-
if ( isset( $request['detached'] ) )
|
214 |
-
remove_filter( 'posts_where', 'MLAData::mla_query_list_table_items_helper' );
|
215 |
-
|
216 |
-
$attachments = $results->posts;
|
217 |
-
|
218 |
-
foreach ( $attachments as $index => $attachment ) {
|
219 |
/*
|
220 |
-
*
|
221 |
*/
|
222 |
-
|
223 |
-
|
224 |
-
$attachments[ $index ]->$parent_key = $parent_value;
|
225 |
}
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
$attachments[ $index ]->$meta_key = $meta_value;
|
233 |
}
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
$
|
238 |
-
$
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
-
return $
|
242 |
}
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
/**
|
245 |
* Adds a WHERE clause for detached items
|
246 |
*
|
247 |
-
* Modeled after _edit_attachments_query_helper in wp-admin/post.php
|
248 |
-
* Defined as public
|
249 |
*
|
250 |
* @since 0.1
|
251 |
*
|
252 |
-
* @param string
|
253 |
*
|
254 |
* @return string query clause after "detached" item modification
|
255 |
*/
|
256 |
-
public static function
|
257 |
global $table_prefix;
|
258 |
-
|
259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
}
|
261 |
|
262 |
/**
|
263 |
-
* Retrieve an Attachment array given a $post_id
|
264 |
*
|
265 |
* The (associative) array will contain every field that can be found in
|
266 |
* the posts and postmeta tables, and all references to the attachment.
|
267 |
*
|
268 |
* @since 0.1
|
|
|
269 |
*
|
270 |
-
* @param int
|
271 |
-
* @return
|
272 |
*/
|
273 |
function mla_get_attachment_by_id( $post_id ) {
|
274 |
-
global $
|
275 |
|
276 |
$item = get_post( $post_id );
|
277 |
if ( empty( $item ) ) {
|
@@ -291,12 +814,12 @@ class MLAData {
|
|
291 |
/*
|
292 |
* Add parent data
|
293 |
*/
|
294 |
-
$post_data = array_merge( $post_data, self::
|
295 |
|
296 |
/*
|
297 |
* Add meta data
|
298 |
*/
|
299 |
-
$post_data = array_merge( $post_data, self::
|
300 |
|
301 |
/*
|
302 |
* Add references
|
@@ -307,67 +830,169 @@ class MLAData {
|
|
307 |
}
|
308 |
|
309 |
/**
|
310 |
-
*
|
311 |
-
*
|
312 |
-
* Searches all post and page content to see if the attachment is used
|
313 |
-
* as a Featured Image or inserted in the post as an image or link.
|
314 |
*
|
315 |
* @since 0.1
|
316 |
*
|
317 |
-
* @param int
|
318 |
-
* @param int $parent post ID of attachment's parent, if any
|
319 |
*
|
320 |
-
* @return array
|
321 |
*/
|
322 |
-
public static function
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
* parent_title post_title of the attachment's parent
|
|
|
342 |
*/
|
343 |
$references = array(
|
|
|
344 |
'found_reference' => false,
|
345 |
'found_parent' => false,
|
346 |
'is_unattached' => ( ( (int) $parent ) === 0 ),
|
347 |
'base_file' => '',
|
348 |
'path' => '',
|
|
|
349 |
'files' => array(),
|
350 |
'features' => array(),
|
351 |
'inserts' => array(),
|
352 |
-
'
|
|
|
353 |
'parent_type' => '',
|
354 |
-
'parent_title' => ''
|
|
|
355 |
);
|
356 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
$attachment_metadata = get_post_meta( $ID, '_wp_attachment_metadata', true );
|
358 |
if ( empty( $attachment_metadata ) ) {
|
359 |
$references['base_file'] = get_post_meta( $ID, '_wp_attached_file', true );
|
360 |
-
|
361 |
-
|
362 |
-
$references['path'] = substr( $references['base_file'], 0, $last_slash + 1 );
|
363 |
-
$references['file'] = substr( $references['base_file'], $last_slash + 1 );
|
364 |
-
} else {
|
365 |
$references['base_file'] = $attachment_metadata['file'];
|
366 |
-
$
|
367 |
-
$last_slash = strrpos( $references['base_file'], '/' );
|
368 |
-
$references['path'] = substr( $references['base_file'], 0, $last_slash + 1 );
|
369 |
-
$references['file'] = substr( $references['base_file'], $last_slash + 1 );
|
370 |
-
$sizes = $attachment_metadata['sizes'];
|
371 |
if ( !empty( $sizes ) ) {
|
372 |
/* Using the name as the array key ensures each name is added only once */
|
373 |
foreach ( $sizes as $size ) {
|
@@ -375,140 +1000,781 @@ class MLAData {
|
|
375 |
}
|
376 |
|
377 |
}
|
378 |
-
}
|
379 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
/*
|
381 |
-
* Look for the "Featured Image(s)"
|
382 |
*/
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
|
393 |
-
|
394 |
-
$
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
|
409 |
/*
|
410 |
* Look for item(s) inserted in post_content
|
411 |
*/
|
412 |
-
|
413 |
-
$
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
}
|
433 |
-
} //
|
434 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
return $references;
|
436 |
}
|
437 |
|
438 |
/**
|
439 |
-
*
|
440 |
*
|
441 |
-
*
|
|
|
|
|
442 |
*
|
443 |
-
*
|
|
|
|
|
|
|
|
|
|
|
444 |
*
|
445 |
-
* @
|
|
|
|
|
446 |
*/
|
447 |
-
private static
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
|
459 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
}
|
461 |
|
462 |
/**
|
463 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
*
|
465 |
-
* Returns a
|
466 |
-
*
|
467 |
-
* a string containing the first array element.
|
468 |
*
|
469 |
-
* @since
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
*
|
471 |
-
* @param int
|
|
|
472 |
*
|
473 |
* @return array Meta data variables
|
474 |
*/
|
475 |
-
|
476 |
-
$results = array(
|
477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
} else {
|
490 |
-
|
|
|
491 |
}
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
$key = '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
}
|
498 |
-
|
499 |
-
|
500 |
-
|
|
|
|
|
|
|
|
|
501 |
else
|
502 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
|
504 |
-
|
|
|
|
|
|
|
505 |
}
|
506 |
-
|
|
|
|
|
|
|
|
|
507 |
}
|
508 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
|
510 |
-
|
|
|
|
|
|
|
511 |
}
|
512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
} // class MLAData
|
514 |
?>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Database and template file access for MLA needs
|
4 |
*
|
5 |
* @package Media Library Assistant
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
+
|
9 |
/**
|
10 |
+
* Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
11 |
*
|
12 |
* The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials."
|
13 |
* Templates separate HTML markup from PHP code for easier maintenance and localization.
|
16 |
* @since 0.1
|
17 |
*/
|
18 |
class MLAData {
|
19 |
+
/**
|
20 |
+
* Provides a unique suffix for the ALT Text SQL VIEW
|
21 |
+
*
|
22 |
+
* @since 0.40
|
23 |
+
*/
|
24 |
+
const MLA_ALT_TEXT_VIEW_SUFFIX = 'alt_text_view';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Provides a unique name for the ALT Text SQL VIEW
|
28 |
+
*
|
29 |
+
* @since 0.40
|
30 |
+
*
|
31 |
+
* @var array
|
32 |
+
*/
|
33 |
+
private static $mla_alt_text_view = NULL;
|
34 |
+
|
35 |
/**
|
36 |
* Initialization function, similar to __construct()
|
37 |
*
|
38 |
* @since 0.1
|
39 |
*/
|
40 |
public static function initialize() {
|
41 |
+
global $table_prefix;
|
42 |
+
self::$mla_alt_text_view = $table_prefix . MLA_OPTION_PREFIX . self::MLA_ALT_TEXT_VIEW_SUFFIX;
|
43 |
+
|
44 |
+
add_action( 'save_post', 'MLAData::mla_save_post_action', 10, 1);
|
45 |
+
add_action( 'edit_attachment', 'MLAData::mla_save_post_action', 10, 1);
|
46 |
+
add_action( 'add_attachment', 'MLAData::mla_save_post_action', 10, 1);
|
47 |
}
|
48 |
|
49 |
/**
|
55 |
*
|
56 |
* @since 0.1
|
57 |
*
|
58 |
+
* @param string Complete path and name of the template file, option name or the raw template
|
59 |
+
* @param string Optional type of template source; 'file' (default), 'option', 'string'
|
60 |
*
|
61 |
+
* @return string|array|false|NULL
|
62 |
+
* string for files that do not contain template divider comments,
|
63 |
+
* array for files containing template divider comments,
|
64 |
+
* false if file or option does not exist,
|
65 |
+
* NULL if file could not be loaded.
|
66 |
*/
|
67 |
+
public static function mla_load_template( $source, $type = 'file' ) {
|
68 |
+
switch ( $type ) {
|
69 |
+
case 'file':
|
70 |
+
if ( !file_exists( $source ) )
|
71 |
+
return false;
|
72 |
+
|
73 |
+
$template = file_get_contents( $source, true );
|
74 |
+
if ( $template == false ) {
|
75 |
+
error_log( 'ERROR: mla_load_template file not found ' . var_export( $source, true ), 0 );
|
76 |
+
return NULL;
|
77 |
+
}
|
78 |
+
break;
|
79 |
+
case 'option':
|
80 |
+
$template = MLAOptions::mla_get_option( $source );
|
81 |
+
if ( $template == false ) {
|
82 |
+
return false;
|
83 |
+
}
|
84 |
+
break;
|
85 |
+
case 'string':
|
86 |
+
$template = $source;
|
87 |
+
if ( empty( $template ) ) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
break;
|
91 |
+
default:
|
92 |
+
error_log( 'ERROR: mla_load_template bad source type ' . var_export( $type, true ), 0 );
|
93 |
+
return NULL;
|
94 |
}
|
95 |
|
96 |
$match_count = preg_match_all( '#\<!-- template=".+" --\>#', $template, $matches, PREG_OFFSET_CAPTURE );
|
106 |
$template_key = preg_split( '#"#', $value[0] );
|
107 |
$template_key = $template_key[1];
|
108 |
$template_value = substr( $template, $value[1] + strlen( $value[0] ), $current_offset - ( $value[1] + strlen( $value[0] ) ) );
|
109 |
+
/*
|
110 |
+
* Trim exactly one newline sequence from the start of the value
|
111 |
+
*/
|
112 |
+
if ( 0 === strpos( $template_value, "\r\n" ) )
|
113 |
+
$offset = 2;
|
114 |
+
elseif ( 0 === strpos( $template_value, "\n\r" ) )
|
115 |
+
$offset = 2;
|
116 |
+
elseif ( 0 === strpos( $template_value, "\n" ) )
|
117 |
+
$offset = 1;
|
118 |
+
elseif ( 0 === strpos( $template_value, "\r" ) )
|
119 |
+
$offset = 1;
|
120 |
+
else
|
121 |
+
$offset = 0;
|
122 |
+
|
123 |
+
$template_value = substr( $template_value, $offset );
|
124 |
+
|
125 |
+
/*
|
126 |
+
* Trim exactly one newline sequence from the end of the value
|
127 |
+
*/
|
128 |
+
$length = strlen( $template_value );
|
129 |
+
if ( $length > 2)
|
130 |
+
$postfix = substr( $template_value, ($length - 2), 2 );
|
131 |
+
else
|
132 |
+
$postfix = $template_value;
|
133 |
+
|
134 |
+
if ( 0 === strpos( $postfix, "\r\n" ) )
|
135 |
+
$length -= 2;
|
136 |
+
elseif ( 0 === strpos( $postfix, "\n\r" ) )
|
137 |
+
$length -= 2;
|
138 |
+
elseif ( 0 === strpos( $postfix, "\n" ) )
|
139 |
+
$length -= 1;
|
140 |
+
elseif ( 0 === strpos( $postfix, "\r" ) )
|
141 |
+
$length -= 1;
|
142 |
+
|
143 |
+
$template_array[ $template_key ] = substr( $template_value, 0, $length );
|
144 |
$current_offset = $value[1];
|
145 |
+
} // foreach $matches
|
146 |
|
147 |
return $template_array;
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
+
* Expand a template, replacing place holders with their values
|
152 |
*
|
153 |
* A simple parsing function for basic templating.
|
154 |
*
|
155 |
* @since 0.1
|
156 |
*
|
157 |
+
* @param string A formatting string containing [+placeholders+]
|
158 |
+
* @param array An associative array containing keys and values e.g. array('key' => 'value')
|
159 |
*
|
160 |
+
* @return string Placeholders corresponding to the keys of the hash will be replaced with their values
|
161 |
*/
|
162 |
public static function mla_parse_template( $tpl, $hash ) {
|
163 |
foreach ( $hash as $key => $value ) {
|
169 |
}
|
170 |
|
171 |
/**
|
172 |
+
* Analyze a template, returning an array of the place holders it contains
|
173 |
+
*
|
174 |
+
* @since 0.90
|
175 |
+
*
|
176 |
+
* @param string A formatting string containing [+placeholders+]
|
177 |
+
*
|
178 |
+
* @return array Placeholder information: each entry is an array with
|
179 |
+
* ['prefix'] => string, ['value'] => string, ['single'] => boolean
|
180 |
+
*/
|
181 |
+
public static function mla_get_template_placeholders( $tpl ) {
|
182 |
+
$results = array();
|
183 |
+
$match_count = preg_match_all( '/\[\+[^+]+\+\]/', $tpl, $matches );
|
184 |
+
if ( ( $match_count == false ) || ( $match_count == 0 ) )
|
185 |
+
return $results;
|
186 |
+
|
187 |
+
foreach ( $matches[0] as $match ) {
|
188 |
+
$key = substr( $match, 2, (strlen( $match ) - 4 ) );
|
189 |
+
$result = array( 'prefix' => '', 'value' => '', 'single' => false);
|
190 |
+
$match_count = preg_match( '/\[\+(.+):(.+)/', $match, $matches );
|
191 |
+
if ( 1 == $match_count ) {
|
192 |
+
$result['prefix'] = $matches[1];
|
193 |
+
$tail = $matches[2];
|
194 |
+
}
|
195 |
+
else {
|
196 |
+
$tail = substr( $match, 2);
|
197 |
+
}
|
198 |
+
|
199 |
+
$match_count = preg_match( '/([^,]+)(,single)\+\]/', $tail, $matches );
|
200 |
+
if ( 1 == $match_count ) {
|
201 |
+
$result['single'] = true;
|
202 |
+
$result['value'] = $matches[1];
|
203 |
+
}
|
204 |
+
else {
|
205 |
+
$result['value'] = substr( $tail, 0, (strlen( $tail ) - 2 ) );
|
206 |
+
}
|
207 |
+
|
208 |
+
$results[ $key ] = $result;
|
209 |
+
} // foreach
|
210 |
+
|
211 |
+
return $results;
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Get the total number of attachment posts
|
216 |
+
*
|
217 |
+
* @since 0.30
|
218 |
+
*
|
219 |
+
* @param array Query variables, e.g., from $_REQUEST
|
220 |
+
*
|
221 |
+
* @return integer Number of attachment posts
|
222 |
+
*/
|
223 |
+
public static function mla_count_list_table_items( $request )
|
224 |
+
{
|
225 |
+
$request = self::_prepare_list_table_query( $request );
|
226 |
+
$results = self::_execute_list_table_query( $request );
|
227 |
+
return $results->found_posts;
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Retrieve attachment objects for list table display
|
232 |
+
*
|
233 |
+
* Supports prepare_items in class-mla-list-table.php.
|
234 |
+
* Modeled after wp_edit_attachments_query in wp-admin/post.php
|
235 |
+
*
|
236 |
+
* @since 0.1
|
237 |
+
*
|
238 |
+
* @param array query parameters from web page, usually found in $_REQUEST
|
239 |
+
* @param int number of rows to skip over to reach desired page
|
240 |
+
* @param int number of rows on each page
|
241 |
+
*
|
242 |
+
* @return array attachment objects (posts) including parent data, meta data and references
|
243 |
+
*/
|
244 |
+
public static function mla_query_list_table_items( $request, $offset, $count ) {
|
245 |
+
$request = self::_prepare_list_table_query( $request, $offset, $count );
|
246 |
+
$results = self::_execute_list_table_query( $request );
|
247 |
+
$attachments = $results->posts;
|
248 |
+
|
249 |
+
foreach ( $attachments as $index => $attachment ) {
|
250 |
+
/*
|
251 |
+
* Add parent data
|
252 |
+
*/
|
253 |
+
$parent_data = self::mla_fetch_attachment_parent_data( $attachment->post_parent );
|
254 |
+
foreach ( $parent_data as $parent_key => $parent_value ) {
|
255 |
+
$attachments[ $index ]->$parent_key = $parent_value;
|
256 |
+
}
|
257 |
+
|
258 |
+
/*
|
259 |
+
* Add meta data
|
260 |
+
*/
|
261 |
+
$meta_data = self::mla_fetch_attachment_metadata( $attachment->ID );
|
262 |
+
foreach ( $meta_data as $meta_key => $meta_value ) {
|
263 |
+
$attachments[ $index ]->$meta_key = $meta_value;
|
264 |
+
}
|
265 |
+
/*
|
266 |
+
* Add references
|
267 |
+
*/
|
268 |
+
$references = self::mla_fetch_attachment_references( $attachment->ID, $attachment->post_parent );
|
269 |
+
$attachments[ $index ]->mla_references = $references;
|
270 |
+
}
|
271 |
+
|
272 |
+
return $attachments;
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* WP_Query filter "parameters"
|
277 |
+
*
|
278 |
+
* This array defines parameters for the query's join, where and orderby filters.
|
279 |
+
* The parameters are set up in the _prepare_list_table_query function, and
|
280 |
+
* any further logic required to translate those values is contained in the filters.
|
281 |
+
*
|
282 |
+
* Array index values are: use_postmeta_view, postmeta_key, detached, orderby, order, s, mla-search-connector, mla-search-fields, sentence, exact
|
283 |
+
*
|
284 |
+
* @since 0.30
|
285 |
+
*
|
286 |
+
* @var array
|
287 |
+
*/
|
288 |
+
private static $query_parameters = array();
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Sanitize and expand query arguments from request variables
|
292 |
*
|
293 |
* Prepare the arguments for WP_Query.
|
294 |
* Modeled after wp_edit_attachments_query in wp-admin/post.php
|
|
|
295 |
*
|
296 |
* @since 0.1
|
297 |
*
|
298 |
+
* @param array query parameters from web page, usually found in $_REQUEST
|
299 |
+
* @param int Optional number of rows (default 0) to skip over to reach desired page
|
300 |
+
* @param int Optional number of rows on each page (0 = all rows, default)
|
301 |
*
|
302 |
* @return array revised arguments suitable for WP_Query
|
303 |
*/
|
304 |
+
private static function _prepare_list_table_query( $raw_request, $offset = 0, $count = 0 ) {
|
305 |
+
/*
|
306 |
+
* Go through the $raw_request, take only the arguments that are used in the query and
|
307 |
+
* sanitize or validate them.
|
308 |
+
*/
|
309 |
+
if ( ! is_array( $raw_request ) ) {
|
310 |
+
error_log( 'ERROR: _prepare_list_table_query $raw_request = ' . var_export( $raw_request, true ), 0 );
|
311 |
+
return null;
|
312 |
+
}
|
313 |
+
|
314 |
+
$clean_request = array (
|
315 |
+
'm' => 0,
|
316 |
+
'orderby' => MLAOptions::mla_get_option( 'default_orderby' ),
|
317 |
+
'order' => MLAOptions::mla_get_option( 'default_order' ),
|
318 |
+
'post_type' => 'attachment',
|
319 |
+
'post_status' => 'inherit',
|
320 |
+
'mla-search-connector' => 'AND',
|
321 |
+
'mla-search-fields' => array()
|
322 |
+
);
|
323 |
+
|
324 |
+
foreach ( $raw_request as $key => $value ) {
|
325 |
+
switch ( $key ) {
|
326 |
+
/*
|
327 |
+
* 'sentence' and 'exact' modify the keyword search ('s')
|
328 |
+
* Their value is not important, only their presence.
|
329 |
+
*/
|
330 |
+
case 'sentence':
|
331 |
+
case 'exact':
|
332 |
+
case 'mla-tax':
|
333 |
+
case 'mla-term':
|
334 |
+
$clean_request[ $key ] = sanitize_key( $value );
|
335 |
+
break;
|
336 |
+
case 'orderby':
|
337 |
+
if ( 'none' == $value )
|
338 |
+
$clean_request[ $key ] = $value;
|
339 |
+
else {
|
340 |
+
$sortable_columns = MLA_List_Table::mla_get_sortable_columns( );
|
341 |
+
foreach ($sortable_columns as $sort_key => $sort_value ) {
|
342 |
+
if ( $value == $sort_value[0] ) {
|
343 |
+
$clean_request[ $key ] = $value;
|
344 |
+
break;
|
345 |
+
}
|
346 |
+
} // foreach
|
347 |
+
}
|
348 |
+
break;
|
349 |
+
case 'post_mime_type':
|
350 |
+
if ( array_key_exists( $value, MLA_List_Table::mla_get_attachment_mime_types( ) ) )
|
351 |
+
$clean_request[ $key ] = $value;
|
352 |
+
break;
|
353 |
+
case 'parent':
|
354 |
+
$clean_request[ 'post_parent' ] = absint( $value );
|
355 |
+
break;
|
356 |
+
/*
|
357 |
+
* ['m'] - filter by year and month of post, e.g., 201204
|
358 |
+
*/
|
359 |
+
case 'author':
|
360 |
+
case 'm':
|
361 |
+
$clean_request[ $key ] = absint( $value );
|
362 |
+
break;
|
363 |
+
/*
|
364 |
+
* ['mla_filter_term'] - filter by category or tag ID; -1 allowed
|
365 |
+
*/
|
366 |
+
case 'mla_filter_term':
|
367 |
+
$clean_request[ $key ] = intval( $value );
|
368 |
+
break;
|
369 |
+
case 'order':
|
370 |
+
switch ( $value = strtoupper ($value ) ) {
|
371 |
+
case 'ASC':
|
372 |
+
case 'DESC':
|
373 |
+
$clean_request[ $key ] = $value;
|
374 |
+
break;
|
375 |
+
default:
|
376 |
+
$clean_request[ $key ] = 'ASC';
|
377 |
+
}
|
378 |
+
break;
|
379 |
+
case 'detached':
|
380 |
+
if ( '1' == $value )
|
381 |
+
$clean_request['detached'] = '1';
|
382 |
+
break;
|
383 |
+
case 'status':
|
384 |
+
if ( 'trash' == $value )
|
385 |
+
$clean_request['post_status'] = 'trash';
|
386 |
+
break;
|
387 |
+
/*
|
388 |
+
* ['s'] - Search Media by one or more keywords
|
389 |
+
* ['mla-search-connector'], ['mla-search-fields'] - Search Media options
|
390 |
+
*/
|
391 |
+
case 's':
|
392 |
+
$clean_request[ $key ] = stripslashes( trim( $value ) );
|
393 |
+
break;
|
394 |
+
case 'mla-search-connector':
|
395 |
+
case 'mla-search-fields':
|
396 |
+
$clean_request[ $key ] = $value;
|
397 |
+
break;
|
398 |
+
case 'mla-metakey':
|
399 |
+
case 'mla-metavalue':
|
400 |
+
$clean_request[ $key ] = stripslashes( $value );
|
401 |
+
break;
|
402 |
+
default:
|
403 |
+
// ignore anything else in $_REQUEST
|
404 |
+
} // switch $key
|
405 |
+
} // foreach $raw_request
|
406 |
+
|
407 |
/*
|
408 |
+
* Pass query parameters to the filters for _execute_list_table_query
|
409 |
*/
|
410 |
+
self::$query_parameters = array( 'use_postmeta_view' => false );
|
411 |
+
self::$query_parameters['detached'] = isset( $clean_request['detached'] );
|
412 |
+
self::$query_parameters['orderby'] = $clean_request['orderby'];
|
413 |
+
self::$query_parameters['order'] = $clean_request['order'];
|
414 |
|
415 |
/*
|
416 |
+
* We will handle keyword search in the mla_query_posts_search_filter.
|
417 |
+
* There must be at least one search field to do a search.
|
|
|
|
|
418 |
*/
|
419 |
+
if ( isset( $clean_request['s'] ) ) {
|
420 |
+
if ( ! empty( $clean_request['mla-search-fields'] ) ) {
|
421 |
+
self::$query_parameters['s'] = $clean_request['s'];
|
422 |
+
self::$query_parameters['mla-search-connector'] = $clean_request['mla-search-connector'];
|
423 |
+
self::$query_parameters['mla-search-fields'] = $clean_request['mla-search-fields'];
|
424 |
+
self::$query_parameters['sentence'] = isset( $clean_request['sentence'] );
|
425 |
+
self::$query_parameters['exact'] = isset( $clean_request['exact'] );
|
426 |
+
|
427 |
+
if ( in_array( 'alt-text', self::$query_parameters['mla-search-fields'] ) )
|
428 |
+
self::$query_parameters['use_postmeta_view'] = true;
|
429 |
+
self::$query_parameters['postmeta_key'] = '_wp_attachment_image_alt';
|
430 |
+
} // !empty
|
431 |
+
|
432 |
+
unset( $clean_request['s'] );
|
433 |
+
unset( $clean_request['mla-search-connector'] );
|
434 |
+
unset( $clean_request['mla-search-fields'] );
|
435 |
+
unset( $clean_request['sentence'] );
|
436 |
+
unset( $clean_request['exact'] );
|
437 |
+
}
|
438 |
+
|
439 |
+
/*
|
440 |
+
* We have to handle custom field/post_meta values here
|
441 |
+
* because they need a JOIN clause supplied by WP_Query
|
442 |
+
*/
|
443 |
+
if ( 'c_' == substr( self::$query_parameters['orderby'], 0, 2 ) ) {
|
444 |
+
$option_value = MLAOptions::mla_custom_field_option_value( self::$query_parameters['orderby'] );
|
445 |
+
if ( isset( $option_value['name'] ) ) {
|
446 |
+
self::$query_parameters['use_postmeta_view'] = true;
|
447 |
+
self::$query_parameters['postmeta_key'] = $option_value['name'];
|
448 |
+
if ( isset($clean_request['orderby']) )
|
449 |
+
unset($clean_request['orderby']);
|
450 |
+
if ( isset($clean_request['order']) )
|
451 |
+
unset($clean_request['order']);
|
452 |
}
|
453 |
+
} // custom field
|
454 |
+
else {
|
455 |
+
switch ( self::$query_parameters['orderby'] ) {
|
456 |
+
/*
|
457 |
+
* '_wp_attachment_image_alt' is special; we'll handle it in the JOIN and ORDERBY filters
|
458 |
+
*/
|
459 |
+
case '_wp_attachment_image_alt':
|
460 |
+
self::$query_parameters['use_postmeta_view'] = true;
|
461 |
+
self::$query_parameters['postmeta_key'] = '_wp_attachment_image_alt';
|
462 |
+
if ( isset($clean_request['orderby']) )
|
463 |
+
unset($clean_request['orderby']);
|
464 |
+
if ( isset($clean_request['order']) )
|
465 |
+
unset($clean_request['order']);
|
466 |
+
break;
|
467 |
+
case '_wp_attached_file':
|
468 |
+
$clean_request['meta_key'] = '_wp_attached_file';
|
469 |
+
$clean_request['orderby'] = 'meta_value';
|
470 |
+
$clean_request['order'] = self::$query_parameters['order'];
|
471 |
+
break;
|
472 |
+
} // switch $orderby
|
473 |
+
}
|
474 |
+
|
475 |
+
/*
|
476 |
+
* Ignore incoming paged value; use offset and count instead
|
477 |
+
*/
|
478 |
+
if ( ( (int) $count ) > 0 ) {
|
479 |
+
$clean_request['offset'] = $offset;
|
480 |
+
$clean_request['posts_per_page'] = $count;
|
481 |
}
|
482 |
|
483 |
+
/*
|
484 |
+
* ['mla_filter_term'] - filter by taxonomy
|
485 |
+
*
|
486 |
+
* cat = 0 is "All Categories", i.e., no filtering
|
487 |
+
* cat = -1 is "No Categories"
|
488 |
+
*/
|
489 |
+
if ( isset( $clean_request['mla_filter_term'] ) ) {
|
490 |
+
if ( $clean_request['mla_filter_term'] != 0 ) {
|
491 |
+
$tax_filter = MLAOptions::mla_taxonomy_support('', 'filter');
|
492 |
+
if ( $clean_request['mla_filter_term'] == -1 ) {
|
493 |
+
$term_list = get_terms( $tax_filter, array(
|
494 |
+
'fields' => 'ids',
|
495 |
+
'hide_empty' => false
|
496 |
+
) );
|
497 |
+
$clean_request['tax_query'] = array(
|
498 |
+
array(
|
499 |
+
'taxonomy' => $tax_filter,
|
500 |
+
'field' => 'id',
|
501 |
+
'terms' => $term_list,
|
502 |
+
'operator' => 'NOT IN'
|
503 |
+
)
|
504 |
+
);
|
505 |
+
} // mla_filter_term == -1
|
506 |
+
else {
|
507 |
+
$clean_request['tax_query'] = array(
|
508 |
+
array(
|
509 |
+
'taxonomy' => $tax_filter,
|
510 |
+
'field' => 'id',
|
511 |
+
'terms' => array(
|
512 |
+
(int) $clean_request['mla_filter_term']
|
513 |
+
)
|
514 |
+
)
|
515 |
+
);
|
516 |
+
} // mla_filter_term != -1
|
517 |
+
} // mla_filter_term != 0
|
518 |
+
|
519 |
+
unset( $clean_request['mla_filter_term'] );
|
520 |
+
} // isset mla_filter_term
|
521 |
+
|
522 |
+
if ( isset( $clean_request['mla-tax'] ) && isset( $clean_request['mla-term'] )) {
|
523 |
+
$clean_request['tax_query'] = array(
|
524 |
array(
|
525 |
+
'taxonomy' => $clean_request['mla-tax'],
|
526 |
'field' => 'slug',
|
527 |
+
'terms' => $clean_request['mla-term'],
|
528 |
'include_children' => false
|
529 |
)
|
530 |
);
|
531 |
|
532 |
+
unset( $clean_request['mla-tax'] );
|
533 |
+
unset( $clean_request['mla-term'] );
|
534 |
+
} // isset mla_tax
|
535 |
|
536 |
+
if ( isset( $clean_request['mla-metakey'] ) && isset( $clean_request['mla-metavalue'] ) ) {
|
537 |
+
$clean_request['meta_key'] = $clean_request['mla-metakey'];
|
538 |
+
$clean_request['meta_value'] = $clean_request['mla-metavalue'];
|
539 |
+
|
540 |
+
unset( $clean_request['mla-metakey'] );
|
541 |
+
unset( $clean_request['mla-metavalue'] );
|
542 |
+
} // isset mla_tax
|
543 |
|
544 |
+
return $clean_request;
|
545 |
+
}
|
546 |
+
|
547 |
+
/**
|
548 |
+
* Add filters, run query, remove filters
|
549 |
+
*
|
550 |
+
* @since 0.30
|
551 |
+
*
|
552 |
+
* @param array query parameters from web page, usually found in $_REQUEST
|
553 |
+
*
|
554 |
+
* @return object WP_Query object with query results
|
555 |
+
*/
|
556 |
+
private static function _execute_list_table_query( $request ) {
|
557 |
+
global $wpdb, $table_prefix;
|
558 |
|
559 |
/*
|
560 |
+
* Custom fields are special; we have to use an SQL VIEW to build
|
561 |
+
* an intermediate table and modify the JOIN to include posts
|
562 |
+
* with no value for the metadata field.
|
563 |
*/
|
564 |
+
if ( self::$query_parameters['use_postmeta_view'] ) {
|
565 |
+
$view_name = self::$mla_alt_text_view;
|
566 |
+
$key_name = self::$query_parameters['postmeta_key'];
|
567 |
+
$table_name = $table_prefix . 'postmeta';
|
568 |
+
|
569 |
+
$result = $wpdb->query(
|
570 |
+
"
|
571 |
+
CREATE OR REPLACE VIEW {$view_name} AS
|
572 |
+
SELECT post_id, meta_value
|
573 |
+
FROM {$table_name}
|
574 |
+
WHERE {$table_name}.meta_key = '{$key_name}'
|
575 |
+
"
|
576 |
+
);
|
577 |
+
}
|
578 |
+
|
579 |
+
add_filter( 'posts_search', 'MLAData::mla_query_posts_search_filter', 10, 2 ); // $search, &$this
|
580 |
+
add_filter( 'posts_join', 'MLAData::mla_query_posts_join_filter' );
|
581 |
+
add_filter( 'posts_where', 'MLAData::mla_query_posts_where_filter' );
|
582 |
+
add_filter( 'posts_orderby', 'MLAData::mla_query_posts_orderby_filter' );
|
583 |
+
|
584 |
+
$results = new WP_Query( $request );
|
585 |
+
|
586 |
+
remove_filter( 'posts_orderby', 'MLAData::mla_query_posts_orderby_filter' );
|
587 |
+
remove_filter( 'posts_where', 'MLAData::mla_query_posts_where_filter' );
|
588 |
+
remove_filter( 'posts_join', 'MLAData::mla_query_posts_join_filter' );
|
589 |
+
remove_filter( 'posts_search', 'MLAData::mla_query_posts_search_filter' );
|
590 |
+
|
591 |
+
if ( self::$query_parameters['use_postmeta_view'] ) {
|
592 |
+
$result = $wpdb->query( "DROP VIEW {$view_name}" );
|
593 |
+
}
|
594 |
+
|
595 |
+
return $results;
|
596 |
}
|
597 |
|
598 |
/**
|
599 |
+
* Adds a keyword search to the WHERE clause, if required
|
600 |
+
*
|
601 |
+
* Defined as public because it's a filter.
|
|
|
602 |
*
|
603 |
+
* @since 0.60
|
604 |
*
|
605 |
+
* @param string query clause before modification
|
606 |
+
* @param object WP_Query object
|
|
|
|
|
|
|
607 |
*
|
608 |
+
* @return string query clause after keyword search addition
|
609 |
*/
|
610 |
+
public static function mla_query_posts_search_filter( $search_string, &$query_object ) {
|
611 |
+
global $table_prefix, $wpdb;
|
612 |
+
|
613 |
/*
|
614 |
+
* Process the keyword search argument, if present.
|
|
|
|
|
615 |
*/
|
616 |
+
$search_clause = '';
|
617 |
+
if ( isset( self::$query_parameters['s'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
/*
|
619 |
+
* Interpret a numeric value as the ID of a specific attactment
|
620 |
*/
|
621 |
+
if(is_numeric( self::$query_parameters['s'] )) {
|
622 |
+
return ' AND ( ' . $wpdb->posts . '.ID = ' . absint( self::$query_parameters['s'] ) . ' ) ';
|
|
|
623 |
}
|
624 |
|
625 |
+
if ( self::$query_parameters['sentence'] ) {
|
626 |
+
$search_terms = array( self::$query_parameters['s'] );
|
627 |
+
} else {
|
628 |
+
preg_match_all('/".*?("|$)|((?<=[\r\n\t ",+])|^)[^\r\n\t ",+]+/', self::$query_parameters['s'], $matches);
|
629 |
+
$search_terms = array_map('_search_terms_tidy', $matches[0]);
|
|
|
630 |
}
|
631 |
+
|
632 |
+
$fields = self::$query_parameters['mla-search-fields'];
|
633 |
+
$percent = self::$query_parameters['exact'] ? '' : '%';
|
634 |
+
$connector = '';
|
635 |
+
foreach ( $search_terms as $term ) {
|
636 |
+
$term = esc_sql( like_escape( $term ) );
|
637 |
+
$inner_connector = '';
|
638 |
+
$search_clause .= "{$connector}(";
|
639 |
+
|
640 |
+
if ( in_array( 'content', $fields ) ) {
|
641 |
+
$search_clause .= "{$inner_connector}({$wpdb->posts}.post_content LIKE '{$percent}{$term}{$percent}')";
|
642 |
+
$inner_connector = ' OR ';
|
643 |
+
}
|
644 |
+
|
645 |
+
if ( in_array( 'title', $fields ) ) {
|
646 |
+
$search_clause .= "{$inner_connector}({$wpdb->posts}.post_title LIKE '{$percent}{$term}{$percent}')";
|
647 |
+
$inner_connector = ' OR ';
|
648 |
+
}
|
649 |
+
|
650 |
+
if ( in_array( 'excerpt', $fields ) ) {
|
651 |
+
$search_clause .= "{$inner_connector}({$wpdb->posts}.post_excerpt LIKE '{$percent}{$term}{$percent}')";
|
652 |
+
$inner_connector = ' OR ';
|
653 |
+
}
|
654 |
+
|
655 |
+
if ( in_array( 'alt-text', $fields ) ) {
|
656 |
+
$view_name = self::$mla_alt_text_view;
|
657 |
+
$search_clause .= "{$inner_connector}({$view_name}.meta_value LIKE '{$percent}{$term}{$percent}')";
|
658 |
+
$inner_connector = ' OR ';
|
659 |
+
}
|
660 |
+
|
661 |
+
if ( in_array( 'name', $fields ) ) {
|
662 |
+
$search_clause .= "{$inner_connector}({$wpdb->posts}.post_name LIKE '{$percent}{$term}{$percent}')";
|
663 |
+
}
|
664 |
+
|
665 |
+
$search_clause .= ")";
|
666 |
+
$connector = ' ' . self::$query_parameters['mla-search-connector'] . ' ';
|
667 |
+
} // foreach
|
668 |
+
|
669 |
+
if ( !empty($search_clause) ) {
|
670 |
+
$search_clause = " AND ({$search_clause}) ";
|
671 |
+
if ( !is_user_logged_in() )
|
672 |
+
$search_clause .= " AND ($wpdb->posts.post_password = '') ";
|
673 |
+
}
|
674 |
+
} // isset 's'
|
675 |
|
676 |
+
return $search_clause;
|
677 |
}
|
678 |
+
|
679 |
+
/**
|
680 |
+
* Adds a JOIN clause, if required, to handle sorting/searching on ALT Text
|
681 |
+
*
|
682 |
+
* Defined as public because it's a filter.
|
683 |
+
*
|
684 |
+
* @since 0.30
|
685 |
+
*
|
686 |
+
* @param string query clause before modification
|
687 |
+
*
|
688 |
+
* @return string query clause after "LEFT JOIN view ON post_id" item modification
|
689 |
+
*/
|
690 |
+
public static function mla_query_posts_join_filter( $join_clause ) {
|
691 |
+
global $table_prefix;
|
692 |
+
/*
|
693 |
+
* '_wp_attachment_image_alt' is special; we have to use an SQL VIEW to
|
694 |
+
* build an intermediate table and modify the JOIN to include posts with
|
695 |
+
* no value for this metadata field.
|
696 |
+
*/
|
697 |
+
if ( self::$query_parameters['use_postmeta_view'] ) {
|
698 |
+
$view_name = self::$mla_alt_text_view;
|
699 |
+
$join_clause .= " LEFT JOIN {$view_name} ON ({$table_prefix}posts.ID = {$view_name}.post_id)";
|
700 |
+
}
|
701 |
+
|
702 |
+
return $join_clause;
|
703 |
+
}
|
704 |
+
|
705 |
/**
|
706 |
* Adds a WHERE clause for detached items
|
707 |
*
|
708 |
+
* Modeled after _edit_attachments_query_helper in wp-admin/post.php.
|
709 |
+
* Defined as public because it's a filter.
|
710 |
*
|
711 |
* @since 0.1
|
712 |
*
|
713 |
+
* @param string query clause before modification
|
714 |
*
|
715 |
* @return string query clause after "detached" item modification
|
716 |
*/
|
717 |
+
public static function mla_query_posts_where_filter( $where_clause ) {
|
718 |
global $table_prefix;
|
719 |
+
|
720 |
+
if ( self::$query_parameters['detached'] )
|
721 |
+
$where_clause .= " AND {$table_prefix}posts.post_parent < 1";
|
722 |
+
|
723 |
+
return $where_clause;
|
724 |
+
}
|
725 |
+
|
726 |
+
/**
|
727 |
+
* Adds a ORDERBY clause, if required
|
728 |
+
*
|
729 |
+
* Expands the range of sort options because the logic in WP_Query is limited.
|
730 |
+
* Defined as public because it's a filter.
|
731 |
+
*
|
732 |
+
* @since 0.30
|
733 |
+
*
|
734 |
+
* @param string query clause before modification
|
735 |
+
*
|
736 |
+
* @return string updated query clause
|
737 |
+
*/
|
738 |
+
public static function mla_query_posts_orderby_filter( $orderby_clause ) {
|
739 |
+
global $table_prefix;
|
740 |
+
|
741 |
+
if ( isset( self::$query_parameters['orderby'] ) ) {
|
742 |
+
if ( 'c_' == substr( self::$query_parameters['orderby'], 0, 2 ) ) {
|
743 |
+
$orderby = self::$mla_alt_text_view . '.meta_value';
|
744 |
+
} // custom field sort
|
745 |
+
else {
|
746 |
+
switch ( self::$query_parameters['orderby'] ) {
|
747 |
+
case 'none':
|
748 |
+
$orderby = '';
|
749 |
+
break;
|
750 |
+
/*
|
751 |
+
* There are two columns defined that end up sorting on post_title,
|
752 |
+
* so we can't use the database column to identify the column but
|
753 |
+
* we actually sort on the database column.
|
754 |
+
*/
|
755 |
+
case 'title_name':
|
756 |
+
$orderby = "{$table_prefix}posts.post_title";
|
757 |
+
break;
|
758 |
+
/*
|
759 |
+
* The _wp_attached_file meta data value is present for all attachments, and the
|
760 |
+
* sorting on the meta data value is handled by WP_Query
|
761 |
+
*/
|
762 |
+
case '_wp_attached_file':
|
763 |
+
$orderby = '';
|
764 |
+
break;
|
765 |
+
/*
|
766 |
+
* The _wp_attachment_image_alt value is only present for images, so we have to
|
767 |
+
* use the view we prepared to get attachments with no meta data value
|
768 |
+
*/
|
769 |
+
case '_wp_attachment_image_alt':
|
770 |
+
$orderby = self::$mla_alt_text_view . '.meta_value';
|
771 |
+
break;
|
772 |
+
default:
|
773 |
+
$orderby = "{$table_prefix}posts." . self::$query_parameters['orderby'];
|
774 |
+
} // $query_parameters['orderby']
|
775 |
+
}
|
776 |
+
|
777 |
+
if ( ! empty( $orderby ) )
|
778 |
+
$orderby_clause = $orderby . ' ' . self::$query_parameters['order'];
|
779 |
+
} // isset
|
780 |
+
|
781 |
+
return $orderby_clause;
|
782 |
}
|
783 |
|
784 |
/**
|
785 |
+
* Retrieve an Attachment array given a $post_id
|
786 |
*
|
787 |
* The (associative) array will contain every field that can be found in
|
788 |
* the posts and postmeta tables, and all references to the attachment.
|
789 |
*
|
790 |
* @since 0.1
|
791 |
+
* @uses $post WordPress global variable
|
792 |
*
|
793 |
+
* @param int The ID of the attachment post
|
794 |
+
* @return NULL|array NULL on failure else associative array
|
795 |
*/
|
796 |
function mla_get_attachment_by_id( $post_id ) {
|
797 |
+
global $post;
|
798 |
|
799 |
$item = get_post( $post_id );
|
800 |
if ( empty( $item ) ) {
|
814 |
/*
|
815 |
* Add parent data
|
816 |
*/
|
817 |
+
$post_data = array_merge( $post_data, self::mla_fetch_attachment_parent_data( $post_data['post_parent'] ) );
|
818 |
|
819 |
/*
|
820 |
* Add meta data
|
821 |
*/
|
822 |
+
$post_data = array_merge( $post_data, self::mla_fetch_attachment_metadata( $post_id ) );
|
823 |
|
824 |
/*
|
825 |
* Add references
|
830 |
}
|
831 |
|
832 |
/**
|
833 |
+
* Returns information about an attachment's parent, if found
|
|
|
|
|
|
|
834 |
*
|
835 |
* @since 0.1
|
836 |
*
|
837 |
+
* @param int post ID of attachment's parent, if any
|
|
|
838 |
*
|
839 |
+
* @return array Parent information; post_date, post_title and post_type
|
840 |
*/
|
841 |
+
public static function mla_fetch_attachment_parent_data( $parent_id ) {
|
842 |
+
$parent_data = array();
|
843 |
+
if ( $parent_id ) {
|
844 |
+
$parent = get_post( $parent_id );
|
845 |
+
if ( isset( $parent->post_date ) )
|
846 |
+
$parent_data['parent_date'] = $parent->post_date;
|
847 |
+
if ( isset( $parent->post_title ) )
|
848 |
+
$parent_data['parent_title'] = $parent->post_title;
|
849 |
+
if ( isset( $parent->post_type ) )
|
850 |
+
$parent_data['parent_type'] = $parent->post_type;
|
851 |
+
}
|
852 |
|
853 |
+
return $parent_data;
|
854 |
+
}
|
855 |
+
|
856 |
+
/**
|
857 |
+
* Fetch and filter meta data for an attachment
|
858 |
+
*
|
859 |
+
* Returns a filtered array of a post's meta data. Internal values beginning with '_'
|
860 |
+
* are stripped out or converted to an 'mla_' equivalent. Array data is replaced with
|
861 |
+
* a string containing the first array element.
|
862 |
+
*
|
863 |
+
* @since 0.1
|
864 |
+
*
|
865 |
+
* @param int post ID of attachment
|
866 |
+
*
|
867 |
+
* @return array Meta data variables
|
868 |
+
*/
|
869 |
+
public static function mla_fetch_attachment_metadata( $post_id ) {
|
870 |
+
$attached_file = NULL;
|
871 |
+
$results = array();
|
872 |
+
$post_meta = get_metadata( 'post', $post_id );
|
873 |
+
|
874 |
+
if ( is_array( $post_meta ) ) {
|
875 |
+
foreach ( $post_meta as $post_meta_key => $post_meta_value ) {
|
876 |
+
if ( empty( $post_meta_key ) )
|
877 |
+
continue;
|
878 |
+
|
879 |
+
if ( '_' == $post_meta_key{0} ) {
|
880 |
+
if ( stripos( $post_meta_key, '_wp_attached_file' ) === 0 ) {
|
881 |
+
$key = 'mla_wp_attached_file';
|
882 |
+
$attached_file = $post_meta_value[0];
|
883 |
+
} elseif ( stripos( $post_meta_key, '_wp_attachment_metadata' ) === 0 ) {
|
884 |
+
$key = 'mla_wp_attachment_metadata';
|
885 |
+
$post_meta_value = unserialize( $post_meta_value[0] );
|
886 |
+
} elseif ( stripos( $post_meta_key, '_wp_attachment_image_alt' ) === 0 ) {
|
887 |
+
$key = 'mla_wp_attachment_image_alt';
|
888 |
+
} else {
|
889 |
+
continue;
|
890 |
+
}
|
891 |
+
} else {
|
892 |
+
if ( stripos( $post_meta_key, 'mla_' ) === 0 )
|
893 |
+
$key = $post_meta_key;
|
894 |
+
else
|
895 |
+
$key = 'mla_item_' . $post_meta_key;
|
896 |
+
}
|
897 |
+
|
898 |
+
if ( is_array( $post_meta_value ) && count( $post_meta_value ) == 1 )
|
899 |
+
$value = $post_meta_value[0];
|
900 |
+
else
|
901 |
+
$value = $post_meta_value;
|
902 |
+
|
903 |
+
$results[ $key ] = $value;
|
904 |
+
} // foreach $post_meta
|
905 |
+
|
906 |
+
if ( !empty( $attached_file ) ) {
|
907 |
+
$last_slash = strrpos( $attached_file, '/' );
|
908 |
+
if ( false === $last_slash ) {
|
909 |
+
$results['mla_wp_attached_path'] = '';
|
910 |
+
$results['mla_wp_attached_filename'] = $attached_file;
|
911 |
+
}
|
912 |
+
else {
|
913 |
+
$results['mla_wp_attached_path'] = substr( $attached_file, 0, $last_slash + 1 );
|
914 |
+
$results['mla_wp_attached_filename'] = substr( $attached_file, $last_slash + 1 );
|
915 |
+
}
|
916 |
+
} // $attached_file
|
917 |
+
} // is_array($post_meta)
|
918 |
+
|
919 |
+
return $results;
|
920 |
+
}
|
921 |
+
|
922 |
+
/**
|
923 |
+
* Find Featured Image and inserted image/link references to an attachment
|
924 |
+
*
|
925 |
+
* Searches all post and page content to see if the attachment is used
|
926 |
+
* as a Featured Image or inserted in the post as an image or link.
|
927 |
+
*
|
928 |
+
* @since 0.1
|
929 |
+
*
|
930 |
+
* @param int post ID of attachment
|
931 |
+
* @param int post ID of attachment's parent, if any
|
932 |
+
*
|
933 |
+
* @return array Reference information; see $references array comments
|
934 |
+
*/
|
935 |
+
public static function mla_fetch_attachment_references( $ID, $parent ) {
|
936 |
+
global $wpdb;
|
937 |
+
|
938 |
+
/*
|
939 |
+
* tested_reference true if any of the four where-used types was processed
|
940 |
+
* found_reference true if any where-used array is not empty()
|
941 |
+
* found_parent true if $parent matches a where-used post ID
|
942 |
+
* is_unattached true if $parent is zero (0)
|
943 |
+
* base_file relative path and name of the uploaded file, e.g., 2012/04/image.jpg
|
944 |
+
* path path to the file, relative to the "uploads/" directory, e.g., 2012/04/
|
945 |
+
* file The name portion of the base file, e.g., image.jpg
|
946 |
+
* files base file and any other image size files. Array key is path and file name.
|
947 |
+
* Non-image file value is a string containing file name without path
|
948 |
+
* Image file value is an array with file name, width and height
|
949 |
+
* features Array of objects with the post_type and post_title of each post
|
950 |
+
* that has the attachment as a "Featured Image"
|
951 |
+
* inserts Array of specific files (i.e., sizes) found in one or more posts/pages
|
952 |
+
* as an image (<img>) or link (<a href>). The array key is the path and file name.
|
953 |
+
* The array value is an array with the ID, post_type and post_title of each reference
|
954 |
+
* mla_galleries Array of objects with the post_type and post_title of each post
|
955 |
+
* that was returned by an [mla_gallery] shortcode
|
956 |
+
* galleries Array of objects with the post_type and post_title of each post
|
957 |
+
* that was returned by a [gallery] shortcode
|
958 |
+
* parent_type 'post' or 'page' or the custom post type of the attachment's parent
|
959 |
* parent_title post_title of the attachment's parent
|
960 |
+
* parent_errors UNATTACHED, ORPHAN, BAD/INVALID PARENT
|
961 |
*/
|
962 |
$references = array(
|
963 |
+
'tested_reference' => false,
|
964 |
'found_reference' => false,
|
965 |
'found_parent' => false,
|
966 |
'is_unattached' => ( ( (int) $parent ) === 0 ),
|
967 |
'base_file' => '',
|
968 |
'path' => '',
|
969 |
+
'file' => '',
|
970 |
'files' => array(),
|
971 |
'features' => array(),
|
972 |
'inserts' => array(),
|
973 |
+
'mla_galleries' => array(),
|
974 |
+
'galleries' => array(),
|
975 |
'parent_type' => '',
|
976 |
+
'parent_title' => '',
|
977 |
+
'parent_errors' => ''
|
978 |
);
|
979 |
|
980 |
+
/*
|
981 |
+
* Fill in Parent data
|
982 |
+
*/
|
983 |
+
$parent_data = self::mla_fetch_attachment_parent_data( $parent );
|
984 |
+
if ( isset( $parent_data['parent_type'] ) )
|
985 |
+
$references['parent_type'] = $parent_data['parent_type'];
|
986 |
+
if ( isset( $parent_data['parent_title'] ) )
|
987 |
+
$references['parent_title'] = $parent_data['parent_title'];
|
988 |
+
|
989 |
$attachment_metadata = get_post_meta( $ID, '_wp_attachment_metadata', true );
|
990 |
if ( empty( $attachment_metadata ) ) {
|
991 |
$references['base_file'] = get_post_meta( $ID, '_wp_attached_file', true );
|
992 |
+
} // empty( $attachment_metadata )
|
993 |
+
else {
|
|
|
|
|
|
|
994 |
$references['base_file'] = $attachment_metadata['file'];
|
995 |
+
$sizes = isset( $attachment_metadata['sizes'] ) ? $attachment_metadata['sizes'] : NULL;
|
|
|
|
|
|
|
|
|
996 |
if ( !empty( $sizes ) ) {
|
997 |
/* Using the name as the array key ensures each name is added only once */
|
998 |
foreach ( $sizes as $size ) {
|
1000 |
}
|
1001 |
|
1002 |
}
|
1003 |
+
} // ! empty( $attachment_metadata )
|
1004 |
|
1005 |
+
$references['files'][ $references['base_file'] ] = $references['base_file'];
|
1006 |
+
$last_slash = strrpos( $references['base_file'], '/' );
|
1007 |
+
if ( false === $last_slash ) {
|
1008 |
+
$references['path'] = '';
|
1009 |
+
$references['file'] = $references['base_file'];
|
1010 |
+
}
|
1011 |
+
else {
|
1012 |
+
$references['path'] = substr( $references['base_file'], 0, $last_slash + 1 );
|
1013 |
+
$references['file'] = substr( $references['base_file'], $last_slash + 1 );
|
1014 |
+
}
|
1015 |
+
|
1016 |
+
/*
|
1017 |
+
* Process the where-used settings option
|
1018 |
+
*/
|
1019 |
+
if ('checked' == MLAOptions::mla_get_option( 'exclude_revisions' ) )
|
1020 |
+
$exclude_revisions = "(post_type <> 'revision') AND ";
|
1021 |
+
else
|
1022 |
+
$exclude_revisions = '';
|
1023 |
+
|
1024 |
+
/*
|
1025 |
+
* Accumulate reference test types, e.g., 0 = no tests, 4 = all tests
|
1026 |
+
*/
|
1027 |
+
$reference_tests = 0;
|
1028 |
+
|
1029 |
/*
|
1030 |
+
* Look for the "Featured Image(s)", if enabled
|
1031 |
*/
|
1032 |
+
if ( MLAOptions::$process_featured_in ) {
|
1033 |
+
$reference_tests++;
|
1034 |
+
$features = $wpdb->get_results(
|
1035 |
+
"
|
1036 |
+
SELECT post_id
|
1037 |
+
FROM {$wpdb->postmeta}
|
1038 |
+
WHERE meta_key = '_thumbnail_id' AND meta_value = {$ID}
|
1039 |
+
"
|
1040 |
+
);
|
1041 |
|
1042 |
+
if ( !empty( $features ) ) {
|
1043 |
+
foreach ( $features as $feature ) {
|
1044 |
+
$feature_results = $wpdb->get_results(
|
1045 |
+
"
|
1046 |
+
SELECT post_type, post_title
|
1047 |
+
FROM {$wpdb->posts}
|
1048 |
+
WHERE {$exclude_revisions}(ID = {$feature->post_id})
|
1049 |
+
"
|
1050 |
+
);
|
1051 |
+
|
1052 |
+
if ( !empty( $feature_results ) ) {
|
1053 |
+
$references['found_reference'] = true;
|
1054 |
+
$references['features'][ $feature->post_id ] = $feature_results[0];
|
1055 |
+
|
1056 |
+
if ( $feature->post_id == $parent ) {
|
1057 |
+
$references['found_parent'] = true;
|
1058 |
+
}
|
1059 |
+
} // !empty
|
1060 |
+
} // foreach $feature
|
1061 |
+
}
|
1062 |
+
} // $process_featured_in
|
1063 |
|
1064 |
/*
|
1065 |
* Look for item(s) inserted in post_content
|
1066 |
*/
|
1067 |
+
if ( MLAOptions::$process_inserted_in ) {
|
1068 |
+
$reference_tests++;
|
1069 |
+
foreach ( $references['files'] as $file => $file_data ) {
|
1070 |
+
$like = like_escape( $file );
|
1071 |
+
$inserts = $wpdb->get_results(
|
1072 |
+
$wpdb->prepare(
|
1073 |
+
"
|
1074 |
+
SELECT ID, post_type, post_title
|
1075 |
+
FROM {$wpdb->posts}
|
1076 |
+
WHERE {$exclude_revisions}(
|
1077 |
+
CONVERT(`post_content` USING utf8 )
|
1078 |
+
LIKE %s)
|
1079 |
+
", "%{$like}%"
|
1080 |
+
)
|
1081 |
+
);
|
1082 |
+
|
1083 |
+
if ( !empty( $inserts ) ) {
|
1084 |
+
$references['found_reference'] = true;
|
1085 |
+
$references['inserts'][ $file ] = $inserts;
|
1086 |
+
|
1087 |
+
foreach ( $inserts as $insert ) {
|
1088 |
+
if ( $insert->ID == $parent ) {
|
1089 |
+
$references['found_parent'] = true;
|
1090 |
+
}
|
1091 |
+
} // foreach $insert
|
1092 |
+
} // !empty
|
1093 |
+
} // foreach $file
|
1094 |
+
} // $process_inserted_in
|
1095 |
+
|
1096 |
+
/*
|
1097 |
+
* Look for [mla_gallery] references
|
1098 |
+
*/
|
1099 |
+
if ( MLAOptions::$process_mla_gallery_in ) {
|
1100 |
+
$reference_tests++;
|
1101 |
+
if ( self::_build_mla_galleries( MLAOptions::MLA_MLA_GALLERY_IN_TUNING, self::$mla_galleries, '[mla_gallery', $exclude_revisions ) ) {
|
1102 |
+
$galleries = self::_search_mla_galleries( self::$mla_galleries, $ID );
|
1103 |
+
if ( !empty( $galleries ) ) {
|
1104 |
+
$references['found_reference'] = true;
|
1105 |
+
$references['mla_galleries'] = $galleries;
|
1106 |
+
|
1107 |
+
foreach ( $galleries as $post_id => $gallery ) {
|
1108 |
+
if ( $post_id == $parent ) {
|
1109 |
+
$references['found_parent'] = true;
|
1110 |
+
}
|
1111 |
+
} // foreach $gallery
|
1112 |
+
} // !empty
|
1113 |
+
else
|
1114 |
+
$references['mla_galleries'] = array();
|
1115 |
+
}
|
1116 |
+
} // $process_mla_gallery_in
|
1117 |
+
|
1118 |
+
/*
|
1119 |
+
* Look for [gallery] references
|
1120 |
+
*/
|
1121 |
+
if ( MLAOptions::$process_gallery_in ) {
|
1122 |
+
$reference_tests++;
|
1123 |
+
if ( self::_build_mla_galleries( MLAOptions::MLA_GALLERY_IN_TUNING, self::$galleries, '[gallery', $exclude_revisions ) ) {
|
1124 |
+
$galleries = self::_search_mla_galleries( self::$galleries, $ID );
|
1125 |
+
if ( !empty( $galleries ) ) {
|
1126 |
+
$references['found_reference'] = true;
|
1127 |
+
$references['galleries'] = $galleries;
|
1128 |
+
|
1129 |
+
foreach ( $galleries as $post_id => $gallery ) {
|
1130 |
+
if ( $post_id == $parent ) {
|
1131 |
+
$references['found_parent'] = true;
|
1132 |
+
}
|
1133 |
+
} // foreach $gallery
|
1134 |
+
} // !empty
|
1135 |
+
else
|
1136 |
+
$references['galleries'] = array();
|
1137 |
}
|
1138 |
+
} // $process_gallery_in
|
1139 |
|
1140 |
+
/*
|
1141 |
+
* Evaluate and summarize reference tests
|
1142 |
+
*/
|
1143 |
+
$errors = '';
|
1144 |
+
if ( 0 == $reference_tests ) {
|
1145 |
+
$references['tested_reference'] = false;
|
1146 |
+
$errors .= '(NO REFERENCE TESTS)';
|
1147 |
+
}
|
1148 |
+
else {
|
1149 |
+
$references['tested_reference'] = true;
|
1150 |
+
$suffix = ( 4 == $reference_tests ) ? '' : '?';
|
1151 |
+
|
1152 |
+
if ( !$references['found_reference'] )
|
1153 |
+
$errors .= "(ORPHAN{$suffix}) ";
|
1154 |
+
|
1155 |
+
if ( !$references['found_parent'] && !empty( $references['parent_title'] ) )
|
1156 |
+
$errors .= "(BAD PARENT{$suffix})";
|
1157 |
+
}
|
1158 |
+
|
1159 |
+
if ( $references['is_unattached'] )
|
1160 |
+
$errors .= '(UNATTACHED) ';
|
1161 |
+
elseif ( empty( $references['parent_title'] ) )
|
1162 |
+
$errors .= '(INVALID PARENT) ';
|
1163 |
+
|
1164 |
+
$references['parent_errors'] = trim( $errors );
|
1165 |
return $references;
|
1166 |
}
|
1167 |
|
1168 |
/**
|
1169 |
+
* Objects containing [gallery] shortcodes
|
1170 |
*
|
1171 |
+
* This array contains all of the objects containing one or more [gallery] shortcodes
|
1172 |
+
* and array(s) of which attachments each [gallery] contains. The arrays are built once
|
1173 |
+
* each page load and cached for subsequent calls.
|
1174 |
*
|
1175 |
+
* The outer array is keyed by post_id. It contains an array of [gallery] entries numbered from one (1).
|
1176 |
+
* Each inner array has these elements:
|
1177 |
+
* ['parent_title'] post_title of the gallery parent,
|
1178 |
+
* ['parent_type'] 'post' or 'page' or the custom post_type of the gallery parent,
|
1179 |
+
* ['query'] contains a string with the arguments of the [gallery],
|
1180 |
+
* ['results'] contains an array of post_ids for the objects in the gallery.
|
1181 |
*
|
1182 |
+
* @since 0.70
|
1183 |
+
*
|
1184 |
+
* @var array
|
1185 |
*/
|
1186 |
+
private static $galleries = null;
|
1187 |
+
|
1188 |
+
/**
|
1189 |
+
* Objects containing [mla_gallery] shortcodes
|
1190 |
+
*
|
1191 |
+
* This array contains all of the objects containing one or more [mla_gallery] shortcodes
|
1192 |
+
* and array(s) of which attachments each [mla_gallery] contains. The arrays are built once
|
1193 |
+
* each page load and cached for subsequent calls.
|
1194 |
+
*
|
1195 |
+
* @since 0.70
|
1196 |
+
*
|
1197 |
+
* @var array
|
1198 |
+
*/
|
1199 |
+
private static $mla_galleries = null;
|
1200 |
+
|
1201 |
+
/**
|
1202 |
+
* Invalidates the $mla_galleries or $galleries array and cached values
|
1203 |
+
*
|
1204 |
+
* @since 1.00
|
1205 |
+
*
|
1206 |
+
* @param string name of the gallery's cache/option variable
|
1207 |
+
*
|
1208 |
+
* @return void
|
1209 |
+
*/
|
1210 |
+
public static function mla_flush_mla_galleries( $option_name ) {
|
1211 |
+
delete_transient( MLA_OPTION_PREFIX . 't_' . $option_name );
|
1212 |
+
|
1213 |
+
switch ( $option_name ) {
|
1214 |
+
case MLAOptions::MLA_GALLERY_IN_TUNING:
|
1215 |
+
self::$galleries = null;
|
1216 |
+
break;
|
1217 |
+
case MLAOptions::MLA_MLA_GALLERY_IN_TUNING:
|
1218 |
+
self::$mla_galleries = null;
|
1219 |
+
break;
|
1220 |
+
default:
|
1221 |
+
// ignore everything else
|
1222 |
+
} // switch
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
/**
|
1226 |
+
* Invalidates $mla_galleries and $galleries arrays and cached values after post, page or attachment updates
|
1227 |
+
*
|
1228 |
+
* @since 1.00
|
1229 |
+
*
|
1230 |
+
* @param integer ID of post/page/attachment; not used at this time
|
1231 |
+
*
|
1232 |
+
* @return void
|
1233 |
+
*/
|
1234 |
+
public static function mla_save_post_action( $post_id ) {
|
1235 |
+
self::mla_flush_mla_galleries( MLAOptions::MLA_GALLERY_IN_TUNING );
|
1236 |
+
self::mla_flush_mla_galleries( MLAOptions::MLA_MLA_GALLERY_IN_TUNING );
|
1237 |
+
}
|
1238 |
+
|
1239 |
+
/**
|
1240 |
+
* Builds the $mla_galleries or $galleries array
|
1241 |
+
*
|
1242 |
+
* @since 0.70
|
1243 |
+
*
|
1244 |
+
* @param string name of the gallery's cache/option variable
|
1245 |
+
* @param array by reference to the private static galleries array variable
|
1246 |
+
* @param string the shortcode to be searched for and processed
|
1247 |
+
* @param boolean true to exclude revisions from the search
|
1248 |
+
*
|
1249 |
+
* @return boolean true if the galleries array is not empty
|
1250 |
+
*/
|
1251 |
+
private static function _build_mla_galleries( $option_name, &$galleries_array, $shortcode, $exclude_revisions ) {
|
1252 |
+
global $wpdb, $post;
|
1253 |
+
|
1254 |
+
if ( is_array( $galleries_array ) ) {
|
1255 |
+
if ( ! empty( $galleries_array ) ) {
|
1256 |
+
return true;
|
1257 |
+
} else {
|
1258 |
+
return false;
|
1259 |
+
}
|
1260 |
}
|
1261 |
+
|
1262 |
+
$option_value = MLAOptions::mla_get_option( $option_name );
|
1263 |
+
if ( 'disabled' == $option_value )
|
1264 |
+
return false;
|
1265 |
+
elseif ( 'cached' == $option_value ) {
|
1266 |
+
$galleries_array = get_transient( MLA_OPTION_PREFIX . 't_' . $option_name );
|
1267 |
+
if ( is_array( $galleries_array ) ) {
|
1268 |
+
if ( ! empty( $galleries_array ) ) {
|
1269 |
+
return true;
|
1270 |
+
} else {
|
1271 |
+
return false;
|
1272 |
+
}
|
1273 |
+
}
|
1274 |
+
else
|
1275 |
+
$galleries_array = NULL;
|
1276 |
+
} // cached
|
1277 |
|
1278 |
+
/*
|
1279 |
+
* $galleries_array is null, so build the array
|
1280 |
+
*/
|
1281 |
+
$galleries_array = array();
|
1282 |
+
|
1283 |
+
if ( $exclude_revisions )
|
1284 |
+
$exclude_revisions = "(post_type <> 'revision') AND ";
|
1285 |
+
else
|
1286 |
+
$exclude_revisions = '';
|
1287 |
+
|
1288 |
+
$like = like_escape( $shortcode );
|
1289 |
+
$results = $wpdb->get_results(
|
1290 |
+
$wpdb->prepare(
|
1291 |
+
"
|
1292 |
+
SELECT ID, post_type, post_title, post_content
|
1293 |
+
FROM {$wpdb->posts}
|
1294 |
+
WHERE {$exclude_revisions}(
|
1295 |
+
CONVERT(`post_content` USING utf8 )
|
1296 |
+
LIKE %s)
|
1297 |
+
", "%{$like}%"
|
1298 |
+
)
|
1299 |
+
);
|
1300 |
+
|
1301 |
+
if ( empty( $results ) )
|
1302 |
+
return false;
|
1303 |
+
|
1304 |
+
foreach ( $results as $result ) {
|
1305 |
+
$count = preg_match_all( "/\\{$shortcode}(.*)\\]/", $result->post_content, $matches, PREG_PATTERN_ORDER );
|
1306 |
+
if ( $count ) {
|
1307 |
+
$result_id = $result->ID;
|
1308 |
+
$galleries_array[ $result_id ]['parent_title'] = $result->post_title;
|
1309 |
+
$galleries_array[ $result_id ]['parent_type'] = $result->post_type;
|
1310 |
+
$galleries_array[ $result_id ]['results'] = array();
|
1311 |
+
$galleries_array[ $result_id ]['galleries'] = array();
|
1312 |
+
$instance = 0;
|
1313 |
+
|
1314 |
+
foreach ( $matches[1] as $index => $match ) {
|
1315 |
+
/*
|
1316 |
+
* Filter out shortcodes that are not an exact match
|
1317 |
+
*/
|
1318 |
+
if ( empty( $match ) || ( ' ' == substr( $match, 0, 1 ) ) ) {
|
1319 |
+
$instance++;
|
1320 |
+
$galleries_array[ $result_id ]['galleries'][ $instance ]['query'] = trim( $matches[1][$index] );
|
1321 |
+
$galleries_array[ $result_id ]['galleries'][ $instance ]['results'] = array();
|
1322 |
+
|
1323 |
+
$post = $result; // set global variable for mla_gallery_shortcode
|
1324 |
+
$attachments = MLAShortcodes::mla_get_shortcode_attachments( $result_id, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] );
|
1325 |
+
if ( ! empty( $attachments ) )
|
1326 |
+
foreach ( $attachments as $attachment ) {
|
1327 |
+
$galleries_array[ $result_id ]['results'][ $attachment->ID ] = $attachment->ID;
|
1328 |
+
$galleries_array[ $result_id ]['galleries'][ $instance ]['results'][] = $attachment->ID;
|
1329 |
+
}
|
1330 |
+
} // exact match
|
1331 |
+
} // foreach $match
|
1332 |
+
} // if $count
|
1333 |
+
} // foreach $result
|
1334 |
+
|
1335 |
+
/*
|
1336 |
+
* Maybe cache the results
|
1337 |
+
*/
|
1338 |
+
if ( 'cached' == $option_value ) {
|
1339 |
+
set_transient( MLA_OPTION_PREFIX . 't_' . $option_name, $galleries_array, 900 ); // fifteen minutes
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
return true;
|
1343 |
}
|
1344 |
|
1345 |
/**
|
1346 |
+
* Search the $mla_galleries or $galleries array
|
1347 |
+
*
|
1348 |
+
* @since 0.70
|
1349 |
+
*
|
1350 |
+
* @param array by reference to the private static galleries array variable
|
1351 |
+
* @param int the attachment ID to be searched for and processed
|
1352 |
+
*
|
1353 |
+
* @return array All posts/pages with one or more galleries that include the attachment.
|
1354 |
+
* The array key is the parent_post ID; each entry contains post_title and post_type.
|
1355 |
+
*/
|
1356 |
+
private static function _search_mla_galleries( &$galleries_array, $attachment_id ) {
|
1357 |
+
$gallery_refs = array();
|
1358 |
+
if ( ! empty( $galleries_array ) ) {
|
1359 |
+
foreach ( $galleries_array as $parent_id => $gallery ) {
|
1360 |
+
if ( in_array( $attachment_id, $gallery['results'] ) ) {
|
1361 |
+
$gallery_refs[ $parent_id ] = array ( 'post_title' => $gallery['parent_title'], 'post_type' => $gallery['parent_type'] );
|
1362 |
+
}
|
1363 |
+
} // foreach gallery
|
1364 |
+
} // !empty
|
1365 |
+
|
1366 |
+
return $gallery_refs;
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
/**
|
1370 |
+
* Parse one EXIF metadata field
|
1371 |
*
|
1372 |
+
* Returns a string value, converting array data to a string as necessary.
|
1373 |
+
* Also handles the special pseudo-values 'ALL_EXIF' and 'ALL_IPTC'.
|
|
|
1374 |
*
|
1375 |
+
* @since 1.13
|
1376 |
+
*
|
1377 |
+
* @param string field name
|
1378 |
+
* @param string metadata array containing 'mla_exif_metadata' and 'mla_iptc_metadata' arrays
|
1379 |
+
*
|
1380 |
+
* @return string string representation of metadata value or an empty string
|
1381 |
+
*/
|
1382 |
+
public static function mla_exif_metadata_value( $key, $image_metadata ) {
|
1383 |
+
$text = '';
|
1384 |
+
if ( array_key_exists( $key, $image_metadata['mla_exif_metadata'] ) ) {
|
1385 |
+
$record = $image_metadata['mla_exif_metadata'][ $key ];
|
1386 |
+
if ( is_array( $record ) ) {
|
1387 |
+
$text = var_export( $record, true);
|
1388 |
+
} // is_array
|
1389 |
+
else
|
1390 |
+
$text = $record;
|
1391 |
+
} elseif ( 'ALL_EXIF' == $key ) {
|
1392 |
+
$text = var_export( $image_metadata['mla_exif_metadata'], true);
|
1393 |
+
} elseif ( 'ALL_IPTC' == $key ) {
|
1394 |
+
$text = var_export( $image_metadata['mla_iptc_metadata'], true);
|
1395 |
+
}
|
1396 |
+
|
1397 |
+
return $text;
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
/**
|
1401 |
+
* Fetch and filter IPTC and EXIF meta data for an image attachment
|
1402 |
+
*
|
1403 |
+
* Returns
|
1404 |
+
*
|
1405 |
+
* @since 0.90
|
1406 |
*
|
1407 |
+
* @param int post ID of attachment
|
1408 |
+
* @param string optional; if $post_id is zero, path to the image file.
|
1409 |
*
|
1410 |
* @return array Meta data variables
|
1411 |
*/
|
1412 |
+
public static function mla_fetch_attachment_image_metadata( $post_id, $path = '' ) {
|
1413 |
+
$results = array(
|
1414 |
+
'mla_iptc_metadata' => array(),
|
1415 |
+
'mla_exif_metadata' => array()
|
1416 |
+
);
|
1417 |
+
|
1418 |
+
if ( 0 != $post_id )
|
1419 |
+
$path = get_attached_file($post_id);
|
1420 |
+
|
1421 |
+
if ( ! empty( $path ) ) {
|
1422 |
+
$size = getimagesize( $path, $info );
|
1423 |
+
foreach ( $info as $key => $value ) {
|
1424 |
+
}
|
1425 |
+
|
1426 |
+
if ( is_callable( 'iptcparse' ) ) {
|
1427 |
+
if ( !empty( $info['APP13'] ) ) {
|
1428 |
+
$iptc_values = iptcparse( $info['APP13'] );
|
1429 |
+
if ( ! is_array( $iptc_values ) )
|
1430 |
+
$iptc_values = array();
|
1431 |
+
|
1432 |
+
foreach ( $iptc_values as $key => $value ) {
|
1433 |
+
if ( in_array( $key, array( '1#000', '1#020', '1#022', '1#120', '1#122', '2#000', '2#200', '2#201' ) ) ) {
|
1434 |
+
$value = unpack( 'nbinary', $value[0] );
|
1435 |
+
$results['mla_iptc_metadata'][ $key ] = (string) $value['binary'];
|
1436 |
+
}
|
1437 |
+
elseif ( 1 == count( $value ) )
|
1438 |
+
$results['mla_iptc_metadata'][ $key ] = $value[0];
|
1439 |
+
else
|
1440 |
+
$results['mla_iptc_metadata'][ $key ] = $value;
|
1441 |
+
|
1442 |
+
} // foreach $value
|
1443 |
+
} // !empty
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
if ( is_callable( 'exif_read_data' ) && in_array( $size[2], array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) {
|
1447 |
+
$results['mla_exif_metadata'] = exif_read_data( $path );
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
|
1451 |
+
/*
|
1452 |
+
* Expand EXIF array values
|
1453 |
+
*/
|
1454 |
+
foreach ( $results['mla_exif_metadata'] as $exif_key => $exif_value ) {
|
1455 |
+
if ( is_array( $exif_value ) ) {
|
1456 |
+
foreach ( $exif_value as $key => $value ) {
|
1457 |
+
$results['mla_exif_metadata'][ $exif_key . '.' . $key ] = $value;
|
1458 |
+
}
|
1459 |
+
} // is_array
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
return $results;
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
/**
|
1466 |
+
* Update a single item; change the meta data
|
1467 |
+
* for a single attachment.
|
1468 |
+
*
|
1469 |
+
* @since 0.1
|
1470 |
+
*
|
1471 |
+
* @param int The ID of the attachment to be updated
|
1472 |
+
* @param array Field name => value pairs
|
1473 |
+
* @param array Optional taxonomy term values, default null
|
1474 |
+
* @param array Optional taxonomy actions (add, remove, replace), default null
|
1475 |
+
*
|
1476 |
+
* @return array success/failure message and NULL content
|
1477 |
+
*/
|
1478 |
+
public static function mla_update_single_item( $post_id, $new_data, $tax_input = NULL, $tax_actions = NULL ) {
|
1479 |
+
$post_data = MLAData::mla_get_attachment_by_id( $post_id );
|
1480 |
+
|
1481 |
+
if ( !isset( $post_data ) )
|
1482 |
+
return array(
|
1483 |
+
'message' => 'ERROR: Could not retrieve Attachment.',
|
1484 |
+
'body' => ''
|
1485 |
+
);
|
1486 |
+
|
1487 |
+
$message = '';
|
1488 |
+
$updates = array( 'ID' => $post_id );
|
1489 |
+
$new_data = stripslashes_deep( $new_data );
|
1490 |
+
$new_meta = NULL;
|
1491 |
+
|
1492 |
+
foreach ( $new_data as $key => $value ) {
|
1493 |
+
switch ( $key ) {
|
1494 |
+
case 'post_title':
|
1495 |
+
if ( $value == $post_data[ $key ] )
|
1496 |
+
break;
|
1497 |
+
|
1498 |
+
$message .= sprintf( 'Changing Title from "%1$s" to "%2$s"<br>', esc_attr( $post_data[ $key ] ), esc_attr( $value ) );
|
1499 |
+
$updates[ $key ] = $value;
|
1500 |
+
break;
|
1501 |
+
case 'post_name':
|
1502 |
+
if ( $value == $post_data[ $key ] )
|
1503 |
+
break;
|
1504 |
+
|
1505 |
+
$value = sanitize_title( $value );
|
1506 |
+
|
1507 |
+
/*
|
1508 |
+
* Make sure new slug is unique
|
1509 |
+
*/
|
1510 |
+
$args = array(
|
1511 |
+
'name' => $value,
|
1512 |
+
'post_type' => 'attachment',
|
1513 |
+
'post_status' => 'inherit',
|
1514 |
+
'showposts' => 1
|
1515 |
+
);
|
1516 |
+
$my_posts = get_posts( $args );
|
1517 |
+
|
1518 |
+
if ( $my_posts ) {
|
1519 |
+
$message .= sprintf( 'ERROR: Could not change Name/Slug "%1$s"; name already exists<br>', $value );
|
1520 |
} else {
|
1521 |
+
$message .= sprintf( 'Changing Name/Slug from "%1$s" to "%2$s"<br>', esc_attr( $post_data[ $key ] ), $value );
|
1522 |
+
$updates[ $key ] = $value;
|
1523 |
}
|
1524 |
+
break;
|
1525 |
+
case 'image_alt':
|
1526 |
+
$key = 'mla_wp_attachment_image_alt';
|
1527 |
+
if ( !isset( $post_data[ $key ] ) )
|
1528 |
+
$post_data[ $key ] = '';
|
1529 |
+
|
1530 |
+
if ( $value == $post_data[ $key ] )
|
1531 |
+
break;
|
1532 |
+
|
1533 |
+
if ( empty( $value ) ) {
|
1534 |
+
if ( delete_post_meta( $post_id, '_wp_attachment_image_alt', $value ) )
|
1535 |
+
$message .= sprintf( 'Deleting Alternate Text, was "%1$s"<br>', esc_attr( $post_data[ $key ] ) );
|
1536 |
+
else
|
1537 |
+
$message .= sprintf( 'ERROR: Could not delete Alternate Text, remains "%1$s"<br>', esc_attr( $post_data[ $key ] ) );
|
1538 |
+
} else {
|
1539 |
+
if ( update_post_meta( $post_id, '_wp_attachment_image_alt', $value ) )
|
1540 |
+
$message .= sprintf( 'Changing Alternate Text from "%1$s" to "%2$s"<br>', esc_attr( $post_data[ $key ] ), esc_attr( $value ) );
|
1541 |
+
else
|
1542 |
+
$message .= sprintf( 'ERROR: Could not change Alternate Text from "%1$s" to "%2$s"<br>', esc_attr( $post_data[ $key ] ), esc_attr( $value ) );
|
1543 |
+
}
|
1544 |
+
break;
|
1545 |
+
case 'post_excerpt':
|
1546 |
+
if ( $value == $post_data[ $key ] )
|
1547 |
+
break;
|
1548 |
+
|
1549 |
+
$message .= sprintf( 'Changing Caption from "%1$s" to "%2$s"<br>', esc_attr( $post_data[ $key ] ), esc_attr( $value ) );
|
1550 |
+
$updates[ $key ] = $value;
|
1551 |
+
break;
|
1552 |
+
case 'post_content':
|
1553 |
+
if ( $value == $post_data[ $key ] )
|
1554 |
+
break;
|
1555 |
+
|
1556 |
+
$message .= sprintf( 'Changing Description from "%1$s" to "%2$s"<br>', esc_textarea( $post_data[ $key ] ), esc_textarea( $value ) );
|
1557 |
+
$updates[ $key ] = $value;
|
1558 |
+
break;
|
1559 |
+
case 'post_parent':
|
1560 |
+
if ( $value == $post_data[ $key ] )
|
1561 |
+
break;
|
1562 |
+
|
1563 |
+
$value = absint( $value );
|
1564 |
+
|
1565 |
+
$message .= sprintf( 'Changing Parent from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
1566 |
+
$updates[ $key ] = $value;
|
1567 |
+
break;
|
1568 |
+
case 'menu_order':
|
1569 |
+
if ( $value == $post_data[ $key ] )
|
1570 |
+
break;
|
1571 |
+
|
1572 |
+
$value = absint( $value );
|
1573 |
+
|
1574 |
+
$message .= sprintf( 'Changing Menu Order from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
1575 |
+
$updates[ $key ] = $value;
|
1576 |
+
break;
|
1577 |
+
case 'post_author':
|
1578 |
+
if ( $value == $post_data[ $key ] )
|
1579 |
+
break;
|
1580 |
+
|
1581 |
+
$value = absint( $value );
|
1582 |
+
|
1583 |
+
$from_user = get_userdata( $post_data[ $key ] );
|
1584 |
+
$to_user = get_userdata( $value );
|
1585 |
+
$message .= sprintf( 'Changing Author from "%1$s" to "%2$s"<br>', $from_user->display_name, $to_user->display_name );
|
1586 |
+
$updates[ $key ] = $value;
|
1587 |
+
break;
|
1588 |
+
case 'taxonomy_updates':
|
1589 |
+
$tax_input = $value['inputs'];
|
1590 |
+
$tax_actions = $value['actions'];
|
1591 |
+
break;
|
1592 |
+
case 'custom_updates':
|
1593 |
+
$new_meta = $value;
|
1594 |
+
break;
|
1595 |
+
default:
|
1596 |
+
// Ignore anything else
|
1597 |
+
} // switch $key
|
1598 |
+
} // foreach $new_data
|
1599 |
+
|
1600 |
+
if ( !empty( $tax_input ) ) {
|
1601 |
+
foreach ( $tax_input as $taxonomy => $tags ) {
|
1602 |
+
if ( !empty( $tax_actions ) )
|
1603 |
+
$tax_action = $tax_actions[ $taxonomy ];
|
1604 |
+
else
|
1605 |
+
$tax_action = 'replace';
|
1606 |
+
|
1607 |
+
$taxonomy_obj = get_taxonomy( $taxonomy );
|
1608 |
+
|
1609 |
+
if ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
|
1610 |
+
$terms_before = wp_get_post_terms( $post_id, $taxonomy, array(
|
1611 |
+
'fields' => 'ids' // all'
|
1612 |
+
) );
|
1613 |
+
if ( is_array( $tags ) ) // array = hierarchical, string = non-hierarchical.
|
1614 |
+
$tags = array_filter( $tags );
|
1615 |
+
|
1616 |
+
switch ( $tax_action ) {
|
1617 |
+
case 'add':
|
1618 |
+
$action_name = 'Adding';
|
1619 |
+
$result = wp_set_post_terms( $post_id, $tags, $taxonomy, true );
|
1620 |
+
break;
|
1621 |
+
case 'remove':
|
1622 |
+
$action_name = 'Removing';
|
1623 |
+
$tags = self::_remove_tags( $terms_before, $tags, $taxonomy_obj );
|
1624 |
+
$result = wp_set_post_terms( $post_id, $tags, $taxonomy );
|
1625 |
+
break;
|
1626 |
+
case 'replace':
|
1627 |
+
$action_name = 'Replacing';
|
1628 |
+
$result = wp_set_post_terms( $post_id, $tags, $taxonomy );
|
1629 |
+
break;
|
1630 |
+
default:
|
1631 |
+
$action_name = 'Ignoring';
|
1632 |
+
$result = NULL;
|
1633 |
+
// ignore anything else
|
1634 |
+
}
|
1635 |
+
|
1636 |
+
$terms_after = wp_get_post_terms( $post_id, $taxonomy, array(
|
1637 |
+
'fields' => 'ids' // all'
|
1638 |
+
) );
|
1639 |
+
|
1640 |
+
if ( $terms_before != $terms_after )
|
1641 |
+
$message .= sprintf( '%1$s "%2$s" terms<br>', $action_name, $taxonomy );
|
1642 |
+
} // current_user_can
|
1643 |
+
else {
|
1644 |
+
$message .= sprintf( 'You cannot assign "%1$s" terms<br>', $action_name, $taxonomy );
|
1645 |
}
|
1646 |
+
} // foreach $tax_input
|
1647 |
+
} // !empty $tax_input
|
1648 |
+
|
1649 |
+
if ( is_array( $new_meta ) ) {
|
1650 |
+
foreach ( $new_meta as $meta_key => $meta_value ) {
|
1651 |
+
if ( isset( $post_data[ 'mla_item_' . $meta_key ] ) )
|
1652 |
+
$old_meta_value = $post_data[ 'mla_item_' . $meta_key ];
|
1653 |
else
|
1654 |
+
$old_meta_value = '';
|
1655 |
+
|
1656 |
+
if ( $old_meta_value != $meta_value ) {
|
1657 |
+
$message .= sprintf( 'Changing %1$s from "%2$s" to "%3$s"<br>', $meta_key, $old_meta_value, $meta_value );
|
1658 |
+
$results = update_post_meta( $post_id, $meta_key, $meta_value );
|
1659 |
+
}
|
1660 |
+
} // foreach $new_meta
|
1661 |
+
}
|
1662 |
+
|
1663 |
+
if ( empty( $message ) )
|
1664 |
+
return array(
|
1665 |
+
'message' => 'Item: ' . $post_id . ', no changes detected.',
|
1666 |
+
'body' => ''
|
1667 |
+
);
|
1668 |
+
else {
|
1669 |
+
if ( wp_update_post( $updates ) ) {
|
1670 |
+
$final_message = 'Item: ' . $post_id . ' updated.';
|
1671 |
+
/*
|
1672 |
+
* Uncomment this for debugging.
|
1673 |
+
*/
|
1674 |
+
// $final_message .= '<br>' . $message;
|
1675 |
|
1676 |
+
return array(
|
1677 |
+
'message' => $final_message,
|
1678 |
+
'body' => ''
|
1679 |
+
);
|
1680 |
}
|
1681 |
+
else
|
1682 |
+
return array(
|
1683 |
+
'message' => 'ERROR: Item ' . $post_id . ' update failed.',
|
1684 |
+
'body' => ''
|
1685 |
+
);
|
1686 |
}
|
1687 |
+
}
|
1688 |
+
|
1689 |
+
/**
|
1690 |
+
* Remove tags from a term ids list
|
1691 |
+
*
|
1692 |
+
* @since 0.40
|
1693 |
+
*
|
1694 |
+
* @param array The term ids currently assigned
|
1695 |
+
* @param array | string The term ids (array) or names (string) to remove
|
1696 |
+
* @param object The taxonomy object
|
1697 |
+
*
|
1698 |
+
* @return array Term ids of the surviving tags
|
1699 |
+
*/
|
1700 |
+
private static function _remove_tags( $terms_before, $tags, $taxonomy_obj ) {
|
1701 |
+
if ( ! is_array( $tags ) ) {
|
1702 |
+
/*
|
1703 |
+
* Convert names to term ids
|
1704 |
+
*/
|
1705 |
+
$comma = _x( ',', 'tag delimiter' );
|
1706 |
+
if ( ',' !== $comma )
|
1707 |
+
$tags = str_replace( $comma, ',', $tags );
|
1708 |
+
$terms = explode( ',', trim( $tags, " \n\t\r\0\x0B," ) );
|
1709 |
+
|
1710 |
+
$tags = array();
|
1711 |
+
foreach ( (array) $terms as $term) {
|
1712 |
+
if ( !strlen(trim($term)) )
|
1713 |
+
continue;
|
1714 |
+
|
1715 |
+
// Skip if a non-existent term name is passed.
|
1716 |
+
if ( ! $term_info = term_exists($term, $taxonomy_obj->name ) )
|
1717 |
+
continue;
|
1718 |
+
|
1719 |
+
if ( is_wp_error($term_info) )
|
1720 |
+
continue;
|
1721 |
+
|
1722 |
+
$tags[] = $term_info['term_id'];
|
1723 |
+
} // foreach term
|
1724 |
+
} // not an array
|
1725 |
|
1726 |
+
$tags = array_map( 'intval', $tags );
|
1727 |
+
$tags = array_unique( $tags );
|
1728 |
+
$terms_after = array_diff( array_map( 'intval', $terms_before ), $tags );
|
1729 |
+
return $terms_after;
|
1730 |
}
|
1731 |
|
1732 |
+
/**
|
1733 |
+
* Format printable version of binary data
|
1734 |
+
*
|
1735 |
+
* @since 0.90
|
1736 |
+
*
|
1737 |
+
* @param string Binary data
|
1738 |
+
* @param integer Bytes to format, default = 0 (all bytes)
|
1739 |
+
* @param intger Bytes to format on each line
|
1740 |
+
*
|
1741 |
+
* @return string Printable representation of $data
|
1742 |
+
*/
|
1743 |
+
private static function _hex_dump( $data, $limit = 0, $bytes_per_row = 16 ) {
|
1744 |
+
if ( 0 == $limit )
|
1745 |
+
$limit = strlen( $data );
|
1746 |
+
|
1747 |
+
$position = 0;
|
1748 |
+
$output = "\r\n";
|
1749 |
+
|
1750 |
+
while ( $position < $limit ) {
|
1751 |
+
$row_length = strlen( substr( $data, $position ) );
|
1752 |
+
|
1753 |
+
if ( $row_length > ( $limit - $position ) )
|
1754 |
+
$row_length = $limit - $position;
|
1755 |
+
|
1756 |
+
if ( $row_length > $bytes_per_row )
|
1757 |
+
$row_length = $bytes_per_row;
|
1758 |
+
|
1759 |
+
$row_data = substr( $data, $position, $row_length );
|
1760 |
+
|
1761 |
+
$print_string = '';
|
1762 |
+
$hex_string = '';
|
1763 |
+
for ( $index = 0; $index < $row_length; $index++ ) {
|
1764 |
+
$char = ord( substr( $row_data, $index, 1 ) );
|
1765 |
+
if ( ( 31 < $char ) && ( 127 > $char ) )
|
1766 |
+
$print_string .= chr($char);
|
1767 |
+
else
|
1768 |
+
$print_string .= '.';
|
1769 |
+
|
1770 |
+
$hex_string .= ' ' . bin2hex( chr($char) );
|
1771 |
+
} // for
|
1772 |
+
|
1773 |
+
$output .= str_pad( $print_string, $bytes_per_row, ' ', STR_PAD_RIGHT ) . $hex_string . "\r\n";
|
1774 |
+
$position += $row_length;
|
1775 |
+
} // while
|
1776 |
+
|
1777 |
+
return $output;
|
1778 |
+
}
|
1779 |
} // class MLAData
|
1780 |
?>
|
includes/class-mla-edit-media.php
ADDED
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Media Library Assistant Edit Media screen enhancements
|
4 |
+
*
|
5 |
+
* @package Media Library Assistant
|
6 |
+
* @since 0.80
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen
|
11 |
+
*
|
12 |
+
* @package Media Library Assistant
|
13 |
+
* @since 0.80
|
14 |
+
*/
|
15 |
+
class MLAEdit {
|
16 |
+
/**
|
17 |
+
* Initialization function, similar to __construct()
|
18 |
+
*
|
19 |
+
* @since 0.80
|
20 |
+
*
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
public static function initialize() {
|
24 |
+
/*
|
25 |
+
* WordPress 3.5 uses the advanced-form-edit.php function for the Edit Media
|
26 |
+
* page. This supports all the standard meta-boxes for post types.
|
27 |
+
*/
|
28 |
+
if ( MLATest::$wordpress_3point5_plus ) {
|
29 |
+
add_action( 'admin_init', 'MLAEdit::mla_custom_field_support_action' );
|
30 |
+
|
31 |
+
add_action( 'add_meta_boxes', 'MLAEdit::mla_add_meta_boxes_action', 10, 2 );
|
32 |
+
|
33 |
+
// apply_filters( 'post_updated_messages', $messages ) in wp-admin/edit-form-advanced.php
|
34 |
+
add_filter( 'post_updated_messages', 'MLAEdit::mla_post_updated_messages_filter', 10, 1 );
|
35 |
+
|
36 |
+
// do_action in wp-admin/includes/meta-boxes.php function attachment_submit_meta_box
|
37 |
+
add_action( 'attachment_submitbox_misc_actions', 'MLAEdit::mla_attachment_submitbox_action' );
|
38 |
+
|
39 |
+
// do_action in wp-includes/post.php function wp_insert_post
|
40 |
+
add_action( 'edit_attachment', 'MLAEdit::mla_edit_attachment_action', 10, 1 );
|
41 |
+
|
42 |
+
// apply_filters( 'admin_title', $admin_title, $title ) in /wp-admin/admin-header.php
|
43 |
+
add_filter( 'admin_title', 'MLAEdit::mla_edit_add_help_tab', 10, 2 );
|
44 |
+
} // $wordpress_3point5_plus
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Adds Custom Field support to the Edit Media screen.
|
49 |
+
* Declared public because it is an action.
|
50 |
+
*
|
51 |
+
* @since 0.80
|
52 |
+
*
|
53 |
+
* @return void echoes the HTML markup for the label and value
|
54 |
+
*/
|
55 |
+
public static function mla_custom_field_support_action( ) {
|
56 |
+
add_post_type_support( 'attachment', 'custom-fields' );
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Adds mapping update messages for display at the top of the Edit Media screen.
|
61 |
+
* Declared public because it is a filter.
|
62 |
+
*
|
63 |
+
* @since 1.10
|
64 |
+
*
|
65 |
+
* @param array messages for the Edit screen
|
66 |
+
*
|
67 |
+
* @return array updated messages
|
68 |
+
*/
|
69 |
+
public static function mla_post_updated_messages_filter( $messages ) {
|
70 |
+
if ( isset( $messages['attachment'] ) ) {
|
71 |
+
$messages['attachment'][101] = 'Custom Field mapping updated.';
|
72 |
+
$messages['attachment'][102] = 'IPTC/EXIF mapping updated.';
|
73 |
+
}
|
74 |
+
|
75 |
+
return $messages;
|
76 |
+
} // mla_post_updated_messages_filter
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Adds Last Modified date to the Submit box on the Edit Media screen.
|
80 |
+
* Declared public because it is an action.
|
81 |
+
*
|
82 |
+
* @since 0.80
|
83 |
+
*
|
84 |
+
* @return void echoes the HTML markup for the label and value
|
85 |
+
*/
|
86 |
+
public static function mla_attachment_submitbox_action( ) {
|
87 |
+
global $post;
|
88 |
+
|
89 |
+
$datef = __( 'M j, Y @ G:i' );
|
90 |
+
$stamp = __('Last modified: <b>%1$s</b>');
|
91 |
+
$date = date_i18n( $datef, strtotime( $post->post_modified ) );
|
92 |
+
echo '<div class="misc-pub-section curtime">' . "\r\n";
|
93 |
+
echo '<span id="timestamp">' . sprintf($stamp, $date) . "</span>\r\n";
|
94 |
+
echo "</div><!-- .misc-pub-section -->\r\n";
|
95 |
+
echo '<div class="misc-pub-section mla-links">' . "\r\n";
|
96 |
+
|
97 |
+
$view_args = array( 'page' => 'mla-menu', 'mla_item_ID' => $post->ID );
|
98 |
+
if ( isset( $_REQUEST['mla_source'] ) )
|
99 |
+
$view_args['mla_source'] = $_REQUEST['mla_source'];
|
100 |
+
|
101 |
+
echo '<span id="mla_metadata_links" style="font-weight: bold; line-height: 2em">';
|
102 |
+
echo '<a href="' . add_query_arg( $view_args, wp_nonce_url( 'upload.php?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP, MLA::MLA_ADMIN_NONCE ) ) . '" title="Map Custom Field metadata for this item">Map Custom Field Metadata</a><br>';
|
103 |
+
echo '<a href="' . add_query_arg( $view_args, wp_nonce_url( 'upload.php?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_MAP, MLA::MLA_ADMIN_NONCE ) ) . '" title="Map IPTC/EXIF metadata for this item">Map IPTC/EXIF Metadata</a>';
|
104 |
+
echo "</span>\r\n";
|
105 |
+
echo "</div><!-- .misc-pub-section -->\r\n";
|
106 |
+
} // mla_attachment_submitbox_action
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Registers meta boxes for the Edit Media screen.
|
110 |
+
* Declared public because it is an action.
|
111 |
+
*
|
112 |
+
* @since 0.80
|
113 |
+
*
|
114 |
+
* @param string type of the current post, e.g., 'attachment'
|
115 |
+
* @param object current post
|
116 |
+
*
|
117 |
+
* @return void
|
118 |
+
*/
|
119 |
+
public static function mla_add_meta_boxes_action( $post_type, $post ) {
|
120 |
+
if ( 'attachment' == $post_type ) {
|
121 |
+
add_meta_box( 'mla-parent-info', 'Parent Info', 'MLAEdit::mla_parent_info_handler', 'attachment', 'normal', 'core' );
|
122 |
+
add_meta_box( 'mla-menu-order', 'Menu Order', 'MLAEdit::mla_menu_order_handler', 'attachment', 'normal', 'core' );
|
123 |
+
|
124 |
+
$image_metadata = get_metadata( 'post', $post->ID, '_wp_attachment_metadata', true );
|
125 |
+
if ( !empty( $image_metadata ) )
|
126 |
+
add_meta_box( 'mla-image-metadata', 'Image Metadata', 'MLAEdit::mla_image_metadata_handler', 'attachment', 'normal', 'core' );
|
127 |
+
|
128 |
+
if ( MLAOptions::$process_featured_in )
|
129 |
+
add_meta_box( 'mla-featured-in', 'Featured in', 'MLAEdit::mla_featured_in_handler', 'attachment', 'normal', 'core' );
|
130 |
+
if ( MLAOptions::$process_inserted_in )
|
131 |
+
add_meta_box( 'mla-inserted-in', 'Inserted in', 'MLAEdit::mla_inserted_in_handler', 'attachment', 'normal', 'core' );
|
132 |
+
if ( MLAOptions::$process_gallery_in )
|
133 |
+
add_meta_box( 'mla-gallery-in', 'Gallery in', 'MLAEdit::mla_gallery_in_handler', 'attachment', 'normal', 'core' );
|
134 |
+
if ( MLAOptions::$process_mla_gallery_in )
|
135 |
+
add_meta_box( 'mla-mla-gallery-in', 'MLA Gallery in', 'MLAEdit::mla_mla_gallery_in_handler', 'attachment', 'normal', 'core' );
|
136 |
+
} // 'attachment'
|
137 |
+
} // mla_add_meta_boxes_action
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Add contextual help tabs to the WordPress Edit Media page
|
141 |
+
*
|
142 |
+
* @since 0.90
|
143 |
+
*
|
144 |
+
* @param string title as shown on the screen
|
145 |
+
* @param string title as shown in the HTML header
|
146 |
+
*
|
147 |
+
* @return void
|
148 |
+
*/
|
149 |
+
public static function mla_edit_add_help_tab( $admin_title, $title ) {
|
150 |
+
$screen = get_current_screen();
|
151 |
+
|
152 |
+
if ( ( 'attachment' != $screen->id ) || ( 'attachment' != $screen->post_type ) || ( 'post' != $screen->base ) )
|
153 |
+
return $admin_title;
|
154 |
+
|
155 |
+
$template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/help-for-edit_attachment.tpl' );
|
156 |
+
if ( empty( $template_array ) ) {
|
157 |
+
return $admin_title;
|
158 |
+
}
|
159 |
+
|
160 |
+
/*
|
161 |
+
* Provide explicit control over tab order
|
162 |
+
*/
|
163 |
+
$tab_array = array();
|
164 |
+
|
165 |
+
foreach ( $template_array as $id => $content ) {
|
166 |
+
$match_count = preg_match( '#\<!-- title="(.+)" order="(.+)" --\>#', $content, $matches, PREG_OFFSET_CAPTURE );
|
167 |
+
|
168 |
+
if ( $match_count > 0 ) {
|
169 |
+
$tab_array[ $matches[ 2 ][ 0 ] ] = array(
|
170 |
+
'id' => $id,
|
171 |
+
'title' => $matches[ 1 ][ 0 ],
|
172 |
+
'content' => $content
|
173 |
+
);
|
174 |
+
} else {
|
175 |
+
error_log( 'ERROR: mla_edit_add_help_tab discarding '.var_export( $id, true ), 0 );
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
ksort( $tab_array, SORT_NUMERIC );
|
180 |
+
foreach ( $tab_array as $indx => $value ) {
|
181 |
+
$screen->add_help_tab( $value );
|
182 |
+
}
|
183 |
+
|
184 |
+
return $admin_title;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Where-used values for the current item
|
189 |
+
*
|
190 |
+
* This array contains the Featured/Inserted/Gallery/MLA Gallery references for the item.
|
191 |
+
* The array is built once each page load and cached for subsequent calls.
|
192 |
+
*
|
193 |
+
* @since 0.80
|
194 |
+
*
|
195 |
+
* @var array
|
196 |
+
*/
|
197 |
+
private static $mla_references = null;
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Renders the Parent Info meta box on the Edit Media page.
|
201 |
+
* Declared public because it is a callback function.
|
202 |
+
*
|
203 |
+
* @since 0.80
|
204 |
+
*
|
205 |
+
* @param object current post
|
206 |
+
*
|
207 |
+
* @return void echoes the HTML markup for the meta box content
|
208 |
+
*/
|
209 |
+
public static function mla_parent_info_handler( $post ) {
|
210 |
+
if ( is_null( self::$mla_references ) )
|
211 |
+
self::$mla_references = MLAData::mla_fetch_attachment_references( $post->ID, $post->post_parent );
|
212 |
+
|
213 |
+
if ( is_array( self::$mla_references ) ) {
|
214 |
+
if ( empty(self::$mla_references['parent_title'] ) )
|
215 |
+
$parent_info = self::$mla_references['parent_errors'];
|
216 |
+
else
|
217 |
+
$parent_info = sprintf( '(%1$s) %2$s %3$s', self::$mla_references['parent_type'], self::$mla_references['parent_title'], self::$mla_references['parent_errors'] );
|
218 |
+
} // is_array
|
219 |
+
|
220 |
+
echo '<label class="screen-reader-text" for="mla_post_parent">Post Parent</label><input name="mla_post_parent" type="text" size="4" id="mla_post_parent" value="' . $post->post_parent . "\" />\r\n";
|
221 |
+
echo '<label class="screen-reader-text" for="mla_parent_info">Parent Info</label><input class="readonly" name="mla_parent_info" type="text" readonly="readonly" size="60" id="mla_parent_info" value="' . esc_attr( $parent_info ) . "\" />\r\n";
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Renders the Menu Order meta box on the Edit Media page.
|
226 |
+
* Declared public because it is a callback function.
|
227 |
+
*
|
228 |
+
* @since 0.80
|
229 |
+
*
|
230 |
+
* @param object current post
|
231 |
+
*
|
232 |
+
* @return void echoes the HTML markup for the meta box content
|
233 |
+
*/
|
234 |
+
public static function mla_menu_order_handler( $post ) {
|
235 |
+
|
236 |
+
echo '<label class="screen-reader-text" for="mla_menu_order">Menu Order</label><input name="mla_menu_order" type="text" size="4" id="mla_menu_order" value="' . $post->menu_order . "\" />\r\n";
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Renders the Image Metadata meta box on the Edit Media page.
|
241 |
+
* Declared public because it is a callback function.
|
242 |
+
*
|
243 |
+
* @since 0.80
|
244 |
+
*
|
245 |
+
* @param object current post
|
246 |
+
*
|
247 |
+
* @return void echoes the HTML markup for the meta box content
|
248 |
+
*/
|
249 |
+
public static function mla_image_metadata_handler( $post ) {
|
250 |
+
$metadata = MLAData::mla_fetch_attachment_metadata( $post->ID );
|
251 |
+
|
252 |
+
if ( isset( $metadata['mla_wp_attachment_metadata'] ) )
|
253 |
+
$value = var_export( $metadata['mla_wp_attachment_metadata'], true );
|
254 |
+
else
|
255 |
+
$value = '';
|
256 |
+
|
257 |
+
echo '<label class="screen-reader-text" for="mla_image_metadata">Image Metadata</label><textarea class="readonly" id="mla_image_metadata" rows="5" cols="80" readonly="readonly" name="mla_image_metadata" >' . esc_textarea( $value ) . "</textarea>\r\n";
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Renders the Featured in meta box on the Edit Media page.
|
262 |
+
* Declared public because it is a callback function.
|
263 |
+
*
|
264 |
+
* @since 0.80
|
265 |
+
*
|
266 |
+
* @param object current post
|
267 |
+
*
|
268 |
+
* @return void echoes the HTML markup for the meta box content
|
269 |
+
*/
|
270 |
+
public static function mla_featured_in_handler( $post ) {
|
271 |
+
if ( is_null( self::$mla_references ) )
|
272 |
+
self::$mla_references = MLAData::mla_fetch_attachment_references( $post->ID, $post->post_parent );
|
273 |
+
|
274 |
+
if ( is_array( self::$mla_references ) ) {
|
275 |
+
$features = '';
|
276 |
+
|
277 |
+
foreach ( self::$mla_references['features'] as $feature_id => $feature ) {
|
278 |
+
if ( $feature_id == $post->post_parent )
|
279 |
+
$parent = 'PARENT ';
|
280 |
+
else
|
281 |
+
$parent = '';
|
282 |
+
|
283 |
+
$features .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $feature->post_type, /*$3%s*/ $feature_id, /*$4%s*/ $feature->post_title ) . "\r\n";
|
284 |
+
} // foreach $feature
|
285 |
+
}
|
286 |
+
|
287 |
+
echo '<label class="screen-reader-text" for="mla_featured_in">Featured in</label><textarea class="readonly" id="mla_featured_in" rows="5" cols="80" readonly="readonly" name="mla_featured_in" >' . esc_textarea( $features ) . "</textarea>\r\n";
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Renders the Inserted in meta box on the Edit Media page.
|
292 |
+
* Declared public because it is a callback function.
|
293 |
+
*
|
294 |
+
* @since 0.80
|
295 |
+
*
|
296 |
+
* @param object current post
|
297 |
+
*
|
298 |
+
* @return void echoes the HTML markup for the meta box content
|
299 |
+
*/
|
300 |
+
public static function mla_inserted_in_handler( $post ) {
|
301 |
+
if ( is_null( self::$mla_references ) )
|
302 |
+
self::$mla_references = MLAData::mla_fetch_attachment_references( $post->ID, $post->post_parent );
|
303 |
+
|
304 |
+
if ( is_array( self::$mla_references ) ) {
|
305 |
+
$inserts = '';
|
306 |
+
|
307 |
+
foreach ( self::$mla_references['inserts'] as $file => $insert_array ) {
|
308 |
+
$inserts .= $file . "\r\n";
|
309 |
+
|
310 |
+
foreach ( $insert_array as $insert ) {
|
311 |
+
if ( $insert->ID == $post->post_parent )
|
312 |
+
$parent = ' PARENT ';
|
313 |
+
else
|
314 |
+
$parent = ' ';
|
315 |
+
|
316 |
+
$inserts .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $insert->post_type, /*$3%s*/ $insert->ID, /*$4%s*/ $insert->post_title ) . "\r\n";
|
317 |
+
} // foreach $insert
|
318 |
+
} // foreach $file
|
319 |
+
} // is_array
|
320 |
+
|
321 |
+
echo '<label class="screen-reader-text" for="mla_inserted_in">Inserted in</label><textarea class="readonly" id="mla_inserted_in" rows="5" cols="80" readonly="readonly" name="mla_inserted_in" >' . esc_textarea( $inserts ) . "</textarea>\r\n";
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Renders the Gallery in meta box on the Edit Media page.
|
326 |
+
* Declared public because it is a callback function.
|
327 |
+
*
|
328 |
+
* @since 0.80
|
329 |
+
*
|
330 |
+
* @param object current post
|
331 |
+
*
|
332 |
+
* @return void echoes the HTML markup for the meta box content
|
333 |
+
*/
|
334 |
+
public static function mla_gallery_in_handler( $post ) {
|
335 |
+
if ( is_null( self::$mla_references ) )
|
336 |
+
self::$mla_references = MLAData::mla_fetch_attachment_references( $post->ID, $post->post_parent );
|
337 |
+
|
338 |
+
$galleries = '';
|
339 |
+
|
340 |
+
if ( is_array( self::$mla_references ) ) {
|
341 |
+
foreach ( self::$mla_references['galleries'] as $gallery_id => $gallery ) {
|
342 |
+
if ( $gallery_id == $post->post_parent )
|
343 |
+
$parent = 'PARENT ';
|
344 |
+
else
|
345 |
+
$parent = '';
|
346 |
+
|
347 |
+
$galleries .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $gallery['post_type'], /*$3%s*/ $gallery_id, /*$4%s*/ $gallery['post_title'] ) . "\r\n";
|
348 |
+
} // foreach $feature
|
349 |
+
}
|
350 |
+
|
351 |
+
echo '<label class="screen-reader-text" for="mla_gallery_in">Gallery in</label><textarea class="readonly" id="mla_gallery_in" rows="5" cols="80" readonly="readonly" name="mla_gallery_in" >' . esc_textarea( $galleries ) . "</textarea>\r\n";
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Renders the Gallery in meta box on the Edit Media page.
|
356 |
+
* Declared public because it is a callback function.
|
357 |
+
*
|
358 |
+
* @since 0.80
|
359 |
+
*
|
360 |
+
* @param object current post
|
361 |
+
*
|
362 |
+
* @return void echoes the HTML markup for the meta box content
|
363 |
+
*/
|
364 |
+
public static function mla_mla_gallery_in_handler( $post ) {
|
365 |
+
if ( is_null( self::$mla_references ) )
|
366 |
+
self::$mla_references = MLAData::mla_fetch_attachment_references( $post->ID, $post->post_parent );
|
367 |
+
|
368 |
+
$galleries = '';
|
369 |
+
|
370 |
+
if ( is_array( self::$mla_references ) ) {
|
371 |
+
foreach ( self::$mla_references['mla_galleries'] as $gallery_id => $gallery ) {
|
372 |
+
if ( $gallery_id == $post->post_parent )
|
373 |
+
$parent = 'PARENT ';
|
374 |
+
else
|
375 |
+
$parent = '';
|
376 |
+
|
377 |
+
$galleries .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $gallery['post_type'], /*$3%s*/ $gallery_id, /*$4%s*/ $gallery['post_title'] ) . "\r\n";
|
378 |
+
} // foreach $feature
|
379 |
+
}
|
380 |
+
|
381 |
+
echo '<label class="screen-reader-text" for="mla_mla_gallery_in">MLA Gallery in</label><textarea class="readonly" id="mla_mla_gallery_in" rows="5" cols="80" readonly="readonly" name="mla_mla_gallery_in" >' . esc_textarea( $galleries ) . "</textarea>\r\n";
|
382 |
+
}
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Saves updates from the Edit Media screen.
|
386 |
+
* Declared public because it is an action.
|
387 |
+
*
|
388 |
+
* @since 0.80
|
389 |
+
*
|
390 |
+
* @param integer ID of the current post
|
391 |
+
*
|
392 |
+
* @return void
|
393 |
+
*/
|
394 |
+
public static function mla_edit_attachment_action( $post_ID ) {
|
395 |
+
$new_data = array();
|
396 |
+
if ( isset( $_REQUEST['mla_post_parent'] ) )
|
397 |
+
$new_data['post_parent'] = $_REQUEST['mla_post_parent'];
|
398 |
+
|
399 |
+
if ( isset( $_REQUEST['mla_menu_order'] ) )
|
400 |
+
$new_data['menu_order'] = $_REQUEST['mla_menu_order'];
|
401 |
+
|
402 |
+
if ( !empty( $new_data ) ) {
|
403 |
+
MLAData::mla_update_single_item( $post_ID, $new_data );
|
404 |
+
}
|
405 |
+
} // mla_edit_attachment_action
|
406 |
+
} //Class MLAEdit
|
407 |
+
?>
|
includes/class-mla-list-table.php
CHANGED
@@ -7,14 +7,16 @@
|
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
-
* The WP_List_Table class isn't automatically available to plugins
|
11 |
*/
|
12 |
if ( !class_exists( 'WP_List_Table' ) ) {
|
13 |
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
14 |
}
|
15 |
|
16 |
/**
|
17 |
-
* Class MLA (Media Library Assistant) List Table
|
|
|
|
|
18 |
*
|
19 |
* @package Media Library Assistant
|
20 |
* @since 0.1
|
@@ -44,10 +46,10 @@ class MLA_List_Table extends WP_List_Table {
|
|
44 |
*
|
45 |
* @var array
|
46 |
*/
|
47 |
-
private $currently_hidden = array(
|
48 |
|
49 |
/*
|
50 |
-
* These arrays
|
51 |
*/
|
52 |
|
53 |
/**
|
@@ -61,6 +63,9 @@ class MLA_List_Table extends WP_List_Table {
|
|
61 |
* column in your table you must create a column_cb() method. If you don't need
|
62 |
* bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
|
63 |
*
|
|
|
|
|
|
|
64 |
* @since 0.1
|
65 |
*
|
66 |
* @var array
|
@@ -73,21 +78,26 @@ class MLA_List_Table extends WP_List_Table {
|
|
73 |
'post_title' => 'Title',
|
74 |
'post_name' => 'Name',
|
75 |
'parent' => 'Parent ID',
|
|
|
76 |
'featured' => 'Featured in',
|
77 |
'inserted' => 'Inserted in',
|
|
|
|
|
78 |
'alt_text' => 'ALT Text',
|
79 |
'caption' => 'Caption',
|
80 |
'description' => 'Description',
|
|
|
81 |
'base_file' => 'Base File',
|
82 |
'date' => 'Date',
|
|
|
83 |
'author' => 'Author',
|
84 |
-
'attached_to' => 'Attached to'
|
85 |
-
|
86 |
-
|
87 |
);
|
88 |
|
89 |
/**
|
90 |
-
* Default values for
|
91 |
*
|
92 |
* This array is used when the user-level option is not set, i.e.,
|
93 |
* the user has not altered the selection of hidden columns.
|
@@ -95,6 +105,9 @@ class MLA_List_Table extends WP_List_Table {
|
|
95 |
* The value on the right-hand side must match the column slug, e.g.,
|
96 |
* array(0 => 'ID_parent, 1 => 'title_name').
|
97 |
*
|
|
|
|
|
|
|
98 |
* @since 0.1
|
99 |
*
|
100 |
* @var array
|
@@ -102,20 +115,24 @@ class MLA_List_Table extends WP_List_Table {
|
|
102 |
private static $default_hidden_columns = array(
|
103 |
// 'ID_parent',
|
104 |
// 'title_name',
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
108 |
// 'featured',
|
109 |
// 'inserted,
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
119 |
);
|
120 |
|
121 |
/**
|
@@ -129,27 +146,35 @@ class MLA_List_Table extends WP_List_Table {
|
|
129 |
* The array value also contains a boolean which is 'true' if the data is currently
|
130 |
* sorted by that column. This is computed each time the table is displayed.
|
131 |
*
|
|
|
|
|
|
|
132 |
* @since 0.1
|
133 |
*
|
134 |
* @var array
|
135 |
*/
|
136 |
private static $default_sortable_columns = array(
|
137 |
-
'ID_parent'
|
138 |
-
'title_name'
|
139 |
-
'post_title'
|
140 |
-
'post_name'
|
141 |
-
'parent'
|
|
|
142 |
// 'featured' => array('featured',false),
|
143 |
// 'inserted' => array('inserted',false),
|
144 |
-
// '
|
|
|
|
|
145 |
'caption' => array('post_excerpt',false),
|
146 |
'description' => array('post_content',false),
|
147 |
-
|
|
|
148 |
'date' => array('post_date',false),
|
|
|
149 |
'author' => array('post_author',false),
|
150 |
'attached_to' => array('post_parent',false),
|
151 |
-
//
|
152 |
-
//
|
153 |
);
|
154 |
|
155 |
/**
|
@@ -164,6 +189,124 @@ class MLA_List_Table extends WP_List_Table {
|
|
164 |
return MLA_List_Table::$default_hidden_columns;
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
/**
|
168 |
* Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'
|
169 |
*
|
@@ -179,7 +322,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
179 |
*
|
180 |
* @return array updated list of hidden columns
|
181 |
*/
|
182 |
-
public static function
|
183 |
if ( $result )
|
184 |
return $result;
|
185 |
else
|
@@ -197,35 +340,73 @@ class MLA_List_Table extends WP_List_Table {
|
|
197 |
*
|
198 |
* @return array list of table columns
|
199 |
*/
|
200 |
-
public static function
|
201 |
{
|
202 |
return MLA_List_Table::$default_columns;
|
203 |
}
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
/**
|
206 |
* Initializes some properties from $_REQUEST vairables, then
|
207 |
* calls the parent constructor to set some default configs.
|
208 |
*
|
209 |
* @since 0.1
|
|
|
|
|
210 |
*/
|
211 |
function __construct( ) {
|
212 |
-
$this->detached = isset( $_REQUEST['detached'] )
|
213 |
$this->is_trash = isset( $_REQUEST['status'] ) && $_REQUEST['status'] == 'trash';
|
214 |
|
215 |
//Set parent defaults
|
216 |
parent::__construct( array(
|
217 |
-
|
218 |
'plural' => 'attachments', //plural name of the listed records
|
219 |
-
'ajax' => true //does this table support ajax?
|
|
|
220 |
) );
|
221 |
|
222 |
$this->currently_hidden = self::get_hidden_columns();
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
|
225 |
/**
|
226 |
-
*
|
227 |
-
*
|
228 |
-
*
|
|
|
|
|
229 |
*
|
230 |
* @since 0.1
|
231 |
*
|
@@ -234,8 +415,52 @@ class MLA_List_Table extends WP_List_Table {
|
|
234 |
* @return string Text or HTML to be placed inside the column
|
235 |
*/
|
236 |
function column_default( $item, $column_name ) {
|
237 |
-
|
238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
}
|
240 |
|
241 |
/**
|
@@ -274,13 +499,13 @@ class MLA_List_Table extends WP_List_Table {
|
|
274 |
*
|
275 |
* @since 0.1
|
276 |
*
|
277 |
-
* @param
|
278 |
* @param string Current column name
|
279 |
*
|
280 |
* @return array Names and URLs of row-level actions
|
281 |
*/
|
282 |
private function _build_rollover_actions( $item, $column ) {
|
283 |
-
$actions = array(
|
284 |
|
285 |
if ( ( $this->rollover_id != $item->ID ) && !in_array( $column, $this->currently_hidden ) ) {
|
286 |
/*
|
@@ -291,6 +516,15 @@ class MLA_List_Table extends WP_List_Table {
|
|
291 |
'page' => $_REQUEST['page'],
|
292 |
'mla_item_ID' => $item->ID
|
293 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
if ( isset( $_REQUEST['detached'] ) )
|
296 |
$view_args['detached'] = $_REQUEST['detached'];
|
@@ -302,24 +536,34 @@ class MLA_List_Table extends WP_List_Table {
|
|
302 |
if ( isset( $_REQUEST['m'] ) )
|
303 |
$view_args['m'] = $_REQUEST['m'];
|
304 |
|
305 |
-
if ( isset( $_REQUEST['
|
306 |
-
$view_args['
|
307 |
-
|
308 |
if ( current_user_can( 'edit_post', $item->ID ) ) {
|
309 |
if ( $this->is_trash )
|
310 |
-
$actions['restore'] = '<a class="submitdelete" href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_RESTORE, MLA::MLA_ADMIN_NONCE ) ) . '">Restore</a>';
|
311 |
-
else
|
312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
} // edit_post
|
314 |
|
315 |
if ( current_user_can( 'delete_post', $item->ID ) ) {
|
316 |
if ( !$this->is_trash && EMPTY_TRASH_DAYS && MEDIA_TRASH )
|
317 |
-
$actions['trash'] = '<a class="submitdelete" href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_TRASH, MLA::MLA_ADMIN_NONCE ) ) . '">Move to Trash</a>';
|
318 |
else {
|
319 |
// If using trash for posts and pages but not for attachments, warn before permanently deleting
|
320 |
$delete_ays = EMPTY_TRASH_DAYS && !MEDIA_TRASH ? ' onclick="return showNotice.warn();"' : '';
|
321 |
|
322 |
-
$actions['delete'] = '<a class="submitdelete"' . $delete_ays . ' href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_DELETE, MLA::MLA_ADMIN_NONCE ) ) . '">Delete Permanently</a>';
|
323 |
}
|
324 |
} // delete_post
|
325 |
|
@@ -329,6 +573,55 @@ class MLA_List_Table extends WP_List_Table {
|
|
329 |
return $actions;
|
330 |
}
|
331 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
/**
|
333 |
* Supply the content for a custom column
|
334 |
*
|
@@ -339,11 +632,25 @@ class MLA_List_Table extends WP_List_Table {
|
|
339 |
*/
|
340 |
function column_ID_parent( $item ) {
|
341 |
$row_actions = self::_build_rollover_actions( $item, 'ID_parent' );
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
if ( !empty( $row_actions ) ) {
|
344 |
-
return sprintf( '%1$s<br><span style="color:silver"
|
345 |
} else {
|
346 |
-
return sprintf( '%1$s<br><span style="color:silver"
|
347 |
}
|
348 |
}
|
349 |
|
@@ -356,23 +663,17 @@ class MLA_List_Table extends WP_List_Table {
|
|
356 |
* @return string HTML markup to be placed inside the column
|
357 |
*/
|
358 |
function column_title_name( $item ) {
|
359 |
-
$errors = '';
|
360 |
-
if ( !$item->references['found_reference'] )
|
361 |
-
$errors .= '(ORPHAN) ';
|
362 |
-
|
363 |
-
if ( $item->references['is_unattached'] )
|
364 |
-
$errors .= '(UNATTACHED) ';
|
365 |
-
else {
|
366 |
-
if ( !$item->references['found_parent'] )
|
367 |
-
$errors .= '(BAD PARENT) ';
|
368 |
-
}
|
369 |
-
|
370 |
$row_actions = self::_build_rollover_actions( $item, 'title_name' );
|
|
|
|
|
|
|
|
|
|
|
371 |
|
372 |
if ( !empty( $row_actions ) ) {
|
373 |
-
return sprintf( '%1$s<br>%2$s<br>%3$s%4$s', /*%1$s*/ $
|
374 |
} else {
|
375 |
-
return sprintf( '%1$s<br>%2$s<br>%3$s', /*%1$s*/ $
|
376 |
}
|
377 |
}
|
378 |
|
@@ -388,9 +689,9 @@ class MLA_List_Table extends WP_List_Table {
|
|
388 |
$row_actions = self::_build_rollover_actions( $item, 'post_title' );
|
389 |
|
390 |
if ( !empty( $row_actions ) ) {
|
391 |
-
return sprintf( '%1$s<br>%2$s', /*%1$s*/ $item->post_title, /*%2$s*/ $this->row_actions( $row_actions ) );
|
392 |
} else {
|
393 |
-
return $item->post_title;
|
394 |
}
|
395 |
}
|
396 |
|
@@ -406,9 +707,9 @@ class MLA_List_Table extends WP_List_Table {
|
|
406 |
$row_actions = self::_build_rollover_actions( $item, 'post_name' );
|
407 |
|
408 |
if ( !empty( $row_actions ) ) {
|
409 |
-
return sprintf( '%1$s<br>%2$s', /*%1$s*/ $item->post_name, /*%2$s*/ $this->row_actions( $row_actions ) );
|
410 |
} else {
|
411 |
-
return $item->post_name;
|
412 |
}
|
413 |
}
|
414 |
|
@@ -421,7 +722,32 @@ class MLA_List_Table extends WP_List_Table {
|
|
421 |
* @return string HTML markup to be placed inside the column
|
422 |
*/
|
423 |
function column_parent( $item ) {
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
}
|
426 |
|
427 |
/**
|
@@ -433,17 +759,23 @@ class MLA_List_Table extends WP_List_Table {
|
|
433 |
* @return string HTML markup to be placed inside the column
|
434 |
*/
|
435 |
function column_featured( $item ) {
|
|
|
|
|
|
|
436 |
$value = '';
|
437 |
|
438 |
-
foreach ( $item->
|
439 |
-
// error_log("\$feature = ".var_export($feature, true), 0);
|
440 |
-
|
441 |
if ( $feature_id == $item->post_parent )
|
442 |
-
$parent = 'PARENT
|
443 |
else
|
444 |
$parent = '';
|
445 |
|
446 |
-
$value .= sprintf( '%1$s
|
|
|
|
|
|
|
|
|
|
|
447 |
} // foreach $feature
|
448 |
|
449 |
return $value;
|
@@ -458,26 +790,94 @@ class MLA_List_Table extends WP_List_Table {
|
|
458 |
* @return string HTML markup to be placed inside the column
|
459 |
*/
|
460 |
function column_inserted( $item ) {
|
|
|
|
|
|
|
461 |
$value = '';
|
462 |
|
463 |
-
foreach ( $item->
|
464 |
-
// error_log("\$file = ".var_export($file, true), 0);
|
465 |
-
// error_log("\$inserts = ".var_export($inserts, true), 0);
|
466 |
$value .= sprintf( '<strong>%1$s</strong><br>', $file );
|
467 |
|
468 |
foreach ( $inserts as $insert ) {
|
469 |
if ( $insert->ID == $item->post_parent )
|
470 |
-
$parent = '
|
471 |
else
|
472 |
-
$parent = '
|
473 |
|
474 |
-
|
|
|
|
|
|
|
|
|
|
|
475 |
} // foreach $insert
|
476 |
} // foreach $file
|
477 |
|
478 |
return $value;
|
479 |
}
|
480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
/**
|
482 |
* Supply the content for a custom column
|
483 |
*
|
@@ -488,7 +888,12 @@ class MLA_List_Table extends WP_List_Table {
|
|
488 |
*/
|
489 |
function column_alt_text( $item ) {
|
490 |
if ( isset( $item->mla_wp_attachment_image_alt ) )
|
491 |
-
return
|
|
|
|
|
|
|
|
|
|
|
492 |
else
|
493 |
return '';
|
494 |
}
|
@@ -502,7 +907,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
502 |
* @return string HTML markup to be placed inside the column
|
503 |
*/
|
504 |
function column_caption( $item ) {
|
505 |
-
return $item->post_excerpt;
|
506 |
}
|
507 |
|
508 |
/**
|
@@ -514,7 +919,19 @@ class MLA_List_Table extends WP_List_Table {
|
|
514 |
* @return string HTML markup to be placed inside the column
|
515 |
*/
|
516 |
function column_description( $item ) {
|
517 |
-
return $item->post_content;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
}
|
519 |
|
520 |
/**
|
@@ -526,7 +943,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
526 |
* @return string HTML markup to be placed inside the column
|
527 |
*/
|
528 |
function column_base_file( $item ) {
|
529 |
-
return $item->
|
530 |
}
|
531 |
|
532 |
/**
|
@@ -561,7 +978,36 @@ class MLA_List_Table extends WP_List_Table {
|
|
561 |
/**
|
562 |
* Supply the content for a custom column
|
563 |
*
|
564 |
-
* @since 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
*
|
566 |
* @param array A singular attachment (post) object
|
567 |
* @return string HTML markup to be placed inside the column
|
@@ -570,7 +1016,11 @@ class MLA_List_Table extends WP_List_Table {
|
|
570 |
$user = get_user_by( 'id', $item->post_author );
|
571 |
|
572 |
if ( isset( $user->data->display_name ) )
|
573 |
-
return
|
|
|
|
|
|
|
|
|
574 |
else
|
575 |
return 'unknown';
|
576 |
}
|
@@ -590,12 +1040,15 @@ class MLA_List_Table extends WP_List_Table {
|
|
590 |
$parent_date = '';
|
591 |
|
592 |
if ( isset( $item->parent_title ) )
|
593 |
-
$parent_title =
|
|
|
|
|
|
|
594 |
else
|
595 |
$parent_title = '(Unattached)';
|
596 |
|
597 |
if ( isset( $item->parent_type ) )
|
598 |
-
$parent_type = '(' . $item->parent_type . ')';
|
599 |
else
|
600 |
$parent_type = '';
|
601 |
|
@@ -603,80 +1056,14 @@ class MLA_List_Table extends WP_List_Table {
|
|
603 |
}
|
604 |
|
605 |
/**
|
606 |
-
*
|
607 |
-
*
|
608 |
-
* @since 0.1
|
609 |
-
*
|
610 |
-
* @param array A singular attachment (post) object
|
611 |
-
* @return string HTML markup to be placed inside the column
|
612 |
-
*/
|
613 |
-
function column_categories( $item ) {
|
614 |
-
if ( ( 'checked' == MLASettings::mla_get_option( 'attachment_category' ) ) && ( is_object_in_taxonomy( 'attachment', 'attachment_category' ) ) ) {
|
615 |
-
$terms = wp_get_object_terms( $item->ID, 'attachment_category' );
|
616 |
-
if ( !is_wp_error( $terms ) ) {
|
617 |
-
if ( empty( $terms ) )
|
618 |
-
return 'none';
|
619 |
-
else {
|
620 |
-
$list = array( );
|
621 |
-
foreach ( $terms as $term ) {
|
622 |
-
$list[ ] = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
623 |
-
'page' => 'mla-menu',
|
624 |
-
'att_cat' => $term->term_id,
|
625 |
-
'heading_suffix' => urlencode( $term->name )
|
626 |
-
), 'upload.php' ) ), esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'category', 'display' ) ) );
|
627 |
-
} // foreach $term
|
628 |
-
|
629 |
-
return join( ', ', $list );
|
630 |
-
} // !empty $terms
|
631 |
-
} // if !is_wp_error
|
632 |
-
} // 'checked'
|
633 |
-
else {
|
634 |
-
return 'not supported';
|
635 |
-
}
|
636 |
-
}
|
637 |
-
|
638 |
-
/**
|
639 |
-
* Supply the content for a custom column
|
640 |
-
*
|
641 |
-
* @since 0.1
|
642 |
-
*
|
643 |
-
* @param array A singular attachment (post) object
|
644 |
-
* @return string HTML markup to be placed inside the column
|
645 |
-
*/
|
646 |
-
function column_tags( $item ) {
|
647 |
-
if ( ( 'checked' == MLASettings::mla_get_option( 'attachment_tag' ) ) && ( is_object_in_taxonomy( 'attachment', 'attachment_tag' ) ) ) {
|
648 |
-
$terms = wp_get_object_terms( $item->ID, 'attachment_tag' );
|
649 |
-
if ( !is_wp_error( $terms ) ) {
|
650 |
-
if ( empty( $terms ) )
|
651 |
-
return 'none';
|
652 |
-
else {
|
653 |
-
$list = array( );
|
654 |
-
foreach ( $terms as $term ) {
|
655 |
-
$list[ ] = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
656 |
-
'page' => 'mla-menu',
|
657 |
-
'attachment_tag' => $term->slug,
|
658 |
-
'heading_suffix' => urlencode( $term->name )
|
659 |
-
), 'upload.php' ) ), esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'category', 'display' ) ) );
|
660 |
-
} // foreach $term
|
661 |
-
|
662 |
-
return join( ', ', $list );
|
663 |
-
} // !empty $terms
|
664 |
-
} // if !is_wp_error
|
665 |
-
} // 'checked'
|
666 |
-
else {
|
667 |
-
return 'not supported';
|
668 |
-
}
|
669 |
-
}
|
670 |
-
|
671 |
-
/**
|
672 |
-
* This method dictates the table's columns and titles.
|
673 |
*
|
674 |
* @since 0.1
|
675 |
*
|
676 |
* @return array Column information: 'slugs'=>'Visible Titles'
|
677 |
*/
|
678 |
function get_columns( ) {
|
679 |
-
return $columns = MLA_List_Table::
|
680 |
}
|
681 |
|
682 |
/**
|
@@ -705,7 +1092,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
705 |
* @since 0.1
|
706 |
*
|
707 |
* @return array Sortable column information,e.g.,
|
708 |
-
* 'slugs'=>array('data_values',
|
709 |
*/
|
710 |
function get_sortable_columns( ) {
|
711 |
$columns = MLA_List_Table::$default_sortable_columns;
|
@@ -722,7 +1109,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
722 |
} else {
|
723 |
$columns['title_name'][ 1 ] = true;
|
724 |
}
|
725 |
-
|
726 |
return $columns;
|
727 |
}
|
728 |
|
@@ -737,12 +1124,17 @@ class MLA_List_Table extends WP_List_Table {
|
|
737 |
function get_views( ) {
|
738 |
global $wpdb;
|
739 |
|
740 |
-
$type_links = array(
|
741 |
$_num_posts = (array) wp_count_attachments();
|
742 |
$_total_posts = array_sum( $_num_posts ) - $_num_posts['trash'];
|
743 |
-
$total_orphans = $wpdb->get_var(
|
|
|
|
|
|
|
|
|
|
|
744 |
|
745 |
-
$post_mime_types =
|
746 |
$avail_post_mime_types = $this->_avail_mime_types( $_num_posts );
|
747 |
$matches = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) );
|
748 |
|
@@ -756,9 +1148,9 @@ class MLA_List_Table extends WP_List_Table {
|
|
756 |
'm' => $_REQUEST['m']
|
757 |
), $base_url );
|
758 |
|
759 |
-
if ( isset( $_REQUEST['
|
760 |
$base_url = add_query_arg( array(
|
761 |
-
'
|
762 |
), $base_url );
|
763 |
|
764 |
foreach ( $matches as $type => $reals )
|
@@ -782,7 +1174,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
782 |
'post_mime_type' => $mime_type
|
783 |
), $base_url ) . "'$class>" . sprintf( translate_nooped_plural( $label[ 2 ], $num_posts[ $mime_type ] ), number_format_i18n( $num_posts[ $mime_type ] ) ) . '</a>';
|
784 |
}
|
785 |
-
} // foreach
|
786 |
|
787 |
$type_links['detached'] = '<a href="' . add_query_arg( array(
|
788 |
'detached' => '1'
|
@@ -806,16 +1198,14 @@ class MLA_List_Table extends WP_List_Table {
|
|
806 |
*/
|
807 |
function get_bulk_actions( )
|
808 |
{
|
809 |
-
$actions = array(
|
810 |
|
811 |
if ( $this->is_trash ) {
|
812 |
$actions['restore'] = 'Restore';
|
813 |
$actions['delete'] = 'Delete Permanently';
|
814 |
} else {
|
815 |
-
|
816 |
// $actions['attach'] = 'Attach';
|
817 |
-
// $actions['catagorize'] = 'Catagorize';
|
818 |
-
// $actions['tag'] = 'Tag';
|
819 |
|
820 |
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
|
821 |
$actions['trash'] = 'Move to Trash';
|
@@ -827,8 +1217,9 @@ class MLA_List_Table extends WP_List_Table {
|
|
827 |
}
|
828 |
|
829 |
/**
|
830 |
-
* Extra controls to be displayed between bulk actions and pagination
|
831 |
-
*
|
|
|
832 |
*
|
833 |
* @since 0.1
|
834 |
*
|
@@ -843,10 +1234,12 @@ class MLA_List_Table extends WP_List_Table {
|
|
843 |
if ( 'top' == $which ) {
|
844 |
$this->months_dropdown( 'attachment' );
|
845 |
|
846 |
-
|
|
|
|
|
847 |
$dropdown_options = array(
|
848 |
-
'show_option_all' => 'All
|
849 |
-
'show_option_none' => 'No
|
850 |
'orderby' => 'ID',
|
851 |
'order' => 'ASC',
|
852 |
'show_count' => false,
|
@@ -857,13 +1250,13 @@ class MLA_List_Table extends WP_List_Table {
|
|
857 |
'echo' => true,
|
858 |
'depth' => 3,
|
859 |
'tab_index' => 0,
|
860 |
-
'name' => '
|
861 |
'id' => 'name',
|
862 |
'class' => 'postform',
|
863 |
-
'selected' => isset( $_REQUEST['
|
864 |
'hierarchical' => true,
|
865 |
'pad_counts' => false,
|
866 |
-
'taxonomy' =>
|
867 |
'hide_if_empty' => false
|
868 |
);
|
869 |
|
@@ -883,7 +1276,7 @@ class MLA_List_Table extends WP_List_Table {
|
|
883 |
}
|
884 |
|
885 |
/**
|
886 |
-
* Prepares the list of items for displaying
|
887 |
*
|
888 |
* This is where you prepare your data for display. This method will usually
|
889 |
* be used to query the database, sort and filter the data, and generally
|
@@ -891,6 +1284,8 @@ class MLA_List_Table extends WP_List_Table {
|
|
891 |
* $this->set_pagination_args().
|
892 |
*
|
893 |
* @since 0.1
|
|
|
|
|
894 |
*/
|
895 |
function prepare_items( ) {
|
896 |
$this->_column_headers = array(
|
@@ -899,18 +1294,10 @@ class MLA_List_Table extends WP_List_Table {
|
|
899 |
$this->get_sortable_columns()
|
900 |
);
|
901 |
|
902 |
-
/*
|
903 |
-
* Use sort and pagination data to build a custom query.
|
904 |
-
*/
|
905 |
-
|
906 |
-
$orderby = ( !empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'post_title'; //If no sort, default to title
|
907 |
-
$order = ( !empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc
|
908 |
-
|
909 |
/*
|
910 |
* REQUIRED for pagination.
|
911 |
*/
|
912 |
-
$
|
913 |
-
$total_items = $this->_count_list_table_items( $_REQUEST );
|
914 |
$user = get_current_user_id();
|
915 |
$screen = get_current_screen();
|
916 |
$option = $screen->get_option( 'per_page', 'option' );
|
@@ -919,12 +1306,6 @@ class MLA_List_Table extends WP_List_Table {
|
|
919 |
$per_page = $screen->get_option( 'per_page', 'default' );
|
920 |
}
|
921 |
|
922 |
-
/*
|
923 |
-
* REQUIRED. Assign sorted and paginated data to the items property, where
|
924 |
-
* it can be used by the rest of the class.
|
925 |
-
*/
|
926 |
-
$this->items = MLAData::mla_query_list_table_items( $_REQUEST, $orderby, $order, ( ( $current_page - 1 ) * $per_page ), $per_page );
|
927 |
-
|
928 |
/*
|
929 |
* REQUIRED. We also have to register our pagination options & calculations.
|
930 |
*/
|
@@ -933,124 +1314,32 @@ class MLA_List_Table extends WP_List_Table {
|
|
933 |
'per_page' => $per_page, //WE have to determine how many items to show on a page
|
934 |
'total_pages' => ceil( $total_items / $per_page ) //WE have to calculate the total number of pages
|
935 |
) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
}
|
937 |
|
938 |
/**
|
939 |
-
*
|
940 |
-
* Modeled after get_post_mime_types in wp-admin/includes/post.php,
|
941 |
-
* with additional entries.
|
942 |
-
*
|
943 |
-
* @since 0.1
|
944 |
-
*
|
945 |
-
* @return array Mime type names and HTML markup for views
|
946 |
-
*/
|
947 |
-
private function _mime_types( )
|
948 |
-
{
|
949 |
-
return array(
|
950 |
-
'image' => array(
|
951 |
-
0 => 'Images',
|
952 |
-
1 => 'Manage Images',
|
953 |
-
2 => array(
|
954 |
-
0 => 'Image <span class="count">(%s)</span>',
|
955 |
-
1 => 'Images <span class="count">(%s)</span>',
|
956 |
-
'singular' => 'Image <span class="count">(%s)</span>',
|
957 |
-
'plural' => 'Images <span class="count">(%s)</span>',
|
958 |
-
'context' => NULL,
|
959 |
-
'domain' => NULL
|
960 |
-
)
|
961 |
-
),
|
962 |
-
'audio' => array(
|
963 |
-
0 => 'Audio',
|
964 |
-
1 => 'Manage Audio',
|
965 |
-
2 => array(
|
966 |
-
0 => 'Audio <span class="count">(%s)</span>',
|
967 |
-
1 => 'Audio <span class="count">(%s)</span>',
|
968 |
-
'singular' => 'Audio <span class="count">(%s)</span>',
|
969 |
-
'plural' => 'Audio <span class="count">(%s)</span>',
|
970 |
-
'context' => NULL,
|
971 |
-
'domain' => NULL
|
972 |
-
)
|
973 |
-
),
|
974 |
-
'video' => array(
|
975 |
-
0 => 'Video',
|
976 |
-
1 => 'Manage Video',
|
977 |
-
2 => array(
|
978 |
-
0 => 'Video <span class="count">(%s)</span>',
|
979 |
-
1 => 'Video <span class="count">(%s)</span>',
|
980 |
-
'singular' => 'Video <span class="count">(%s)</span>',
|
981 |
-
'plural' => 'Video <span class="count">(%s)</span>',
|
982 |
-
'context' => NULL,
|
983 |
-
'domain' => NULL
|
984 |
-
)
|
985 |
-
),
|
986 |
-
'text' => array(
|
987 |
-
0 => 'Text',
|
988 |
-
1 => 'Manage Text',
|
989 |
-
2 => array(
|
990 |
-
0 => 'Text <span class="count">(%s)</span>',
|
991 |
-
1 => 'Text <span class="count">(%s)</span>',
|
992 |
-
'singular' => 'Text <span class="count">(%s)</span>',
|
993 |
-
'plural' => 'Text <span class="count">(%s)</span>',
|
994 |
-
'context' => NULL,
|
995 |
-
'domain' => NULL
|
996 |
-
)
|
997 |
-
),
|
998 |
-
'application' => array(
|
999 |
-
0 => 'Applications',
|
1000 |
-
1 => 'Manage Applications',
|
1001 |
-
2 => array(
|
1002 |
-
0 => 'Application <span class="count">(%s)</span>',
|
1003 |
-
1 => 'Applications <span class="count">(%s)</span>',
|
1004 |
-
'singular' => 'Application <span class="count">(%s)</span>',
|
1005 |
-
'plural' => 'Applications <span class="count">(%s)</span>',
|
1006 |
-
'context' => NULL,
|
1007 |
-
'domain' => NULL
|
1008 |
-
)
|
1009 |
-
)
|
1010 |
-
);
|
1011 |
-
}
|
1012 |
-
|
1013 |
-
/**
|
1014 |
-
* Get mime types with one or more attachments for view preparation.
|
1015 |
-
* Modeled after get_available_post_mime_types in wp-admin/includes/post.php,
|
1016 |
-
* with additional entries.
|
1017 |
-
*
|
1018 |
-
* @since 0.1
|
1019 |
-
*
|
1020 |
-
* @param array Number of posts for each mime type
|
1021 |
-
*
|
1022 |
-
* @return array Mime type names
|
1023 |
-
*/
|
1024 |
-
private function _avail_mime_types( $num_posts ) {
|
1025 |
-
$availible = array( );
|
1026 |
-
|
1027 |
-
foreach ( $num_posts as $mime_type => $number ) {
|
1028 |
-
if ( ( $number > 0 ) && ( $mime_type <> 'trash' ) )
|
1029 |
-
$available[ ] = $mime_type;
|
1030 |
-
}
|
1031 |
-
|
1032 |
-
return $available;
|
1033 |
-
}
|
1034 |
-
|
1035 |
-
/**
|
1036 |
-
* Get the total number of attachment posts
|
1037 |
*
|
1038 |
-
* @since
|
1039 |
*
|
1040 |
-
* @param
|
1041 |
*
|
1042 |
-
* @return
|
1043 |
*/
|
1044 |
-
|
1045 |
-
|
1046 |
-
$
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
remove_filter( 'posts_where', 'MLAData::mla_query_list_table_items_helper' );
|
1052 |
-
|
1053 |
-
return $results->found_posts;
|
1054 |
}
|
1055 |
} // class MLA_List_Table
|
1056 |
|
@@ -1058,6 +1347,8 @@ class MLA_List_Table extends WP_List_Table {
|
|
1058 |
* Filters are added here, when the source file is loaded, because the MLA_List_Table
|
1059 |
* object is created too late to be useful.
|
1060 |
*/
|
1061 |
-
|
1062 |
-
|
|
|
|
|
1063 |
?>
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
+
* The WP_List_Table class isn't automatically available to plugins
|
11 |
*/
|
12 |
if ( !class_exists( 'WP_List_Table' ) ) {
|
13 |
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
14 |
}
|
15 |
|
16 |
/**
|
17 |
+
* Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu
|
18 |
+
*
|
19 |
+
* Extends the core WP_List_Table class.
|
20 |
*
|
21 |
* @package Media Library Assistant
|
22 |
* @since 0.1
|
46 |
*
|
47 |
* @var array
|
48 |
*/
|
49 |
+
private $currently_hidden = array();
|
50 |
|
51 |
/*
|
52 |
+
* These arrays define the table columns.
|
53 |
*/
|
54 |
|
55 |
/**
|
63 |
* column in your table you must create a column_cb() method. If you don't need
|
64 |
* bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
|
65 |
*
|
66 |
+
* Taxonomy columns are added to this array by mla_admin_init_action.
|
67 |
+
* Custom field columns are added to this array by mla_admin_init_action.
|
68 |
+
*
|
69 |
* @since 0.1
|
70 |
*
|
71 |
* @var array
|
78 |
'post_title' => 'Title',
|
79 |
'post_name' => 'Name',
|
80 |
'parent' => 'Parent ID',
|
81 |
+
'menu_order' => 'Menu Order',
|
82 |
'featured' => 'Featured in',
|
83 |
'inserted' => 'Inserted in',
|
84 |
+
'galleries' => 'Gallery in',
|
85 |
+
'mla_galleries' => 'MLA Gallery in',
|
86 |
'alt_text' => 'ALT Text',
|
87 |
'caption' => 'Caption',
|
88 |
'description' => 'Description',
|
89 |
+
'post_mime_type' => 'MIME Type',
|
90 |
'base_file' => 'Base File',
|
91 |
'date' => 'Date',
|
92 |
+
'modified' => 'Last Modified',
|
93 |
'author' => 'Author',
|
94 |
+
'attached_to' => 'Attached to'
|
95 |
+
// taxonomy columns added by mla_admin_init_action
|
96 |
+
// custom field columns added by mla_admin_init_action
|
97 |
);
|
98 |
|
99 |
/**
|
100 |
+
* Default values for hidden columns
|
101 |
*
|
102 |
* This array is used when the user-level option is not set, i.e.,
|
103 |
* the user has not altered the selection of hidden columns.
|
105 |
* The value on the right-hand side must match the column slug, e.g.,
|
106 |
* array(0 => 'ID_parent, 1 => 'title_name').
|
107 |
*
|
108 |
+
* Taxonomy columns are added to this array by mla_admin_init_action.
|
109 |
+
* Custom field columns are added to this array by mla_admin_init_action.
|
110 |
+
*
|
111 |
* @since 0.1
|
112 |
*
|
113 |
* @var array
|
115 |
private static $default_hidden_columns = array(
|
116 |
// 'ID_parent',
|
117 |
// 'title_name',
|
118 |
+
'post_title',
|
119 |
+
'post_name',
|
120 |
+
'parent',
|
121 |
+
'menu_order',
|
122 |
// 'featured',
|
123 |
// 'inserted,
|
124 |
+
'galleries',
|
125 |
+
'mla_galleries',
|
126 |
+
'alt_text',
|
127 |
+
'caption',
|
128 |
+
'description',
|
129 |
+
'post_mime_type',
|
130 |
+
'base_file',
|
131 |
+
'date',
|
132 |
+
'modified',
|
133 |
+
'author',
|
134 |
+
'attached_to',
|
135 |
+
// taxonomy columns added by mla_admin_init_action
|
136 |
);
|
137 |
|
138 |
/**
|
146 |
* The array value also contains a boolean which is 'true' if the data is currently
|
147 |
* sorted by that column. This is computed each time the table is displayed.
|
148 |
*
|
149 |
+
* Taxonomy columns, if any, are added to this array by mla_admin_init_action.
|
150 |
+
* Custom field columns are added to this array by mla_admin_init_action.
|
151 |
+
*
|
152 |
* @since 0.1
|
153 |
*
|
154 |
* @var array
|
155 |
*/
|
156 |
private static $default_sortable_columns = array(
|
157 |
+
'ID_parent' => array('ID',false),
|
158 |
+
'title_name' => array('title_name',false),
|
159 |
+
'post_title' => array('post_title',false),
|
160 |
+
'post_name' => array('post_name',false),
|
161 |
+
'parent' => array('post_parent',false),
|
162 |
+
'menu_order' => array('menu_order',false),
|
163 |
// 'featured' => array('featured',false),
|
164 |
// 'inserted' => array('inserted',false),
|
165 |
+
// 'galleries' => array('galleries',false),
|
166 |
+
// 'mla_galleries' => array('mla_galleries',false),
|
167 |
+
'alt_text' => array('_wp_attachment_image_alt',false),
|
168 |
'caption' => array('post_excerpt',false),
|
169 |
'description' => array('post_content',false),
|
170 |
+
'post_mime_type' => array('post_mime_type',false),
|
171 |
+
'base_file' => array('_wp_attached_file',false),
|
172 |
'date' => array('post_date',false),
|
173 |
+
'modified' => array('post_modified',false),
|
174 |
'author' => array('post_author',false),
|
175 |
'attached_to' => array('post_parent',false),
|
176 |
+
// sortable taxonomy columns, if any, added by mla_admin_init_action
|
177 |
+
// sortable custom field columns, if any, added by mla_admin_init_action
|
178 |
);
|
179 |
|
180 |
/**
|
189 |
return MLA_List_Table::$default_hidden_columns;
|
190 |
}
|
191 |
|
192 |
+
/**
|
193 |
+
* Get mime types with one or more attachments for view preparation
|
194 |
+
*
|
195 |
+
* Modeled after get_available_post_mime_types in wp-admin/includes/post.php,
|
196 |
+
* with additional entries.
|
197 |
+
*
|
198 |
+
* @since 0.1
|
199 |
+
*
|
200 |
+
* @param array Number of posts for each mime type
|
201 |
+
*
|
202 |
+
* @return array Mime type names
|
203 |
+
*/
|
204 |
+
private function _avail_mime_types( $num_posts ) {
|
205 |
+
$available = array();
|
206 |
+
|
207 |
+
foreach ( $num_posts as $mime_type => $number ) {
|
208 |
+
if ( ( $number > 0 ) && ( $mime_type <> 'trash' ) )
|
209 |
+
$available[ ] = $mime_type;
|
210 |
+
}
|
211 |
+
|
212 |
+
return $available;
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Get possible mime types for view preparation
|
217 |
+
*
|
218 |
+
* Modeled after get_post_mime_types in wp-includes/post.php,
|
219 |
+
* with additional entries.
|
220 |
+
*
|
221 |
+
* @since 0.1
|
222 |
+
*
|
223 |
+
* @return array Mime type names and HTML markup for views
|
224 |
+
*/
|
225 |
+
public static function mla_get_attachment_mime_types( )
|
226 |
+
{
|
227 |
+
return array(
|
228 |
+
'image' => array(
|
229 |
+
0 => 'Images',
|
230 |
+
1 => 'Manage Images',
|
231 |
+
2 => array(
|
232 |
+
0 => 'Image <span class="count">(%s)</span>',
|
233 |
+
1 => 'Images <span class="count">(%s)</span>',
|
234 |
+
'singular' => 'Image <span class="count">(%s)</span>',
|
235 |
+
'plural' => 'Images <span class="count">(%s)</span>',
|
236 |
+
'context' => NULL,
|
237 |
+
'domain' => NULL
|
238 |
+
)
|
239 |
+
),
|
240 |
+
'audio' => array(
|
241 |
+
0 => 'Audio',
|
242 |
+
1 => 'Manage Audio',
|
243 |
+
2 => array(
|
244 |
+
0 => 'Audio <span class="count">(%s)</span>',
|
245 |
+
1 => 'Audio <span class="count">(%s)</span>',
|
246 |
+
'singular' => 'Audio <span class="count">(%s)</span>',
|
247 |
+
'plural' => 'Audio <span class="count">(%s)</span>',
|
248 |
+
'context' => NULL,
|
249 |
+
'domain' => NULL
|
250 |
+
)
|
251 |
+
),
|
252 |
+
'video' => array(
|
253 |
+
0 => 'Video',
|
254 |
+
1 => 'Manage Video',
|
255 |
+
2 => array(
|
256 |
+
0 => 'Video <span class="count">(%s)</span>',
|
257 |
+
1 => 'Video <span class="count">(%s)</span>',
|
258 |
+
'singular' => 'Video <span class="count">(%s)</span>',
|
259 |
+
'plural' => 'Video <span class="count">(%s)</span>',
|
260 |
+
'context' => NULL,
|
261 |
+
'domain' => NULL
|
262 |
+
)
|
263 |
+
),
|
264 |
+
'text' => array(
|
265 |
+
0 => 'Text',
|
266 |
+
1 => 'Manage Text',
|
267 |
+
2 => array(
|
268 |
+
0 => 'Text <span class="count">(%s)</span>',
|
269 |
+
1 => 'Text <span class="count">(%s)</span>',
|
270 |
+
'singular' => 'Text <span class="count">(%s)</span>',
|
271 |
+
'plural' => 'Text <span class="count">(%s)</span>',
|
272 |
+
'context' => NULL,
|
273 |
+
'domain' => NULL
|
274 |
+
)
|
275 |
+
),
|
276 |
+
'application' => array(
|
277 |
+
0 => 'Applications',
|
278 |
+
1 => 'Manage Applications',
|
279 |
+
2 => array(
|
280 |
+
0 => 'Application <span class="count">(%s)</span>',
|
281 |
+
1 => 'Applications <span class="count">(%s)</span>',
|
282 |
+
'singular' => 'Application <span class="count">(%s)</span>',
|
283 |
+
'plural' => 'Applications <span class="count">(%s)</span>',
|
284 |
+
'context' => NULL,
|
285 |
+
'domain' => NULL
|
286 |
+
)
|
287 |
+
)
|
288 |
+
);
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Return the names and display values of the sortable columns
|
293 |
+
*
|
294 |
+
* @since 0.30
|
295 |
+
*
|
296 |
+
* @return array name => array( orderby value, heading ) for sortable columns
|
297 |
+
*/
|
298 |
+
public static function mla_get_sortable_columns( )
|
299 |
+
{
|
300 |
+
$results = array() ;
|
301 |
+
|
302 |
+
foreach ( MLA_List_Table::$default_sortable_columns as $key => $value ) {
|
303 |
+
$value[1] = MLA_List_Table::$default_columns[ $key ];
|
304 |
+
$results[ $key ] = $value;
|
305 |
+
}
|
306 |
+
|
307 |
+
return $results;
|
308 |
+
}
|
309 |
+
|
310 |
/**
|
311 |
* Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'
|
312 |
*
|
322 |
*
|
323 |
* @return array updated list of hidden columns
|
324 |
*/
|
325 |
+
public static function mla_manage_hidden_columns_filter( $result, $option, $user_data ) {
|
326 |
if ( $result )
|
327 |
return $result;
|
328 |
else
|
340 |
*
|
341 |
* @return array list of table columns
|
342 |
*/
|
343 |
+
public static function mla_manage_columns_filter( )
|
344 |
{
|
345 |
return MLA_List_Table::$default_columns;
|
346 |
}
|
347 |
|
348 |
+
/**
|
349 |
+
* Adds support for taxonomy columns
|
350 |
+
*
|
351 |
+
* Called in the admin_init action because the list_table object isn't
|
352 |
+
* created in time to affect the "screen options" setup.
|
353 |
+
*
|
354 |
+
* @since 0.30
|
355 |
+
*
|
356 |
+
* @return void
|
357 |
+
*/
|
358 |
+
public static function mla_admin_init_action( )
|
359 |
+
{
|
360 |
+
$taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'names' );
|
361 |
+
|
362 |
+
foreach ( $taxonomies as $tax_name ) {
|
363 |
+
if ( MLAOptions::mla_taxonomy_support( $tax_name ) ) {
|
364 |
+
$tax_object = get_taxonomy( $tax_name );
|
365 |
+
MLA_List_Table::$default_columns[ 't_' . $tax_name ] = $tax_object->labels->name;
|
366 |
+
MLA_List_Table::$default_hidden_columns [] = 't_' . $tax_name;
|
367 |
+
// MLA_List_Table::$default_sortable_columns [] = none at this time
|
368 |
+
} // supported taxonomy
|
369 |
+
} // foreach $tax_name
|
370 |
+
|
371 |
+
MLA_List_Table::$default_columns = array_merge( MLA_List_Table::$default_columns, MLAOptions::mla_custom_field_support( 'default_columns' ) );
|
372 |
+
MLA_List_Table::$default_hidden_columns = array_merge( MLA_List_Table::$default_hidden_columns, MLAOptions::mla_custom_field_support( 'default_hidden_columns' ) );
|
373 |
+
MLA_List_Table::$default_sortable_columns = array_merge( MLA_List_Table::$default_sortable_columns, MLAOptions::mla_custom_field_support( 'default_sortable_columns' ) );
|
374 |
+
}
|
375 |
+
|
376 |
/**
|
377 |
* Initializes some properties from $_REQUEST vairables, then
|
378 |
* calls the parent constructor to set some default configs.
|
379 |
*
|
380 |
* @since 0.1
|
381 |
+
*
|
382 |
+
* @return void
|
383 |
*/
|
384 |
function __construct( ) {
|
385 |
+
$this->detached = isset( $_REQUEST['detached'] );
|
386 |
$this->is_trash = isset( $_REQUEST['status'] ) && $_REQUEST['status'] == 'trash';
|
387 |
|
388 |
//Set parent defaults
|
389 |
parent::__construct( array(
|
390 |
+
'singular' => 'attachment', //singular name of the listed records
|
391 |
'plural' => 'attachments', //plural name of the listed records
|
392 |
+
'ajax' => true, //does this table support ajax?
|
393 |
+
'screen' => 'media_page_mla-menu'
|
394 |
) );
|
395 |
|
396 |
$this->currently_hidden = self::get_hidden_columns();
|
397 |
+
|
398 |
+
/*
|
399 |
+
* NOTE: There is one add_action call at the end of this source file.
|
400 |
+
* NOTE: There are two add_filter calls at the end of this source file.
|
401 |
+
*/
|
402 |
}
|
403 |
|
404 |
/**
|
405 |
+
* Supply a column value if no column-specific function has been defined
|
406 |
+
*
|
407 |
+
* Called when the parent class can't find a method specifically built for a
|
408 |
+
* given column. The taxonomy columns are handled here. All other columns should
|
409 |
+
* have a specific method, so this function returns a troubleshooting message.
|
410 |
*
|
411 |
* @since 0.1
|
412 |
*
|
415 |
* @return string Text or HTML to be placed inside the column
|
416 |
*/
|
417 |
function column_default( $item, $column_name ) {
|
418 |
+
if ( 't_' == substr( $column_name, 0, 2 ) ) {
|
419 |
+
$taxonomy = substr( $column_name, 2 );
|
420 |
+
$tax_object = get_taxonomy( $taxonomy );
|
421 |
+
$terms = wp_get_object_terms( $item->ID, $taxonomy );
|
422 |
+
|
423 |
+
if ( !is_wp_error( $terms ) ) {
|
424 |
+
if ( empty( $terms ) )
|
425 |
+
return 'none';
|
426 |
+
|
427 |
+
$list = array();
|
428 |
+
foreach ( $terms as $term ) {
|
429 |
+
$list[ ] = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
430 |
+
'page' => 'mla-menu',
|
431 |
+
'mla-tax' => $taxonomy,
|
432 |
+
'mla-term' => $term->slug,
|
433 |
+
'heading_suffix' => urlencode( $tax_object->label . ': ' . $term->name )
|
434 |
+
), 'upload.php' ) ), esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'category', 'display' ) ) );
|
435 |
+
} // foreach $term
|
436 |
+
|
437 |
+
return join( ', ', $list );
|
438 |
+
} // if !is_wp_error
|
439 |
+
else {
|
440 |
+
return 'not supported';
|
441 |
+
}
|
442 |
+
} // 't_'
|
443 |
+
elseif ( 'c_' == substr( $column_name, 0, 2 ) ) {
|
444 |
+
$values = get_post_meta( $item->ID, MLA_List_Table::$default_columns[ $column_name ], false );
|
445 |
+
if ( empty( $values ) )
|
446 |
+
return '';
|
447 |
+
|
448 |
+
$list = array();
|
449 |
+
foreach( $values as $index => $value ) {
|
450 |
+
$list[ ] = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
451 |
+
'page' => 'mla-menu',
|
452 |
+
'mla-metakey' => urlencode( MLA_List_Table::$default_columns[ $column_name ] ),
|
453 |
+
'mla-metavalue' => urlencode( $value ),
|
454 |
+
'heading_suffix' => urlencode( MLA_List_Table::$default_columns[ $column_name ] . ': ' . $value )
|
455 |
+
), 'upload.php' ) ), esc_html( $value ) );
|
456 |
+
}
|
457 |
+
|
458 |
+
return join( ', ', $list );
|
459 |
+
} // 'c_'
|
460 |
+
else {
|
461 |
+
//Show the whole array for troubleshooting purposes
|
462 |
+
return 'column_default: ' . $column_name . ', ' . print_r( $item, true );
|
463 |
+
}
|
464 |
}
|
465 |
|
466 |
/**
|
499 |
*
|
500 |
* @since 0.1
|
501 |
*
|
502 |
+
* @param object A singular attachment (post) object
|
503 |
* @param string Current column name
|
504 |
*
|
505 |
* @return array Names and URLs of row-level actions
|
506 |
*/
|
507 |
private function _build_rollover_actions( $item, $column ) {
|
508 |
+
$actions = array();
|
509 |
|
510 |
if ( ( $this->rollover_id != $item->ID ) && !in_array( $column, $this->currently_hidden ) ) {
|
511 |
/*
|
516 |
'page' => $_REQUEST['page'],
|
517 |
'mla_item_ID' => $item->ID
|
518 |
);
|
519 |
+
|
520 |
+
if ( isset( $_REQUEST['paged'] ) )
|
521 |
+
$view_args['paged'] = $_REQUEST['paged'];
|
522 |
+
|
523 |
+
if ( isset( $_REQUEST['order'] ) )
|
524 |
+
$view_args['order'] = $_REQUEST['order'];
|
525 |
+
|
526 |
+
if ( isset( $_REQUEST['orderby'] ) )
|
527 |
+
$view_args['orderby'] = $_REQUEST['orderby'];
|
528 |
|
529 |
if ( isset( $_REQUEST['detached'] ) )
|
530 |
$view_args['detached'] = $_REQUEST['detached'];
|
536 |
if ( isset( $_REQUEST['m'] ) )
|
537 |
$view_args['m'] = $_REQUEST['m'];
|
538 |
|
539 |
+
if ( isset( $_REQUEST['mla_filter_term'] ) )
|
540 |
+
$view_args['mla_filter_term'] = $_REQUEST['mla_filter_term'];
|
541 |
+
|
542 |
if ( current_user_can( 'edit_post', $item->ID ) ) {
|
543 |
if ( $this->is_trash )
|
544 |
+
$actions['restore'] = '<a class="submitdelete" href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_RESTORE, MLA::MLA_ADMIN_NONCE ) ) . '" title="Restore this item from the Trash">Restore</a>';
|
545 |
+
else {
|
546 |
+
/*
|
547 |
+
* Use the WordPress Edit Media screen for 3.5 and later
|
548 |
+
*/
|
549 |
+
if( MLATest::$wordpress_3point5_plus ) {
|
550 |
+
$actions['edit'] = '<a href="' . admin_url( 'post.php' ) . '?post=' . $item->ID . '&action=edit&mla_source=edit" title="Edit this item">Edit</a>';
|
551 |
+
}
|
552 |
+
else {
|
553 |
+
$actions['edit'] = '<a href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLA::MLA_ADMIN_NONCE ) ) . '" title="Edit this item">Edit</a>';
|
554 |
+
}
|
555 |
+
$actions['inline hide-if-no-js'] = '<a class="editinline" href="#" title="Edit this item inline">Quick Edit</a>';
|
556 |
+
}
|
557 |
} // edit_post
|
558 |
|
559 |
if ( current_user_can( 'delete_post', $item->ID ) ) {
|
560 |
if ( !$this->is_trash && EMPTY_TRASH_DAYS && MEDIA_TRASH )
|
561 |
+
$actions['trash'] = '<a class="submitdelete" href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_TRASH, MLA::MLA_ADMIN_NONCE ) ) . '" title="Move this item to the Trash">Move to Trash</a>';
|
562 |
else {
|
563 |
// If using trash for posts and pages but not for attachments, warn before permanently deleting
|
564 |
$delete_ays = EMPTY_TRASH_DAYS && !MEDIA_TRASH ? ' onclick="return showNotice.warn();"' : '';
|
565 |
|
566 |
+
$actions['delete'] = '<a class="submitdelete"' . $delete_ays . ' href="' . add_query_arg( $view_args, wp_nonce_url( '?mla_admin_action=' . MLA::MLA_ADMIN_SINGLE_DELETE, MLA::MLA_ADMIN_NONCE ) ) . '" title="Delete this item Permanently">Delete Permanently</a>';
|
567 |
}
|
568 |
} // delete_post
|
569 |
|
573 |
return $actions;
|
574 |
}
|
575 |
|
576 |
+
/**
|
577 |
+
* Add hidden fields with the data for use in the inline editor
|
578 |
+
*
|
579 |
+
* @since 0.20
|
580 |
+
*
|
581 |
+
* @param object A singular attachment (post) object
|
582 |
+
*
|
583 |
+
* @return string HTML <div> with row data
|
584 |
+
*/
|
585 |
+
private function _build_inline_data( $item ) {
|
586 |
+
$inline_data = "\r\n" . '<div class="hidden" id="inline_' . $item->ID . "\">\r\n";
|
587 |
+
$inline_data .= ' <div class="post_title">' . esc_attr( $item->post_title ) . "</div>\r\n";
|
588 |
+
$inline_data .= ' <div class="post_name">' . esc_attr( $item->post_name ) . "</div>\r\n";
|
589 |
+
$inline_data .= ' <div class="post_excerpt">' . esc_attr( $item->post_excerpt ) . "</div>\r\n";
|
590 |
+
|
591 |
+
if ( !empty( $item->mla_wp_attachment_metadata ) ) {
|
592 |
+
if ( isset( $item->mla_wp_attachment_image_alt ) )
|
593 |
+
$inline_data .= ' <div class="image_alt">' . esc_attr( $item->mla_wp_attachment_image_alt ) . "</div>\r\n";
|
594 |
+
else
|
595 |
+
$inline_data .= ' <div class="image_alt">' . "</div>\r\n";
|
596 |
+
}
|
597 |
+
|
598 |
+
$inline_data .= ' <div class="post_parent">' . $item->post_parent . "</div>\r\n";
|
599 |
+
$inline_data .= ' <div class="menu_order">' . $item->menu_order . "</div>\r\n";
|
600 |
+
$inline_data .= ' <div class="post_author">' . $item->post_author . "</div>\r\n";
|
601 |
+
|
602 |
+
$custom_fields = MLAOptions::mla_custom_field_support( 'quick_edit' );
|
603 |
+
$custom_fields = array_merge( $custom_fields, MLAOptions::mla_custom_field_support( 'bulk_edit' ) );
|
604 |
+
foreach ($custom_fields as $slug => $label ) {
|
605 |
+
$value = get_metadata( 'post', $item->ID, $label, true );
|
606 |
+
$inline_data .= ' <div class="' . $slug . '">' . $value . "</div>\r\n";
|
607 |
+
}
|
608 |
+
|
609 |
+
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
610 |
+
|
611 |
+
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
612 |
+
if ( $tax_object->hierarchical && $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit') ) {
|
613 |
+
$inline_data .= ' <div class="mla_category" id="' . $tax_name . '_' . $item->ID . '">'
|
614 |
+
. implode( ',', wp_get_object_terms( $item->ID, $tax_name, array( 'fields' => 'ids' ) ) ) . "</div>\r\n";
|
615 |
+
} elseif ( $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit') ) {
|
616 |
+
$inline_data .= ' <div class="mla_tags" id="'.$tax_name.'_'.$item->ID. '">'
|
617 |
+
. esc_html( str_replace( ',', ', ', get_terms_to_edit( $item->ID, $tax_name ) ) ) . "</div>\r\n";
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
+
$inline_data .= "</div>\r\n";
|
622 |
+
return $inline_data;
|
623 |
+
}
|
624 |
+
|
625 |
/**
|
626 |
* Supply the content for a custom column
|
627 |
*
|
632 |
*/
|
633 |
function column_ID_parent( $item ) {
|
634 |
$row_actions = self::_build_rollover_actions( $item, 'ID_parent' );
|
635 |
+
if ( $item->post_parent ) {
|
636 |
+
if ( isset( $item->parent_title ) )
|
637 |
+
$parent_title = $item->parent_title;
|
638 |
+
else
|
639 |
+
$parent_title = '(no title: bad ID)';
|
640 |
+
|
641 |
+
$parent = sprintf( '<a href="%1$s">(parent:%2$s)</a>', esc_url( add_query_arg( array(
|
642 |
+
'page' => 'mla-menu',
|
643 |
+
'parent' => $item->post_parent,
|
644 |
+
'heading_suffix' => urlencode( 'Parent: ' . $parent_title )
|
645 |
+
), 'upload.php' ) ), (string) $item->post_parent );
|
646 |
+
} // $item->post_parent
|
647 |
+
else
|
648 |
+
$parent = 'parent:0';
|
649 |
+
|
650 |
if ( !empty( $row_actions ) ) {
|
651 |
+
return sprintf( '%1$s<br><span style="color:silver">%2$s</span><br>%3$s%4$s', /*%1$s*/ $item->ID, /*%2$s*/ $parent, /*%3$s*/ $this->row_actions( $row_actions ), /*%4$s*/ $this->_build_inline_data( $item ) );
|
652 |
} else {
|
653 |
+
return sprintf( '%1$s<br><span style="color:silver">%2$s</span>', /*%1$s*/ $item->ID, /*%2$s*/ $parent );
|
654 |
}
|
655 |
}
|
656 |
|
663 |
* @return string HTML markup to be placed inside the column
|
664 |
*/
|
665 |
function column_title_name( $item ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
$row_actions = self::_build_rollover_actions( $item, 'title_name' );
|
667 |
+
$post_title = esc_attr( $item->post_title );
|
668 |
+
$post_name = esc_attr( $item->post_name );
|
669 |
+
$errors = $item->mla_references['parent_errors'];
|
670 |
+
if ( '(NO REFERENCE TESTS)' == $errors )
|
671 |
+
$errors = '';
|
672 |
|
673 |
if ( !empty( $row_actions ) ) {
|
674 |
+
return sprintf( '%1$s<br>%2$s<br>%3$s%4$s', /*%1$s*/ $post_title, /*%2$s*/ $post_name, /*%3$s*/ $errors, /*%4$s*/ $this->row_actions( $row_actions ) );
|
675 |
} else {
|
676 |
+
return sprintf( '%1$s<br>%2$s<br>%3$s', /*%1$s*/ $post_title, /*%2$s*/ $post_name, /*%3$s*/ $errors );
|
677 |
}
|
678 |
}
|
679 |
|
689 |
$row_actions = self::_build_rollover_actions( $item, 'post_title' );
|
690 |
|
691 |
if ( !empty( $row_actions ) ) {
|
692 |
+
return sprintf( '%1$s<br>%2$s', /*%1$s*/ esc_attr( $item->post_title ), /*%2$s*/ $this->row_actions( $row_actions ) );
|
693 |
} else {
|
694 |
+
return esc_attr( $item->post_title );
|
695 |
}
|
696 |
}
|
697 |
|
707 |
$row_actions = self::_build_rollover_actions( $item, 'post_name' );
|
708 |
|
709 |
if ( !empty( $row_actions ) ) {
|
710 |
+
return sprintf( '%1$s<br>%2$s', /*%1$s*/ esc_attr( $item->post_name ), /*%2$s*/ $this->row_actions( $row_actions ) );
|
711 |
} else {
|
712 |
+
return esc_attr( $item->post_name );
|
713 |
}
|
714 |
}
|
715 |
|
722 |
* @return string HTML markup to be placed inside the column
|
723 |
*/
|
724 |
function column_parent( $item ) {
|
725 |
+
if ( $item->post_parent ){
|
726 |
+
if ( isset( $item->parent_title ) )
|
727 |
+
$parent_title = $item->parent_title;
|
728 |
+
else
|
729 |
+
$parent_title = '(no title: bad ID)';
|
730 |
+
|
731 |
+
return sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
732 |
+
'page' => 'mla-menu',
|
733 |
+
'parent' => $item->post_parent,
|
734 |
+
'heading_suffix' => urlencode( 'Parent: ' . $parent_title )
|
735 |
+
), 'upload.php' ) ), (string) $item->post_parent );
|
736 |
+
}
|
737 |
+
else
|
738 |
+
return (string) $item->post_parent;
|
739 |
+
}
|
740 |
+
|
741 |
+
/**
|
742 |
+
* Supply the content for a custom column
|
743 |
+
*
|
744 |
+
* @since 0.60
|
745 |
+
*
|
746 |
+
* @param array A singular attachment (post) object
|
747 |
+
* @return string HTML markup to be placed inside the column
|
748 |
+
*/
|
749 |
+
function column_menu_order( $item ) {
|
750 |
+
return (string) $item->menu_order;
|
751 |
}
|
752 |
|
753 |
/**
|
759 |
* @return string HTML markup to be placed inside the column
|
760 |
*/
|
761 |
function column_featured( $item ) {
|
762 |
+
if ( !MLAOptions::$process_featured_in )
|
763 |
+
return 'disabled';
|
764 |
+
|
765 |
$value = '';
|
766 |
|
767 |
+
foreach ( $item->mla_references['features'] as $feature_id => $feature ) {
|
|
|
|
|
768 |
if ( $feature_id == $item->post_parent )
|
769 |
+
$parent = ',<br>PARENT';
|
770 |
else
|
771 |
$parent = '';
|
772 |
|
773 |
+
$value .= sprintf( '(%1$s %2$s%3$s), <a href="%4$s">%5$s</a>',
|
774 |
+
/*%1$s*/ esc_attr( $feature->post_type ),
|
775 |
+
/*%2$s*/ $feature_id,
|
776 |
+
/*%3$s*/ $parent,
|
777 |
+
/*%4$s*/ esc_url( add_query_arg( array('post' => $feature_id, 'action' => 'edit'), 'post.php' ) ),
|
778 |
+
/*%5$s*/ esc_attr( $feature->post_title ) ) . "<br>\r\n";
|
779 |
} // foreach $feature
|
780 |
|
781 |
return $value;
|
790 |
* @return string HTML markup to be placed inside the column
|
791 |
*/
|
792 |
function column_inserted( $item ) {
|
793 |
+
if ( !MLAOptions::$process_inserted_in )
|
794 |
+
return 'disabled';
|
795 |
+
|
796 |
$value = '';
|
797 |
|
798 |
+
foreach ( $item->mla_references['inserts'] as $file => $inserts ) {
|
|
|
|
|
799 |
$value .= sprintf( '<strong>%1$s</strong><br>', $file );
|
800 |
|
801 |
foreach ( $inserts as $insert ) {
|
802 |
if ( $insert->ID == $item->post_parent )
|
803 |
+
$parent = ',<br>PARENT';
|
804 |
else
|
805 |
+
$parent = '';
|
806 |
|
807 |
+
$value .= sprintf( '(%1$s %2$s%3$s), <a href="%4$s">%5$s</a>',
|
808 |
+
/*%1$s*/ esc_attr( $insert->post_type ),
|
809 |
+
/*%2$s*/ $insert->ID,
|
810 |
+
/*%3$s*/ $parent,
|
811 |
+
/*%4$s*/ esc_url( add_query_arg( array('post' => $insert->ID, 'action' => 'edit'), 'post.php' ) ),
|
812 |
+
/*%5$s*/ esc_attr( $insert->post_title ) ) . "<br>\r\n";
|
813 |
} // foreach $insert
|
814 |
} // foreach $file
|
815 |
|
816 |
return $value;
|
817 |
}
|
818 |
|
819 |
+
/**
|
820 |
+
* Supply the content for a custom column
|
821 |
+
*
|
822 |
+
* @since 0.70
|
823 |
+
*
|
824 |
+
* @param array A singular attachment (post) object
|
825 |
+
* @return string HTML markup to be placed inside the column
|
826 |
+
*/
|
827 |
+
function column_galleries( $item ) {
|
828 |
+
if ( !MLAOptions::$process_gallery_in )
|
829 |
+
return 'disabled';
|
830 |
+
|
831 |
+
$value = '';
|
832 |
+
|
833 |
+
foreach ( $item->mla_references['galleries'] as $ID => $gallery ) {
|
834 |
+
if ( $ID == $item->post_parent )
|
835 |
+
$parent = ',<br>PARENT';
|
836 |
+
else
|
837 |
+
$parent = '';
|
838 |
+
|
839 |
+
$value .= sprintf( '(%1$s %2$s%3$s), <a href="%4$s">%5$s</a>',
|
840 |
+
/*%1$s*/ esc_attr( $gallery['post_type'] ),
|
841 |
+
/*%2$s*/ $ID,
|
842 |
+
/*%3$s*/ $parent,
|
843 |
+
/*%4$s*/ esc_url( add_query_arg( array('post' => $ID, 'action' => 'edit'), 'post.php' ) ),
|
844 |
+
/*%5$s*/ esc_attr( $gallery['post_title'] ) ) . "<br>\r\n";
|
845 |
+
} // foreach $gallery
|
846 |
+
|
847 |
+
return $value;
|
848 |
+
}
|
849 |
+
|
850 |
+
/**
|
851 |
+
* Supply the content for a custom column
|
852 |
+
*
|
853 |
+
* @since 0.70
|
854 |
+
*
|
855 |
+
* @param array A singular attachment (post) object
|
856 |
+
* @return string HTML markup to be placed inside the column
|
857 |
+
*/
|
858 |
+
function column_mla_galleries( $item ) {
|
859 |
+
if ( !MLAOptions::$process_mla_gallery_in )
|
860 |
+
return 'disabled';
|
861 |
+
|
862 |
+
$value = '';
|
863 |
+
|
864 |
+
foreach ( $item->mla_references['mla_galleries'] as $ID => $gallery ) {
|
865 |
+
if ( $ID == $item->post_parent )
|
866 |
+
$parent = ',<br>PARENT ';
|
867 |
+
else
|
868 |
+
$parent = '';
|
869 |
+
|
870 |
+
$value .= sprintf( '(%1$s %2$s%3$s), <a href="%4$s">%5$s</a>',
|
871 |
+
/*%1$s*/ esc_attr( $gallery['post_type'] ),
|
872 |
+
/*%2$s*/ $ID,
|
873 |
+
/*%3$s*/ $parent,
|
874 |
+
/*%4$s*/ esc_url( add_query_arg( array('post' => $ID, 'action' => 'edit'), 'post.php' ) ),
|
875 |
+
/*%5$s*/ esc_attr( $gallery['post_title'] ) ) . "<br>\r\n";
|
876 |
+
} // foreach $gallery
|
877 |
+
|
878 |
+
return $value;
|
879 |
+
}
|
880 |
+
|
881 |
/**
|
882 |
* Supply the content for a custom column
|
883 |
*
|
888 |
*/
|
889 |
function column_alt_text( $item ) {
|
890 |
if ( isset( $item->mla_wp_attachment_image_alt ) )
|
891 |
+
return sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
892 |
+
'page' => 'mla-menu',
|
893 |
+
'mla-metakey' => '_wp_attachment_image_alt',
|
894 |
+
'mla-metavalue' => urlencode( $item->mla_wp_attachment_image_alt ),
|
895 |
+
'heading_suffix' => urlencode( 'ALT Text: ' . $item->mla_wp_attachment_image_alt )
|
896 |
+
), 'upload.php' ) ), esc_html( $item->mla_wp_attachment_image_alt ) );
|
897 |
else
|
898 |
return '';
|
899 |
}
|
907 |
* @return string HTML markup to be placed inside the column
|
908 |
*/
|
909 |
function column_caption( $item ) {
|
910 |
+
return esc_attr( $item->post_excerpt );
|
911 |
}
|
912 |
|
913 |
/**
|
919 |
* @return string HTML markup to be placed inside the column
|
920 |
*/
|
921 |
function column_description( $item ) {
|
922 |
+
return esc_textarea( $item->post_content );
|
923 |
+
}
|
924 |
+
|
925 |
+
/**
|
926 |
+
* Supply the content for a custom column
|
927 |
+
*
|
928 |
+
* @since 0.30
|
929 |
+
*
|
930 |
+
* @param array A singular attachment (post) object
|
931 |
+
* @return string HTML markup to be placed inside the column
|
932 |
+
*/
|
933 |
+
function column_post_mime_type( $item ) {
|
934 |
+
return $item->post_mime_type;
|
935 |
}
|
936 |
|
937 |
/**
|
943 |
* @return string HTML markup to be placed inside the column
|
944 |
*/
|
945 |
function column_base_file( $item ) {
|
946 |
+
return $item->mla_references['base_file'];
|
947 |
}
|
948 |
|
949 |
/**
|
978 |
/**
|
979 |
* Supply the content for a custom column
|
980 |
*
|
981 |
+
* @since 0.30
|
982 |
+
*
|
983 |
+
* @param array A singular attachment (post) object
|
984 |
+
* @return string HTML markup to be placed inside the column
|
985 |
+
*/
|
986 |
+
function column_modified( $item ) {
|
987 |
+
if ( '0000-00-00 00:00:00' == $item->post_modified ) {
|
988 |
+
$t_time = $h_time = __( 'Unpublished' );
|
989 |
+
} else {
|
990 |
+
$t_time = get_the_time( __( 'Y/m/d g:i:s A' ), $item );
|
991 |
+
$m_time = $item->post_modified;
|
992 |
+
$time = get_post_time( 'G', true, $item, false );
|
993 |
+
|
994 |
+
if ( ( abs( $t_diff = time() - $time ) ) < 86400 ) {
|
995 |
+
if ( $t_diff < 0 )
|
996 |
+
$h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
|
997 |
+
else
|
998 |
+
$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
|
999 |
+
} else {
|
1000 |
+
$h_time = mysql2date( __( 'Y/m/d' ), $m_time );
|
1001 |
+
}
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
return $h_time;
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
/**
|
1008 |
+
* Supply the content for a custom column
|
1009 |
+
*
|
1010 |
+
* @since 0.30
|
1011 |
*
|
1012 |
* @param array A singular attachment (post) object
|
1013 |
* @return string HTML markup to be placed inside the column
|
1016 |
$user = get_user_by( 'id', $item->post_author );
|
1017 |
|
1018 |
if ( isset( $user->data->display_name ) )
|
1019 |
+
return sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
1020 |
+
'page' => 'mla-menu',
|
1021 |
+
'author' => $item->post_author,
|
1022 |
+
'heading_suffix' => urlencode( 'Author: ' . $user->data->display_name )
|
1023 |
+
), 'upload.php' ) ), esc_html( $user->data->display_name ) );
|
1024 |
else
|
1025 |
return 'unknown';
|
1026 |
}
|
1040 |
$parent_date = '';
|
1041 |
|
1042 |
if ( isset( $item->parent_title ) )
|
1043 |
+
$parent_title = sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array(
|
1044 |
+
'post' => $item->post_parent,
|
1045 |
+
'action' => 'edit'
|
1046 |
+
), 'post.php' ) ), esc_attr( $item->parent_title ) );
|
1047 |
else
|
1048 |
$parent_title = '(Unattached)';
|
1049 |
|
1050 |
if ( isset( $item->parent_type ) )
|
1051 |
+
$parent_type = '(' . $item->parent_type . ' ' . (string) $item->post_parent . ')';
|
1052 |
else
|
1053 |
$parent_type = '';
|
1054 |
|
1056 |
}
|
1057 |
|
1058 |
/**
|
1059 |
+
* This method dictates the table's columns and titles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1060 |
*
|
1061 |
* @since 0.1
|
1062 |
*
|
1063 |
* @return array Column information: 'slugs'=>'Visible Titles'
|
1064 |
*/
|
1065 |
function get_columns( ) {
|
1066 |
+
return $columns = MLA_List_Table::mla_manage_columns_filter();
|
1067 |
}
|
1068 |
|
1069 |
/**
|
1092 |
* @since 0.1
|
1093 |
*
|
1094 |
* @return array Sortable column information,e.g.,
|
1095 |
+
* 'slugs'=>array('data_values',boolean)
|
1096 |
*/
|
1097 |
function get_sortable_columns( ) {
|
1098 |
$columns = MLA_List_Table::$default_sortable_columns;
|
1109 |
} else {
|
1110 |
$columns['title_name'][ 1 ] = true;
|
1111 |
}
|
1112 |
+
|
1113 |
return $columns;
|
1114 |
}
|
1115 |
|
1124 |
function get_views( ) {
|
1125 |
global $wpdb;
|
1126 |
|
1127 |
+
$type_links = array();
|
1128 |
$_num_posts = (array) wp_count_attachments();
|
1129 |
$_total_posts = array_sum( $_num_posts ) - $_num_posts['trash'];
|
1130 |
+
$total_orphans = $wpdb->get_var(
|
1131 |
+
"
|
1132 |
+
SELECT COUNT( * ) FROM {$wpdb->posts}
|
1133 |
+
WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1
|
1134 |
+
"
|
1135 |
+
);
|
1136 |
|
1137 |
+
$post_mime_types = self::mla_get_attachment_mime_types();
|
1138 |
$avail_post_mime_types = $this->_avail_mime_types( $_num_posts );
|
1139 |
$matches = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) );
|
1140 |
|
1148 |
'm' => $_REQUEST['m']
|
1149 |
), $base_url );
|
1150 |
|
1151 |
+
if ( isset( $_REQUEST['mla_filter_term'] ) )
|
1152 |
$base_url = add_query_arg( array(
|
1153 |
+
'mla_filter_term' => $_REQUEST['mla_filter_term']
|
1154 |
), $base_url );
|
1155 |
|
1156 |
foreach ( $matches as $type => $reals )
|
1174 |
'post_mime_type' => $mime_type
|
1175 |
), $base_url ) . "'$class>" . sprintf( translate_nooped_plural( $label[ 2 ], $num_posts[ $mime_type ] ), number_format_i18n( $num_posts[ $mime_type ] ) ) . '</a>';
|
1176 |
}
|
1177 |
+
} // foreach post_mime_type
|
1178 |
|
1179 |
$type_links['detached'] = '<a href="' . add_query_arg( array(
|
1180 |
'detached' => '1'
|
1198 |
*/
|
1199 |
function get_bulk_actions( )
|
1200 |
{
|
1201 |
+
$actions = array();
|
1202 |
|
1203 |
if ( $this->is_trash ) {
|
1204 |
$actions['restore'] = 'Restore';
|
1205 |
$actions['delete'] = 'Delete Permanently';
|
1206 |
} else {
|
1207 |
+
$actions['edit'] = 'Edit';
|
1208 |
// $actions['attach'] = 'Attach';
|
|
|
|
|
1209 |
|
1210 |
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
|
1211 |
$actions['trash'] = 'Move to Trash';
|
1217 |
}
|
1218 |
|
1219 |
/**
|
1220 |
+
* Extra controls to be displayed between bulk actions and pagination
|
1221 |
+
*
|
1222 |
+
* Modeled after class-wp-posts-list-table.php in wp-admin/includes.
|
1223 |
*
|
1224 |
* @since 0.1
|
1225 |
*
|
1234 |
if ( 'top' == $which ) {
|
1235 |
$this->months_dropdown( 'attachment' );
|
1236 |
|
1237 |
+
$tax_filter = MLAOptions::mla_taxonomy_support('', 'filter');
|
1238 |
+
if ( ( '' != $tax_filter ) && ( is_object_in_taxonomy( 'attachment', $tax_filter ) ) ) {
|
1239 |
+
$tax_object = get_taxonomy( $tax_filter );
|
1240 |
$dropdown_options = array(
|
1241 |
+
'show_option_all' => 'All ' . $tax_object->labels->name,
|
1242 |
+
'show_option_none' => 'No ' . $tax_object->labels->name,
|
1243 |
'orderby' => 'ID',
|
1244 |
'order' => 'ASC',
|
1245 |
'show_count' => false,
|
1250 |
'echo' => true,
|
1251 |
'depth' => 3,
|
1252 |
'tab_index' => 0,
|
1253 |
+
'name' => 'mla_filter_term',
|
1254 |
'id' => 'name',
|
1255 |
'class' => 'postform',
|
1256 |
+
'selected' => isset( $_REQUEST['mla_filter_term'] ) ? $_REQUEST['mla_filter_term'] : 0,
|
1257 |
'hierarchical' => true,
|
1258 |
'pad_counts' => false,
|
1259 |
+
'taxonomy' => $tax_filter,
|
1260 |
'hide_if_empty' => false
|
1261 |
);
|
1262 |
|
1276 |
}
|
1277 |
|
1278 |
/**
|
1279 |
+
* Prepares the list of items for displaying
|
1280 |
*
|
1281 |
* This is where you prepare your data for display. This method will usually
|
1282 |
* be used to query the database, sort and filter the data, and generally
|
1284 |
* $this->set_pagination_args().
|
1285 |
*
|
1286 |
* @since 0.1
|
1287 |
+
*
|
1288 |
+
* @return void
|
1289 |
*/
|
1290 |
function prepare_items( ) {
|
1291 |
$this->_column_headers = array(
|
1294 |
$this->get_sortable_columns()
|
1295 |
);
|
1296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
/*
|
1298 |
* REQUIRED for pagination.
|
1299 |
*/
|
1300 |
+
$total_items = MLAData::mla_count_list_table_items( $_REQUEST );
|
|
|
1301 |
$user = get_current_user_id();
|
1302 |
$screen = get_current_screen();
|
1303 |
$option = $screen->get_option( 'per_page', 'option' );
|
1306 |
$per_page = $screen->get_option( 'per_page', 'default' );
|
1307 |
}
|
1308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1309 |
/*
|
1310 |
* REQUIRED. We also have to register our pagination options & calculations.
|
1311 |
*/
|
1314 |
'per_page' => $per_page, //WE have to determine how many items to show on a page
|
1315 |
'total_pages' => ceil( $total_items / $per_page ) //WE have to calculate the total number of pages
|
1316 |
) );
|
1317 |
+
|
1318 |
+
$current_page = $this->get_pagenum();
|
1319 |
+
|
1320 |
+
/*
|
1321 |
+
* REQUIRED. Assign sorted and paginated data to the items property, where
|
1322 |
+
* it can be used by the rest of the class.
|
1323 |
+
*/
|
1324 |
+
$this->items = MLAData::mla_query_list_table_items( $_REQUEST, ( ( $current_page - 1 ) * $per_page ), $per_page );
|
1325 |
}
|
1326 |
|
1327 |
/**
|
1328 |
+
* Generates (echoes) content for a single row of the table
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1329 |
*
|
1330 |
+
* @since .20
|
1331 |
*
|
1332 |
+
* @param object the current item
|
1333 |
*
|
1334 |
+
* @return void Echoes the row HTML
|
1335 |
*/
|
1336 |
+
function single_row( $item ) {
|
1337 |
+
static $row_class = '';
|
1338 |
+
$row_class = ( $row_class == '' ? ' class="alternate"' : '' );
|
1339 |
+
|
1340 |
+
echo '<tr id="attachment-' . $item->ID . '"' . $row_class . '>';
|
1341 |
+
echo parent::single_row_columns( $item );
|
1342 |
+
echo '</tr>';
|
|
|
|
|
|
|
1343 |
}
|
1344 |
} // class MLA_List_Table
|
1345 |
|
1347 |
* Filters are added here, when the source file is loaded, because the MLA_List_Table
|
1348 |
* object is created too late to be useful.
|
1349 |
*/
|
1350 |
+
add_action( 'admin_init', 'MLA_List_Table::mla_admin_init_action' );
|
1351 |
+
|
1352 |
+
add_filter( 'get_user_option_managemedia_page_mla-menucolumnshidden', 'MLA_List_Table::mla_manage_hidden_columns_filter', 10, 3 );
|
1353 |
+
add_filter( 'manage_media_page_mla-menu_columns', 'MLA_List_Table::mla_manage_columns_filter', 10, 0 );
|
1354 |
?>
|
includes/class-mla-main.php
CHANGED
@@ -38,43 +38,52 @@ class MLA {
|
|
38 |
*
|
39 |
* @var string
|
40 |
*/
|
41 |
-
const CURRENT_MLA_VERSION = '
|
42 |
|
43 |
/**
|
44 |
-
*
|
45 |
*
|
46 |
* @since 0.1
|
47 |
*
|
48 |
* @var string
|
49 |
*/
|
50 |
-
const
|
51 |
|
52 |
/**
|
53 |
-
*
|
54 |
*
|
55 |
* @since 0.1
|
56 |
*
|
57 |
* @var string
|
58 |
*/
|
59 |
-
const
|
60 |
|
61 |
/**
|
62 |
-
*
|
63 |
*
|
64 |
* @since 0.1
|
65 |
*
|
66 |
* @var string
|
67 |
*/
|
68 |
-
const
|
69 |
|
70 |
/**
|
71 |
-
* Slug for localizing and enqueueing
|
72 |
*
|
73 |
-
* @since 0.
|
74 |
*
|
75 |
* @var string
|
76 |
*/
|
77 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
/**
|
80 |
* Slug for adding plugin submenu
|
@@ -85,6 +94,78 @@ class MLA {
|
|
85 |
*/
|
86 |
const ADMIN_PAGE_SLUG = 'mla-menu';
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
/**
|
89 |
* Holds screen ids to match help text to corresponding screen
|
90 |
*
|
@@ -92,24 +173,68 @@ class MLA {
|
|
92 |
*
|
93 |
* @var array
|
94 |
*/
|
95 |
-
private static $page_hooks = array(
|
96 |
|
97 |
/**
|
98 |
* Initialization function, similar to __construct()
|
99 |
*
|
|
|
|
|
|
|
|
|
100 |
* @since 0.1
|
|
|
|
|
101 |
*/
|
102 |
public static function initialize( )
|
103 |
{
|
104 |
-
|
105 |
-
MLATest::min_WordPress_version( self::MIN_WORDPRESS_VERSION, self::PLUGIN_NAME );
|
106 |
-
|
107 |
add_action( 'admin_enqueue_scripts', 'MLA::mla_admin_enqueue_scripts_action' );
|
108 |
add_action( 'admin_menu', 'MLA::mla_admin_menu_action' );
|
109 |
add_filter( 'set-screen-option', 'MLA::mla_set_screen_option_filter', 10, 3 ); // $status, $option, $value
|
110 |
add_filter( 'screen_options_show_screen', 'MLA::mla_screen_options_show_screen_filter', 10, 2 ); // $show_screen, $this
|
111 |
}
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
/**
|
114 |
* Load the plugin's Style Sheet and Javascript files
|
115 |
*
|
@@ -117,25 +242,53 @@ class MLA {
|
|
117 |
*
|
118 |
* @param string Name of the page being loaded
|
119 |
*
|
120 |
-
* @return
|
121 |
*/
|
122 |
public static function mla_admin_enqueue_scripts_action( $page_hook ) {
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
return;
|
|
|
125 |
|
|
|
|
|
|
|
126 |
wp_register_style( self::STYLESHEET_SLUG, MLA_PLUGIN_URL . 'css/mla-style.css', false, self::CURRENT_MLA_VERSION );
|
127 |
wp_enqueue_style( self::STYLESHEET_SLUG );
|
128 |
-
|
129 |
if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) ) {
|
130 |
-
wp_enqueue_script( self::
|
131 |
-
|
132 |
-
'suggest',
|
133 |
-
'jquery'
|
134 |
-
), self::CURRENT_MLA_VERSION, false );
|
135 |
$script_variables = array(
|
136 |
-
|
|
|
137 |
);
|
138 |
-
wp_localize_script( self::
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
140 |
}
|
141 |
|
@@ -143,12 +296,16 @@ class MLA {
|
|
143 |
* Add the submenu pages
|
144 |
*
|
145 |
* Add a submenu page in the "Media" section,
|
146 |
-
* add
|
147 |
-
* add filter to clean up taxonomy submenu labels
|
148 |
-
* add settings page in the "Settings" section,
|
149 |
* add settings link in the Plugins section entry for MLA.
|
150 |
*
|
|
|
|
|
|
|
|
|
151 |
* @since 0.1
|
|
|
|
|
152 |
*/
|
153 |
public static function mla_admin_menu_action( ) {
|
154 |
$hook = add_submenu_page( 'upload.php', 'Media Library Assistant', 'Assistant', 'upload_files', self::ADMIN_PAGE_SLUG, 'MLA::mla_render_admin_page' );
|
@@ -159,25 +316,33 @@ class MLA {
|
|
159 |
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
160 |
if ( !empty( $taxonomies ) ) {
|
161 |
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
162 |
-
$hook = add_submenu_page( 'upload.php', $tax_object->label, $tax_object->label, 'manage_categories', 'mla-edit-tags-' . $tax_name, 'MLA::mla_edit_tags_redirect' );
|
163 |
-
add_action( 'load-' . $hook, 'MLA::mla_edit_tags_redirect' );
|
164 |
/*
|
165 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
*/
|
167 |
$hook = 'edit-' . $tax_name;
|
168 |
-
self::$page_hooks[ $hook ] = $
|
169 |
-
}
|
170 |
|
171 |
add_action( 'load-edit-tags.php', 'MLA::mla_add_help_tab' );
|
172 |
}
|
173 |
|
174 |
-
add_filter( 'parent_file', 'MLA::
|
175 |
}
|
176 |
|
177 |
/**
|
178 |
* Add the "XX Entries per page" filter to the Screen Options tab
|
179 |
*
|
180 |
* @since 0.1
|
|
|
|
|
181 |
*/
|
182 |
public static function mla_add_menu_options( ) {
|
183 |
$option = 'per_page';
|
@@ -191,115 +356,12 @@ class MLA {
|
|
191 |
add_screen_option( $option, $args );
|
192 |
}
|
193 |
|
194 |
-
/**
|
195 |
-
* Only show screen options on the table-list screen
|
196 |
-
*
|
197 |
-
* @since 0.1
|
198 |
-
*
|
199 |
-
* @param boolean True to display "Screen Options", false to suppress them
|
200 |
-
* @param string Name of the page being loaded
|
201 |
-
*
|
202 |
-
* @return boolean True to display "Screen Options", false to suppress them
|
203 |
-
*/
|
204 |
-
public static function mla_screen_options_show_screen_filter( $show_screen, $this_screen ) {
|
205 |
-
if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) )
|
206 |
-
return false;
|
207 |
-
else
|
208 |
-
return $show_screen;
|
209 |
-
}
|
210 |
-
|
211 |
-
/**
|
212 |
-
* Save the "Entries per page" option set by this user
|
213 |
-
*
|
214 |
-
* @since 0.1
|
215 |
-
*
|
216 |
-
* @param boolean Unknown - always false?
|
217 |
-
* @param string Name of the option being changed
|
218 |
-
* @param string New value of the option
|
219 |
-
*
|
220 |
-
* @return string New value if this is our option, otherwise nothing
|
221 |
-
*/
|
222 |
-
public static function mla_set_screen_option_filter( $status, $option, $value )
|
223 |
-
{
|
224 |
-
if ( 'mla_entries_per_page' == $option )
|
225 |
-
return $value;
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* Action name; uniquely identifies the nonce
|
230 |
-
*
|
231 |
-
* @since 0.1
|
232 |
-
*
|
233 |
-
* @var string
|
234 |
-
*/
|
235 |
-
const MLA_ADMIN_NONCE = 'mla_admin';
|
236 |
-
|
237 |
-
/**
|
238 |
-
* mla_admin_action value for permanently deleting a single item
|
239 |
-
*
|
240 |
-
* @since 0.1
|
241 |
-
*
|
242 |
-
* @var string
|
243 |
-
*/
|
244 |
-
const MLA_ADMIN_SINGLE_DELETE = 'single_item_delete';
|
245 |
-
|
246 |
-
/**
|
247 |
-
* mla_admin_action value for displaying a single item
|
248 |
-
*
|
249 |
-
* @since 0.1
|
250 |
-
*
|
251 |
-
* @var string
|
252 |
-
*/
|
253 |
-
const MLA_ADMIN_SINGLE_EDIT_DISPLAY = 'single_item_edit_display';
|
254 |
-
|
255 |
-
/**
|
256 |
-
* mla_admin_action value for updating a single item
|
257 |
-
*
|
258 |
-
* @since 0.1
|
259 |
-
*
|
260 |
-
* @var string
|
261 |
-
*/
|
262 |
-
const MLA_ADMIN_SINGLE_EDIT_UPDATE = 'single_item_edit_update';
|
263 |
-
|
264 |
-
/**
|
265 |
-
* mla_admin_action value for restoring a single item from the trash
|
266 |
-
*
|
267 |
-
* @since 0.1
|
268 |
-
*
|
269 |
-
* @var string
|
270 |
-
*/
|
271 |
-
const MLA_ADMIN_SINGLE_RESTORE = 'single_item_restore';
|
272 |
-
|
273 |
-
/**
|
274 |
-
* mla_admin_action value for moving a single item to the trash
|
275 |
-
*
|
276 |
-
* @since 0.1
|
277 |
-
*
|
278 |
-
* @var string
|
279 |
-
*/
|
280 |
-
const MLA_ADMIN_SINGLE_TRASH = 'single_item_trash';
|
281 |
-
|
282 |
-
/**
|
283 |
-
* Redirect to the Edit Tags/Categories page
|
284 |
-
*
|
285 |
-
* The custom taxonomy add/edit submenu entries go to "upload.php" by default.
|
286 |
-
* This filter is the only way to redirect them to the correct WordPress page.
|
287 |
-
*
|
288 |
-
* @since 0.1
|
289 |
-
*/
|
290 |
-
public static function mla_edit_tags_redirect( )
|
291 |
-
{
|
292 |
-
if ( isset( $_REQUEST['page'] ) && ( substr( $_REQUEST['page'], 0, 14 ) == 'mla-edit-tags-' ) ) {
|
293 |
-
$taxonomy = substr( $_REQUEST['page'], 14 );
|
294 |
-
wp_redirect( admin_url( 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=attachment' ), 302 );
|
295 |
-
exit;
|
296 |
-
}
|
297 |
-
}
|
298 |
-
|
299 |
/**
|
300 |
* Add contextual help tabs to all the MLA pages
|
301 |
*
|
302 |
* @since 0.1
|
|
|
|
|
303 |
*/
|
304 |
public static function mla_add_help_tab( )
|
305 |
{
|
@@ -323,6 +385,26 @@ class MLA {
|
|
323 |
$file_suffix = self::MLA_ADMIN_SINGLE_EDIT_DISPLAY;
|
324 |
break;
|
325 |
} // switch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
}
|
327 |
|
328 |
$template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/help-for-' . $file_suffix . '.tpl' );
|
@@ -338,7 +420,7 @@ class MLA {
|
|
338 |
/*
|
339 |
* Provide explicit control over tab order
|
340 |
*/
|
341 |
-
$tab_array = array(
|
342 |
|
343 |
foreach ( $template_array as $id => $content ) {
|
344 |
$match_count = preg_match( '#\<!-- title="(.+)" order="(.+)" --\>#', $content, $matches, PREG_OFFSET_CAPTURE );
|
@@ -350,7 +432,7 @@ class MLA {
|
|
350 |
'content' => $content
|
351 |
);
|
352 |
} else {
|
353 |
-
|
354 |
}
|
355 |
}
|
356 |
|
@@ -360,12 +442,77 @@ class MLA {
|
|
360 |
}
|
361 |
}
|
362 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
/**
|
364 |
* Cleanup menus for Edit Tags/Categories page
|
365 |
*
|
366 |
-
*
|
367 |
-
*
|
368 |
-
*
|
|
|
|
|
|
|
369 |
*
|
370 |
* @since 0.1
|
371 |
*
|
@@ -373,15 +520,27 @@ class MLA {
|
|
373 |
*
|
374 |
* @return string The updated top-level menu page
|
375 |
*/
|
376 |
-
public static function
|
377 |
-
global $submenu;
|
378 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
if ( isset( $_REQUEST['taxonomy'] ) ) {
|
380 |
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
381 |
|
382 |
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
383 |
if ( $_REQUEST['taxonomy'] == $tax_name ) {
|
384 |
-
$mla_page = 'mla-edit-
|
385 |
$real_page = 'edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment';
|
386 |
|
387 |
foreach ( $submenu['upload.php'] as $submenu_index => $submenu_entry ) {
|
@@ -401,13 +560,15 @@ class MLA {
|
|
401 |
* Render the "Assistant" subpage in the Media section, using the list_table package
|
402 |
*
|
403 |
* @since 0.1
|
|
|
|
|
404 |
*/
|
405 |
public static function mla_render_admin_page( ) {
|
406 |
$bulk_action = self::_current_bulk_action();
|
407 |
|
408 |
echo "<div class=\"wrap\">\r\n";
|
409 |
echo "<div id=\"icon-upload\" class=\"icon32\"><br/></div>\r\n";
|
410 |
-
echo "<h2>Media Library Assistant"; //
|
411 |
|
412 |
if ( !current_user_can( 'upload_files' ) ) {
|
413 |
echo " - Error</h2>\r\n";
|
@@ -419,6 +580,17 @@ class MLA {
|
|
419 |
'body' => ''
|
420 |
);
|
421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
/*
|
423 |
* Process bulk actions that affect an array of items
|
424 |
*/
|
@@ -433,7 +605,45 @@ class MLA {
|
|
433 |
case 'delete':
|
434 |
$item_content = self::_delete_single_item( $post_id );
|
435 |
break;
|
436 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
case 'restore':
|
438 |
$item_content = self::_restore_single_item( $post_id );
|
439 |
break;
|
@@ -464,34 +674,33 @@ class MLA {
|
|
464 |
|
465 |
switch ( $_REQUEST['mla_admin_action'] ) {
|
466 |
case self::MLA_ADMIN_SINGLE_DELETE:
|
467 |
-
echo "</h2>\r\n";
|
468 |
$page_content = self::_delete_single_item( $_REQUEST['mla_item_ID'] );
|
469 |
break;
|
470 |
case self::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
|
471 |
-
echo " - Edit single item</h2
|
472 |
$page_content = self::_display_single_item( $_REQUEST['mla_item_ID'] );
|
473 |
break;
|
474 |
case self::MLA_ADMIN_SINGLE_EDIT_UPDATE:
|
475 |
-
echo "</h2>\r\n";
|
476 |
if ( !empty( $_REQUEST['update'] ) ) {
|
477 |
-
$page_content =
|
|
|
|
|
|
|
|
|
478 |
} else {
|
479 |
$page_content = array(
|
480 |
-
|
481 |
'body' => ''
|
482 |
);
|
483 |
}
|
484 |
break;
|
485 |
case self::MLA_ADMIN_SINGLE_RESTORE:
|
486 |
-
echo "</h2>\r\n";
|
487 |
$page_content = self::_restore_single_item( $_REQUEST['mla_item_ID'] );
|
488 |
break;
|
489 |
case self::MLA_ADMIN_SINGLE_TRASH:
|
490 |
-
echo "</h2>\r\n";
|
491 |
$page_content = self::_trash_single_item( $_REQUEST['mla_item_ID'] );
|
492 |
break;
|
493 |
default:
|
494 |
-
echo "</h2>\r\n";
|
495 |
$page_content = array(
|
496 |
'message' => sprintf( 'Unknown mla_admin_action - "%1$s"', $_REQUEST['mla_admin_action'] ),
|
497 |
'body' => ''
|
@@ -500,13 +709,13 @@ class MLA {
|
|
500 |
} // switch ($_REQUEST['mla_admin_action'])
|
501 |
} // (!empty($_REQUEST['mla_admin_action'])
|
502 |
|
503 |
-
if ( !empty( $page_content['message'] ) ) {
|
504 |
-
echo " <div style=\"background:#ECECEC;border:1px solid #CCC;padding:0 10px;margin-top:5px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\"><p>\r\n";
|
505 |
-
echo ' ' . $page_content['message'] . "\r\n";
|
506 |
-
echo " </p></div>\r\n"; // id="message"
|
507 |
-
}
|
508 |
-
|
509 |
if ( !empty( $page_content['body'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
echo $page_content['body'];
|
511 |
} else {
|
512 |
/*
|
@@ -524,10 +733,18 @@ class MLA {
|
|
524 |
), $_SERVER['REQUEST_URI'] );
|
525 |
|
526 |
if ( !empty( $_REQUEST['heading_suffix'] ) ) {
|
527 |
-
echo ' - ' . $_REQUEST['heading_suffix'] . "</h2>\r\n";
|
|
|
|
|
528 |
} else
|
529 |
echo "</h2>\r\n";
|
530 |
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
// Create an instance of our package class...
|
532 |
$MLAListTable = new MLA_List_Table();
|
533 |
|
@@ -536,8 +753,59 @@ class MLA {
|
|
536 |
$MLAListTable->views();
|
537 |
|
538 |
// Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions
|
539 |
-
echo
|
540 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
541 |
/*
|
542 |
* We also need to ensure that the form posts back to our current page and remember all the view arguments
|
543 |
*/
|
@@ -555,24 +823,317 @@ class MLA {
|
|
555 |
if ( isset( $_REQUEST['m'] ) ) // filter by date
|
556 |
echo sprintf( '<input type="hidden" name="m" value="%1$s" />', $_REQUEST['m'] ) . "\r\n";
|
557 |
|
558 |
-
if ( isset( $_REQUEST['att_cat'] ) ) // filter by category
|
559 |
-
echo sprintf( '<input type="hidden" name="att_cat" value="%1$s" />', $_REQUEST['att_cat'] ) . "\r\n";
|
560 |
-
|
561 |
// Now we can render the completed list table
|
562 |
$MLAListTable->display();
|
563 |
-
echo "</form
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
}
|
|
|
|
|
565 |
}
|
566 |
|
567 |
/**
|
568 |
-
* Get the current action selected from the bulk actions dropdown
|
569 |
*
|
570 |
* @since 0.1
|
571 |
*
|
572 |
-
* @return string|
|
573 |
*/
|
574 |
-
private static function _current_bulk_action( )
|
575 |
-
{
|
576 |
$action = false;
|
577 |
|
578 |
if ( isset( $_REQUEST['action'] ) ) {
|
@@ -593,12 +1154,13 @@ class MLA {
|
|
593 |
}
|
594 |
|
595 |
/**
|
596 |
-
* Delete a single item permanently
|
597 |
*
|
598 |
* @since 0.1
|
599 |
*
|
600 |
-
* @param array The form POST data
|
601 |
-
*
|
|
|
602 |
*/
|
603 |
private static function _delete_single_item( $post_id ) {
|
604 |
if ( !current_user_can( 'delete_post', $post_id ) )
|
@@ -626,22 +1188,28 @@ class MLA {
|
|
626 |
* @since 0.1
|
627 |
*
|
628 |
* @param int The WordPress Post ID of the attachment item
|
629 |
-
*
|
|
|
630 |
*/
|
631 |
private static function _display_single_item( $post_id ) {
|
632 |
global $post;
|
633 |
-
|
634 |
/*
|
635 |
* This function sets the global $post
|
636 |
*/
|
637 |
$post_data = MLAData::mla_get_attachment_by_id( $post_id );
|
638 |
-
|
639 |
if ( !isset( $post_data ) )
|
640 |
return array(
|
641 |
'message' => 'ERROR: Could not retrieve Attachment.',
|
642 |
'body' => ''
|
643 |
);
|
644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
645 |
if ( !empty( $post_data['mla_wp_attachment_metadata'] ) ) {
|
646 |
$page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-display-single-image.tpl' );
|
647 |
$width = $post_data['mla_wp_attachment_metadata']['width'];
|
@@ -657,65 +1225,112 @@ class MLA {
|
|
657 |
$image_meta = '';
|
658 |
}
|
659 |
|
660 |
-
if ( array(
|
661 |
-
$page_template_array
|
662 |
-
) ) {
|
663 |
$page_template = $page_template_array['page'];
|
|
|
664 |
$postbox_template = $page_template_array['postbox'];
|
665 |
} else {
|
666 |
error_log( "ERROR: MLA::_display_single_item \$page_template_array = " . var_export( $page_template_array, true ), 0 );
|
667 |
$page_template = $page_template_array;
|
|
|
668 |
$postbox_template = '';
|
669 |
}
|
670 |
|
671 |
-
if ( $post_data['mla_references']['
|
672 |
-
$parent_info =
|
673 |
-
|
674 |
-
$parent_info = '';
|
675 |
-
|
676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
|
678 |
-
|
679 |
-
$
|
680 |
-
|
681 |
-
|
682 |
-
$
|
683 |
-
|
|
|
|
|
684 |
}
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
foreach ( $post_data['mla_references']['features'] as $feature_id => $feature ) {
|
689 |
-
if ( $feature_id == $post_data['post_parent'] )
|
690 |
-
$parent = 'PARENT ';
|
691 |
-
else
|
692 |
-
$parent = '';
|
693 |
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
$inserts = '';
|
698 |
-
|
699 |
-
foreach ( $post_data['mla_references']['inserts'] as $file => $insert_array ) {
|
700 |
-
$inserts .= $file . "\r\n";
|
701 |
|
702 |
-
foreach ( $
|
703 |
-
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
else
|
706 |
-
$parent = '
|
707 |
|
708 |
-
$
|
709 |
-
} // foreach $
|
710 |
-
}
|
|
|
|
|
711 |
|
712 |
/*
|
713 |
-
* WordPress doesn't look in hidden fields to set the month filter dropdown
|
714 |
*/
|
715 |
if ( isset( $_REQUEST['m'] ) )
|
716 |
-
$
|
717 |
else
|
718 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
719 |
|
720 |
/*
|
721 |
* Add the current view arguments
|
@@ -724,13 +1339,11 @@ class MLA {
|
|
724 |
$view_args = '<input type="hidden" name="detached" value="' . $_REQUEST['detached'] . "\" />\r\n";
|
725 |
elseif ( isset( $_REQUEST['status'] ) )
|
726 |
$view_args = '<input type="hidden" name="status" value="' . $_REQUEST['status'] . "\" />\r\n";
|
727 |
-
elseif ( isset( $_REQUEST['post_mime_type'] ) )
|
728 |
-
$view_args = '<input type="hidden" name="post_mime_type" value="' . $_REQUEST['post_mime_type'] . "\" />\r\n";
|
729 |
else
|
730 |
$view_args = '';
|
731 |
|
732 |
-
if ( isset( $_REQUEST['
|
733 |
-
$view_args .= sprintf( '<input type="hidden" name="
|
734 |
|
735 |
$side_info_column = '';
|
736 |
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
@@ -738,10 +1351,10 @@ class MLA {
|
|
738 |
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
739 |
ob_start();
|
740 |
|
741 |
-
if ( $tax_object->hierarchical ) {
|
742 |
$box = array(
|
743 |
'id' => $tax_name . 'div',
|
744 |
-
'title' => $tax_object->labels->name,
|
745 |
'callback' => 'categories_meta_box',
|
746 |
'args' => array(
|
747 |
'taxonomy' => $tax_name
|
@@ -749,10 +1362,10 @@ class MLA {
|
|
749 |
'inside_html' => ''
|
750 |
);
|
751 |
post_categories_meta_box( $post, $box );
|
752 |
-
}
|
753 |
$box = array(
|
754 |
'id' => 'tagsdiv-' . $tax_name,
|
755 |
-
'title' => $tax_object->labels->name,
|
756 |
'callback' => 'post_tags_meta_box',
|
757 |
'args' => array(
|
758 |
'taxonomy' => $tax_name
|
@@ -768,165 +1381,47 @@ class MLA {
|
|
768 |
}
|
769 |
|
770 |
$page_values = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
771 |
'attachment_icon' => wp_get_attachment_image( $post_id, array( 160, 120 ), true ),
|
772 |
-
'file_name' => $post_data['mla_references']['file'],
|
773 |
'width' => $width,
|
774 |
'height' => $height,
|
775 |
-
'
|
776 |
-
'
|
777 |
-
'
|
778 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
'mla_admin_action' => self::MLA_ADMIN_SINGLE_EDIT_UPDATE,
|
780 |
-
'
|
781 |
-
'month' => $month,
|
782 |
'view_args' => $view_args,
|
783 |
-
'
|
784 |
'side_info_column' => $side_info_column
|
785 |
);
|
786 |
|
787 |
-
|
|
|
|
|
|
|
788 |
return array(
|
789 |
-
|
790 |
'body' => MLAData::mla_parse_template( $page_template, $page_values )
|
791 |
);
|
792 |
}
|
793 |
|
794 |
-
/**
|
795 |
-
* Update a single item; change the meta data
|
796 |
-
* for a single attachment.
|
797 |
-
*
|
798 |
-
* @since 0.1
|
799 |
-
*
|
800 |
-
* @param int The ID of the attachment to be updated
|
801 |
-
* @param array Field name => value pairs
|
802 |
-
* @param array Attachment Category and Tag values
|
803 |
-
* @return array success/failure message and null content
|
804 |
-
*/
|
805 |
-
private static function _update_single_item( $post_id, $new_data, $tax_input = null ) {
|
806 |
-
$post_data = MLAData::mla_get_attachment_by_id( $post_id );
|
807 |
-
|
808 |
-
if ( !isset( $post_data ) )
|
809 |
-
return array(
|
810 |
-
'message' => 'ERROR: Could not retrieve Attachment.',
|
811 |
-
'body' => ''
|
812 |
-
);
|
813 |
-
|
814 |
-
$message = '';
|
815 |
-
$updates = array( 'ID' => $post_id );
|
816 |
-
|
817 |
-
foreach ( $new_data as $key => $value ) {
|
818 |
-
switch ( $key ) {
|
819 |
-
case 'post_title':
|
820 |
-
if ( $value == $post_data[ $key ] )
|
821 |
-
break;
|
822 |
-
$message .= sprintf( 'Changing Title from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
823 |
-
$updates[ $key ] = $value;
|
824 |
-
break;
|
825 |
-
case 'post_name':
|
826 |
-
if ( $value == $post_data[ $key ] )
|
827 |
-
break;
|
828 |
-
|
829 |
-
/*
|
830 |
-
* Make sure new slug is unique
|
831 |
-
*/
|
832 |
-
$args = array(
|
833 |
-
'name' => $value,
|
834 |
-
'post_type' => 'attachment',
|
835 |
-
'post_status' => 'inherit',
|
836 |
-
'showposts' => 1
|
837 |
-
);
|
838 |
-
$my_posts = get_posts( $args );
|
839 |
-
|
840 |
-
if ( $my_posts ) {
|
841 |
-
$message .= sprintf( 'ERROR: Could not change Name/Slug "%1$s"; name already exists<br>', $value );
|
842 |
-
} else {
|
843 |
-
$message .= sprintf( 'Changing Name/Slug from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
844 |
-
$updates[ $key ] = $value;
|
845 |
-
}
|
846 |
-
break;
|
847 |
-
case 'image_alt':
|
848 |
-
$key = 'mla_wp_attachment_image_alt';
|
849 |
-
if ( !isset( $post_data[ $key ] ) )
|
850 |
-
$post_data[ $key ] = '';
|
851 |
-
|
852 |
-
if ( $value == $post_data[ $key ] )
|
853 |
-
break;
|
854 |
-
|
855 |
-
if ( empty( $value ) ) {
|
856 |
-
if ( delete_post_meta( $post_id, '_wp_attachment_image_alt', $value ) )
|
857 |
-
$message .= sprintf( 'Deleting Alternate Text, was "%1$s"<br>', $post_data[ $key ] );
|
858 |
-
else
|
859 |
-
$message .= sprintf( 'ERROR: Could not delete Alternate Text, remains "%1$s"<br>', $post_data[ $key ] );
|
860 |
-
} else {
|
861 |
-
if ( update_post_meta( $post_id, '_wp_attachment_image_alt', $value ) )
|
862 |
-
$message .= sprintf( 'Changing Alternate Text from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
863 |
-
else
|
864 |
-
$message .= sprintf( 'ERROR: Could not change Alternate Text from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
865 |
-
}
|
866 |
-
break;
|
867 |
-
case 'post_excerpt':
|
868 |
-
if ( $value == $post_data[ $key ] )
|
869 |
-
break;
|
870 |
-
$message .= sprintf( 'Changing Caption from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
871 |
-
$updates[ $key ] = $value;
|
872 |
-
break;
|
873 |
-
case 'post_content':
|
874 |
-
if ( $value == $post_data[ $key ] )
|
875 |
-
break;
|
876 |
-
$message .= sprintf( 'Changing Description from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
877 |
-
$updates[ $key ] = $value;
|
878 |
-
break;
|
879 |
-
case 'post_parent':
|
880 |
-
if ( $value == $post_data[ $key ] )
|
881 |
-
break;
|
882 |
-
$message .= sprintf( 'Changing Parent from "%1$s" to "%2$s"<br>', $post_data[ $key ], $value );
|
883 |
-
$updates[ $key ] = $value;
|
884 |
-
break;
|
885 |
-
default:
|
886 |
-
} // switch $key
|
887 |
-
} // foreach $new_data
|
888 |
-
|
889 |
-
if ( !empty( $tax_input ) ) {
|
890 |
-
foreach ( $tax_input as $taxonomy => $tags ) {
|
891 |
-
$taxonomy_obj = get_taxonomy( $taxonomy );
|
892 |
-
$terms_before = wp_get_post_terms( $post_id, $taxonomy, array(
|
893 |
-
"fields" => "all"
|
894 |
-
) );
|
895 |
-
if ( is_array( $tags ) ) // array = hierarchical, string = non-hierarchical.
|
896 |
-
$tags = array_filter( $tags );
|
897 |
-
|
898 |
-
if ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
|
899 |
-
$result = wp_set_post_terms( $post_id, $tags, $taxonomy );
|
900 |
-
}
|
901 |
-
|
902 |
-
$terms_after = wp_get_post_terms( $post_id, $taxonomy, array(
|
903 |
-
"fields" => "all"
|
904 |
-
) );
|
905 |
-
|
906 |
-
if ( $terms_before != $terms_after )
|
907 |
-
$message .= sprintf( 'Changing "%1$s" terms<br>', $taxonomy );
|
908 |
-
}
|
909 |
-
}
|
910 |
-
|
911 |
-
if ( empty( $message ) )
|
912 |
-
return array(
|
913 |
-
'message' => 'Item: ' . $post_id . ', no changes detected.',
|
914 |
-
'body' => ''
|
915 |
-
);
|
916 |
-
else {
|
917 |
-
if ( wp_update_post( $updates ) )
|
918 |
-
return array(
|
919 |
-
'message' => 'Item: ' . $post_id . ' updated.<br>' . $message,
|
920 |
-
'body' => ''
|
921 |
-
);
|
922 |
-
else
|
923 |
-
return array(
|
924 |
-
'message' => 'ERROR: Item ' . $post_id . ' update failed.',
|
925 |
-
'body' => ''
|
926 |
-
);
|
927 |
-
}
|
928 |
-
}
|
929 |
-
|
930 |
/**
|
931 |
* Restore a single item from the Trash
|
932 |
*
|
@@ -934,7 +1429,7 @@ class MLA {
|
|
934 |
*
|
935 |
* @param array The form POST data
|
936 |
*
|
937 |
-
* @return array success/failure message and
|
938 |
*/
|
939 |
private static function _restore_single_item( $post_id ) {
|
940 |
if ( !current_user_can( 'delete_post', $post_id ) )
|
@@ -952,7 +1447,7 @@ class MLA {
|
|
952 |
/*
|
953 |
* Posts are restored to "draft" status, so this must be updated.
|
954 |
*/
|
955 |
-
$update_post = array(
|
956 |
$update_post['ID'] = $post_id;
|
957 |
$update_post['post_status'] = 'inherit';
|
958 |
wp_update_post( $update_post );
|
@@ -969,7 +1464,8 @@ class MLA {
|
|
969 |
* @since 0.1
|
970 |
*
|
971 |
* @param array The form POST data
|
972 |
-
*
|
|
|
973 |
*/
|
974 |
private static function _trash_single_item( $post_id ) {
|
975 |
if ( !current_user_can( 'delete_post', $post_id ) )
|
@@ -989,6 +1485,5 @@ class MLA {
|
|
989 |
'body' => ''
|
990 |
);
|
991 |
}
|
992 |
-
|
993 |
} // class MLA
|
994 |
?>
|
38 |
*
|
39 |
* @var string
|
40 |
*/
|
41 |
+
const CURRENT_MLA_VERSION = '1.14';
|
42 |
|
43 |
/**
|
44 |
+
* Slug for registering and enqueueing plugin style sheet
|
45 |
*
|
46 |
* @since 0.1
|
47 |
*
|
48 |
* @var string
|
49 |
*/
|
50 |
+
const STYLESHEET_SLUG = 'mla-style';
|
51 |
|
52 |
/**
|
53 |
+
* Slug for localizing and enqueueing JavaScript - edit single item page
|
54 |
*
|
55 |
* @since 0.1
|
56 |
*
|
57 |
* @var string
|
58 |
*/
|
59 |
+
const JAVASCRIPT_SINGLE_EDIT_SLUG = 'mla-single-edit-scripts';
|
60 |
|
61 |
/**
|
62 |
+
* Object name for localizing JavaScript - edit single item page
|
63 |
*
|
64 |
* @since 0.1
|
65 |
*
|
66 |
* @var string
|
67 |
*/
|
68 |
+
const JAVASCRIPT_SINGLE_EDIT_OBJECT = 'mla_single_edit_vars';
|
69 |
|
70 |
/**
|
71 |
+
* Slug for localizing and enqueueing JavaScript - MLA List Table
|
72 |
*
|
73 |
+
* @since 0.20
|
74 |
*
|
75 |
* @var string
|
76 |
*/
|
77 |
+
const JAVASCRIPT_INLINE_EDIT_SLUG = 'mla-inline-edit-scripts';
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Object name for localizing JavaScript - MLA List Table
|
81 |
+
*
|
82 |
+
* @since 0.20
|
83 |
+
*
|
84 |
+
* @var string
|
85 |
+
*/
|
86 |
+
const JAVASCRIPT_INLINE_EDIT_OBJECT = 'mla_inline_edit_vars';
|
87 |
|
88 |
/**
|
89 |
* Slug for adding plugin submenu
|
94 |
*/
|
95 |
const ADMIN_PAGE_SLUG = 'mla-menu';
|
96 |
|
97 |
+
/**
|
98 |
+
* Action name; uniquely identifies the nonce
|
99 |
+
*
|
100 |
+
* @since 0.1
|
101 |
+
*
|
102 |
+
* @var string
|
103 |
+
*/
|
104 |
+
const MLA_ADMIN_NONCE = 'mla_admin';
|
105 |
+
|
106 |
+
/**
|
107 |
+
* mla_admin_action value for permanently deleting a single item
|
108 |
+
*
|
109 |
+
* @since 0.1
|
110 |
+
*
|
111 |
+
* @var string
|
112 |
+
*/
|
113 |
+
const MLA_ADMIN_SINGLE_DELETE = 'single_item_delete';
|
114 |
+
|
115 |
+
/**
|
116 |
+
* mla_admin_action value for displaying a single item
|
117 |
+
*
|
118 |
+
* @since 0.1
|
119 |
+
*
|
120 |
+
* @var string
|
121 |
+
*/
|
122 |
+
const MLA_ADMIN_SINGLE_EDIT_DISPLAY = 'single_item_edit_display';
|
123 |
+
|
124 |
+
/**
|
125 |
+
* mla_admin_action value for updating a single item
|
126 |
+
*
|
127 |
+
* @since 0.1
|
128 |
+
*
|
129 |
+
* @var string
|
130 |
+
*/
|
131 |
+
const MLA_ADMIN_SINGLE_EDIT_UPDATE = 'single_item_edit_update';
|
132 |
+
|
133 |
+
/**
|
134 |
+
* mla_admin_action value for restoring a single item from the trash
|
135 |
+
*
|
136 |
+
* @since 0.1
|
137 |
+
*
|
138 |
+
* @var string
|
139 |
+
*/
|
140 |
+
const MLA_ADMIN_SINGLE_RESTORE = 'single_item_restore';
|
141 |
+
|
142 |
+
/**
|
143 |
+
* mla_admin_action value for moving a single item to the trash
|
144 |
+
*
|
145 |
+
* @since 0.1
|
146 |
+
*
|
147 |
+
* @var string
|
148 |
+
*/
|
149 |
+
const MLA_ADMIN_SINGLE_TRASH = 'single_item_trash';
|
150 |
+
|
151 |
+
/**
|
152 |
+
* mla_admin_action value for mapping Custom Field metadata
|
153 |
+
*
|
154 |
+
* @since 1.10
|
155 |
+
*
|
156 |
+
* @var string
|
157 |
+
*/
|
158 |
+
const MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP = 'single_item_custom_field_map';
|
159 |
+
|
160 |
+
/**
|
161 |
+
* mla_admin_action value for mapping IPTC/EXIF metadata
|
162 |
+
*
|
163 |
+
* @since 1.00
|
164 |
+
*
|
165 |
+
* @var string
|
166 |
+
*/
|
167 |
+
const MLA_ADMIN_SINGLE_MAP = 'single_item_map';
|
168 |
+
|
169 |
/**
|
170 |
* Holds screen ids to match help text to corresponding screen
|
171 |
*
|
173 |
*
|
174 |
* @var array
|
175 |
*/
|
176 |
+
private static $page_hooks = array();
|
177 |
|
178 |
/**
|
179 |
* Initialization function, similar to __construct()
|
180 |
*
|
181 |
+
* This function contains add_action and add_filter calls
|
182 |
+
* to set up the Ajax handlers, enqueue JavaScript and CSS files, and
|
183 |
+
* set up the Assistant submenu.
|
184 |
+
*
|
185 |
* @since 0.1
|
186 |
+
*
|
187 |
+
* @return void
|
188 |
*/
|
189 |
public static function initialize( )
|
190 |
{
|
191 |
+
add_action( 'admin_init', 'MLA::mla_admin_init_action' );
|
|
|
|
|
192 |
add_action( 'admin_enqueue_scripts', 'MLA::mla_admin_enqueue_scripts_action' );
|
193 |
add_action( 'admin_menu', 'MLA::mla_admin_menu_action' );
|
194 |
add_filter( 'set-screen-option', 'MLA::mla_set_screen_option_filter', 10, 3 ); // $status, $option, $value
|
195 |
add_filter( 'screen_options_show_screen', 'MLA::mla_screen_options_show_screen_filter', 10, 2 ); // $show_screen, $this
|
196 |
}
|
197 |
|
198 |
+
/**
|
199 |
+
* Load the plugin's Ajax handler or process Edit Media update actions
|
200 |
+
*
|
201 |
+
* @since 0.20
|
202 |
+
*
|
203 |
+
* @return void
|
204 |
+
*/
|
205 |
+
public static function mla_admin_init_action() {
|
206 |
+
/*
|
207 |
+
* Process row-level actions from the Edit Media screen
|
208 |
+
*/
|
209 |
+
if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
|
210 |
+
check_admin_referer( self::MLA_ADMIN_NONCE );
|
211 |
+
|
212 |
+
switch ( $_REQUEST['mla_admin_action'] ) {
|
213 |
+
case self::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP:
|
214 |
+
$updates = MLAOptions::mla_evaluate_custom_field_mapping( $_REQUEST['mla_item_ID'], 'single_attachment_mapping' );
|
215 |
+
|
216 |
+
if ( !empty( $updates ) )
|
217 |
+
$item_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
|
218 |
+
|
219 |
+
$view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
|
220 |
+
wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $_REQUEST['mla_item_ID'] . '&action=edit&message=101' ), 302 );
|
221 |
+
exit;
|
222 |
+
case self::MLA_ADMIN_SINGLE_MAP:
|
223 |
+
$item = get_post( $_REQUEST['mla_item_ID'] );
|
224 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
|
225 |
+
$page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
|
226 |
+
|
227 |
+
$view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
|
228 |
+
wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $_REQUEST['mla_item_ID'] . '&action=edit&message=102' ), 302 );
|
229 |
+
exit;
|
230 |
+
default:
|
231 |
+
// ignore the rest
|
232 |
+
} // switch ($_REQUEST['mla_admin_action'])
|
233 |
+
} // (!empty($_REQUEST['mla_admin_action'])
|
234 |
+
|
235 |
+
add_action( 'wp_ajax_' . self::JAVASCRIPT_INLINE_EDIT_SLUG, 'MLA::mla_inline_edit_action' );
|
236 |
+
}
|
237 |
+
|
238 |
/**
|
239 |
* Load the plugin's Style Sheet and Javascript files
|
240 |
*
|
242 |
*
|
243 |
* @param string Name of the page being loaded
|
244 |
*
|
245 |
+
* @return void
|
246 |
*/
|
247 |
public static function mla_admin_enqueue_scripts_action( $page_hook ) {
|
248 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
249 |
+
|
250 |
+
if( 'edit-tags.php' == $page_hook ) {
|
251 |
+
wp_register_style( self::STYLESHEET_SLUG, MLA_PLUGIN_URL . 'css/mla-edit-tags-style.css', false, self::CURRENT_MLA_VERSION );
|
252 |
+
wp_enqueue_style( self::STYLESHEET_SLUG );
|
253 |
return;
|
254 |
+
}
|
255 |
|
256 |
+
if ( ( 'media_page_mla-menu' != $page_hook ) && ( 'settings_page_mla-settings-menu' != $page_hook ) )
|
257 |
+
return;
|
258 |
+
|
259 |
wp_register_style( self::STYLESHEET_SLUG, MLA_PLUGIN_URL . 'css/mla-style.css', false, self::CURRENT_MLA_VERSION );
|
260 |
wp_enqueue_style( self::STYLESHEET_SLUG );
|
261 |
+
|
262 |
if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) ) {
|
263 |
+
wp_enqueue_script( self::JAVASCRIPT_SINGLE_EDIT_SLUG, MLA_PLUGIN_URL . "js/mla-single-edit-scripts{$suffix}.js",
|
264 |
+
array( 'wp-lists', 'suggest', 'jquery' ), self::CURRENT_MLA_VERSION, false );
|
|
|
|
|
|
|
265 |
$script_variables = array(
|
266 |
+
'comma' => _x( ',', 'tag delimiter' ),
|
267 |
+
'Ajax_Url' => admin_url( 'admin-ajax.php' )
|
268 |
);
|
269 |
+
wp_localize_script( self::JAVASCRIPT_SINGLE_EDIT_SLUG, self::JAVASCRIPT_SINGLE_EDIT_OBJECT, $script_variables );
|
270 |
+
}
|
271 |
+
else {
|
272 |
+
wp_enqueue_script( self::JAVASCRIPT_INLINE_EDIT_SLUG, MLA_PLUGIN_URL . "js/mla-inline-edit-scripts{$suffix}.js",
|
273 |
+
array( 'wp-lists', 'suggest', 'jquery' ), self::CURRENT_MLA_VERSION, false );
|
274 |
+
|
275 |
+
$fields = array( 'post_title', 'post_name', 'post_excerpt', 'image_alt', 'post_parent', 'menu_order', 'post_author' );
|
276 |
+
$custom_fields = MLAOptions::mla_custom_field_support( 'quick_edit' );
|
277 |
+
$custom_fields = array_merge( $custom_fields, MLAOptions::mla_custom_field_support( 'bulk_edit' ) );
|
278 |
+
foreach ($custom_fields as $slug => $label ) {
|
279 |
+
$fields[] = $slug;
|
280 |
+
}
|
281 |
+
|
282 |
+
$script_variables = array(
|
283 |
+
'fields' => $fields,
|
284 |
+
'error' => 'Error while saving the changes.',
|
285 |
+
'ntdeltitle' => 'Remove From Bulk Edit',
|
286 |
+
'notitle' => '(no title)',
|
287 |
+
'comma' => _x( ',', 'tag delimiter' ),
|
288 |
+
'ajax_action' => self::JAVASCRIPT_INLINE_EDIT_SLUG,
|
289 |
+
'ajax_nonce' => wp_create_nonce( self::MLA_ADMIN_NONCE )
|
290 |
+
);
|
291 |
+
wp_localize_script( self::JAVASCRIPT_INLINE_EDIT_SLUG, self::JAVASCRIPT_INLINE_EDIT_OBJECT, $script_variables );
|
292 |
}
|
293 |
}
|
294 |
|
296 |
* Add the submenu pages
|
297 |
*
|
298 |
* Add a submenu page in the "Media" section,
|
299 |
+
* add settings page in the "Settings" section.
|
|
|
|
|
300 |
* add settings link in the Plugins section entry for MLA.
|
301 |
*
|
302 |
+
* For WordPress versions before 3.5,
|
303 |
+
* add submenu page(s) for attachment taxonomies,
|
304 |
+
* add filter to clean up taxonomy submenu labels.
|
305 |
+
*
|
306 |
* @since 0.1
|
307 |
+
*
|
308 |
+
* @return void
|
309 |
*/
|
310 |
public static function mla_admin_menu_action( ) {
|
311 |
$hook = add_submenu_page( 'upload.php', 'Media Library Assistant', 'Assistant', 'upload_files', self::ADMIN_PAGE_SLUG, 'MLA::mla_render_admin_page' );
|
316 |
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
317 |
if ( !empty( $taxonomies ) ) {
|
318 |
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
|
|
|
|
319 |
/*
|
320 |
+
* WordPress 3.5 adds native support for taxonomies
|
321 |
+
*/
|
322 |
+
if( ! MLATest::$wordpress_3point5_plus ) {
|
323 |
+
$hook = add_submenu_page( 'upload.php', $tax_object->label, $tax_object->label, 'manage_categories', 'mla-edit-tax-' . $tax_name, 'MLA::mla_edit_tax_redirect' );
|
324 |
+
add_action( 'load-' . $hook, 'MLA::mla_edit_tax_redirect' );
|
325 |
+
} // ! MLATest::$wordpress_3point5_plus
|
326 |
+
|
327 |
+
/*
|
328 |
+
* The page_hook we need for taxonomy edits is slightly different
|
329 |
*/
|
330 |
$hook = 'edit-' . $tax_name;
|
331 |
+
self::$page_hooks[ $hook ] = 't_' . $tax_name;
|
332 |
+
} // foreach $taxonomies
|
333 |
|
334 |
add_action( 'load-edit-tags.php', 'MLA::mla_add_help_tab' );
|
335 |
}
|
336 |
|
337 |
+
add_filter( 'parent_file', 'MLA::mla_parent_file_filter', 10, 1 );
|
338 |
}
|
339 |
|
340 |
/**
|
341 |
* Add the "XX Entries per page" filter to the Screen Options tab
|
342 |
*
|
343 |
* @since 0.1
|
344 |
+
*
|
345 |
+
* @return void
|
346 |
*/
|
347 |
public static function mla_add_menu_options( ) {
|
348 |
$option = 'per_page';
|
356 |
add_screen_option( $option, $args );
|
357 |
}
|
358 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
/**
|
360 |
* Add contextual help tabs to all the MLA pages
|
361 |
*
|
362 |
* @since 0.1
|
363 |
+
*
|
364 |
+
* @return void
|
365 |
*/
|
366 |
public static function mla_add_help_tab( )
|
367 |
{
|
385 |
$file_suffix = self::MLA_ADMIN_SINGLE_EDIT_DISPLAY;
|
386 |
break;
|
387 |
} // switch
|
388 |
+
} // isset( $_REQUEST['mla_admin_action'] )
|
389 |
+
else {
|
390 |
+
/*
|
391 |
+
* Use a generic page for edit taxonomy screens
|
392 |
+
*/
|
393 |
+
if ( 't_' == substr( self::$page_hooks[ $file_suffix ], 0, 2 ) ) {
|
394 |
+
$taxonomy = substr( self::$page_hooks[ $file_suffix ], 2 );
|
395 |
+
switch ( $taxonomy ) {
|
396 |
+
case 'attachment_category':
|
397 |
+
case 'attachment_tag':
|
398 |
+
break;
|
399 |
+
default:
|
400 |
+
$tax_object = get_taxonomy( $taxonomy );
|
401 |
+
|
402 |
+
if ( $tax_object->hierarchical )
|
403 |
+
$file_suffix = 'edit-hierarchical-taxonomy';
|
404 |
+
else
|
405 |
+
$file_suffix = 'edit-flat-taxonomy';
|
406 |
+
} // $taxonomy switch
|
407 |
+
} // is taxonomy
|
408 |
}
|
409 |
|
410 |
$template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/help-for-' . $file_suffix . '.tpl' );
|
420 |
/*
|
421 |
* Provide explicit control over tab order
|
422 |
*/
|
423 |
+
$tab_array = array();
|
424 |
|
425 |
foreach ( $template_array as $id => $content ) {
|
426 |
$match_count = preg_match( '#\<!-- title="(.+)" order="(.+)" --\>#', $content, $matches, PREG_OFFSET_CAPTURE );
|
432 |
'content' => $content
|
433 |
);
|
434 |
} else {
|
435 |
+
error_log( 'ERROR: mla_add_help_tab discarding '.var_export( $id, true ), 0 );
|
436 |
}
|
437 |
}
|
438 |
|
442 |
}
|
443 |
}
|
444 |
|
445 |
+
/**
|
446 |
+
* Only show screen options on the table-list screen
|
447 |
+
*
|
448 |
+
* @since 0.1
|
449 |
+
*
|
450 |
+
* @param boolean True to display "Screen Options", false to suppress them
|
451 |
+
* @param string Name of the page being loaded
|
452 |
+
*
|
453 |
+
* @return boolean True to display "Screen Options", false to suppress them
|
454 |
+
*/
|
455 |
+
public static function mla_screen_options_show_screen_filter( $show_screen, $this_screen ) {
|
456 |
+
if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) )
|
457 |
+
return false;
|
458 |
+
else
|
459 |
+
return $show_screen;
|
460 |
+
}
|
461 |
+
|
462 |
+
/**
|
463 |
+
* Save the "Entries per page" option set by this user
|
464 |
+
*
|
465 |
+
* @since 0.1
|
466 |
+
*
|
467 |
+
* @param boolean Unknown - always false?
|
468 |
+
* @param string Name of the option being changed
|
469 |
+
* @param string New value of the option
|
470 |
+
*
|
471 |
+
* @return string|void New value if this is our option, otherwise nothing
|
472 |
+
*/
|
473 |
+
public static function mla_set_screen_option_filter( $status, $option, $value )
|
474 |
+
{
|
475 |
+
if ( 'mla_entries_per_page' == $option )
|
476 |
+
return $value;
|
477 |
+
}
|
478 |
+
|
479 |
+
/**
|
480 |
+
* Redirect to the Edit Tags/Categories page
|
481 |
+
*
|
482 |
+
* The custom taxonomy add/edit submenu entries go to "upload.php" by default.
|
483 |
+
* This filter is the only way to redirect them to the correct WordPress page.
|
484 |
+
* The filter is not required for WordPress 3.5 and later.
|
485 |
+
*
|
486 |
+
* @since 0.1
|
487 |
+
*
|
488 |
+
* @return void
|
489 |
+
*/
|
490 |
+
public static function mla_edit_tax_redirect( )
|
491 |
+
{
|
492 |
+
/*
|
493 |
+
* WordPress 3.5 adds native support for taxonomies
|
494 |
+
*/
|
495 |
+
if( MLATest::$wordpress_3point5_plus )
|
496 |
+
return;
|
497 |
+
|
498 |
+
$screen = get_current_screen();
|
499 |
+
|
500 |
+
if ( isset( $_REQUEST['page'] ) && ( substr( $_REQUEST['page'], 0, 13 ) == 'mla-edit-tax-' ) ) {
|
501 |
+
$taxonomy = substr( $_REQUEST['page'], 13 );
|
502 |
+
wp_redirect( admin_url( 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=attachment' ), 302 );
|
503 |
+
exit;
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
/**
|
508 |
* Cleanup menus for Edit Tags/Categories page
|
509 |
*
|
510 |
+
* For WordPress before 3.5, the submenu entries for custom taxonomies
|
511 |
+
* under the "Media" menu are not set up correctly by WordPress, so this
|
512 |
+
* function cleans them up, redirecting the request to the right WordPress
|
513 |
+
* page for editing/adding taxonomy terms.
|
514 |
+
* For WordPress 3.5 and later, the function fixes the submenu bolding when
|
515 |
+
* going to the Edit Media screen.
|
516 |
*
|
517 |
* @since 0.1
|
518 |
*
|
520 |
*
|
521 |
* @return string The updated top-level menu page
|
522 |
*/
|
523 |
+
public static function mla_parent_file_filter( $parent_file ) {
|
524 |
+
global $submenu_file, $submenu;
|
525 |
|
526 |
+
/*
|
527 |
+
* Make sure the "Assistant" submenu line is bolded when we go to the Edit Media page
|
528 |
+
*/
|
529 |
+
if ( isset( $_REQUEST['mla_source'] ) )
|
530 |
+
$submenu_file = 'mla-menu';
|
531 |
+
|
532 |
+
/*
|
533 |
+
* WordPress 3.5 adds native support for taxonomies
|
534 |
+
*/
|
535 |
+
if( MLATest::$wordpress_3point5_plus )
|
536 |
+
return $parent_file;
|
537 |
+
|
538 |
if ( isset( $_REQUEST['taxonomy'] ) ) {
|
539 |
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
540 |
|
541 |
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
542 |
if ( $_REQUEST['taxonomy'] == $tax_name ) {
|
543 |
+
$mla_page = 'mla-edit-tax-' . $tax_name;
|
544 |
$real_page = 'edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment';
|
545 |
|
546 |
foreach ( $submenu['upload.php'] as $submenu_index => $submenu_entry ) {
|
560 |
* Render the "Assistant" subpage in the Media section, using the list_table package
|
561 |
*
|
562 |
* @since 0.1
|
563 |
+
*
|
564 |
+
* @return void
|
565 |
*/
|
566 |
public static function mla_render_admin_page( ) {
|
567 |
$bulk_action = self::_current_bulk_action();
|
568 |
|
569 |
echo "<div class=\"wrap\">\r\n";
|
570 |
echo "<div id=\"icon-upload\" class=\"icon32\"><br/></div>\r\n";
|
571 |
+
echo "<h2>Media Library Assistant"; // trailing </h2> is action-specific
|
572 |
|
573 |
if ( !current_user_can( 'upload_files' ) ) {
|
574 |
echo " - Error</h2>\r\n";
|
580 |
'body' => ''
|
581 |
);
|
582 |
|
583 |
+
/*
|
584 |
+
* The category taxonomy is a special case because post_categories_meta_box() changes the input name
|
585 |
+
*/
|
586 |
+
if ( !isset( $_REQUEST['tax_input'] ) )
|
587 |
+
$_REQUEST['tax_input'] = array();
|
588 |
+
|
589 |
+
if ( isset( $_REQUEST['post_category'] ) ) {
|
590 |
+
$_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
|
591 |
+
unset ( $_REQUEST['post_category'] );
|
592 |
+
}
|
593 |
+
|
594 |
/*
|
595 |
* Process bulk actions that affect an array of items
|
596 |
*/
|
605 |
case 'delete':
|
606 |
$item_content = self::_delete_single_item( $post_id );
|
607 |
break;
|
608 |
+
case 'edit':
|
609 |
+
if ( !empty( $_REQUEST['bulk_custom_field_map'] ) ) {
|
610 |
+
$updates = MLAOptions::mla_evaluate_custom_field_mapping( $post_id, 'single_attachment_mapping' );
|
611 |
+
|
612 |
+
$item_content = MLAData::mla_update_single_item( $post_id, $updates );
|
613 |
+
break;
|
614 |
+
}
|
615 |
+
|
616 |
+
if ( !empty( $_REQUEST['bulk_map'] ) ) {
|
617 |
+
$item = get_post( $post_id );
|
618 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
|
619 |
+
|
620 |
+
$item_content = MLAData::mla_update_single_item( $post_id, $updates );
|
621 |
+
break;
|
622 |
+
}
|
623 |
+
|
624 |
+
$new_data = array() ;
|
625 |
+
if ( isset( $_REQUEST['post_parent'] ) && is_numeric( $_REQUEST['post_parent'] ) )
|
626 |
+
$new_data['post_parent'] = $_REQUEST['post_parent'];
|
627 |
+
|
628 |
+
if ( isset( $_REQUEST['post_author'] ) && ( -1 != $_REQUEST['post_author'] ) )
|
629 |
+
$new_data['post_author'] = $_REQUEST['post_author'];
|
630 |
+
|
631 |
+
/*
|
632 |
+
* Custom field support
|
633 |
+
*/
|
634 |
+
$custom_fields = array();
|
635 |
+
foreach (MLAOptions::mla_custom_field_support( 'bulk_edit' ) as $slug => $label ) {
|
636 |
+
$field_name = $slug;
|
637 |
+
if ( isset( $_REQUEST[ $field_name ] ) && ( ! empty( $_REQUEST[ $field_name ] ) ) ) {
|
638 |
+
$custom_fields[ $label ] = $_REQUEST[ $field_name ];
|
639 |
+
}
|
640 |
+
}
|
641 |
+
|
642 |
+
if ( ! empty( $custom_fields ) )
|
643 |
+
$new_data[ 'custom_updates' ] = $custom_fields;
|
644 |
+
|
645 |
+
$item_content = MLAData::mla_update_single_item( $post_id, $new_data, $_REQUEST['tax_input'], $_REQUEST['tax_action'] );
|
646 |
+
break;
|
647 |
case 'restore':
|
648 |
$item_content = self::_restore_single_item( $post_id );
|
649 |
break;
|
674 |
|
675 |
switch ( $_REQUEST['mla_admin_action'] ) {
|
676 |
case self::MLA_ADMIN_SINGLE_DELETE:
|
|
|
677 |
$page_content = self::_delete_single_item( $_REQUEST['mla_item_ID'] );
|
678 |
break;
|
679 |
case self::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
|
680 |
+
echo " - Edit single item</h2>";
|
681 |
$page_content = self::_display_single_item( $_REQUEST['mla_item_ID'] );
|
682 |
break;
|
683 |
case self::MLA_ADMIN_SINGLE_EDIT_UPDATE:
|
|
|
684 |
if ( !empty( $_REQUEST['update'] ) ) {
|
685 |
+
$page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $_REQUEST['attachments'][ $_REQUEST['mla_item_ID'] ], $_REQUEST['tax_input'] );
|
686 |
+
} elseif ( !empty( $_REQUEST['map-iptc-exif'] ) ) {
|
687 |
+
$item = get_post( $_REQUEST['mla_item_ID'] );
|
688 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
|
689 |
+
$page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
|
690 |
} else {
|
691 |
$page_content = array(
|
692 |
+
'message' => 'Item: ' . $_REQUEST['mla_item_ID'] . ' cancelled.',
|
693 |
'body' => ''
|
694 |
);
|
695 |
}
|
696 |
break;
|
697 |
case self::MLA_ADMIN_SINGLE_RESTORE:
|
|
|
698 |
$page_content = self::_restore_single_item( $_REQUEST['mla_item_ID'] );
|
699 |
break;
|
700 |
case self::MLA_ADMIN_SINGLE_TRASH:
|
|
|
701 |
$page_content = self::_trash_single_item( $_REQUEST['mla_item_ID'] );
|
702 |
break;
|
703 |
default:
|
|
|
704 |
$page_content = array(
|
705 |
'message' => sprintf( 'Unknown mla_admin_action - "%1$s"', $_REQUEST['mla_admin_action'] ),
|
706 |
'body' => ''
|
709 |
} // switch ($_REQUEST['mla_admin_action'])
|
710 |
} // (!empty($_REQUEST['mla_admin_action'])
|
711 |
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
if ( !empty( $page_content['body'] ) ) {
|
713 |
+
if ( !empty( $page_content['message'] ) ) {
|
714 |
+
echo " <div class=\"mla_messages\"><p>\r\n";
|
715 |
+
echo ' ' . $page_content['message'] . "\r\n";
|
716 |
+
echo " </p></div>\r\n"; // id="message"
|
717 |
+
}
|
718 |
+
|
719 |
echo $page_content['body'];
|
720 |
} else {
|
721 |
/*
|
733 |
), $_SERVER['REQUEST_URI'] );
|
734 |
|
735 |
if ( !empty( $_REQUEST['heading_suffix'] ) ) {
|
736 |
+
echo ' - ' . esc_html( $_REQUEST['heading_suffix'] ) . "</h2>\r\n";
|
737 |
+
} elseif ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['mla-search-fields'] ) ) {
|
738 |
+
echo ' - search results for "' . stripslashes( trim( $_REQUEST['s'] ) ) . "\"</h2>\r\n";
|
739 |
} else
|
740 |
echo "</h2>\r\n";
|
741 |
|
742 |
+
if ( !empty( $page_content['message'] ) ) {
|
743 |
+
echo " <div class=\"mla_messages\"><p>\r\n";
|
744 |
+
echo ' ' . $page_content['message'] . "\r\n";
|
745 |
+
echo " </p></div>\r\n"; // id="message"
|
746 |
+
}
|
747 |
+
|
748 |
// Create an instance of our package class...
|
749 |
$MLAListTable = new MLA_List_Table();
|
750 |
|
753 |
$MLAListTable->views();
|
754 |
|
755 |
// Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions
|
756 |
+
echo '<form id="mla-filter" action="' . admin_url( 'upload.php' ) . "\" method=\"get\">\r\n";
|
757 |
+
/*
|
758 |
+
* Compose the Search Media box
|
759 |
+
*/
|
760 |
+
if ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['mla-search-fields'] ) ) {
|
761 |
+
$search_value = esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) );
|
762 |
+
$search_fields = $_REQUEST['mla-search-fields'];
|
763 |
+
$search_connector = $_REQUEST['mla-search-connector'];
|
764 |
+
} else {
|
765 |
+
$search_value = '';
|
766 |
+
$search_fields = array ( 'title', 'content' );
|
767 |
+
$search_connector = 'AND';
|
768 |
+
}
|
769 |
+
|
770 |
+
echo '<p class="search-box">' . "\r\n";
|
771 |
+
echo '<label class="screen-reader-text" for="media-search-input">Search Media:</label>' . "\r\n";
|
772 |
+
echo '<input type="text" size="45" id="media-search-input" name="s" value="' . $search_value . '" />' . "\r\n";
|
773 |
+
echo '<input type="submit" name="mla-search-submit" id="search-submit" class="button" value="Search Media" /><br>' . "\r\n";
|
774 |
+
if ( 'OR' == $search_connector ) {
|
775 |
+
echo '<input type="radio" name="mla-search-connector" value="AND" /> and ' . "\r\n";
|
776 |
+
echo '<input type="radio" name="mla-search-connector" checked="checked" value="OR" /> or ' . "\r\n";
|
777 |
+
} else {
|
778 |
+
echo '<input type="radio" name="mla-search-connector" checked="checked" value="AND" /> and ' . "\r\n";
|
779 |
+
echo '<input type="radio" name="mla-search-connector" value="OR" /> or ' . "\r\n";
|
780 |
+
}
|
781 |
+
|
782 |
+
if ( in_array( 'title', $search_fields ) )
|
783 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-title" checked="checked" value="title" /> title ' . "\r\n";
|
784 |
+
else
|
785 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-title" value="title" /> title ' . "\r\n";
|
786 |
+
|
787 |
+
if ( in_array( 'name', $search_fields ) )
|
788 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-name" checked="checked" value="name" /> name ' . "\r\n";
|
789 |
+
else
|
790 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-name" value="name" /> name ' . "\r\n";
|
791 |
+
|
792 |
+
if ( in_array( 'alt-text', $search_fields ) )
|
793 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-alt-text" checked="checked" value="alt-text" /> ALT text ' . "\r\n";
|
794 |
+
else
|
795 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-alt-text" value="alt-text" /> ALT text ' . "\r\n";
|
796 |
+
|
797 |
+
if ( in_array( 'excerpt', $search_fields ) )
|
798 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-excerpt" checked="checked" value="excerpt" /> caption ' . "\r\n";
|
799 |
+
else
|
800 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-excerpt" value="excerpt" /> caption ' . "\r\n";
|
801 |
+
|
802 |
+
if ( in_array( 'content', $search_fields ) )
|
803 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-content" checked="checked" value="content" /> description ' . "\r\n";
|
804 |
+
else
|
805 |
+
echo '<input type="checkbox" name="mla-search-fields[]" id="search-content" value="content" /> description ' . "\r\n";
|
806 |
+
|
807 |
+
echo '</p>' . "\r\n";
|
808 |
+
|
809 |
/*
|
810 |
* We also need to ensure that the form posts back to our current page and remember all the view arguments
|
811 |
*/
|
823 |
if ( isset( $_REQUEST['m'] ) ) // filter by date
|
824 |
echo sprintf( '<input type="hidden" name="m" value="%1$s" />', $_REQUEST['m'] ) . "\r\n";
|
825 |
|
|
|
|
|
|
|
826 |
// Now we can render the completed list table
|
827 |
$MLAListTable->display();
|
828 |
+
echo "</form><!-- id=mla-filter -->\r\n";
|
829 |
+
|
830 |
+
/*
|
831 |
+
* Insert the hidden form and table for inline edits (quick & bulk)
|
832 |
+
*/
|
833 |
+
echo self::_build_inline_edit_form($MLAListTable);
|
834 |
+
|
835 |
+
echo "<div id=\"ajax-response\"></div>\r\n";
|
836 |
+
echo "<br class=\"clear\" />\r\n";
|
837 |
+
echo "</div><!-- class=wrap -->\r\n";
|
838 |
+
}
|
839 |
+
}
|
840 |
+
|
841 |
+
/**
|
842 |
+
* Ajax handler for inline editing (quick and bulk edit)
|
843 |
+
*
|
844 |
+
* Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php
|
845 |
+
*
|
846 |
+
* @since 0.20
|
847 |
+
*
|
848 |
+
* @return void echo HTML <tr> markup for updated row or error message, then die()
|
849 |
+
*/
|
850 |
+
public static function mla_inline_edit_action() {
|
851 |
+
set_current_screen( $_REQUEST['screen'] );
|
852 |
+
|
853 |
+
check_ajax_referer( self::MLA_ADMIN_NONCE, 'nonce' );
|
854 |
+
|
855 |
+
if ( empty( $_REQUEST['post_ID'] ) ) {
|
856 |
+
echo 'Error: no post ID found';
|
857 |
+
die();
|
858 |
+
}
|
859 |
+
else
|
860 |
+
$post_id = $_REQUEST['post_ID'];
|
861 |
+
|
862 |
+
if ( ! current_user_can( 'edit_post', $post_id ) )
|
863 |
+
wp_die( __( 'You are not allowed to edit this Attachment.' ) );
|
864 |
+
|
865 |
+
/*
|
866 |
+
* Custom field support
|
867 |
+
*/
|
868 |
+
$custom_fields = array();
|
869 |
+
foreach (MLAOptions::mla_custom_field_support( 'quick_edit' ) as $slug => $label ) {
|
870 |
+
$field_name = $slug;
|
871 |
+
if ( isset( $_REQUEST[ $field_name ] ) ) {
|
872 |
+
$custom_fields[ $label ] = $_REQUEST[ $field_name ];
|
873 |
+
unset ( $_REQUEST[ $field_name ] );
|
874 |
+
}
|
875 |
+
}
|
876 |
+
|
877 |
+
if ( ! empty( $custom_fields ) )
|
878 |
+
$_REQUEST[ 'custom_updates' ] = $custom_fields;
|
879 |
+
|
880 |
+
/*
|
881 |
+
* The category taxonomy is a special case because post_categories_meta_box() changes the input name
|
882 |
+
*/
|
883 |
+
if ( !isset( $_REQUEST['tax_input'] ) )
|
884 |
+
$_REQUEST['tax_input'] = array();
|
885 |
+
|
886 |
+
if ( isset( $_REQUEST['post_category'] ) ) {
|
887 |
+
$_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
|
888 |
+
unset ( $_REQUEST['post_category'] );
|
889 |
+
}
|
890 |
+
|
891 |
+
if ( ! empty( $_REQUEST['tax_input'] ) ) {
|
892 |
+
/*
|
893 |
+
* Flat taxonomy strings must be cleaned up and duplicates removed
|
894 |
+
*/
|
895 |
+
$tax_output = array();
|
896 |
+
$tax_input = $_REQUEST['tax_input'];
|
897 |
+
foreach ( $tax_input as $tax_name => $tax_value ) {
|
898 |
+
if ( ! is_array( $tax_value ) ) {
|
899 |
+
$comma = _x( ',', 'tag delimiter' );
|
900 |
+
if ( ',' != $comma )
|
901 |
+
$tax_value = str_replace( $comma, ',', $tax_value );
|
902 |
+
|
903 |
+
$tax_value = preg_replace( '#\s*,\s*#', ',', $tax_value );
|
904 |
+
$tax_value = preg_replace( '#,+#', ',', $tax_value );
|
905 |
+
$tax_value = preg_replace( '#[,\s]+$#', '', $tax_value );
|
906 |
+
$tax_value = preg_replace( '#^[,\s]+#', '', $tax_value );
|
907 |
+
|
908 |
+
if ( ',' != $comma )
|
909 |
+
$tax_value = str_replace( ',', $comma, $tax_value );
|
910 |
+
|
911 |
+
$tax_array = array();
|
912 |
+
$dedup_array = explode( $comma, $tax_value );
|
913 |
+
foreach ( $dedup_array as $tax_value )
|
914 |
+
$tax_array [$tax_value] = $tax_value;
|
915 |
+
|
916 |
+
$tax_value = implode( $comma, $tax_array );
|
917 |
+
} // ! array( $tax_value )
|
918 |
+
|
919 |
+
$tax_output[$tax_name] = $tax_value;
|
920 |
+
} // foreach $tax_input
|
921 |
+
} // ! empty( $_REQUEST['tax_input'] )
|
922 |
+
else
|
923 |
+
$tax_output = NULL;
|
924 |
+
|
925 |
+
$results = MLAData::mla_update_single_item( $post_id, $_REQUEST, $tax_output );
|
926 |
+
$new_item = (object) MLAData::mla_get_attachment_by_id( $post_id );
|
927 |
+
|
928 |
+
// Create an instance of our package class and echo the new HTML
|
929 |
+
$MLAListTable = new MLA_List_Table();
|
930 |
+
$MLAListTable->single_row( $new_item );
|
931 |
+
die(); // this is required to return a proper result
|
932 |
+
}
|
933 |
+
|
934 |
+
/**
|
935 |
+
* Build the hidden row templates for inline editing (quick and bulk edit)
|
936 |
+
*
|
937 |
+
* inspired by inline_edit() in wp-admin\includes\class-wp-posts-list-table.php.
|
938 |
+
*
|
939 |
+
* @since 0.20
|
940 |
+
*
|
941 |
+
* @param object MLA List Table object
|
942 |
+
*
|
943 |
+
* @return string HTML <form> markup for hidden rows
|
944 |
+
*/
|
945 |
+
private static function _build_inline_edit_form( $MLAListTable ) {
|
946 |
+
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
947 |
+
|
948 |
+
$hierarchical_taxonomies = array();
|
949 |
+
$flat_taxonomies = array();
|
950 |
+
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
951 |
+
if ( $tax_object->hierarchical && $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit') ) {
|
952 |
+
$hierarchical_taxonomies[$tax_name] = $tax_object;
|
953 |
+
} elseif ( $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit') ) {
|
954 |
+
$flat_taxonomies[$tax_name] = $tax_object;
|
955 |
+
}
|
956 |
+
}
|
957 |
+
|
958 |
+
$page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-inline-edit-form.tpl' );
|
959 |
+
if ( ! array( $page_template_array ) ) {
|
960 |
+
error_log( "ERROR: MLA::_build_inline_edit_form \$page_template_array = " . var_export( $page_template_array, true ), 0 );
|
961 |
+
return '';
|
962 |
+
}
|
963 |
+
|
964 |
+
if ( $authors = self::_authors_dropdown() ) {
|
965 |
+
$authors_dropdown = ' <label class="inline-edit-author">' . "\r\n";
|
966 |
+
$authors_dropdown .= ' <span class="title">' . __( 'Author' ) . '</span>' . "\r\n";
|
967 |
+
$authors_dropdown .= $authors . "\r\n";
|
968 |
+
$authors_dropdown .= ' </label>' . "\r\n";
|
969 |
+
}
|
970 |
+
else
|
971 |
+
$authors_dropdown = '';
|
972 |
+
|
973 |
+
$custom_fields = '';
|
974 |
+
foreach (MLAOptions::mla_custom_field_support( 'quick_edit' ) as $slug => $label ) {
|
975 |
+
$page_values = array(
|
976 |
+
'slug' => $slug,
|
977 |
+
'label' => esc_attr( $label ),
|
978 |
+
);
|
979 |
+
$custom_fields .= MLAData::mla_parse_template( $page_template_array['custom_field'], $page_values );
|
980 |
+
}
|
981 |
+
|
982 |
+
/*
|
983 |
+
* The middle column contains the hierarchical taxonomies, e.g., Attachment Category
|
984 |
+
*/
|
985 |
+
$quick_middle_column = '';
|
986 |
+
$bulk_middle_column = '';
|
987 |
+
|
988 |
+
if ( count( $hierarchical_taxonomies ) ) {
|
989 |
+
$quick_category_blocks = '';
|
990 |
+
$bulk_category_blocks = '';
|
991 |
+
|
992 |
+
foreach ( $hierarchical_taxonomies as $tax_name => $tax_object ) {
|
993 |
+
if ( current_user_can( $tax_object->cap->assign_terms ) ) {
|
994 |
+
ob_start();
|
995 |
+
wp_terms_checklist( NULL, array( 'taxonomy' => $tax_name ) );
|
996 |
+
$tax_checklist = ob_get_contents();
|
997 |
+
ob_end_clean();
|
998 |
+
|
999 |
+
$page_values = array(
|
1000 |
+
'tax_html' => esc_html( $tax_object->labels->name ),
|
1001 |
+
'tax_attr' => esc_attr( $tax_name ),
|
1002 |
+
'tax_checklist' => $tax_checklist
|
1003 |
+
);
|
1004 |
+
$category_block = MLAData::mla_parse_template( $page_template_array['category_block'], $page_values );
|
1005 |
+
$taxonomy_options = MLAData::mla_parse_template( $page_template_array['taxonomy_options'], $page_values );
|
1006 |
+
|
1007 |
+
$quick_category_blocks .= $category_block;
|
1008 |
+
$bulk_category_blocks .= $category_block . $taxonomy_options;
|
1009 |
+
} // current_user_can
|
1010 |
+
} // foreach $hierarchical_taxonomies
|
1011 |
+
|
1012 |
+
$page_values = array(
|
1013 |
+
'category_blocks' => $quick_category_blocks
|
1014 |
+
);
|
1015 |
+
$quick_middle_column = MLAData::mla_parse_template( $page_template_array['category_fieldset'], $page_values );
|
1016 |
+
|
1017 |
+
$page_values = array(
|
1018 |
+
'category_blocks' => $bulk_category_blocks
|
1019 |
+
);
|
1020 |
+
$bulk_middle_column = MLAData::mla_parse_template( $page_template_array['category_fieldset'], $page_values );
|
1021 |
+
} // count( $hierarchical_taxonomies )
|
1022 |
+
|
1023 |
+
/*
|
1024 |
+
* The right-hand column contains the flat taxonomies, e.g., Attachment Tag
|
1025 |
+
*/
|
1026 |
+
$quick_right_column = '';
|
1027 |
+
$bulk_right_column = '';
|
1028 |
+
|
1029 |
+
if ( count( $flat_taxonomies ) ) {
|
1030 |
+
$quick_tag_blocks = '';
|
1031 |
+
$bulk_tag_blocks = '';
|
1032 |
+
|
1033 |
+
foreach ( $flat_taxonomies as $tax_name => $tax_object ) {
|
1034 |
+
if ( current_user_can( $tax_object->cap->assign_terms ) ) {
|
1035 |
+
$page_values = array(
|
1036 |
+
'tax_html' => esc_html( $tax_object->labels->name ),
|
1037 |
+
'tax_attr' => esc_attr( $tax_name )
|
1038 |
+
);
|
1039 |
+
$tag_block = MLAData::mla_parse_template( $page_template_array['tag_block'], $page_values );
|
1040 |
+
$taxonomy_options = MLAData::mla_parse_template( $page_template_array['taxonomy_options'], $page_values );
|
1041 |
+
|
1042 |
+
$quick_tag_blocks .= $tag_block;
|
1043 |
+
$bulk_tag_blocks .= $tag_block . $taxonomy_options;
|
1044 |
+
} // current_user_can
|
1045 |
+
} // foreach $flat_taxonomies
|
1046 |
+
|
1047 |
+
$page_values = array(
|
1048 |
+
'tag_blocks' => $quick_tag_blocks
|
1049 |
+
);
|
1050 |
+
$quick_right_column = MLAData::mla_parse_template( $page_template_array['tag_fieldset'], $page_values );
|
1051 |
+
|
1052 |
+
$page_values = array(
|
1053 |
+
'tag_blocks' => $bulk_tag_blocks
|
1054 |
+
);
|
1055 |
+
$bulk_right_column = MLAData::mla_parse_template( $page_template_array['tag_fieldset'], $page_values );
|
1056 |
+
} // count( $flat_taxonomies )
|
1057 |
+
|
1058 |
+
if ( $authors = self::_authors_dropdown( -1 ) ) {
|
1059 |
+
$bulk_authors_dropdown = ' <label class="inline-edit-author">' . "\r\n";
|
1060 |
+
$bulk_authors_dropdown .= ' <span class="title">' . __( 'Author' ) . '</span>' . "\r\n";
|
1061 |
+
$bulk_authors_dropdown .= $authors . "\r\n";
|
1062 |
+
$bulk_authors_dropdown .= ' </label>' . "\r\n";
|
1063 |
+
}
|
1064 |
+
else
|
1065 |
+
$bulk_authors_dropdown = '';
|
1066 |
+
|
1067 |
+
$bulk_custom_fields = '';
|
1068 |
+
foreach (MLAOptions::mla_custom_field_support( 'bulk_edit' ) as $slug => $label ) {
|
1069 |
+
$page_values = array(
|
1070 |
+
'slug' => $slug,
|
1071 |
+
'label' => esc_attr( $label ),
|
1072 |
+
);
|
1073 |
+
$bulk_custom_fields .= MLAData::mla_parse_template( $page_template_array['custom_field'], $page_values );
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
$page_values = array(
|
1077 |
+
'colspan' => count( $MLAListTable->get_columns() ),
|
1078 |
+
'authors' => $authors_dropdown,
|
1079 |
+
'custom_fields' => $custom_fields,
|
1080 |
+
'quick_middle_column' => $quick_middle_column,
|
1081 |
+
'quick_right_column' => $quick_right_column,
|
1082 |
+
'bulk_middle_column' => $bulk_middle_column,
|
1083 |
+
'bulk_right_column' => $bulk_right_column,
|
1084 |
+
'bulk_authors' => $bulk_authors_dropdown,
|
1085 |
+
'bulk_custom_fields' => $bulk_custom_fields
|
1086 |
+
);
|
1087 |
+
$page_template = MLAData::mla_parse_template( $page_template_array['page'], $page_values );
|
1088 |
+
return $page_template;
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
/**
|
1092 |
+
* Get the edit Authors dropdown box, if user has suitable permissions
|
1093 |
+
*
|
1094 |
+
* @since 0.20
|
1095 |
+
*
|
1096 |
+
* @param integer Optional User ID of the current author, default 0
|
1097 |
+
* @param string Optional HTML name attribute, default 'post_author'
|
1098 |
+
* @param string Optional HTML class attribute, default 'authors'
|
1099 |
+
*
|
1100 |
+
* @return string|false HTML markup for the dropdown field or False
|
1101 |
+
*/
|
1102 |
+
private static function _authors_dropdown( $author = 0, $name = 'post_author', $class = 'authors' ) {
|
1103 |
+
$post_type_object = get_post_type_object('attachment');
|
1104 |
+
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) {
|
1105 |
+
$users_opt = array(
|
1106 |
+
'hide_if_only_one_author' => false,
|
1107 |
+
'who' => 'authors',
|
1108 |
+
'name' => $name,
|
1109 |
+
'class'=> $class,
|
1110 |
+
'multi' => 1,
|
1111 |
+
'echo' => 0
|
1112 |
+
);
|
1113 |
+
|
1114 |
+
if ( $author > 0 ) {
|
1115 |
+
$users_opt['selected'] = $author;
|
1116 |
+
$users_opt['include_selected'] = true;
|
1117 |
+
}
|
1118 |
+
elseif ( -1 == $author )
|
1119 |
+
$users_opt['show_option_none'] = __( '— No Change —' );
|
1120 |
+
|
1121 |
+
if ( $authors = wp_dropdown_users( $users_opt ) ) {
|
1122 |
+
return $authors;
|
1123 |
+
}
|
1124 |
}
|
1125 |
+
|
1126 |
+
return false;
|
1127 |
}
|
1128 |
|
1129 |
/**
|
1130 |
+
* Get the current action selected from the bulk actions dropdown
|
1131 |
*
|
1132 |
* @since 0.1
|
1133 |
*
|
1134 |
+
* @return string|false The action name or False if no action was selected
|
1135 |
*/
|
1136 |
+
private static function _current_bulk_action( ) {
|
|
|
1137 |
$action = false;
|
1138 |
|
1139 |
if ( isset( $_REQUEST['action'] ) ) {
|
1154 |
}
|
1155 |
|
1156 |
/**
|
1157 |
+
* Delete a single item permanently
|
1158 |
*
|
1159 |
* @since 0.1
|
1160 |
*
|
1161 |
+
* @param array The form POST data
|
1162 |
+
*
|
1163 |
+
* @return array success/failure message and NULL content
|
1164 |
*/
|
1165 |
private static function _delete_single_item( $post_id ) {
|
1166 |
if ( !current_user_can( 'delete_post', $post_id ) )
|
1188 |
* @since 0.1
|
1189 |
*
|
1190 |
* @param int The WordPress Post ID of the attachment item
|
1191 |
+
*
|
1192 |
+
* @return array message and/or HTML content
|
1193 |
*/
|
1194 |
private static function _display_single_item( $post_id ) {
|
1195 |
global $post;
|
1196 |
+
|
1197 |
/*
|
1198 |
* This function sets the global $post
|
1199 |
*/
|
1200 |
$post_data = MLAData::mla_get_attachment_by_id( $post_id );
|
|
|
1201 |
if ( !isset( $post_data ) )
|
1202 |
return array(
|
1203 |
'message' => 'ERROR: Could not retrieve Attachment.',
|
1204 |
'body' => ''
|
1205 |
);
|
1206 |
|
1207 |
+
if ( ! current_user_can( 'edit_post', $post_id ) )
|
1208 |
+
return array(
|
1209 |
+
'message' => 'You are not allowed to edit this Attachment.',
|
1210 |
+
'body' => ''
|
1211 |
+
);
|
1212 |
+
|
1213 |
if ( !empty( $post_data['mla_wp_attachment_metadata'] ) ) {
|
1214 |
$page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-display-single-image.tpl' );
|
1215 |
$width = $post_data['mla_wp_attachment_metadata']['width'];
|
1225 |
$image_meta = '';
|
1226 |
}
|
1227 |
|
1228 |
+
if ( array( $page_template_array ) ) {
|
|
|
|
|
1229 |
$page_template = $page_template_array['page'];
|
1230 |
+
$authors_template = $page_template_array['authors'];
|
1231 |
$postbox_template = $page_template_array['postbox'];
|
1232 |
} else {
|
1233 |
error_log( "ERROR: MLA::_display_single_item \$page_template_array = " . var_export( $page_template_array, true ), 0 );
|
1234 |
$page_template = $page_template_array;
|
1235 |
+
$authors_template = '';
|
1236 |
$postbox_template = '';
|
1237 |
}
|
1238 |
|
1239 |
+
if ( empty($post_data['mla_references']['parent_title'] ) )
|
1240 |
+
$parent_info = $post_data['mla_references']['parent_errors'];
|
1241 |
+
else
|
1242 |
+
$parent_info = sprintf( '(%1$s) %2$s %3$s', $post_data['mla_references']['parent_type'], $post_data['mla_references']['parent_title'], $post_data['mla_references']['parent_errors'] );
|
1243 |
+
|
1244 |
+
if ( $authors = self::_authors_dropdown( $post_data['post_author'], 'attachments[' . $post_data['ID'] . '][post_author]' ) ) {
|
1245 |
+
$args = array (
|
1246 |
+
'ID' => $post_data['ID'],
|
1247 |
+
'authors' => $authors
|
1248 |
+
);
|
1249 |
+
$authors = MLAData::mla_parse_template( $authors_template, $args );
|
1250 |
+
}
|
1251 |
+
else
|
1252 |
+
$authors = '';
|
1253 |
+
|
1254 |
+
if ( MLAOptions::$process_featured_in ) {
|
1255 |
+
$features = '';
|
1256 |
|
1257 |
+
foreach ( $post_data['mla_references']['features'] as $feature_id => $feature ) {
|
1258 |
+
if ( $feature_id == $post_data['post_parent'] )
|
1259 |
+
$parent = 'PARENT ';
|
1260 |
+
else
|
1261 |
+
$parent = '';
|
1262 |
+
|
1263 |
+
$features .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $feature->post_type, /*$3%s*/ $feature_id, /*$4%s*/ $feature->post_title ) . "\r\n";
|
1264 |
+
} // foreach $feature
|
1265 |
}
|
1266 |
+
else
|
1267 |
+
$features = 'disabled';
|
|
|
|
|
|
|
|
|
|
|
|
|
1268 |
|
1269 |
+
if ( MLAOptions::$process_inserted_in ) {
|
1270 |
+
$inserts = '';
|
|
|
|
|
|
|
|
|
|
|
1271 |
|
1272 |
+
foreach ( $post_data['mla_references']['inserts'] as $file => $insert_array ) {
|
1273 |
+
$inserts .= $file . "\r\n";
|
1274 |
+
|
1275 |
+
foreach ( $insert_array as $insert ) {
|
1276 |
+
if ( $insert->ID == $post_data['post_parent'] )
|
1277 |
+
$parent = ' PARENT ';
|
1278 |
+
else
|
1279 |
+
$parent = ' ';
|
1280 |
+
|
1281 |
+
$inserts .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $insert->post_type, /*$3%s*/ $insert->ID, /*$4%s*/ $insert->post_title ) . "\r\n";
|
1282 |
+
} // foreach $insert
|
1283 |
+
} // foreach $file
|
1284 |
+
}
|
1285 |
+
else
|
1286 |
+
$inserts = 'disabled';
|
1287 |
+
|
1288 |
+
if ( MLAOptions::$process_gallery_in ) {
|
1289 |
+
$galleries = '';
|
1290 |
+
|
1291 |
+
foreach ( $post_data['mla_references']['galleries'] as $gallery_id => $gallery ) {
|
1292 |
+
if ( $gallery_id == $post_data['post_parent'] )
|
1293 |
+
$parent = 'PARENT ';
|
1294 |
+
else
|
1295 |
+
$parent = '';
|
1296 |
+
|
1297 |
+
$galleries .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $gallery['post_type'], /*$3%s*/ $gallery_id, /*$4%s*/ $gallery['post_title'] ) . "\r\n";
|
1298 |
+
} // foreach $gallery
|
1299 |
+
}
|
1300 |
+
else
|
1301 |
+
$galleries = 'disabled';
|
1302 |
+
|
1303 |
+
if ( MLAOptions::$process_mla_gallery_in ) {
|
1304 |
+
$mla_galleries = '';
|
1305 |
+
|
1306 |
+
foreach ( $post_data['mla_references']['mla_galleries'] as $gallery_id => $gallery ) {
|
1307 |
+
if ( $gallery_id == $post_data['post_parent'] )
|
1308 |
+
$parent = 'PARENT ';
|
1309 |
else
|
1310 |
+
$parent = '';
|
1311 |
|
1312 |
+
$mla_galleries .= sprintf( '%1$s (%2$s %3$s), %4$s', /*$1%s*/ $parent, /*$2%s*/ $gallery['post_type'], /*$3%s*/ $gallery_id, /*$4%s*/ $gallery['post_title'] ) . "\r\n";
|
1313 |
+
} // foreach $gallery
|
1314 |
+
}
|
1315 |
+
else
|
1316 |
+
$mla_galleries = 'disabled';
|
1317 |
|
1318 |
/*
|
1319 |
+
* WordPress doesn't look in hidden fields to set the month filter dropdown or pagination filter
|
1320 |
*/
|
1321 |
if ( isset( $_REQUEST['m'] ) )
|
1322 |
+
$url_args = '&m=' . $_REQUEST['m'];
|
1323 |
else
|
1324 |
+
$url_args = '';
|
1325 |
+
|
1326 |
+
if ( isset( $_REQUEST['post_mime_type'] ) )
|
1327 |
+
$url_args .= '&post_mime_type=' . $_REQUEST['post_mime_type'];
|
1328 |
+
|
1329 |
+
if ( isset( $_REQUEST['order'] ) )
|
1330 |
+
$url_args .= '&order=' . $_REQUEST['order'];
|
1331 |
+
|
1332 |
+
if ( isset( $_REQUEST['orderby'] ) )
|
1333 |
+
$url_args .= '&orderby=' . $_REQUEST['orderby'];
|
1334 |
|
1335 |
/*
|
1336 |
* Add the current view arguments
|
1339 |
$view_args = '<input type="hidden" name="detached" value="' . $_REQUEST['detached'] . "\" />\r\n";
|
1340 |
elseif ( isset( $_REQUEST['status'] ) )
|
1341 |
$view_args = '<input type="hidden" name="status" value="' . $_REQUEST['status'] . "\" />\r\n";
|
|
|
|
|
1342 |
else
|
1343 |
$view_args = '';
|
1344 |
|
1345 |
+
if ( isset( $_REQUEST['paged'] ) )
|
1346 |
+
$view_args .= sprintf( '<input type="hidden" name="paged" value="%1$s" />', $_REQUEST['paged'] ) . "\r\n";
|
1347 |
|
1348 |
$side_info_column = '';
|
1349 |
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
|
1351 |
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
1352 |
ob_start();
|
1353 |
|
1354 |
+
if ( $tax_object->hierarchical && $tax_object->show_ui ) {
|
1355 |
$box = array(
|
1356 |
'id' => $tax_name . 'div',
|
1357 |
+
'title' => esc_html( $tax_object->labels->name ),
|
1358 |
'callback' => 'categories_meta_box',
|
1359 |
'args' => array(
|
1360 |
'taxonomy' => $tax_name
|
1362 |
'inside_html' => ''
|
1363 |
);
|
1364 |
post_categories_meta_box( $post, $box );
|
1365 |
+
} elseif ( $tax_object->show_ui ) {
|
1366 |
$box = array(
|
1367 |
'id' => 'tagsdiv-' . $tax_name,
|
1368 |
+
'title' => esc_html( $tax_object->labels->name ),
|
1369 |
'callback' => 'post_tags_meta_box',
|
1370 |
'args' => array(
|
1371 |
'taxonomy' => $tax_name
|
1381 |
}
|
1382 |
|
1383 |
$page_values = array(
|
1384 |
+
'ID' => $post_data['ID'],
|
1385 |
+
'post_mime_type' => $post_data['post_mime_type'],
|
1386 |
+
'menu_order' => $post_data['menu_order'],
|
1387 |
+
'post_date' => $post_data['post_date'],
|
1388 |
+
'post_modified' => $post_data['post_modified'],
|
1389 |
+
'post_parent' => $post_data['post_parent'],
|
1390 |
+
'menu_order' => $post_data['menu_order'],
|
1391 |
'attachment_icon' => wp_get_attachment_image( $post_id, array( 160, 120 ), true ),
|
1392 |
+
'file_name' => esc_html( $post_data['mla_references']['file'] ),
|
1393 |
'width' => $width,
|
1394 |
'height' => $height,
|
1395 |
+
'post_title_attr' => esc_attr( $post_data['post_title'] ),
|
1396 |
+
'post_name_attr' => esc_attr( $post_data['post_name'] ),
|
1397 |
+
'image_alt_attr' => '',
|
1398 |
+
'post_excerpt_attr' => esc_attr( $post_data['post_excerpt'] ),
|
1399 |
+
'post_content' => esc_textarea( $post_data['post_content'] ),
|
1400 |
+
'image_meta' => esc_textarea( $image_meta ),
|
1401 |
+
'parent_info' => esc_attr( $parent_info ),
|
1402 |
+
'guid_attr' => esc_attr( $post_data['guid'] ),
|
1403 |
+
'authors' => $authors,
|
1404 |
+
'features' => esc_textarea( $features ),
|
1405 |
+
'inserts' => esc_textarea( $inserts ),
|
1406 |
+
'galleries' => esc_textarea( $galleries ),
|
1407 |
+
'mla_galleries' => esc_textarea( $mla_galleries ),
|
1408 |
'mla_admin_action' => self::MLA_ADMIN_SINGLE_EDIT_UPDATE,
|
1409 |
+
'form_url' => admin_url( 'upload.php' ) . '?page=' . self::ADMIN_PAGE_SLUG . $url_args,
|
|
|
1410 |
'view_args' => $view_args,
|
1411 |
+
'wpnonce' => wp_nonce_field( self::MLA_ADMIN_NONCE, '_wpnonce', true, false ),
|
1412 |
'side_info_column' => $side_info_column
|
1413 |
);
|
1414 |
|
1415 |
+
if ( !empty( $post_data['mla_wp_attachment_metadata'] ) ) {
|
1416 |
+
$page_values['image_alt_attr'] = esc_attr( $post_data['mla_wp_attachment_image_alt'] );
|
1417 |
+
}
|
1418 |
+
|
1419 |
return array(
|
1420 |
+
'message' => '',
|
1421 |
'body' => MLAData::mla_parse_template( $page_template, $page_values )
|
1422 |
);
|
1423 |
}
|
1424 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1425 |
/**
|
1426 |
* Restore a single item from the Trash
|
1427 |
*
|
1429 |
*
|
1430 |
* @param array The form POST data
|
1431 |
*
|
1432 |
+
* @return array success/failure message and NULL content
|
1433 |
*/
|
1434 |
private static function _restore_single_item( $post_id ) {
|
1435 |
if ( !current_user_can( 'delete_post', $post_id ) )
|
1447 |
/*
|
1448 |
* Posts are restored to "draft" status, so this must be updated.
|
1449 |
*/
|
1450 |
+
$update_post = array();
|
1451 |
$update_post['ID'] = $post_id;
|
1452 |
$update_post['post_status'] = 'inherit';
|
1453 |
wp_update_post( $update_post );
|
1464 |
* @since 0.1
|
1465 |
*
|
1466 |
* @param array The form POST data
|
1467 |
+
*
|
1468 |
+
* @return array success/failure message and NULL content
|
1469 |
*/
|
1470 |
private static function _trash_single_item( $post_id ) {
|
1471 |
if ( !current_user_can( 'delete_post', $post_id ) )
|
1485 |
'body' => ''
|
1486 |
);
|
1487 |
}
|
|
|
1488 |
} // class MLA
|
1489 |
?>
|
includes/class-mla-objects.php
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Media Library Assistant Custom Taxonomy and Post Type objects
|
4 |
+
*
|
5 |
+
* @package Media Library Assistant
|
6 |
+
* @since 0.1
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags
|
11 |
+
*
|
12 |
+
* @package Media Library Assistant
|
13 |
+
* @since 0.20
|
14 |
+
*/
|
15 |
+
class MLAObjects {
|
16 |
+
/**
|
17 |
+
* Initialization function, similar to __construct()
|
18 |
+
*
|
19 |
+
* @since 0.20
|
20 |
+
*
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
public static function initialize() {
|
24 |
+
self::_build_taxonomies();
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Registers Attachment Categories and Attachment Tags custom taxonomies, adds taxonomy-related filters
|
29 |
+
*
|
30 |
+
* @since 0.1
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
private static function _build_taxonomies( ) {
|
35 |
+
if ( MLAOptions::mla_taxonomy_support('attachment_category') ) {
|
36 |
+
$labels = array(
|
37 |
+
'name' => _x( 'Att. Categories', 'taxonomy general name' ),
|
38 |
+
'singular_name' => _x( 'Att. Category', 'taxonomy singular name' ),
|
39 |
+
'search_items' => __( 'Search Att. Categories' ),
|
40 |
+
'all_items' => __( 'All Att. Categories' ),
|
41 |
+
'parent_item' => __( 'Parent Att. Category' ),
|
42 |
+
'parent_item_colon' => __( 'Parent Att. Category:' ),
|
43 |
+
'edit_item' => __( 'Edit Att. Category' ),
|
44 |
+
'update_item' => __( 'Update Att. Category' ),
|
45 |
+
'add_new_item' => __( 'Add New Att. Category' ),
|
46 |
+
'new_item_name' => __( 'New Att. Category Name' ),
|
47 |
+
'menu_name' => __( 'Att. Category' )
|
48 |
+
);
|
49 |
+
|
50 |
+
register_taxonomy(
|
51 |
+
'attachment_category',
|
52 |
+
array( 'attachment' ),
|
53 |
+
array(
|
54 |
+
'hierarchical' => true,
|
55 |
+
'labels' => $labels,
|
56 |
+
'show_ui' => true,
|
57 |
+
'query_var' => true,
|
58 |
+
'rewrite' => true
|
59 |
+
)
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
if ( MLAOptions::mla_taxonomy_support('attachment_tag') ) {
|
64 |
+
$labels = array(
|
65 |
+
'name' => _x( 'Att. Tags', 'taxonomy general name' ),
|
66 |
+
'singular_name' => _x( 'Att. Tag', 'taxonomy singular name' ),
|
67 |
+
'search_items' => __( 'Search Att. Tags' ),
|
68 |
+
'all_items' => __( 'All Att. Tags' ),
|
69 |
+
'parent_item' => __( 'Parent Att. Tag' ),
|
70 |
+
'parent_item_colon' => __( 'Parent Att. Tag:' ),
|
71 |
+
'edit_item' => __( 'Edit Att. Tag' ),
|
72 |
+
'update_item' => __( 'Update Att. Tag' ),
|
73 |
+
'add_new_item' => __( 'Add New Att. Tag' ),
|
74 |
+
'new_item_name' => __( 'New Att. Tag Name' ),
|
75 |
+
'menu_name' => __( 'Att. Tag' )
|
76 |
+
);
|
77 |
+
|
78 |
+
register_taxonomy(
|
79 |
+
'attachment_tag',
|
80 |
+
array( 'attachment' ),
|
81 |
+
array(
|
82 |
+
'hierarchical' => false,
|
83 |
+
'labels' => $labels,
|
84 |
+
'show_ui' => true,
|
85 |
+
'update_count_callback' => '_update_post_term_count',
|
86 |
+
'query_var' => true,
|
87 |
+
'rewrite' => true
|
88 |
+
)
|
89 |
+
);
|
90 |
+
}
|
91 |
+
|
92 |
+
$taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'names' );
|
93 |
+
foreach ( $taxonomies as $tax_name ) {
|
94 |
+
if ( MLAOptions::mla_taxonomy_support( $tax_name ) ) {
|
95 |
+
register_taxonomy_for_object_type( $tax_name, 'attachment');
|
96 |
+
add_filter( "manage_edit-{$tax_name}_columns", 'MLAObjects::mla_taxonomy_get_columns_filter', 10, 1 ); // $columns
|
97 |
+
add_filter( "manage_{$tax_name}_custom_column", 'MLAObjects::mla_taxonomy_column_filter', 10, 3 ); // $place_holder, $column_name, $tag->term_id
|
98 |
+
}
|
99 |
+
} // foreach
|
100 |
+
} // _build_taxonomies
|
101 |
+
|
102 |
+
/**
|
103 |
+
* WordPress Filter for edit taxonomy "Attachments" column,
|
104 |
+
* which replaces the "Posts" column with an equivalent "Attachments" column.
|
105 |
+
*
|
106 |
+
* @since 0.30
|
107 |
+
*
|
108 |
+
* @param array column definitions for the edit taxonomy list table
|
109 |
+
*
|
110 |
+
* @return array updated column definitions for the edit taxonomy list table
|
111 |
+
*/
|
112 |
+
public static function mla_taxonomy_get_columns_filter( $columns ) {
|
113 |
+
/*
|
114 |
+
* Adding or inline-editing a tag is done with AJAX, and there's no current screen object
|
115 |
+
*/
|
116 |
+
if ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'add-tag', 'inline-save-tax' ) ) ) {
|
117 |
+
$post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
$screen = get_current_screen();
|
121 |
+
$post_type = !empty( $screen->post_type ) ? $screen->post_type : 'post';
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( 'attachment' == $post_type ) {
|
125 |
+
if ( isset ( $columns[ 'posts' ] ) )
|
126 |
+
unset( $columns[ 'posts' ] );
|
127 |
+
|
128 |
+
$columns[ 'attachments' ] = 'Attachments';
|
129 |
+
}
|
130 |
+
|
131 |
+
return $columns;
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* WordPress Filter for edit taxonomy "Attachments" column,
|
136 |
+
* which returns a count of the attachments assigned a given term
|
137 |
+
*
|
138 |
+
* @since 0.30
|
139 |
+
*
|
140 |
+
* @param string current column value; always ''
|
141 |
+
* @param array name of the column
|
142 |
+
* @param array ID of the term for which the count is desired
|
143 |
+
*
|
144 |
+
* @return array HTML markup for the column content; number of attachments in the category
|
145 |
+
* and alink to retrieve a list of them
|
146 |
+
*/
|
147 |
+
public static function mla_taxonomy_column_filter( $place_holder, $column_name, $term_id ) {
|
148 |
+
/*
|
149 |
+
* Adding or inline-editing a tag is done with AJAX, and there's no current screen object
|
150 |
+
*/
|
151 |
+
if ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'add-tag', 'inline-save-tax' ) ) ) {
|
152 |
+
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
$screen = get_current_screen();
|
156 |
+
$taxonomy = !empty( $screen->taxonomy ) ? $screen->taxonomy : 'post_tag';
|
157 |
+
}
|
158 |
+
|
159 |
+
$term = get_term( $term_id, $taxonomy );
|
160 |
+
|
161 |
+
if ( is_wp_error( $term ) ) {
|
162 |
+
error_log( "ERROR: mla_taxonomy_column_filter( {$taxonomy} ) - get_term " . $term->get_error_message(), 0 );
|
163 |
+
return 0;
|
164 |
+
}
|
165 |
+
|
166 |
+
$request = array (
|
167 |
+
// 'fields' => 'ids',
|
168 |
+
'post_type' => 'attachment',
|
169 |
+
'post_status' => 'inherit',
|
170 |
+
'orderby' => 'none',
|
171 |
+
'nopaging' => true,
|
172 |
+
'posts_per_page' => 0,
|
173 |
+
'posts_per_archive_page' => 0,
|
174 |
+
'update_post_term_cache' => false,
|
175 |
+
'tax_query' => array(
|
176 |
+
array(
|
177 |
+
'taxonomy' => $taxonomy,
|
178 |
+
'field' => 'slug',
|
179 |
+
'terms' => $term->slug,
|
180 |
+
'include_children' => false
|
181 |
+
) )
|
182 |
+
);
|
183 |
+
|
184 |
+
$results = new WP_Query( $request );
|
185 |
+
if ( ! empty( $results->error ) ){
|
186 |
+
error_log( "ERROR: mla_taxonomy_column_filter( {$taxonomy} ) - WP_Query " . $results->error, 0 );
|
187 |
+
return 0;
|
188 |
+
}
|
189 |
+
|
190 |
+
$tax_object = get_taxonomy($taxonomy);
|
191 |
+
|
192 |
+
return sprintf( '<a href="%1$s">%2$s</a>', esc_url( add_query_arg(
|
193 |
+
array( 'page' => 'mla-menu', 'mla-tax' => $taxonomy, 'mla-term' => $term->slug, 'heading_suffix' => urlencode( $tax_object->label . ':' . $term->name ) ), 'upload.php' ) ), number_format_i18n( $results->post_count ) );
|
194 |
+
}
|
195 |
+
} //Class MLAObjects
|
196 |
+
?>
|
includes/class-mla-options.php
ADDED
@@ -0,0 +1,2569 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Manages the plugin option settings
|
4 |
+
*
|
5 |
+
* @package Media Library Assistant
|
6 |
+
* @since 1.00
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class MLA (Media Library Assistant) Options manages the plugin option settings
|
11 |
+
* and provides functions to get and put them from/to WordPress option variables
|
12 |
+
*
|
13 |
+
* Separated from class MLASettings in version 1.00
|
14 |
+
*
|
15 |
+
* @package Media Library Assistant
|
16 |
+
* @since 1.00
|
17 |
+
*/
|
18 |
+
class MLAOptions {
|
19 |
+
/**
|
20 |
+
* Provides a unique name for the current version option
|
21 |
+
*/
|
22 |
+
const MLA_VERSION_OPTION = 'current_version';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Provides a unique name for a database tuning option
|
26 |
+
*/
|
27 |
+
const MLA_FEATURED_IN_TUNING = 'featured_in_tuning';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Provides a unique name for a database tuning option
|
31 |
+
*/
|
32 |
+
const MLA_INSERTED_IN_TUNING = 'inserted_in_tuning';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Provides a unique name for a database tuning option
|
36 |
+
*/
|
37 |
+
const MLA_GALLERY_IN_TUNING = 'gallery_in_tuning';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Provides a unique name for a database tuning option
|
41 |
+
*/
|
42 |
+
const MLA_MLA_GALLERY_IN_TUNING = 'mla_gallery_in_tuning';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Provides a unique name for the Custom Field "new rule" key
|
46 |
+
*/
|
47 |
+
const MLA_NEW_CUSTOM_RULE = '__NEW RULE__';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Provides a unique name for the Custom Field "new field" key
|
51 |
+
*/
|
52 |
+
const MLA_NEW_CUSTOM_FIELD = '__NEW FIELD__';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Option setting for "Featured in" reporting
|
56 |
+
*
|
57 |
+
* This setting is false if the "Featured in" database access setting is "disabled", else true.
|
58 |
+
*
|
59 |
+
* @since 1.00
|
60 |
+
*
|
61 |
+
* @var boolean
|
62 |
+
*/
|
63 |
+
public static $process_featured_in = true;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Option setting for "Inserted in" reporting
|
67 |
+
*
|
68 |
+
* This setting is false if the "Inserted in" database access setting is "disabled", else true.
|
69 |
+
*
|
70 |
+
* @since 1.00
|
71 |
+
*
|
72 |
+
* @var boolean
|
73 |
+
*/
|
74 |
+
public static $process_inserted_in = true;
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Option setting for "Gallery in" reporting
|
78 |
+
*
|
79 |
+
* This setting is false if the "Gallery in" database access setting is "disabled", else true.
|
80 |
+
*
|
81 |
+
* @since 1.00
|
82 |
+
*
|
83 |
+
* @var boolean
|
84 |
+
*/
|
85 |
+
public static $process_gallery_in = true;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Option setting for "MLA Gallery in" reporting
|
89 |
+
*
|
90 |
+
* This setting is false if the "MLA Gallery in" database access setting is "disabled", else true.
|
91 |
+
*
|
92 |
+
* @since 1.00
|
93 |
+
*
|
94 |
+
* @var boolean
|
95 |
+
*/
|
96 |
+
public static $process_mla_gallery_in = true;
|
97 |
+
|
98 |
+
/**
|
99 |
+
* $mla_option_definitions defines the database options and admin page areas for setting/updating them.
|
100 |
+
* Each option is defined by an array with the following elements:
|
101 |
+
*
|
102 |
+
* array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
|
103 |
+
*
|
104 |
+
* tab => Settings page tab id for the option
|
105 |
+
* name => admin page label or heading text
|
106 |
+
* type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea', 'custom', 'hidden'
|
107 |
+
* std => default value
|
108 |
+
* help => help text
|
109 |
+
* size => text size, default 40
|
110 |
+
* cols => textbox columns, default 90
|
111 |
+
* rows => textbox rows, default 5
|
112 |
+
* options => array of radio or select option values
|
113 |
+
* texts => array of radio or select option display texts
|
114 |
+
* render => rendering function for 'custom' options. Usage:
|
115 |
+
* $options_list .= ['render']( 'render', $key, $value );
|
116 |
+
* update => update function for 'custom' options; returns nothing. Usage:
|
117 |
+
* $message = ['update']( 'update', $key, $value, $_REQUEST );
|
118 |
+
* delete => delete function for 'custom' options; returns nothing. Usage:
|
119 |
+
* $message = ['delete']( 'delete', $key, $value, $_REQUEST );
|
120 |
+
* reset => reset function for 'custom' options; returns nothing. Usage:
|
121 |
+
* $message = ['reset']( 'reset', $key, $value, $_REQUEST );
|
122 |
+
*/
|
123 |
+
public static $mla_option_definitions = array (
|
124 |
+
/*
|
125 |
+
* This option records the highest MLA version so-far installed
|
126 |
+
*/
|
127 |
+
self::MLA_VERSION_OPTION =>
|
128 |
+
array('tab' => '',
|
129 |
+
'type' => 'hidden',
|
130 |
+
'std' => '0'),
|
131 |
+
|
132 |
+
/*
|
133 |
+
* These checkboxes are no longer used;
|
134 |
+
* they are retained for the database version/update check
|
135 |
+
*/
|
136 |
+
'attachment_category' =>
|
137 |
+
array('tab' => '',
|
138 |
+
'name' => 'Attachment Categories',
|
139 |
+
'type' => 'hidden', // checkbox',
|
140 |
+
'std' => 'checked',
|
141 |
+
'help' => 'Check this option to add support for Attachment Categories.'),
|
142 |
+
|
143 |
+
'attachment_tag' =>
|
144 |
+
array('tab' => '',
|
145 |
+
'name' => 'Attachment Tags',
|
146 |
+
'type' => 'hidden', // checkbox',
|
147 |
+
'std' => 'checked',
|
148 |
+
'help' => 'Check this option to add support for Attachment Tags.'),
|
149 |
+
|
150 |
+
'where_used_heading' =>
|
151 |
+
array('tab' => 'general',
|
152 |
+
'name' => 'Where-used Reporting',
|
153 |
+
'type' => 'header'),
|
154 |
+
|
155 |
+
'exclude_revisions' =>
|
156 |
+
array('tab' => 'general',
|
157 |
+
'name' => 'Exclude Revisions',
|
158 |
+
'type' => 'checkbox',
|
159 |
+
'std' => 'checked',
|
160 |
+
'help' => 'Check this option to exclude revisions from where-used reporting.'),
|
161 |
+
|
162 |
+
'where_used_subheading' =>
|
163 |
+
array('tab' => 'general',
|
164 |
+
'name' => 'Where-used database access tuning',
|
165 |
+
'type' => 'subheader'),
|
166 |
+
|
167 |
+
self::MLA_FEATURED_IN_TUNING =>
|
168 |
+
array('tab' => 'general',
|
169 |
+
'name' => 'Featured in',
|
170 |
+
'type' => 'select',
|
171 |
+
'std' => 'enabled',
|
172 |
+
'options' => array('enabled', 'disabled'),
|
173 |
+
'texts' => array('Enabled', 'Disabled'),
|
174 |
+
'help' => 'Search database posts and pages for Featured Image attachments.'),
|
175 |
+
|
176 |
+
self::MLA_INSERTED_IN_TUNING =>
|
177 |
+
array('tab' => 'general',
|
178 |
+
'name' => 'Inserted in',
|
179 |
+
'type' => 'select',
|
180 |
+
'std' => 'enabled',
|
181 |
+
'options' => array('enabled', 'disabled'),
|
182 |
+
'texts' => array('Enabled', 'Disabled'),
|
183 |
+
'help' => 'Search database posts and pages for attachments embedded in content.'),
|
184 |
+
|
185 |
+
self::MLA_GALLERY_IN_TUNING =>
|
186 |
+
array('tab' => 'general',
|
187 |
+
'name' => 'Gallery in',
|
188 |
+
'type' => 'select',
|
189 |
+
'std' => 'cached',
|
190 |
+
'options' => array('dynamic', 'refresh', 'cached', 'disabled'),
|
191 |
+
'texts' => array('Dynamic', 'Refresh', 'Cached', 'Disabled'),
|
192 |
+
'help' => 'Search database posts and pages for [gallery] shortcode results.<br> Dynamic = once every page load, Cached = once every login, Disabled = never.<br> Refresh = update references, then set to Cached.'),
|
193 |
+
|
194 |
+
self::MLA_MLA_GALLERY_IN_TUNING =>
|
195 |
+
array('tab' => 'general',
|
196 |
+
'name' => 'MLA Gallery in',
|
197 |
+
'type' => 'select',
|
198 |
+
'std' => 'cached',
|
199 |
+
'options' => array('dynamic', 'refresh', 'cached', 'disabled'),
|
200 |
+
'texts' => array('Dynamic', 'Refresh', 'Cached', 'Disabled'),
|
201 |
+
'help' => 'Search database posts and pages for [mla_gallery] shortcode results.<br> Dynamic = once every page load, Cached = once every login, Disabled = never.<br> Refresh = update references, then set to Cached.'),
|
202 |
+
|
203 |
+
'taxonomy_heading' =>
|
204 |
+
array('tab' => 'general',
|
205 |
+
'name' => 'Taxonomy Support',
|
206 |
+
'type' => 'header'),
|
207 |
+
|
208 |
+
'taxonomy_support' =>
|
209 |
+
array('tab' => 'general',
|
210 |
+
'help' => 'Check the "Support" box to add the taxonomy to the Assistant and the Edit Media screen.<br>Check the "Inline Edit" box to display the taxonomy in the Quick Edit and Bulk Edit areas.<br>Use the "List Filter" option to select the taxonomy on which to filter the Assistant table listing.',
|
211 |
+
'std' => array (
|
212 |
+
'tax_support' => array (
|
213 |
+
'attachment_category' => 'checked',
|
214 |
+
'attachment_tag' => 'checked',
|
215 |
+
),
|
216 |
+
'tax_quick_edit' => array (
|
217 |
+
'attachment_category' => 'checked',
|
218 |
+
'attachment_tag' => 'checked',
|
219 |
+
),
|
220 |
+
'tax_filter' => 'attachment_category'
|
221 |
+
),
|
222 |
+
'type' => 'custom',
|
223 |
+
'render' => 'mla_taxonomy_option_handler',
|
224 |
+
'update' => 'mla_taxonomy_option_handler',
|
225 |
+
'delete' => 'mla_taxonomy_option_handler',
|
226 |
+
'reset' => 'mla_taxonomy_option_handler'),
|
227 |
+
|
228 |
+
'orderby_heading' =>
|
229 |
+
array('tab' => 'general',
|
230 |
+
'name' => 'Default Table Listing Sort Order',
|
231 |
+
'type' => 'header'),
|
232 |
+
|
233 |
+
'default_orderby' =>
|
234 |
+
array('tab' => 'general',
|
235 |
+
'name' => 'Order By',
|
236 |
+
'type' => 'select',
|
237 |
+
'std' => 'title_name',
|
238 |
+
'options' => array('none', 'title_name'),
|
239 |
+
'texts' => array('None', 'Title/Name'),
|
240 |
+
'help' => 'Select the column for the sort order of the Assistant table listing.'),
|
241 |
+
|
242 |
+
'default_order' =>
|
243 |
+
array('tab' => 'general',
|
244 |
+
'name' => 'Order',
|
245 |
+
'type' => 'radio',
|
246 |
+
'std' => 'ASC',
|
247 |
+
'options' => array('ASC', 'DESC'),
|
248 |
+
'texts' => array('Ascending', 'Descending'),
|
249 |
+
'help' => 'Choose the sort order.'),
|
250 |
+
|
251 |
+
'template_heading' =>
|
252 |
+
array('tab' => 'mla-gallery',
|
253 |
+
'name' => 'Default [mla_gallery] Templates',
|
254 |
+
'type' => 'header'),
|
255 |
+
|
256 |
+
'default_style' =>
|
257 |
+
array('tab' => 'mla-gallery',
|
258 |
+
'name' => 'Style Template',
|
259 |
+
'type' => 'select',
|
260 |
+
'std' => 'default',
|
261 |
+
'options' => array(),
|
262 |
+
'texts' => array(),
|
263 |
+
'help' => 'Select the default style template for your [mla_gallery] shortcodes.'),
|
264 |
+
|
265 |
+
'default_markup' =>
|
266 |
+
array('tab' => 'mla-gallery',
|
267 |
+
'name' => 'Markup Template',
|
268 |
+
'type' => 'select',
|
269 |
+
'std' => 'default',
|
270 |
+
'options' => array(),
|
271 |
+
'texts' => array(),
|
272 |
+
'help' => 'Select the default markup template for your [mla_gallery] shortcodes.'),
|
273 |
+
|
274 |
+
/*
|
275 |
+
* Managed by mla_get_style_templates and mla_put_style_templates
|
276 |
+
*/
|
277 |
+
'style_templates' =>
|
278 |
+
array('tab' => '',
|
279 |
+
'type' => 'hidden',
|
280 |
+
'std' => array()),
|
281 |
+
|
282 |
+
/*
|
283 |
+
* Managed by mla_get_markup_templates and mla_put_markup_templates
|
284 |
+
*/
|
285 |
+
'markup_templates' =>
|
286 |
+
array('tab' => '',
|
287 |
+
'type' => 'hidden',
|
288 |
+
'std' => array()),
|
289 |
+
|
290 |
+
'enable_custom_field_mapping' =>
|
291 |
+
array('tab' => 'custom-field',
|
292 |
+
'name' => 'Enable custom field mapping when adding new media',
|
293 |
+
'type' => 'checkbox',
|
294 |
+
'std' => '',
|
295 |
+
'help' => 'Check this option to enable mapping when uploading new media (attachments).<br> Click Save Changes at the bottom of the screen if you change this option.<br> Does NOT affect the operation of the "Map" buttons on the bulk edit, single edit and settings screens.'),
|
296 |
+
|
297 |
+
'custom_field_mapping' =>
|
298 |
+
array('tab' => '',
|
299 |
+
'help' => ' <br>Update the custom field mapping values above, then click Save Changes to make the updates permanent.<br>You can also make temporary updates and click a Map All Attachments button to apply the rule(s) to all attachments without saving any rule changes.',
|
300 |
+
'std' => array(),
|
301 |
+
'type' => 'custom',
|
302 |
+
'render' => 'mla_custom_field_option_handler',
|
303 |
+
'update' => 'mla_custom_field_option_handler',
|
304 |
+
'delete' => 'mla_custom_field_option_handler',
|
305 |
+
'reset' => 'mla_custom_field_option_handler'),
|
306 |
+
|
307 |
+
'enable_iptc_exif_mapping' =>
|
308 |
+
array('tab' => 'iptc-exif',
|
309 |
+
'name' => 'Enable IPTC/EXIF Mapping when adding new media',
|
310 |
+
'type' => 'checkbox',
|
311 |
+
'std' => '',
|
312 |
+
'help' => 'Check this option to enable mapping when uploading new media (attachments).<br> Does NOT affect the operation of the "Map" buttons on the bulk edit, single edit and settings screens.'),
|
313 |
+
|
314 |
+
'iptc_exif_standard_mapping' =>
|
315 |
+
array('tab' => '',
|
316 |
+
'help' => 'Update the standard field mapping values above, then click Save Changes to make the updates permanent.<br>You can also make temporary updates and click Map All Attachments Now to apply the updates to all attachments without saving the rule changes.',
|
317 |
+
'std' => NULL,
|
318 |
+
'type' => 'custom',
|
319 |
+
'render' => 'mla_iptc_exif_option_handler',
|
320 |
+
'update' => 'mla_iptc_exif_option_handler',
|
321 |
+
'delete' => 'mla_iptc_exif_option_handler',
|
322 |
+
'reset' => 'mla_iptc_exif_option_handler'),
|
323 |
+
|
324 |
+
'iptc_exif_taxonomy_mapping' =>
|
325 |
+
array('tab' => '',
|
326 |
+
'help' => 'Update the taxonomy term mapping values above, then click Save Changes or Map All Attachments Now.',
|
327 |
+
'std' => NULL,
|
328 |
+
'type' => 'custom',
|
329 |
+
'render' => 'mla_iptc_exif_option_handler',
|
330 |
+
'update' => 'mla_iptc_exif_option_handler',
|
331 |
+
'delete' => 'mla_iptc_exif_option_handler',
|
332 |
+
'reset' => 'mla_iptc_exif_option_handler'),
|
333 |
+
|
334 |
+
'iptc_exif_custom_mapping' =>
|
335 |
+
array('tab' => '',
|
336 |
+
'help' => 'Update the custom field mapping values above.<br>To define a new custom field, enter a field name in the "Field Title" text box at the end of the list and Save Changes.',
|
337 |
+
'std' => NULL,
|
338 |
+
'type' => 'custom',
|
339 |
+
'render' => 'mla_iptc_exif_option_handler',
|
340 |
+
'update' => 'mla_iptc_exif_option_handler',
|
341 |
+
'delete' => 'mla_iptc_exif_option_handler',
|
342 |
+
'reset' => 'mla_iptc_exif_option_handler'),
|
343 |
+
|
344 |
+
'iptc_exif_mapping' =>
|
345 |
+
array('tab' => '',
|
346 |
+
'help' => 'IPTC/EXIF Mapping help',
|
347 |
+
'std' => array (
|
348 |
+
'standard' => array (
|
349 |
+
'post_title' => array (
|
350 |
+
'name' => 'Title',
|
351 |
+
'iptc_value' => 'none',
|
352 |
+
'exif_value' => '',
|
353 |
+
'iptc_first' => true,
|
354 |
+
'keep_existing' => true
|
355 |
+
),
|
356 |
+
'post_name' => array (
|
357 |
+
'name' => 'Name/Slug',
|
358 |
+
'iptc_value' => 'none',
|
359 |
+
'exif_value' => '',
|
360 |
+
'iptc_first' => true,
|
361 |
+
'keep_existing' => true
|
362 |
+
),
|
363 |
+
'image_alt' => array (
|
364 |
+
'name' => 'Alternate Text',
|
365 |
+
'iptc_value' => 'none',
|
366 |
+
'exif_value' => '',
|
367 |
+
'iptc_first' => true,
|
368 |
+
'keep_existing' => true
|
369 |
+
),
|
370 |
+
'post_excerpt' => array (
|
371 |
+
'name' => 'Caption',
|
372 |
+
'iptc_value' => 'none',
|
373 |
+
'exif_value' => '',
|
374 |
+
'iptc_first' => true,
|
375 |
+
'keep_existing' => true
|
376 |
+
),
|
377 |
+
'post_content' => array (
|
378 |
+
'name' => 'Description',
|
379 |
+
'iptc_value' => 'none',
|
380 |
+
'exif_value' => '',
|
381 |
+
'iptc_first' => true,
|
382 |
+
'keep_existing' => true
|
383 |
+
),
|
384 |
+
),
|
385 |
+
'taxonomy' => array (
|
386 |
+
),
|
387 |
+
'custom' => array (
|
388 |
+
)
|
389 |
+
),
|
390 |
+
'type' => 'custom',
|
391 |
+
'render' => 'mla_iptc_exif_option_handler',
|
392 |
+
'update' => 'mla_iptc_exif_option_handler',
|
393 |
+
'delete' => 'mla_iptc_exif_option_handler',
|
394 |
+
'reset' => 'mla_iptc_exif_option_handler'),
|
395 |
+
|
396 |
+
/* Here are examples of the other option types
|
397 |
+
'text' =>
|
398 |
+
array('name' => 'Text Field',
|
399 |
+
'type' => 'text',
|
400 |
+
'std' => 'default text',
|
401 |
+
'size' => 20,
|
402 |
+
'help' => 'Enter the text...'),
|
403 |
+
|
404 |
+
'textarea' =>
|
405 |
+
array('name' => 'Text Area',
|
406 |
+
'type' => 'textarea',
|
407 |
+
'std' => 'default text area',
|
408 |
+
'cols' => 60,
|
409 |
+
'rows' => 4,
|
410 |
+
'help' => 'Enter the text area...'),
|
411 |
+
*/
|
412 |
+
);
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Initialization function, similar to __construct()
|
416 |
+
*
|
417 |
+
* @since 1.00
|
418 |
+
*
|
419 |
+
* @return void
|
420 |
+
*/
|
421 |
+
public static function initialize( ) {
|
422 |
+
self::_load_option_templates();
|
423 |
+
|
424 |
+
if ( 'disabled' == self::mla_get_option( self::MLA_FEATURED_IN_TUNING ) )
|
425 |
+
self::$process_featured_in = false;
|
426 |
+
if ( 'disabled' == self::mla_get_option( self::MLA_INSERTED_IN_TUNING ) )
|
427 |
+
self::$process_inserted_in = false;
|
428 |
+
if ( 'disabled' == self::mla_get_option( self::MLA_GALLERY_IN_TUNING ) )
|
429 |
+
self::$process_gallery_in = false;
|
430 |
+
if ( 'disabled' == self::mla_get_option( self::MLA_MLA_GALLERY_IN_TUNING ) )
|
431 |
+
self::$process_mla_gallery_in = false;
|
432 |
+
|
433 |
+
if ( 'checked' == MLAOptions::mla_get_option( 'enable_iptc_exif_mapping' ) )
|
434 |
+
add_action( 'add_attachment', 'MLAOptions::mla_add_attachment_action' );
|
435 |
+
|
436 |
+
if ( 'checked' == MLAOptions::mla_get_option( 'enable_custom_field_mapping' ) )
|
437 |
+
add_filter( 'wp_update_attachment_metadata', 'MLAOptions::mla_update_attachment_metadata_filter', 10, 2 ); // $data, $post_id
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Style and Markup templates
|
442 |
+
*
|
443 |
+
* @since 0.80
|
444 |
+
*
|
445 |
+
* @var array
|
446 |
+
*/
|
447 |
+
private static $mla_option_templates = null;
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Load style and markup templates to $mla_templates
|
451 |
+
*
|
452 |
+
* @since 0.80
|
453 |
+
*
|
454 |
+
* @return void
|
455 |
+
*/
|
456 |
+
private static function _load_option_templates() {
|
457 |
+
self::$mla_option_templates = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/mla-option-templates.tpl' );
|
458 |
+
|
459 |
+
/*
|
460 |
+
* Load the default templates
|
461 |
+
*/
|
462 |
+
if( is_null( self::$mla_option_templates ) ) {
|
463 |
+
MLAShortcodes::$mla_debug_messages .= '<p><strong>_load_option_templates()</strong> error loading tpls/mla-option-templates.tpl';
|
464 |
+
return;
|
465 |
+
}
|
466 |
+
elseif( !self::$mla_option_templates ) {
|
467 |
+
MLAShortcodes::$mla_debug_messages .= '<p><strong>_load_option_templates()</strong>tpls/mla-option-templates.tpl not found';
|
468 |
+
$mla_option_templates = null;
|
469 |
+
return;
|
470 |
+
}
|
471 |
+
|
472 |
+
/*
|
473 |
+
* Add user-defined Style and Markup templates
|
474 |
+
*/
|
475 |
+
$templates = self::mla_get_option( 'style_templates' );
|
476 |
+
if ( is_array( $templates ) ) {
|
477 |
+
foreach ( $templates as $name => $value ) {
|
478 |
+
self::$mla_option_templates[ $name . '-style' ] = $value;
|
479 |
+
} // foreach $templates
|
480 |
+
} // is_array
|
481 |
+
|
482 |
+
$templates = self::mla_get_option( 'markup_templates' );
|
483 |
+
if ( is_array( $templates ) ) {
|
484 |
+
foreach ( $templates as $name => $value ) {
|
485 |
+
self::$mla_option_templates[ $name . '-open-markup' ] = $value['open'];
|
486 |
+
self::$mla_option_templates[ $name . '-row-open-markup' ] = $value['row-open'];
|
487 |
+
self::$mla_option_templates[ $name . '-item-markup' ] = $value['item'];
|
488 |
+
self::$mla_option_templates[ $name . '-row-close-markup' ] = $value['row-close'];
|
489 |
+
self::$mla_option_templates[ $name . '-close-markup' ] = $value['close'];
|
490 |
+
} // foreach $templates
|
491 |
+
} // is_array
|
492 |
+
}
|
493 |
+
|
494 |
+
/**
|
495 |
+
* Fetch style or markup template from $mla_templates
|
496 |
+
*
|
497 |
+
* @since 0.80
|
498 |
+
*
|
499 |
+
* @param string Template name
|
500 |
+
* @param string Template type; 'style' (default) or 'markup'
|
501 |
+
*
|
502 |
+
* @return string|boolean|null requested template, false if not found or null if no templates
|
503 |
+
*/
|
504 |
+
public static function mla_fetch_gallery_template( $key, $type = 'style' ) {
|
505 |
+
if ( ! is_array( self::$mla_option_templates ) ) {
|
506 |
+
MLAShortcodes::$mla_debug_messages .= '<p><strong>_fetch_template()</strong> no templates exist';
|
507 |
+
return null;
|
508 |
+
}
|
509 |
+
|
510 |
+
$array_key = $key . '-' . $type;
|
511 |
+
if ( array_key_exists( $array_key, self::$mla_option_templates ) )
|
512 |
+
return self::$mla_option_templates[ $array_key ];
|
513 |
+
else {
|
514 |
+
MLAShortcodes::$mla_debug_messages .= "<p><strong>_fetch_template( {$key}, {$type} )</strong> not found";
|
515 |
+
return false;
|
516 |
+
}
|
517 |
+
}
|
518 |
+
|
519 |
+
/**
|
520 |
+
* Get ALL style templates from $mla_templates, including 'default'
|
521 |
+
*
|
522 |
+
* @since 0.80
|
523 |
+
*
|
524 |
+
* @return array|null name => value for all style templates or null if no templates
|
525 |
+
*/
|
526 |
+
public static function mla_get_style_templates() {
|
527 |
+
if ( ! is_array( self::$mla_option_templates ) ) {
|
528 |
+
MLAShortcodes::$mla_debug_messages .= '<p><strong>_fetch_template()</strong> no templates exist';
|
529 |
+
return null;
|
530 |
+
}
|
531 |
+
|
532 |
+
$templates = array();
|
533 |
+
foreach ( self::$mla_option_templates as $key => $value ) {
|
534 |
+
$tail = strrpos( $key, '-style' );
|
535 |
+
if ( ! ( false === $tail ) ) {
|
536 |
+
$name = substr( $key, 0, $tail );
|
537 |
+
$templates[ $name ] = $value;
|
538 |
+
}
|
539 |
+
} // foreach
|
540 |
+
|
541 |
+
return $templates;
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Put user-defined style templates to $mla_templates and database
|
546 |
+
*
|
547 |
+
* @since 0.80
|
548 |
+
*
|
549 |
+
* @param array name => value for all user-defined style templates
|
550 |
+
* @return boolean true if success, false if failure
|
551 |
+
*/
|
552 |
+
public static function mla_put_style_templates( $templates ) {
|
553 |
+
if ( self::mla_update_option( 'style_templates', $templates ) ) {
|
554 |
+
self::_load_option_templates();
|
555 |
+
return true;
|
556 |
+
}
|
557 |
+
|
558 |
+
return false;
|
559 |
+
}
|
560 |
+
|
561 |
+
/**
|
562 |
+
* Get ALL markup templates from $mla_templates, including 'default'
|
563 |
+
*
|
564 |
+
* @since 0.80
|
565 |
+
*
|
566 |
+
* @return array|null name => value for all markup templates or null if no templates
|
567 |
+
*/
|
568 |
+
public static function mla_get_markup_templates() {
|
569 |
+
if ( ! is_array( self::$mla_option_templates ) ) {
|
570 |
+
MLAShortcodes::$mla_debug_messages .= '<p><strong>_fetch_template()</strong> no templates exist';
|
571 |
+
return null;
|
572 |
+
}
|
573 |
+
|
574 |
+
$templates = array();
|
575 |
+
foreach ( self::$mla_option_templates as $key => $value ) {
|
576 |
+
$tail = strrpos( $key, '-row-open-markup' );
|
577 |
+
if ( ! ( false === $tail ) ) {
|
578 |
+
$name = substr( $key, 0, $tail );
|
579 |
+
$templates[ $name ]['row-open'] = $value;
|
580 |
+
continue;
|
581 |
+
}
|
582 |
+
|
583 |
+
$tail = strrpos( $key, '-open-markup' );
|
584 |
+
if ( ! ( false === $tail ) ) {
|
585 |
+
$name = substr( $key, 0, $tail );
|
586 |
+
$templates[ $name ]['open'] = $value;
|
587 |
+
continue;
|
588 |
+
}
|
589 |
+
|
590 |
+
$tail = strrpos( $key, '-item-markup' );
|
591 |
+
if ( ! ( false === $tail ) ) {
|
592 |
+
$name = substr( $key, 0, $tail );
|
593 |
+
$templates[ $name ]['item'] = $value;
|
594 |
+
continue;
|
595 |
+
}
|
596 |
+
|
597 |
+
$tail = strrpos( $key, '-row-close-markup' );
|
598 |
+
if ( ! ( false === $tail ) ) {
|
599 |
+
$name = substr( $key, 0, $tail );
|
600 |
+
$templates[ $name ]['row-close'] = $value;
|
601 |
+
continue;
|
602 |
+
}
|
603 |
+
|
604 |
+
$tail = strrpos( $key, '-close-markup' );
|
605 |
+
if ( ! ( false === $tail ) ) {
|
606 |
+
$name = substr( $key, 0, $tail );
|
607 |
+
$templates[ $name ]['close'] = $value;
|
608 |
+
}
|
609 |
+
} // foreach
|
610 |
+
|
611 |
+
return $templates;
|
612 |
+
}
|
613 |
+
|
614 |
+
/**
|
615 |
+
* Put user-defined markup templates to $mla_templates and database
|
616 |
+
*
|
617 |
+
* @since 0.80
|
618 |
+
*
|
619 |
+
* @param array name => value for all user-defined markup templates
|
620 |
+
* @return boolean true if success, false if failure
|
621 |
+
*/
|
622 |
+
public static function mla_put_markup_templates( $templates ) {
|
623 |
+
if ( self::mla_update_option( 'markup_templates', $templates ) ) {
|
624 |
+
self::_load_option_templates();
|
625 |
+
return true;
|
626 |
+
}
|
627 |
+
|
628 |
+
return false;
|
629 |
+
}
|
630 |
+
|
631 |
+
/**
|
632 |
+
* Return the stored value or default value of a defined MLA option
|
633 |
+
*
|
634 |
+
* @since 0.1
|
635 |
+
*
|
636 |
+
* @param string Name of the desired option
|
637 |
+
*
|
638 |
+
* @return mixed Value(s) for the option or false if the option is not a defined MLA option
|
639 |
+
*/
|
640 |
+
public static function mla_get_option( $option ) {
|
641 |
+
if ( array_key_exists( $option, self::$mla_option_definitions ) ) {
|
642 |
+
if ( array_key_exists( 'std', self::$mla_option_definitions[ $option ] ) )
|
643 |
+
return get_option( MLA_OPTION_PREFIX . $option, self::$mla_option_definitions[ $option ]['std'] );
|
644 |
+
else
|
645 |
+
return get_option( MLA_OPTION_PREFIX . $option, false );
|
646 |
+
}
|
647 |
+
|
648 |
+
return false;
|
649 |
+
}
|
650 |
+
|
651 |
+
/**
|
652 |
+
* Add or update the stored value of a defined MLA option
|
653 |
+
*
|
654 |
+
* @since 0.1
|
655 |
+
*
|
656 |
+
* @param string Name of the desired option
|
657 |
+
* @param mixed New value for the desired option
|
658 |
+
*
|
659 |
+
* @return boolean True if the value was changed or false if the update failed
|
660 |
+
*/
|
661 |
+
public static function mla_update_option( $option, $newvalue ) {
|
662 |
+
if ( array_key_exists( $option, self::$mla_option_definitions ) )
|
663 |
+
return update_option( MLA_OPTION_PREFIX . $option, $newvalue );
|
664 |
+
|
665 |
+
return false;
|
666 |
+
}
|
667 |
+
|
668 |
+
/**
|
669 |
+
* Delete the stored value of a defined MLA option
|
670 |
+
*
|
671 |
+
* @since 0.1
|
672 |
+
*
|
673 |
+
* @param string Name of the desired option
|
674 |
+
*
|
675 |
+
* @return boolean True if the option was deleted, otherwise false
|
676 |
+
*/
|
677 |
+
public static function mla_delete_option( $option ) {
|
678 |
+
if ( array_key_exists( $option, self::$mla_option_definitions ) ) {
|
679 |
+
return delete_option( MLA_OPTION_PREFIX . $option );
|
680 |
+
}
|
681 |
+
|
682 |
+
return false;
|
683 |
+
}
|
684 |
+
|
685 |
+
/**
|
686 |
+
* Determine MLA support for a taxonomy, handling the special case where the
|
687 |
+
* settings are being updated or reset.
|
688 |
+
*
|
689 |
+
* @since 0.30
|
690 |
+
*
|
691 |
+
* @param string Taxonomy name, e.g., attachment_category
|
692 |
+
* @param string Optional. 'support' (default), 'quick-edit' or 'filter'
|
693 |
+
*
|
694 |
+
* @return boolean|string
|
695 |
+
* true if the taxonomy is supported in this way else false
|
696 |
+
* string if $tax_name is '' and $support_type is 'filter', returns the taxonomy to filter by
|
697 |
+
*/
|
698 |
+
public static function mla_taxonomy_support($tax_name, $support_type = 'support') {
|
699 |
+
$tax_options = MLAOptions::mla_get_option( 'taxonomy_support' );
|
700 |
+
|
701 |
+
switch ( $support_type ) {
|
702 |
+
case 'support':
|
703 |
+
$tax_support = isset( $tax_options['tax_support'] ) ? $tax_options['tax_support'] : array();
|
704 |
+
$is_supported = array_key_exists( $tax_name, $tax_support );
|
705 |
+
|
706 |
+
if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
|
707 |
+
$is_supported = isset( $_REQUEST['tax_support'][ $tax_name ] );
|
708 |
+
} elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
|
709 |
+
switch ( $tax_name ) {
|
710 |
+
case 'attachment_category':
|
711 |
+
case 'attachment_tag':
|
712 |
+
$is_supported = true;
|
713 |
+
break;
|
714 |
+
default:
|
715 |
+
$is_supported = false;
|
716 |
+
}
|
717 |
+
}
|
718 |
+
|
719 |
+
return $is_supported;
|
720 |
+
case 'quick-edit':
|
721 |
+
$tax_quick_edit = isset( $tax_options['tax_quick_edit'] ) ? $tax_options['tax_quick_edit'] : array();
|
722 |
+
$is_supported = array_key_exists( $tax_name, $tax_quick_edit );
|
723 |
+
|
724 |
+
if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
|
725 |
+
$is_supported = isset( $_REQUEST['tax_quick_edit'][ $tax_name ] );
|
726 |
+
} elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
|
727 |
+
switch ( $tax_name ) {
|
728 |
+
case 'attachment_category':
|
729 |
+
case 'attachment_tag':
|
730 |
+
$is_supported = true;
|
731 |
+
break;
|
732 |
+
default:
|
733 |
+
$is_supported = false;
|
734 |
+
}
|
735 |
+
}
|
736 |
+
|
737 |
+
return $is_supported;
|
738 |
+
case 'filter':
|
739 |
+
$tax_filter = isset( $tax_options['tax_filter'] ) ? $tax_options['tax_filter'] : '';
|
740 |
+
if ( '' == $tax_name )
|
741 |
+
return $tax_filter;
|
742 |
+
else
|
743 |
+
$is_supported = ( $tax_name == $tax_filter );
|
744 |
+
|
745 |
+
if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
|
746 |
+
$tax_filter = isset( $_REQUEST['tax_filter'] ) ? $_REQUEST['tax_filter'] : '';
|
747 |
+
$is_supported = ( $tax_name == $tax_filter );
|
748 |
+
} elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
|
749 |
+
if ( 'attachment_category' == $tax_name )
|
750 |
+
$is_supported = true;
|
751 |
+
else
|
752 |
+
$is_supported = false;
|
753 |
+
}
|
754 |
+
|
755 |
+
return $is_supported;
|
756 |
+
default:
|
757 |
+
return false;
|
758 |
+
} // $support_type
|
759 |
+
} // mla_taxonomy_support
|
760 |
+
|
761 |
+
/**
|
762 |
+
* Render and manage taxonomy support options, e.g., Categories and Post Tags
|
763 |
+
*
|
764 |
+
* @since 0.30
|
765 |
+
* @uses $mla_option_templates contains taxonomy-row and taxonomy-table templates
|
766 |
+
*
|
767 |
+
* @param string 'render', 'update', 'delete', or 'reset'
|
768 |
+
* @param string option name, e.g., 'taxonomy_support'
|
769 |
+
* @param array option parameters
|
770 |
+
* @param array Optional. null (default) for 'render' else option data, e.g., $_REQUEST
|
771 |
+
*
|
772 |
+
* @return string HTML table row markup for 'render' else message(s) reflecting the results of the operation.
|
773 |
+
*/
|
774 |
+
public static function mla_taxonomy_option_handler( $action, $key, $value, $args = null ) {
|
775 |
+
switch ( $action ) {
|
776 |
+
case 'render':
|
777 |
+
$taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'objects' );
|
778 |
+
$current_values = self::mla_get_option( $key );
|
779 |
+
$tax_support = isset( $current_values['tax_support'] ) ? $current_values['tax_support'] : array();
|
780 |
+
$tax_quick_edit = isset( $current_values['tax_quick_edit'] ) ? $current_values['tax_quick_edit'] : array();
|
781 |
+
$tax_filter = isset( $current_values['tax_filter'] ) ? $current_values['tax_filter'] : '';
|
782 |
+
|
783 |
+
/*
|
784 |
+
* Always display our own taxonomies, even if not registered.
|
785 |
+
* Otherwise there's no way to turn them back on.
|
786 |
+
*/
|
787 |
+
if ( ! array_key_exists( 'attachment_category', $taxonomies ) ) {
|
788 |
+
$taxonomies['attachment_category'] = (object) array( 'labels' => (object) array( 'name' => 'Attachment Categories' ) );
|
789 |
+
if ( isset( $tax_support['attachment_category'] ) )
|
790 |
+
unset( $tax_support['attachment_category'] );
|
791 |
+
|
792 |
+
if ( isset( $tax_quick_edit['attachment_category'] ) )
|
793 |
+
unset( $tax_quick_edit['attachment_category'] );
|
794 |
+
|
795 |
+
if ( $tax_filter == 'attachment_category' )
|
796 |
+
$tax_filter = '';
|
797 |
+
}
|
798 |
+
|
799 |
+
if ( ! array_key_exists( 'attachment_tag', $taxonomies ) ) {
|
800 |
+
$taxonomies['attachment_tag'] = (object) array( 'labels' => (object) array( 'name' => 'Attachment Tags' ) );
|
801 |
+
|
802 |
+
if ( isset( $tax_support['attachment_tag'] ) )
|
803 |
+
unset( $tax_support['attachment_tag'] );
|
804 |
+
|
805 |
+
if ( isset( $tax_quick_edit['attachment_tag'] ) )
|
806 |
+
unset( $tax_quick_edit['attachment_tag'] );
|
807 |
+
|
808 |
+
if ( $tax_filter == 'attachment_tag' )
|
809 |
+
$tax_filter = '';
|
810 |
+
}
|
811 |
+
|
812 |
+
$taxonomy_row = self::$mla_option_templates['taxonomy-row'];
|
813 |
+
$row = '';
|
814 |
+
|
815 |
+
foreach ( $taxonomies as $tax_name => $tax_object ) {
|
816 |
+
$option_values = array (
|
817 |
+
'key' => $tax_name,
|
818 |
+
'name' => $tax_object->labels->name,
|
819 |
+
'support_checked' => array_key_exists( $tax_name, $tax_support ) ? 'checked=checked' : '',
|
820 |
+
'quick_edit_checked' => array_key_exists( $tax_name, $tax_quick_edit ) ? 'checked=checked' : '',
|
821 |
+
'filter_checked' => ( $tax_name == $tax_filter ) ? 'checked=checked' : ''
|
822 |
+
);
|
823 |
+
|
824 |
+
$row .= MLAData::mla_parse_template( $taxonomy_row, $option_values );
|
825 |
+
}
|
826 |
+
|
827 |
+
$option_values = array (
|
828 |
+
'taxonomy_rows' => $row,
|
829 |
+
'help' => $value['help']
|
830 |
+
);
|
831 |
+
|
832 |
+
return MLAData::mla_parse_template( self::$mla_option_templates['taxonomy-table'], $option_values );
|
833 |
+
case 'update':
|
834 |
+
case 'delete':
|
835 |
+
$tax_support = isset( $args['tax_support'] ) ? $args['tax_support'] : array();
|
836 |
+
$tax_quick_edit = isset( $args['tax_quick_edit'] ) ? $args['tax_quick_edit'] : array();
|
837 |
+
$tax_filter = isset( $args['tax_filter'] ) ? $args['tax_filter'] : '';
|
838 |
+
|
839 |
+
$msg = '';
|
840 |
+
|
841 |
+
if ( !empty($tax_filter) && !array_key_exists( $tax_filter, $tax_support ) ) {
|
842 |
+
$msg .= "<br>List Filter ignored; {$tax_filter} not supported.\r\n";
|
843 |
+
$tax_filter = '';
|
844 |
+
}
|
845 |
+
|
846 |
+
foreach ( $tax_quick_edit as $tax_name => $tax_value ) {
|
847 |
+
if ( !array_key_exists( $tax_name, $tax_support ) ) {
|
848 |
+
$msg .= "<br>Quick Edit ignored; {$tax_name} not supported.\r\n";
|
849 |
+
unset( $tax_quick_edit[ $tax_name ] );
|
850 |
+
}
|
851 |
+
}
|
852 |
+
|
853 |
+
$value = array (
|
854 |
+
'tax_support' => $tax_support,
|
855 |
+
'tax_quick_edit' => $tax_quick_edit,
|
856 |
+
'tax_filter' => $tax_filter
|
857 |
+
);
|
858 |
+
|
859 |
+
self::mla_update_option( $key, $value );
|
860 |
+
|
861 |
+
if ( empty( $msg ) )
|
862 |
+
$msg = "<br>Update custom {$key}\r\n";
|
863 |
+
|
864 |
+
return $msg;
|
865 |
+
case 'reset':
|
866 |
+
self::mla_delete_option( $key );
|
867 |
+
return "<br>Reset custom {$key}\r\n";
|
868 |
+
default:
|
869 |
+
return "<br>ERROR: custom {$key} unknown action: {$action}\r\n";
|
870 |
+
}
|
871 |
+
} // mla_taxonomy_option_handler
|
872 |
+
|
873 |
+
/**
|
874 |
+
* Perform ITC/EXIF mapping on just-inserted attachment
|
875 |
+
*
|
876 |
+
* @since 1.00
|
877 |
+
*
|
878 |
+
* @param integer ID of just-inserted attachment
|
879 |
+
*
|
880 |
+
* @return void
|
881 |
+
*/
|
882 |
+
public static function mla_add_attachment_action( $post_id ) {
|
883 |
+
if ( 'checked' == MLAOptions::mla_get_option( 'enable_iptc_exif_mapping' ) ) {
|
884 |
+
$item = get_post( $post_id );
|
885 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
|
886 |
+
|
887 |
+
if ( !empty( $updates ) )
|
888 |
+
$item_content = MLAData::mla_update_single_item( $post_id, $updates );
|
889 |
+
}
|
890 |
+
} // mla_add_attachment_action
|
891 |
+
|
892 |
+
/**
|
893 |
+
* Perform Custom Field mapping on just-inserted or updated attachment
|
894 |
+
*
|
895 |
+
* @since 1.10
|
896 |
+
*
|
897 |
+
* @param array Attachment metadata for just-inserted attachment
|
898 |
+
* @param integer ID of just-inserted attachment
|
899 |
+
*
|
900 |
+
* @return void
|
901 |
+
*/
|
902 |
+
public static function mla_update_attachment_metadata_filter( $data, $post_id ) {
|
903 |
+
if ( 'checked' == MLAOptions::mla_get_option( 'enable_custom_field_mapping' ) ) {
|
904 |
+
$updates = MLAOptions::mla_evaluate_custom_field_mapping( $post_id, 'single_attachment_mapping', NULL, $data );
|
905 |
+
|
906 |
+
if ( !empty( $updates ) )
|
907 |
+
$item_content = MLAData::mla_update_single_item( $post_id, $updates );
|
908 |
+
}
|
909 |
+
|
910 |
+
return $data;
|
911 |
+
} // mla_update_attachment_metadata_filter
|
912 |
+
|
913 |
+
/**
|
914 |
+
* Fetch custom field option value given a slug
|
915 |
+
*
|
916 |
+
* @since 1.10
|
917 |
+
*
|
918 |
+
* @param string slug, e.g., 'c_file-size' for the 'File Size' field
|
919 |
+
*
|
920 |
+
* @return array option value, e.g., array( 'name' => 'File Size', ... )
|
921 |
+
*/
|
922 |
+
public static function mla_custom_field_option_value( $slug ) {
|
923 |
+
$option_values = self::mla_get_option( 'custom_field_mapping' );
|
924 |
+
|
925 |
+
foreach( $option_values as $key => $value ) {
|
926 |
+
if ( $slug == 'c_' . sanitize_title( $key ) )
|
927 |
+
return $value;
|
928 |
+
}
|
929 |
+
|
930 |
+
return array();
|
931 |
+
} // mla_custom_field_option_value
|
932 |
+
|
933 |
+
/**
|
934 |
+
* Evaluate file information for custom field mapping
|
935 |
+
*
|
936 |
+
* @since 1.10
|
937 |
+
*
|
938 |
+
* @param string array format; 'default_columns' (default), 'default_hidden_columns', 'default_sortable_columns', 'quick_edit' or 'bulk_edit'
|
939 |
+
*
|
940 |
+
* @return array default, hidden, sortable quick_edit or bulk_edit colums in appropriate format
|
941 |
+
*/
|
942 |
+
public static function mla_custom_field_support( $support_type = 'default_columns' ) {
|
943 |
+
$option_values = self::mla_get_option( 'custom_field_mapping' );
|
944 |
+
$results = array();
|
945 |
+
|
946 |
+
foreach( $option_values as $key => $value ) {
|
947 |
+
$slug = 'c_' . sanitize_title( $key );
|
948 |
+
|
949 |
+
switch( $support_type ) {
|
950 |
+
case 'default_columns':
|
951 |
+
if ( $value['mla_column'] )
|
952 |
+
$results[ $slug ] = $value['name'];
|
953 |
+
break;
|
954 |
+
case 'default_hidden_columns':
|
955 |
+
if ( $value['mla_column'] )
|
956 |
+
$results[ ] = $slug;
|
957 |
+
break;
|
958 |
+
case 'default_sortable_columns':
|
959 |
+
if ( $value['mla_column'] )
|
960 |
+
$results[ $slug ] = array( $slug, false );
|
961 |
+
break;
|
962 |
+
case 'quick_edit':
|
963 |
+
if ( $value['quick_edit'] )
|
964 |
+
$results[ $slug ] = $value['name'];
|
965 |
+
break;
|
966 |
+
case 'bulk_edit':
|
967 |
+
if ( $value['bulk_edit'] )
|
968 |
+
$results[ $slug ] = $value['name'];
|
969 |
+
break;
|
970 |
+
} // switch support_type
|
971 |
+
} // foreach option_value
|
972 |
+
|
973 |
+
return $results;
|
974 |
+
} // mla_custom_field_support
|
975 |
+
|
976 |
+
/**
|
977 |
+
* Evaluate file information for custom field mapping
|
978 |
+
*
|
979 |
+
* @since 1.10
|
980 |
+
*
|
981 |
+
* @param string absolute path the the uploads base directory
|
982 |
+
* @param array _wp_attached_file meta_value array, indexed by post_id
|
983 |
+
* @param array _wp_attachment_metadata meta_value array, indexed by post_id
|
984 |
+
* @param integer post->ID of attachment
|
985 |
+
*
|
986 |
+
* @return array absolute_path, base_file, path, file_name, extension, dimensions, width, height, hwstring_small, array of intermediate sizes
|
987 |
+
*/
|
988 |
+
private static function _evaluate_file_information( $upload_dir, &$wp_attached_files, &$wp_attachment_metadata, $post_id ) {
|
989 |
+
$results = array(
|
990 |
+
'absolute_path' => '',
|
991 |
+
'base_file' => '',
|
992 |
+
'path' => '',
|
993 |
+
'file_name' => '',
|
994 |
+
'extension' => '',
|
995 |
+
'width' => '',
|
996 |
+
'height' => '',
|
997 |
+
'hwstring_small' => '',
|
998 |
+
'sizes' => array()
|
999 |
+
);
|
1000 |
+
|
1001 |
+
$attached_file = isset( $wp_attached_files[ $post_id ]->meta_value ) ? $wp_attached_files[ $post_id ]->meta_value : '';
|
1002 |
+
$attachment_metadata = isset( $wp_attachment_metadata[ $post_id ]->meta_value ) ? unserialize( $wp_attachment_metadata[ $post_id ]->meta_value ) : array();
|
1003 |
+
|
1004 |
+
if ( !empty( $attachment_metadata ) ) {
|
1005 |
+
$base_file = $attachment_metadata['file'];
|
1006 |
+
$sizes = isset( $attachment_metadata['sizes'] ) ? $attachment_metadata['sizes'] : array();
|
1007 |
+
$results['width'] = $attachment_metadata['width'];
|
1008 |
+
$results['height'] = $attachment_metadata['height'];
|
1009 |
+
$results['hwstring_small'] = isset( $attachment_metadata['hwstring_small'] ) ? $attachment_metadata['hwstring_small'] : '';
|
1010 |
+
|
1011 |
+
foreach( $attachment_metadata['image_meta'] as $key => $value )
|
1012 |
+
$results[ $key ] = $value;
|
1013 |
+
}
|
1014 |
+
else {
|
1015 |
+
$base_file = $attached_file;
|
1016 |
+
$sizes = array();
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
if ( ! empty( $base_file ) ) {
|
1020 |
+
$results['base_file'] = $base_file;
|
1021 |
+
$last_slash = strrpos( $base_file, '/' );
|
1022 |
+
if ( false === $last_slash ) {
|
1023 |
+
$results['absolute_path'] = $upload_dir;
|
1024 |
+
$results['file_name'] = wptexturize( $base_file );
|
1025 |
+
}
|
1026 |
+
else {
|
1027 |
+
$file_name = substr( $base_file, $last_slash + 1 );
|
1028 |
+
$path = substr( $base_file, 0, $last_slash + 1 );
|
1029 |
+
$results['absolute_path'] = $upload_dir . $path;
|
1030 |
+
$results['path'] = wptexturize( $path );
|
1031 |
+
$results['file_name'] = wptexturize( $file_name );
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
$last_dot = strrpos( $base_file, '.' );
|
1035 |
+
if ( false === $last_dot ) {
|
1036 |
+
$results['extension'] = '';
|
1037 |
+
}
|
1038 |
+
else {
|
1039 |
+
$results['extension'] = substr( $base_file, $last_dot + 1 );
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
$results['sizes'] = $sizes;
|
1045 |
+
return $results;
|
1046 |
+
} // _evaluate_file_information
|
1047 |
+
|
1048 |
+
/**
|
1049 |
+
* Evaluate custom field mapping data source
|
1050 |
+
*
|
1051 |
+
* @since 1.10
|
1052 |
+
*
|
1053 |
+
* @param integer post->ID of attachment
|
1054 |
+
* @param string category/scope to evaluate against: custom_field_mapping or single_attachment_mapping
|
1055 |
+
* @param string data source name
|
1056 |
+
* @param string desired results format, default 'native'
|
1057 |
+
* @param array (optional) attachment_metadata, default NULL (use current postmeta database value)
|
1058 |
+
*
|
1059 |
+
* @return string data source value
|
1060 |
+
*/
|
1061 |
+
private static function _evaluate_data_source( $post_id, $category, $data_source, $format = 'native', $attachment_metadata = NULL ) {
|
1062 |
+
global $wpdb;
|
1063 |
+
static $upload_dir, $intermediate_sizes = NULL, $wp_attached_files = NULL, $wp_attachment_metadata = NULL;
|
1064 |
+
static $current_id = 0, $file_info = NULL;
|
1065 |
+
|
1066 |
+
if ( 'none' == $data_source )
|
1067 |
+
return '';
|
1068 |
+
|
1069 |
+
/*
|
1070 |
+
* Do this once per page load; cache attachment metadata if mapping all attachments
|
1071 |
+
*/
|
1072 |
+
if ( NULL == $intermediate_sizes ) {
|
1073 |
+
$upload_dir = wp_upload_dir();
|
1074 |
+
$upload_dir = $upload_dir['basedir'] . '/';
|
1075 |
+
$intermediate_sizes = get_intermediate_image_sizes();
|
1076 |
+
|
1077 |
+
if ( 'custom_field_mapping' == $category ) {
|
1078 |
+
if ( ! $table = _get_meta_table('post') ) {
|
1079 |
+
$wp_attached_files = array();
|
1080 |
+
$wp_attachment_metadata = array();
|
1081 |
+
}
|
1082 |
+
else {
|
1083 |
+
$wp_attachment_metadata = $wpdb->get_results( "SELECT post_id, meta_value FROM {$table} WHERE meta_key = '_wp_attachment_metadata'", OBJECT_K );
|
1084 |
+
$wp_attached_files = $wpdb->get_results( "SELECT post_id, meta_value FROM {$table} WHERE meta_key = '_wp_attached_file'", OBJECT_K );
|
1085 |
+
}
|
1086 |
+
} // custom_field_mapping, i.e., mapping all attachments
|
1087 |
+
} // first call after page load
|
1088 |
+
|
1089 |
+
/*
|
1090 |
+
* Do this once per post. Simulate SQL results for $wp_attached_files and $wp_attachment_metadata.
|
1091 |
+
*/
|
1092 |
+
if ( $current_id != $post_id ) {
|
1093 |
+
$current_id = $post_id;
|
1094 |
+
if ( 'single_attachment_mapping' == $category ) {
|
1095 |
+
$meta_value = get_metadata( 'post', $post_id, '_wp_attached_file' );
|
1096 |
+
$wp_attached_files = array( $post_id => (object) array( 'post_id' => $post_id, 'meta_value' => $meta_value[0] ) );
|
1097 |
+
|
1098 |
+
if ( NULL == $attachment_metadata ) {
|
1099 |
+
$metadata = get_metadata( 'post', $post_id, '_wp_attachment_metadata' );
|
1100 |
+
if ( isset( $metadata[0] ) )
|
1101 |
+
$attachment_metadata = $metadata[0];
|
1102 |
+
}
|
1103 |
+
|
1104 |
+
if ( empty( $attachment_metadata ) )
|
1105 |
+
$attachment_metadata = array();
|
1106 |
+
|
1107 |
+
$wp_attachment_metadata = array( $post_id => (object) array( 'post_id' => $post_id, 'meta_value' => serialize( $attachment_metadata ) ) );
|
1108 |
+
}
|
1109 |
+
|
1110 |
+
$file_info = self::_evaluate_file_information( $upload_dir, $wp_attached_files, $wp_attachment_metadata, $post_id );
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
$size_info = array( 'file' => '', 'width' => '', 'height' => '' );
|
1114 |
+
$match_count = preg_match( '/(.+)\[(.+)\]/', $data_source, $matches );
|
1115 |
+
if ( 1 == $match_count ) {
|
1116 |
+
$data_source = $matches[1] . '[size]';
|
1117 |
+
if ( isset( $file_info['sizes'][ $matches[2] ] ) )
|
1118 |
+
$size_info = $file_info['sizes'][ $matches[2] ];
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
$result = '';
|
1122 |
+
|
1123 |
+
switch( $data_source ) {
|
1124 |
+
case 'path':
|
1125 |
+
case 'file_name':
|
1126 |
+
case 'extension':
|
1127 |
+
case 'width':
|
1128 |
+
case 'height':
|
1129 |
+
case 'hwstring_small':
|
1130 |
+
case 'aperture':
|
1131 |
+
case 'credit':
|
1132 |
+
case 'camera':
|
1133 |
+
case 'caption':
|
1134 |
+
case 'created_timestamp':
|
1135 |
+
case 'copyright':
|
1136 |
+
case 'focal_length':
|
1137 |
+
case 'iso':
|
1138 |
+
case 'shutter_speed':
|
1139 |
+
case 'title':
|
1140 |
+
$result = $file_info[ $data_source ];
|
1141 |
+
break;
|
1142 |
+
case 'file_size':
|
1143 |
+
$filesize = @ filesize( $file_info['absolute_path'] . $file_info['file_name'] );
|
1144 |
+
if ( ! (false === $filesize ) )
|
1145 |
+
$result = $filesize;
|
1146 |
+
break;
|
1147 |
+
case 'dimensions':
|
1148 |
+
$result = $file_info['width'] . 'x' . $file_info['height'];
|
1149 |
+
if ( 'x' == $result )
|
1150 |
+
$result = '';
|
1151 |
+
break;
|
1152 |
+
case 'pixels':
|
1153 |
+
$result = absint( (int) $file_info['width'] * (int) $file_info['height'] );
|
1154 |
+
if ( 0 == $result )
|
1155 |
+
$result = '';
|
1156 |
+
else
|
1157 |
+
$result = (string) $result;
|
1158 |
+
break;
|
1159 |
+
case 'size_keys':
|
1160 |
+
foreach( $file_info['sizes'] as $key => $value ) {
|
1161 |
+
$result .= $key . ', ';
|
1162 |
+
}
|
1163 |
+
if ( $result )
|
1164 |
+
$result = rtrim( $result, ', ' );
|
1165 |
+
break;
|
1166 |
+
case 'size_names':
|
1167 |
+
foreach( $file_info['sizes'] as $key => $value ) {
|
1168 |
+
$result .= $value['file'] . ', ';
|
1169 |
+
}
|
1170 |
+
if ( $result )
|
1171 |
+
$result = rtrim( $result, ', ' );
|
1172 |
+
break;
|
1173 |
+
case 'size_bytes':
|
1174 |
+
foreach( $file_info['sizes'] as $key => $value ) {
|
1175 |
+
$filesize = @ filesize( $file_info['absolute_path'] . $value['file'] );
|
1176 |
+
if ( false === $filesize )
|
1177 |
+
$result .= '?, ';
|
1178 |
+
else {
|
1179 |
+
switch( $format ) {
|
1180 |
+
case 'commas':
|
1181 |
+
if ( is_numeric( $filesize ) )
|
1182 |
+
$filesize = number_format( (float)$filesize );
|
1183 |
+
break;
|
1184 |
+
default:
|
1185 |
+
// no change
|
1186 |
+
} // format
|
1187 |
+
$result .= $filesize . ', ';
|
1188 |
+
}
|
1189 |
+
}
|
1190 |
+
if ( $result )
|
1191 |
+
$result = rtrim( $result, ', ' );
|
1192 |
+
break;
|
1193 |
+
case 'size_pixels':
|
1194 |
+
foreach( $file_info['sizes'] as $key => $value ) {
|
1195 |
+
$pixels = absint( (int) $value['width'] * (int) $value['height'] );
|
1196 |
+
|
1197 |
+
switch( $format ) {
|
1198 |
+
case 'commas':
|
1199 |
+
if ( is_numeric( $pixels ) )
|
1200 |
+
$pixels = number_format( (float)$pixels );
|
1201 |
+
break;
|
1202 |
+
default:
|
1203 |
+
// no change
|
1204 |
+
} // format
|
1205 |
+
$result .= $pixels . ', ';
|
1206 |
+
}
|
1207 |
+
if ( $result )
|
1208 |
+
$result = rtrim( $result, ', ' );
|
1209 |
+
break;
|
1210 |
+
case 'size_dimensions':
|
1211 |
+
foreach( $file_info['sizes'] as $key => $value ) {
|
1212 |
+
$result .= $value['width'] . 'x' . $value['height'] . ', ';
|
1213 |
+
}
|
1214 |
+
if ( $result )
|
1215 |
+
$result = rtrim( $result, ', ' );
|
1216 |
+
break;
|
1217 |
+
case 'size_name[size]':
|
1218 |
+
$result = $size_info['file'];
|
1219 |
+
break;
|
1220 |
+
case 'size_bytes[size]':
|
1221 |
+
$result = @ filesize( $file_info['absolute_path'] . $size_info['file'] );
|
1222 |
+
if ( false === $result )
|
1223 |
+
$result .= '?';
|
1224 |
+
break;
|
1225 |
+
case 'size_pixels[size]':
|
1226 |
+
$result = absint( (int) $size_info['width'] * (int) $size_info['height'] );
|
1227 |
+
break;
|
1228 |
+
case 'size_dimensions[size]':
|
1229 |
+
$result = $size_info['width'] . 'x' . $size_info['height'];
|
1230 |
+
if ( 'x' == $result )
|
1231 |
+
$result = '';
|
1232 |
+
break;
|
1233 |
+
case 'parent_type':
|
1234 |
+
case 'parent_title':
|
1235 |
+
$parent_info = $wpdb->get_col( "SELECT post_parent FROM {$wpdb->posts} WHERE ID = '{$post_id}'" );
|
1236 |
+
if ( is_array( $parent_info) ) {
|
1237 |
+
$parent_info = MLAData::mla_fetch_attachment_parent_data( $parent_info[0] );
|
1238 |
+
if ( isset( $parent_info[ $data_source ] ) )
|
1239 |
+
$result = $parent_info[ $data_source ];
|
1240 |
+
}
|
1241 |
+
break;
|
1242 |
+
case 'parent_issues':
|
1243 |
+
$parent_info = $wpdb->get_col( "SELECT post_parent FROM {$wpdb->posts} WHERE ID = '{$post_id}'" );
|
1244 |
+
$parent_id = is_array( $parent_info) ? $parent_info[0] : 0;
|
1245 |
+
$references = MLAData::mla_fetch_attachment_references( $post_id, $parent_id );
|
1246 |
+
|
1247 |
+
if ( !empty( $references['parent_errors'] ) ) {
|
1248 |
+
$result = $references['parent_errors'];
|
1249 |
+
/*
|
1250 |
+
* Remove (ORPHAN...
|
1251 |
+
*/
|
1252 |
+
if ( false !== strpos( $result, '(ORPHAN)' ) )
|
1253 |
+
$result = trim( substr( $result, 8) );
|
1254 |
+
elseif ( false !== strpos( $result, '(ORPHAN?)' ) )
|
1255 |
+
$result = trim( substr( $result, 9) );
|
1256 |
+
}
|
1257 |
+
break;
|
1258 |
+
case 'reference_issues':
|
1259 |
+
$parent_info = $wpdb->get_col( "SELECT post_parent FROM {$wpdb->posts} WHERE ID = '{$post_id}'" );
|
1260 |
+
$parent_id = is_array( $parent_info) ? $parent_info[0] : 0;
|
1261 |
+
$references = MLAData::mla_fetch_attachment_references( $post_id, $parent_id );
|
1262 |
+
if ( !empty( $references['parent_errors'] ) )
|
1263 |
+
$result = $references['parent_errors'];
|
1264 |
+
break;
|
1265 |
+
default:
|
1266 |
+
return '';
|
1267 |
+
} // switch $data_source
|
1268 |
+
|
1269 |
+
switch( $format ) {
|
1270 |
+
case 'commas':
|
1271 |
+
if ( is_numeric( $result ) )
|
1272 |
+
$result = number_format( (float)$result );
|
1273 |
+
break;
|
1274 |
+
default:
|
1275 |
+
// no change
|
1276 |
+
} // format
|
1277 |
+
|
1278 |
+
/*
|
1279 |
+
* Make numeric values sortable as strings, make all value non-empty
|
1280 |
+
*/
|
1281 |
+
if ( in_array( $data_source, array( 'file_size', 'pixels', 'width', 'height' ) ) )
|
1282 |
+
$result = str_pad( $result, 15, ' ', STR_PAD_LEFT );
|
1283 |
+
elseif ( empty( $result ) )
|
1284 |
+
$result = ' ';
|
1285 |
+
|
1286 |
+
return $result;
|
1287 |
+
} // _evaluate_data_source
|
1288 |
+
|
1289 |
+
/**
|
1290 |
+
* Evaluate custom field mapping updates for a post
|
1291 |
+
*
|
1292 |
+
* @since 1.10
|
1293 |
+
*
|
1294 |
+
* @param integer post ID to be evaluated
|
1295 |
+
* @param string category/scope to evaluate against: custom_field_mapping or single_attachment_mapping
|
1296 |
+
* @param array (optional) custom_field_mapping values, default NULL (use current option value)
|
1297 |
+
* @param array (optional) attachment_metadata, default NULL (use current postmeta database value)
|
1298 |
+
*
|
1299 |
+
* @return array Updates suitable for MLAData::mla_update_single_item, if any
|
1300 |
+
*/
|
1301 |
+
public static function mla_evaluate_custom_field_mapping( $post_id, $category, $settings = NULL, $attachment_metadata = NULL ) {
|
1302 |
+
if ( NULL == $settings )
|
1303 |
+
$settings = self::mla_get_option( 'custom_field_mapping' );
|
1304 |
+
|
1305 |
+
$updates = array();
|
1306 |
+
$custom_updates = array();
|
1307 |
+
|
1308 |
+
foreach( $settings as $new_key => $new_value ) {
|
1309 |
+
if ( 'none' == $new_value['data_source'] )
|
1310 |
+
continue;
|
1311 |
+
|
1312 |
+
if ( $new_value['keep_existing'] )
|
1313 |
+
$old_text = get_metadata( 'post', $post_id, $new_key, true );
|
1314 |
+
else
|
1315 |
+
$old_text = '';
|
1316 |
+
|
1317 |
+
if ( empty( $old_text ) )
|
1318 |
+
$custom_updates[ $new_value['name'] ] = self::_evaluate_data_source( $post_id, $category, $new_value['data_source'], $new_value['format'], $attachment_metadata );
|
1319 |
+
} // foreach new setting
|
1320 |
+
|
1321 |
+
if ( ! empty( $custom_updates ) )
|
1322 |
+
$updates['custom_updates'] = $custom_updates;
|
1323 |
+
|
1324 |
+
return $updates;
|
1325 |
+
} // mla_evaluate_custom_field_mapping
|
1326 |
+
|
1327 |
+
/**
|
1328 |
+
* Compose a Custom Field Options list with current selection
|
1329 |
+
*
|
1330 |
+
* @since 1.10
|
1331 |
+
* @uses $mla_option_templates contains row and table templates
|
1332 |
+
*
|
1333 |
+
* @param string current selection or 'none' (default)
|
1334 |
+
*
|
1335 |
+
* @return string HTML markup with select field options
|
1336 |
+
*/
|
1337 |
+
private static function _compose_custom_field_option_list( $selection = 'none' ) {
|
1338 |
+
$option_template = self::$mla_option_templates['custom-field-select-option'];
|
1339 |
+
$option_values = array (
|
1340 |
+
'selected' => ( 'none' == $selection ) ? 'selected="selected"' : '',
|
1341 |
+
'value' => 'none',
|
1342 |
+
'text' => ' -- None (select a value) -- '
|
1343 |
+
);
|
1344 |
+
|
1345 |
+
$custom_field_options = MLAData::mla_parse_template( $option_template, $option_values );
|
1346 |
+
$custom_field_names = MLAOptions::_get_custom_field_names();
|
1347 |
+
foreach ( $custom_field_names as $value ) {
|
1348 |
+
$option_values = array (
|
1349 |
+
'selected' => ( $value == $selection ) ? 'selected="selected"' : '',
|
1350 |
+
'value' => $value,
|
1351 |
+
'text' => $value
|
1352 |
+
);
|
1353 |
+
|
1354 |
+
$custom_field_options .= MLAData::mla_parse_template( $option_template, $option_values );
|
1355 |
+
} // foreach custom_field_name
|
1356 |
+
|
1357 |
+
return $custom_field_options;
|
1358 |
+
} // _compose_custom_field_option_list
|
1359 |
+
|
1360 |
+
/**
|
1361 |
+
* Array of Data Source names for custom field mapping
|
1362 |
+
*
|
1363 |
+
* @since 1.10
|
1364 |
+
*
|
1365 |
+
* @var array
|
1366 |
+
*/
|
1367 |
+
private static $custom_field_data_sources = array (
|
1368 |
+
'path',
|
1369 |
+
'file_name',
|
1370 |
+
'extension',
|
1371 |
+
'file_size',
|
1372 |
+
'dimensions',
|
1373 |
+
'pixels',
|
1374 |
+
'width',
|
1375 |
+
'height',
|
1376 |
+
'hwstring_small',
|
1377 |
+
'size_keys',
|
1378 |
+
'size_names',
|
1379 |
+
'size_bytes',
|
1380 |
+
'size_pixels',
|
1381 |
+
'size_dimensions',
|
1382 |
+
'size_name[size]',
|
1383 |
+
'size_bytes[size]',
|
1384 |
+
'size_pixels[size]',
|
1385 |
+
'size_dimensions[size]',
|
1386 |
+
'parent_type',
|
1387 |
+
'parent_title',
|
1388 |
+
'parent_issues',
|
1389 |
+
'reference_issues',
|
1390 |
+
'aperture',
|
1391 |
+
'credit',
|
1392 |
+
'camera',
|
1393 |
+
'caption',
|
1394 |
+
'created_timestamp',
|
1395 |
+
'copyright',
|
1396 |
+
'focal_length',
|
1397 |
+
'iso',
|
1398 |
+
'shutter_speed',
|
1399 |
+
'title'
|
1400 |
+
);
|
1401 |
+
|
1402 |
+
/**
|
1403 |
+
* Compose a (Custom Field) Data Source Options list with current selection
|
1404 |
+
*
|
1405 |
+
* @since 1.10
|
1406 |
+
* @uses $mla_option_templates contains row and table templates
|
1407 |
+
*
|
1408 |
+
* @param string current selection or 'none' (default)
|
1409 |
+
*
|
1410 |
+
* @return string HTML markup with select field options
|
1411 |
+
*/
|
1412 |
+
private static function _compose_data_source_option_list( $selection = 'none' ) {
|
1413 |
+
$option_template = self::$mla_option_templates['custom-field-select-option'];
|
1414 |
+
$option_values = array (
|
1415 |
+
'selected' => ( 'none' == $selection ) ? 'selected="selected"' : '',
|
1416 |
+
'value' => 'none',
|
1417 |
+
'text' => ' -- None (select a value) -- '
|
1418 |
+
);
|
1419 |
+
|
1420 |
+
$custom_field_options = MLAData::mla_parse_template( $option_template, $option_values );
|
1421 |
+
$intermediate_sizes = get_intermediate_image_sizes();
|
1422 |
+
|
1423 |
+
foreach ( self::$custom_field_data_sources as $value ) {
|
1424 |
+
$size_pos = strpos( $value, '[size]' );
|
1425 |
+
if ( $size_pos ) {
|
1426 |
+
$root_value = substr( $value, 0, $size_pos );
|
1427 |
+
foreach( $intermediate_sizes as $size_name ) {
|
1428 |
+
$value = $root_value . '[' . $size_name . ']';
|
1429 |
+
$option_values = array (
|
1430 |
+
'selected' => ( $value == $selection ) ? 'selected="selected"' : '',
|
1431 |
+
'value' => $value,
|
1432 |
+
'text' => $value
|
1433 |
+
);
|
1434 |
+
|
1435 |
+
$custom_field_options .= MLAData::mla_parse_template( $option_template, $option_values );
|
1436 |
+
} // foreach size_name
|
1437 |
+
continue;
|
1438 |
+
}
|
1439 |
+
else {
|
1440 |
+
$option_values = array (
|
1441 |
+
'selected' => ( $value == $selection ) ? 'selected="selected"' : '',
|
1442 |
+
'value' => $value,
|
1443 |
+
'text' => $value
|
1444 |
+
);
|
1445 |
+
}
|
1446 |
+
|
1447 |
+
$custom_field_options .= MLAData::mla_parse_template( $option_template, $option_values );
|
1448 |
+
} // foreach custom_field_name
|
1449 |
+
|
1450 |
+
return $custom_field_options;
|
1451 |
+
} // _compose_data_source_option_list
|
1452 |
+
|
1453 |
+
/**
|
1454 |
+
* Update custom field mappings
|
1455 |
+
*
|
1456 |
+
* @since 1.10
|
1457 |
+
*
|
1458 |
+
* @param array current custom_field_mapping values
|
1459 |
+
* @param array new values
|
1460 |
+
*
|
1461 |
+
* @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
|
1462 |
+
*/
|
1463 |
+
private static function _update_custom_field_mapping( $current_values, $new_values ) {
|
1464 |
+
$error_list = '';
|
1465 |
+
$message_list = '';
|
1466 |
+
$settings_changed = false;
|
1467 |
+
|
1468 |
+
foreach ( $new_values as $new_key => $new_value ) {
|
1469 |
+
$any_setting_changed = false;
|
1470 |
+
|
1471 |
+
/*
|
1472 |
+
* Check for the addition of a new rule or field
|
1473 |
+
*/
|
1474 |
+
if ( self::MLA_NEW_CUSTOM_FIELD == $new_key ) {
|
1475 |
+
$new_key = trim( $new_value['name'] );
|
1476 |
+
|
1477 |
+
if ( empty( $new_key ) )
|
1478 |
+
continue;
|
1479 |
+
|
1480 |
+
$message_list .= "<br>Adding new field {$new_key}.\r\n";
|
1481 |
+
$any_setting_changed = true;
|
1482 |
+
}
|
1483 |
+
elseif ( self::MLA_NEW_CUSTOM_RULE == $new_key ) {
|
1484 |
+
$new_key = trim( $new_value['name'] );
|
1485 |
+
|
1486 |
+
if ( 'none' == $new_key )
|
1487 |
+
continue;
|
1488 |
+
|
1489 |
+
$message_list .= "<br>Adding new rule for {$new_key}.\r\n";
|
1490 |
+
$any_setting_changed = true;
|
1491 |
+
}
|
1492 |
+
else {
|
1493 |
+
/*
|
1494 |
+
* Replace slug with field name
|
1495 |
+
*/
|
1496 |
+
$new_key = trim( $new_value['name'] );
|
1497 |
+
}
|
1498 |
+
|
1499 |
+
if ( isset( $current_values[ $new_key ] ) ) {
|
1500 |
+
$old_values = $current_values[ $new_key ];
|
1501 |
+
$any_setting_changed = false;
|
1502 |
+
}
|
1503 |
+
else {
|
1504 |
+
$old_values = array(
|
1505 |
+
'name' => $new_key,
|
1506 |
+
'data_source' => 'none',
|
1507 |
+
'keep_existing' => true,
|
1508 |
+
'format' => 'native',
|
1509 |
+
'mla_column' => false,
|
1510 |
+
'quick_edit' => false,
|
1511 |
+
'bulk_edit' => false
|
1512 |
+
);
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
if ( isset( $new_value['action'] ) ) {
|
1516 |
+
if ( array_key_exists( 'delete_rule', $new_value['action'] ) || array_key_exists( 'delete_field', $new_value['action'] ) ) {
|
1517 |
+
$settings_changed = true;
|
1518 |
+
$message_list .= "<br>deleting rule for {$old_values['name']}.\r\n";
|
1519 |
+
unset( $current_values[ $new_key ] );
|
1520 |
+
continue;
|
1521 |
+
} // delete rule
|
1522 |
+
} // isset action
|
1523 |
+
|
1524 |
+
if ( $old_values['data_source'] != $new_value['data_source'] ) {
|
1525 |
+
$any_setting_changed = true;
|
1526 |
+
$message_list .= "<br>{$old_values['name']} changing Data Source from {$old_values['data_source']} to {$new_value['data_source']}.\r\n";
|
1527 |
+
$old_values['data_source'] = $new_value['data_source'];
|
1528 |
+
}
|
1529 |
+
|
1530 |
+
if ( $new_value['keep_existing'] ) {
|
1531 |
+
$boolean_value = true;
|
1532 |
+
$boolean_text = 'Replace to Keep';
|
1533 |
+
}
|
1534 |
+
else {
|
1535 |
+
$boolean_value = false;
|
1536 |
+
$boolean_text = 'Keep to Replace';
|
1537 |
+
}
|
1538 |
+
if ( $old_values['keep_existing'] != $boolean_value ) {
|
1539 |
+
$any_setting_changed = true;
|
1540 |
+
$message_list .= "<br>{$old_values['name']} changing Existing Text value from {$boolean_text}.\r\n";
|
1541 |
+
$old_values['keep_existing'] = $boolean_value;
|
1542 |
+
}
|
1543 |
+
|
1544 |
+
if ( $old_values['format'] != $new_value['format'] ) {
|
1545 |
+
$any_setting_changed = true;
|
1546 |
+
$message_list .= "<br>{$old_values['name']} changing Format from {$old_values['format']} to {$new_value['format']}.\r\n";
|
1547 |
+
$old_values['format'] = $new_value['format'];
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
if ( isset( $new_value['mla_column'] ) ) {
|
1551 |
+
$boolean_value = true;
|
1552 |
+
$boolean_text = 'unchecked to checked';
|
1553 |
+
}
|
1554 |
+
else {
|
1555 |
+
$boolean_value = false;
|
1556 |
+
$boolean_text = 'checked to unchecked';
|
1557 |
+
}
|
1558 |
+
if ( $old_values['mla_column'] != $boolean_value ) {
|
1559 |
+
$any_setting_changed = true;
|
1560 |
+
$message_list .= "<br>{$old_values['name']} changing MLA Column value from {$boolean_text}.\r\n";
|
1561 |
+
$old_values['mla_column'] = $boolean_value;
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
if ( isset( $new_value['quick_edit'] ) ) {
|
1565 |
+
$boolean_value = true;
|
1566 |
+
$boolean_text = 'unchecked to checked';
|
1567 |
+
}
|
1568 |
+
else {
|
1569 |
+
$boolean_value = false;
|
1570 |
+
$boolean_text = 'checked to unchecked';
|
1571 |
+
}
|
1572 |
+
if ( $old_values['quick_edit'] != $boolean_value ) {
|
1573 |
+
$any_setting_changed = true;
|
1574 |
+
$message_list .= "<br>{$old_values['name']} changing Quick Edit value from {$boolean_text}.\r\n";
|
1575 |
+
$old_values['quick_edit'] = $boolean_value;
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
if ( isset( $new_value['bulk_edit'] ) ) {
|
1579 |
+
$boolean_value = true;
|
1580 |
+
$boolean_text = 'unchecked to checked';
|
1581 |
+
}
|
1582 |
+
else {
|
1583 |
+
$boolean_value = false;
|
1584 |
+
$boolean_text = 'checked to unchecked';
|
1585 |
+
}
|
1586 |
+
if ( $old_values['bulk_edit'] != $boolean_value ) {
|
1587 |
+
$any_setting_changed = true;
|
1588 |
+
$message_list .= "<br>{$old_values['name']} changing Bulk Edit value from {$boolean_text}.\r\n";
|
1589 |
+
$old_values['bulk_edit'] = $boolean_value;
|
1590 |
+
}
|
1591 |
+
|
1592 |
+
if ( $any_setting_changed ) {
|
1593 |
+
$settings_changed = true;
|
1594 |
+
$current_values[ $new_key ] = $old_values;
|
1595 |
+
}
|
1596 |
+
} // foreach new value
|
1597 |
+
|
1598 |
+
/*
|
1599 |
+
* Uncomment this for debugging.
|
1600 |
+
*/
|
1601 |
+
// $error_list .= $message_list;
|
1602 |
+
|
1603 |
+
return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
|
1604 |
+
} // _update_custom_field_mapping
|
1605 |
+
|
1606 |
+
/**
|
1607 |
+
* Render and manage custom field mapping options
|
1608 |
+
*
|
1609 |
+
* @since 1.10
|
1610 |
+
* @uses $mla_option_templates contains row and table templates
|
1611 |
+
*
|
1612 |
+
* @param string 'render', 'update', 'delete', or 'reset'
|
1613 |
+
* @param string option name, e.g., 'custom_field_mapping'
|
1614 |
+
* @param array option parameters
|
1615 |
+
* @param array Optional. null (default) for 'render' else option data, e.g., $_REQUEST
|
1616 |
+
*
|
1617 |
+
* @return string HTML table row markup for 'render' else message(s) reflecting the results of the operation.
|
1618 |
+
*/
|
1619 |
+
public static function mla_custom_field_option_handler( $action, $key, $value, $args = null ) {
|
1620 |
+
$current_values = self::mla_get_option( 'custom_field_mapping' );
|
1621 |
+
|
1622 |
+
switch ( $action ) {
|
1623 |
+
case 'render':
|
1624 |
+
if (empty( $current_values ) ) {
|
1625 |
+
$table_rows = MLAData::mla_parse_template( self::$mla_option_templates['custom-field-empty-row'], array( 'column_count' => 7 ) );
|
1626 |
+
}
|
1627 |
+
else {
|
1628 |
+
$row_template = self::$mla_option_templates['custom-field-rule-row'];
|
1629 |
+
$table_rows = '';
|
1630 |
+
}
|
1631 |
+
|
1632 |
+
foreach ( $current_values as $row_name => $current_value ) {
|
1633 |
+
$row_values = array (
|
1634 |
+
'key' => sanitize_title( $row_name ),
|
1635 |
+
'name' => $row_name,
|
1636 |
+
'data_source_options' => self::_compose_data_source_option_list( $current_value['data_source'] ),
|
1637 |
+
'keep_selected' => '',
|
1638 |
+
'replace_selected' => '',
|
1639 |
+
'native_format' => '',
|
1640 |
+
'commas_format' => '',
|
1641 |
+
'mla_column_checked' => '',
|
1642 |
+
'quick_edit_checked' => '',
|
1643 |
+
'bulk_edit_checked' => '',
|
1644 |
+
'column_count' => 7
|
1645 |
+
);
|
1646 |
+
|
1647 |
+
if ( $current_value['keep_existing'] )
|
1648 |
+
$row_values['keep_selected'] = 'selected="selected"';
|
1649 |
+
else
|
1650 |
+
$row_values['replace_selected'] = 'selected="selected"';
|
1651 |
+
|
1652 |
+
switch( $current_value['format'] ) {
|
1653 |
+
case 'native':
|
1654 |
+
$row_values['native_format'] = 'selected="selected"';
|
1655 |
+
break;
|
1656 |
+
case 'commas':
|
1657 |
+
$row_values['commas_format'] = 'selected="selected"';
|
1658 |
+
break;
|
1659 |
+
default:
|
1660 |
+
$row_values['native_format'] = 'selected="selected"';
|
1661 |
+
} // format
|
1662 |
+
|
1663 |
+
if ( $current_value['mla_column'] )
|
1664 |
+
$row_values['mla_column_checked'] = 'checked="checked"';
|
1665 |
+
|
1666 |
+
if ( $current_value['quick_edit'] )
|
1667 |
+
$row_values['quick_edit_checked'] = 'checked="checked"';
|
1668 |
+
|
1669 |
+
if ( $current_value['bulk_edit'] )
|
1670 |
+
$row_values['bulk_edit_checked'] = 'checked="checked"';
|
1671 |
+
|
1672 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
1673 |
+
} // foreach current_value
|
1674 |
+
|
1675 |
+
/*
|
1676 |
+
* Add a row for defining a new Custom Rule
|
1677 |
+
*/
|
1678 |
+
$row_template = self::$mla_option_templates['custom-field-new-rule-row'];
|
1679 |
+
$row_values = array (
|
1680 |
+
'key' => self::MLA_NEW_CUSTOM_RULE,
|
1681 |
+
'field_name_options' => self::_compose_custom_field_option_list( 'none' ),
|
1682 |
+
'data_source_options' => self::_compose_data_source_option_list( 'none' ),
|
1683 |
+
'keep_selected' => '',
|
1684 |
+
'replace_selected' => 'selected="selected"',
|
1685 |
+
'native_format' => 'selected="selected"',
|
1686 |
+
'commas_format' => '',
|
1687 |
+
'mla_column_checked' => '',
|
1688 |
+
'quick_edit_checked' => '',
|
1689 |
+
'bulk_edit_checked' => '',
|
1690 |
+
'column_count' => 7
|
1691 |
+
);
|
1692 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
1693 |
+
|
1694 |
+
/*
|
1695 |
+
* Add a row for defining a new Custom Field
|
1696 |
+
*/
|
1697 |
+
$row_template = self::$mla_option_templates['custom-field-new-field-row'];
|
1698 |
+
$row_values = array (
|
1699 |
+
'key' => self::MLA_NEW_CUSTOM_FIELD,
|
1700 |
+
'field_name_size' => '24',
|
1701 |
+
'data_source_options' => self::_compose_data_source_option_list( 'none' ),
|
1702 |
+
'keep_selected' => '',
|
1703 |
+
'replace_selected' => 'selected="selected"',
|
1704 |
+
'native_format' => 'selected="selected"',
|
1705 |
+
'commas_format' => '',
|
1706 |
+
'mla_column_checked' => '',
|
1707 |
+
'quick_edit_checked' => '',
|
1708 |
+
'bulk_edit_checked' => '',
|
1709 |
+
'column_count' => 7
|
1710 |
+
);
|
1711 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
1712 |
+
|
1713 |
+
$option_values = array (
|
1714 |
+
'table_rows' => $table_rows,
|
1715 |
+
'help' => $value['help']
|
1716 |
+
);
|
1717 |
+
|
1718 |
+
return MLAData::mla_parse_template( self::$mla_option_templates['custom-field-table'], $option_values );
|
1719 |
+
case 'update':
|
1720 |
+
case 'delete':
|
1721 |
+
$settings_changed = false;
|
1722 |
+
$messages = '';
|
1723 |
+
|
1724 |
+
$results = self::_update_custom_field_mapping( $current_values, $args );
|
1725 |
+
$messages .= $results['message'];
|
1726 |
+
$current_values = $results['values'];
|
1727 |
+
$settings_changed = $results['changed'];
|
1728 |
+
|
1729 |
+
if ( $settings_changed ) {
|
1730 |
+
$settings_changed = MLAOptions::mla_update_option( 'custom_field_mapping', $current_values );
|
1731 |
+
if ( $settings_changed )
|
1732 |
+
$results = "Custom field mapping rules updated.\r\n";
|
1733 |
+
else
|
1734 |
+
$results = "ERROR: Custom field mapping rules update failed.\r\n";
|
1735 |
+
}
|
1736 |
+
else
|
1737 |
+
$results = "Custom field no mapping rule changes detected.\r\n";
|
1738 |
+
|
1739 |
+
return $results . $messages;
|
1740 |
+
case 'reset':
|
1741 |
+
$current_values = self::$mla_option_definitions['custom_field_mapping']['std'];
|
1742 |
+
$settings_changed = MLAOptions::mla_update_option( 'custom_field_mapping', $current_values );
|
1743 |
+
if ( $settings_changed )
|
1744 |
+
return "Custom field mapping settings saved.\r\n";
|
1745 |
+
else
|
1746 |
+
return "ERROR: Custom field mapping settings reset failed.\r\n";
|
1747 |
+
default:
|
1748 |
+
return "<br>ERROR: Custom {$key} unknown action: {$action}\r\n";
|
1749 |
+
} // switch $action
|
1750 |
+
} // mla_custom_field_option_handler
|
1751 |
+
|
1752 |
+
/**
|
1753 |
+
* Evaluate IPTC/EXIF mapping updates for a post
|
1754 |
+
*
|
1755 |
+
* @since 1.00
|
1756 |
+
*
|
1757 |
+
* @param object post object with current values
|
1758 |
+
* @param string category to evaluate against, e.g., iptc_exif_standard_mapping or iptc_exif_mapping
|
1759 |
+
* @param array (optional) iptc_exif_mapping values, default - current option value
|
1760 |
+
*
|
1761 |
+
* @return array Updates suitable for MLAData::mla_update_single_item, if any
|
1762 |
+
*/
|
1763 |
+
public static function mla_evaluate_iptc_exif_mapping( $post, $category, $settings = NULL ) {
|
1764 |
+
$metadata = MLAData::mla_fetch_attachment_image_metadata( $post->ID );
|
1765 |
+
$iptc_metadata = $metadata['mla_iptc_metadata'];
|
1766 |
+
$updates = array();
|
1767 |
+
$update_all = ( 'iptc_exif_mapping' == $category );
|
1768 |
+
if ( NULL == $settings )
|
1769 |
+
$settings = self::mla_get_option( 'iptc_exif_mapping' );
|
1770 |
+
|
1771 |
+
if ( $update_all || ( 'iptc_exif_standard_mapping' == $category ) ) {}{
|
1772 |
+
foreach( $settings['standard'] as $new_key => $new_value ) {
|
1773 |
+
$iptc_value = ( isset( $iptc_metadata[ $new_value['iptc_value'] ] ) ) ? $iptc_metadata[ $new_value['iptc_value'] ] : '';
|
1774 |
+
$exif_value = MLAData::mla_exif_metadata_value( $new_value['exif_value'], $metadata );
|
1775 |
+
$keep_existing = (boolean) $new_value['keep_existing'];
|
1776 |
+
|
1777 |
+
if ( $new_value['iptc_first'] )
|
1778 |
+
if ( ! empty( $iptc_value ) )
|
1779 |
+
$new_text = $iptc_value;
|
1780 |
+
else
|
1781 |
+
$new_text = $exif_value;
|
1782 |
+
else
|
1783 |
+
if ( ! empty( $exif_value ) )
|
1784 |
+
$new_text = $exif_value;
|
1785 |
+
else
|
1786 |
+
$new_text = $iptc_value;
|
1787 |
+
|
1788 |
+
if ( is_array( $new_text ) ) {
|
1789 |
+
$new_text = implode( ',', $new_text );
|
1790 |
+
}
|
1791 |
+
|
1792 |
+
$new_text = trim( convert_chars( $new_text ) );
|
1793 |
+
if ( !empty( $new_text ) )
|
1794 |
+
switch ( $new_key ) {
|
1795 |
+
case 'post_title':
|
1796 |
+
if ( ( empty( $post->post_title ) || !$keep_existing ) &&
|
1797 |
+
( trim( $new_text ) && ! is_numeric( sanitize_title( $new_text ) ) ) )
|
1798 |
+
$updates[ $new_key ] = $new_text;
|
1799 |
+
break;
|
1800 |
+
case 'post_name':
|
1801 |
+
$updates[ $new_key ] = wp_unique_post_slug( sanitize_title( $new_text ), $post->ID, $post->post_status, $post->post_type, $post->post_parent);
|
1802 |
+
break;
|
1803 |
+
case 'image_alt':
|
1804 |
+
$old_text = get_metadata( 'post', $post->ID, '_wp_attachment_image_alt', true );
|
1805 |
+
if ( empty( $old_text ) || !$keep_existing ) {
|
1806 |
+
$updates[ $new_key ] = $new_text; }
|
1807 |
+
break;
|
1808 |
+
case 'post_excerpt':
|
1809 |
+
if ( empty( $post->post_excerpt ) || !$keep_existing )
|
1810 |
+
$updates[ $new_key ] = $new_text;
|
1811 |
+
break;
|
1812 |
+
case 'post_content':
|
1813 |
+
if ( empty( $post->post_content ) || !$keep_existing )
|
1814 |
+
$updates[ $new_key ] = $new_text;
|
1815 |
+
break;
|
1816 |
+
default:
|
1817 |
+
// ignore anything else
|
1818 |
+
} // $new_key
|
1819 |
+
} // foreach new setting
|
1820 |
+
} // update standard field mappings
|
1821 |
+
|
1822 |
+
if ( $update_all || ( 'iptc_exif_taxonomy_mapping' == $category ) ) {
|
1823 |
+
$tax_inputs = array();
|
1824 |
+
$tax_actions = array();
|
1825 |
+
|
1826 |
+
foreach( $settings['taxonomy'] as $new_key => $new_value ) {
|
1827 |
+
$iptc_value = ( isset( $iptc_metadata[ $new_value['iptc_value'] ] ) ) ? $iptc_metadata[ $new_value['iptc_value'] ] : '';
|
1828 |
+
$exif_value = MLAData::mla_exif_metadata_value( $new_value['exif_value'], $metadata );
|
1829 |
+
|
1830 |
+
$tax_action = ( $new_value['keep_existing'] ) ? 'add' : 'replace';
|
1831 |
+
$tax_parent = ( isset( $new_value['parent'] ) && (0 != (integer) $new_value['parent'] ) ) ? (integer) $new_value['parent'] : 0;
|
1832 |
+
|
1833 |
+
if ( $new_value['iptc_first'] )
|
1834 |
+
if ( ! empty( $iptc_value ) )
|
1835 |
+
$new_text = $iptc_value;
|
1836 |
+
else
|
1837 |
+
$new_text = $exif_value;
|
1838 |
+
else
|
1839 |
+
if ( ! empty( $exif_value ) )
|
1840 |
+
$new_text = $exif_value;
|
1841 |
+
else
|
1842 |
+
$new_text = $iptc_value;
|
1843 |
+
|
1844 |
+
if ( !empty( $new_text ) ) {
|
1845 |
+
if ( $new_value['hierarchical'] ) {
|
1846 |
+
if ( is_string( $new_text ) )
|
1847 |
+
$new_text = array( $new_text );
|
1848 |
+
|
1849 |
+
$new_terms = array();
|
1850 |
+
foreach( $new_text as $new_term ) {
|
1851 |
+
$term_object = term_exists( $new_term, $new_key );
|
1852 |
+
if ($term_object !== 0 && $term_object !== null)
|
1853 |
+
$new_terms[] = $term_object['term_id'];
|
1854 |
+
else {
|
1855 |
+
$term_object = wp_insert_term( $new_term, $new_key, array( 'parent' => $tax_parent ) );
|
1856 |
+
if ( isset( $term_object['term_id'] ) )
|
1857 |
+
$new_terms[] = $term_object['term_id'];
|
1858 |
+
}
|
1859 |
+
} // foreach new_term
|
1860 |
+
|
1861 |
+
$tax_inputs[ $new_key ] = $new_terms;
|
1862 |
+
} // hierarchical
|
1863 |
+
else {
|
1864 |
+
$tax_inputs[ $new_key ] = $new_text;
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
$tax_actions[ $new_key ] = $tax_action;
|
1868 |
+
} // new_text
|
1869 |
+
} // foreach new setting
|
1870 |
+
|
1871 |
+
if ( ! empty( $tax_inputs ) )
|
1872 |
+
$updates['taxonomy_updates'] = array ( 'inputs' => $tax_inputs, 'actions' => $tax_actions );
|
1873 |
+
} // update taxonomy term mappings
|
1874 |
+
|
1875 |
+
if ( $update_all || ( 'iptc_exif_custom_mapping' == $category ) ) {
|
1876 |
+
$custom_updates = array();
|
1877 |
+
|
1878 |
+
foreach( $settings['custom'] as $new_key => $new_value ) {
|
1879 |
+
$iptc_value = ( isset( $iptc_metadata[ $new_value['iptc_value'] ] ) ) ? $iptc_metadata[ $new_value['iptc_value'] ] : '';
|
1880 |
+
$exif_value = MLAData::mla_exif_metadata_value( $new_value['exif_value'], $metadata );
|
1881 |
+
|
1882 |
+
if ( $new_value['iptc_first'] )
|
1883 |
+
if ( ! empty( $iptc_value ) )
|
1884 |
+
$new_text = $iptc_value;
|
1885 |
+
else
|
1886 |
+
$new_text = $exif_value;
|
1887 |
+
else
|
1888 |
+
if ( ! empty( $exif_value ) )
|
1889 |
+
$new_text = $exif_value;
|
1890 |
+
else
|
1891 |
+
$new_text = $iptc_value;
|
1892 |
+
|
1893 |
+
if ( $new_value['keep_existing'] )
|
1894 |
+
$old_text = get_metadata( 'post', $post->ID, $new_key, true );
|
1895 |
+
else
|
1896 |
+
$old_text = '';
|
1897 |
+
|
1898 |
+
if ( is_array( $new_text ) ) {
|
1899 |
+
$new_text = implode( ',', $new_text );
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
if ( empty( $old_text ) ) {
|
1903 |
+
$custom_updates[ $new_key ] = $new_text;
|
1904 |
+
}
|
1905 |
+
} // foreach new setting
|
1906 |
+
|
1907 |
+
if ( ! empty( $custom_updates ) )
|
1908 |
+
$updates['custom_updates'] = $custom_updates;
|
1909 |
+
} // update custom field mappings
|
1910 |
+
|
1911 |
+
return $updates;
|
1912 |
+
} // mla_evaluate_iptc_exif_mapping
|
1913 |
+
|
1914 |
+
/**
|
1915 |
+
* Compose an IPTC Options list with current selection
|
1916 |
+
*
|
1917 |
+
* @since 1.00
|
1918 |
+
* @uses $mla_option_templates contains row and table templates
|
1919 |
+
*
|
1920 |
+
* @param string current selection or 'none' (default)
|
1921 |
+
*
|
1922 |
+
* @return string HTML markup with select field options
|
1923 |
+
*/
|
1924 |
+
private static function _compose_iptc_option_list( $selection = 'none' ) {
|
1925 |
+
$option_template = self::$mla_option_templates['iptc-exif-select-option'];
|
1926 |
+
$option_values = array (
|
1927 |
+
'selected' => ( 'none' == $selection ) ? 'selected="selected"' : '',
|
1928 |
+
'value' => 'none',
|
1929 |
+
'text' => ' -- None (select a value) -- '
|
1930 |
+
);
|
1931 |
+
|
1932 |
+
$iptc_options = MLAData::mla_parse_template( $option_template, $option_values );
|
1933 |
+
foreach ( MLAShortcodes::$mla_iptc_keys as $iptc_name => $iptc_code ) {
|
1934 |
+
$option_values = array (
|
1935 |
+
'selected' => ( $iptc_code == $selection ) ? 'selected="selected"' : '',
|
1936 |
+
'value' => $iptc_code,
|
1937 |
+
'text' => $iptc_code . ' ' . $iptc_name
|
1938 |
+
);
|
1939 |
+
|
1940 |
+
$iptc_options .= MLAData::mla_parse_template( $option_template, $option_values );
|
1941 |
+
} // foreach iptc_key
|
1942 |
+
|
1943 |
+
return $iptc_options;
|
1944 |
+
} // _compose_iptc_option_list
|
1945 |
+
|
1946 |
+
/**
|
1947 |
+
* Compose an hierarchical taxonomy Parent options list with current selection
|
1948 |
+
*
|
1949 |
+
* @since 1.00
|
1950 |
+
* @uses $mla_option_templates contains row and table templates
|
1951 |
+
*
|
1952 |
+
* @param string taxonomy slug
|
1953 |
+
* @param integer current selection or 0 (zero, default)
|
1954 |
+
*
|
1955 |
+
* @return string HTML markup with select field options
|
1956 |
+
*/
|
1957 |
+
private static function _compose_parent_option_list( $taxonomy, $selection = 0 ) {
|
1958 |
+
$option_template = self::$mla_option_templates['iptc-exif-select-option'];
|
1959 |
+
$option_values = array (
|
1960 |
+
'selected' => ( 0 == $selection ) ? 'selected="selected"' : '',
|
1961 |
+
'value' => 0,
|
1962 |
+
'text' => ' -- None (select a value) -- '
|
1963 |
+
);
|
1964 |
+
|
1965 |
+
$parent_options = MLAData::mla_parse_template( $option_template, $option_values );
|
1966 |
+
|
1967 |
+
$terms = get_terms( $taxonomy, array( 'orderby' => 'name', 'get' => 'all' ) );
|
1968 |
+
foreach ( $terms as $term ) {
|
1969 |
+
$option_values = array (
|
1970 |
+
'selected' => ( $term->term_id == $selection ) ? 'selected="selected"' : '',
|
1971 |
+
'value' => $term->term_id,
|
1972 |
+
'text' => $term->name
|
1973 |
+
);
|
1974 |
+
|
1975 |
+
$parent_options .= MLAData::mla_parse_template( $option_template, $option_values );
|
1976 |
+
} // foreach iptc_key
|
1977 |
+
|
1978 |
+
return $parent_options;
|
1979 |
+
} // _compose_parent_option_list
|
1980 |
+
|
1981 |
+
/**
|
1982 |
+
* Update Standard field portion of IPTC/EXIF mappings
|
1983 |
+
*
|
1984 |
+
* @since 1.00
|
1985 |
+
*
|
1986 |
+
* @param array current iptc_exif_mapping values
|
1987 |
+
* @param array new values
|
1988 |
+
*
|
1989 |
+
* @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
|
1990 |
+
*/
|
1991 |
+
private static function _update_iptc_exif_standard_mapping( $current_values, $new_values ) {
|
1992 |
+
$error_list = '';
|
1993 |
+
$message_list = '';
|
1994 |
+
$settings_changed = false;
|
1995 |
+
|
1996 |
+
foreach ( $new_values['standard'] as $new_key => $new_value ) {
|
1997 |
+
if ( isset( $current_values['standard'][ $new_key ] ) ) {
|
1998 |
+
$old_values = $current_values['standard'][ $new_key ];
|
1999 |
+
$any_setting_changed = false;
|
2000 |
+
}
|
2001 |
+
else {
|
2002 |
+
$error_list .= "<br>ERROR: No old values for {$new_key}.\r\n";
|
2003 |
+
continue;
|
2004 |
+
}
|
2005 |
+
|
2006 |
+
if ( $old_values['iptc_value'] != $new_value['iptc_value'] ) {
|
2007 |
+
$any_setting_changed = true;
|
2008 |
+
$message_list .= "<br>{$old_values['name']} changing IPTC Value from {$old_values['iptc_value']} to {$new_value['iptc_value']}.\r\n";
|
2009 |
+
$old_values['iptc_value'] = $new_value['iptc_value'];
|
2010 |
+
}
|
2011 |
+
|
2012 |
+
if ( $old_values['exif_value'] != $new_value['exif_value'] ) {
|
2013 |
+
$any_setting_changed = true;
|
2014 |
+
$message_list .= "<br>{$old_values['name']} changing EXIF Value from {$old_values['exif_value']} to {$new_value['exif_value']}.\r\n";
|
2015 |
+
$old_values['exif_value'] = $new_value['exif_value'];
|
2016 |
+
}
|
2017 |
+
|
2018 |
+
if ( $new_value['iptc_first'] ) {
|
2019 |
+
$boolean_value = true;
|
2020 |
+
$boolean_text = 'EXIF to IPTC';
|
2021 |
+
}
|
2022 |
+
else {
|
2023 |
+
$boolean_value = false;
|
2024 |
+
$boolean_text = 'IPTC to EXIF';
|
2025 |
+
}
|
2026 |
+
if ( $old_values['iptc_first'] != $boolean_value ) {
|
2027 |
+
$any_setting_changed = true;
|
2028 |
+
$message_list .= "<br>{$old_values['name']} changing Priority Value from {$boolean_text}.\r\n";
|
2029 |
+
$old_values['iptc_first'] = $boolean_value;
|
2030 |
+
}
|
2031 |
+
|
2032 |
+
if ( $new_value['keep_existing'] ) {
|
2033 |
+
$boolean_value = true;
|
2034 |
+
$boolean_text = 'Replace to Keep';
|
2035 |
+
}
|
2036 |
+
else {
|
2037 |
+
$boolean_value = false;
|
2038 |
+
$boolean_text = 'Keep to Replace';
|
2039 |
+
}
|
2040 |
+
if ( $old_values['keep_existing'] != $boolean_value ) {
|
2041 |
+
$any_setting_changed = true;
|
2042 |
+
$message_list .= "<br>{$old_values['name']} changing Existing Text Value from {$boolean_text}.\r\n";
|
2043 |
+
$old_values['keep_existing'] = $boolean_value;
|
2044 |
+
}
|
2045 |
+
|
2046 |
+
if ( $any_setting_changed ) {
|
2047 |
+
$settings_changed = true;
|
2048 |
+
$current_values['standard'][ $new_key ] = $old_values;
|
2049 |
+
}
|
2050 |
+
} // new standard value
|
2051 |
+
|
2052 |
+
/*
|
2053 |
+
* Uncomment this for debugging.
|
2054 |
+
*/
|
2055 |
+
// $error_list .= $message_list;
|
2056 |
+
|
2057 |
+
return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
|
2058 |
+
} // _update_iptc_exif_standard_mapping
|
2059 |
+
|
2060 |
+
/**
|
2061 |
+
* Update Taxonomy term portion of IPTC/EXIF mappings
|
2062 |
+
*
|
2063 |
+
* @since 1.00
|
2064 |
+
*
|
2065 |
+
* @param array current iptc_exif_mapping values
|
2066 |
+
* @param array new values
|
2067 |
+
*
|
2068 |
+
* @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
|
2069 |
+
*/
|
2070 |
+
private static function _update_iptc_exif_taxonomy_mapping( $current_values, $new_values ) {
|
2071 |
+
$error_list = '';
|
2072 |
+
$message_list = '';
|
2073 |
+
$settings_changed = false;
|
2074 |
+
|
2075 |
+
foreach ( $new_values['taxonomy'] as $new_key => $new_value ) {
|
2076 |
+
if ( isset( $current_values['taxonomy'][ $new_key ] ) ) {
|
2077 |
+
$old_values = $current_values['taxonomy'][ $new_key ];
|
2078 |
+
}
|
2079 |
+
else {
|
2080 |
+
$old_values = array(
|
2081 |
+
'name' => $new_value['name'],
|
2082 |
+
'hierarchical' => $new_value['hierarchical'],
|
2083 |
+
'iptc_value' => 'none',
|
2084 |
+
'exif_value' => '',
|
2085 |
+
'iptc_first' => true,
|
2086 |
+
'keep_existing' => true,
|
2087 |
+
'parent' => 0
|
2088 |
+
);
|
2089 |
+
}
|
2090 |
+
|
2091 |
+
$any_setting_changed = false;
|
2092 |
+
if ( $old_values['iptc_value'] != $new_value['iptc_value'] ) {
|
2093 |
+
$any_setting_changed = true;
|
2094 |
+
$message_list .= "<br>{$old_values['name']} changing IPTC Value from {$old_values['iptc_value']} to {$new_value['iptc_value']}.\r\n";
|
2095 |
+
$old_values['iptc_value'] = $new_value['iptc_value'];
|
2096 |
+
}
|
2097 |
+
|
2098 |
+
if ( $old_values['exif_value'] != $new_value['exif_value'] ) {
|
2099 |
+
$any_setting_changed = true;
|
2100 |
+
$message_list .= "<br>{$old_values['name']} changing EXIF Value from {$old_values['exif_value']} to {$new_value['exif_value']}.\r\n";
|
2101 |
+
$old_values['exif_value'] = $new_value['exif_value'];
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
if ( $new_value['iptc_first'] ) {
|
2105 |
+
$boolean_value = true;
|
2106 |
+
$boolean_text = 'EXIF to IPTC';
|
2107 |
+
}
|
2108 |
+
else {
|
2109 |
+
$boolean_value = false;
|
2110 |
+
$boolean_text = 'IPTC to EXIF';
|
2111 |
+
}
|
2112 |
+
if ( $old_values['iptc_first'] != $boolean_value ) {
|
2113 |
+
$any_setting_changed = true;
|
2114 |
+
$message_list .= "<br>{$old_values['name']} changing Priority Value from {$boolean_text}.\r\n";
|
2115 |
+
$old_values['iptc_first'] = $boolean_value;
|
2116 |
+
}
|
2117 |
+
|
2118 |
+
if ( $new_value['keep_existing'] ) {
|
2119 |
+
$boolean_value = true;
|
2120 |
+
$boolean_text = 'Replace to Keep';
|
2121 |
+
}
|
2122 |
+
else {
|
2123 |
+
$boolean_value = false;
|
2124 |
+
$boolean_text = 'Keep to Replace';
|
2125 |
+
}
|
2126 |
+
if ( $old_values['keep_existing'] != $boolean_value ) {
|
2127 |
+
$any_setting_changed = true;
|
2128 |
+
$message_list .= "<br>{$old_values['name']} changing Existing Text Value from {$boolean_text}.\r\n";
|
2129 |
+
$old_values['keep_existing'] = $boolean_value;
|
2130 |
+
}
|
2131 |
+
|
2132 |
+
if ( isset( $new_value['parent'] ) && ( $old_values['parent'] != $new_value['parent'] ) ) {
|
2133 |
+
$any_setting_changed = true;
|
2134 |
+
$message_list .= "<br>{$old_values['name']} changing Parent from {$old_values['parent']} to {$new_value['parent']}.\r\n";
|
2135 |
+
$old_values['parent'] = $new_value['parent'];
|
2136 |
+
}
|
2137 |
+
|
2138 |
+
if ( $any_setting_changed ) {
|
2139 |
+
$settings_changed = true;
|
2140 |
+
$current_values['taxonomy'][ $new_key ] = $old_values;
|
2141 |
+
}
|
2142 |
+
} // new taxonomy value
|
2143 |
+
|
2144 |
+
/*
|
2145 |
+
* Uncomment this for debugging.
|
2146 |
+
*/
|
2147 |
+
// $error_list .= $message_list;
|
2148 |
+
|
2149 |
+
return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
|
2150 |
+
} // _update_iptc_exif_taxonomy_mapping
|
2151 |
+
|
2152 |
+
/**
|
2153 |
+
* Update Custom field portion of IPTC/EXIF mappings
|
2154 |
+
*
|
2155 |
+
* @since 1.00
|
2156 |
+
*
|
2157 |
+
* @param array current iptc_exif_mapping values
|
2158 |
+
* @param array new values
|
2159 |
+
*
|
2160 |
+
* @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
|
2161 |
+
*/
|
2162 |
+
private static function _update_iptc_exif_custom_mapping( $current_values, $new_values ) {
|
2163 |
+
$error_list = '';
|
2164 |
+
$message_list = '';
|
2165 |
+
$settings_changed = false;
|
2166 |
+
|
2167 |
+
foreach ( $new_values['custom'] as $new_key => $new_value ) {
|
2168 |
+
$any_setting_changed = false;
|
2169 |
+
|
2170 |
+
/*
|
2171 |
+
* Check for the addition of a new field
|
2172 |
+
*/
|
2173 |
+
if ( self::MLA_NEW_CUSTOM_FIELD == $new_key ) {
|
2174 |
+
$new_key = trim( $new_value['name'] );
|
2175 |
+
|
2176 |
+
if ( empty( $new_key ) )
|
2177 |
+
continue;
|
2178 |
+
|
2179 |
+
$message_list .= "<br>Adding new field {$new_key}.\r\n";
|
2180 |
+
$any_setting_changed = true;
|
2181 |
+
}
|
2182 |
+
|
2183 |
+
if ( isset( $current_values['custom'][ $new_key ] ) ) {
|
2184 |
+
$old_values = $current_values['custom'][ $new_key ];
|
2185 |
+
$any_setting_changed = false;
|
2186 |
+
}
|
2187 |
+
else {
|
2188 |
+
$old_values = array(
|
2189 |
+
'name' => $new_key,
|
2190 |
+
'iptc_value' => 'none',
|
2191 |
+
'exif_value' => '',
|
2192 |
+
'iptc_first' => true,
|
2193 |
+
'keep_existing' => true
|
2194 |
+
);
|
2195 |
+
}
|
2196 |
+
|
2197 |
+
if ( $old_values['iptc_value'] != $new_value['iptc_value'] ) {
|
2198 |
+
$any_setting_changed = true;
|
2199 |
+
$message_list .= "<br>{$old_values['name']} changing IPTC Value from {$old_values['iptc_value']} to {$new_value['iptc_value']}.\r\n";
|
2200 |
+
$old_values['iptc_value'] = $new_value['iptc_value'];
|
2201 |
+
}
|
2202 |
+
|
2203 |
+
if ( $old_values['exif_value'] != $new_value['exif_value'] ) {
|
2204 |
+
$any_setting_changed = true;
|
2205 |
+
$message_list .= "<br>{$old_values['name']} changing EXIF Value from {$old_values['exif_value']} to {$new_value['exif_value']}.\r\n";
|
2206 |
+
$old_values['exif_value'] = $new_value['exif_value'];
|
2207 |
+
}
|
2208 |
+
|
2209 |
+
if ( $new_value['iptc_first'] ) {
|
2210 |
+
$boolean_value = true;
|
2211 |
+
$boolean_text = 'EXIF to IPTC';
|
2212 |
+
}
|
2213 |
+
else {
|
2214 |
+
$boolean_value = false;
|
2215 |
+
$boolean_text = 'IPTC to EXIF';
|
2216 |
+
}
|
2217 |
+
if ( $old_values['iptc_first'] != $boolean_value ) {
|
2218 |
+
$any_setting_changed = true;
|
2219 |
+
$message_list .= "<br>{$old_values['name']} changing Priority Value from {$boolean_text}.\r\n";
|
2220 |
+
$old_values['iptc_first'] = $boolean_value;
|
2221 |
+
}
|
2222 |
+
|
2223 |
+
if ( $new_value['keep_existing'] ) {
|
2224 |
+
$boolean_value = true;
|
2225 |
+
$boolean_text = 'Replace to Keep';
|
2226 |
+
}
|
2227 |
+
else {
|
2228 |
+
$boolean_value = false;
|
2229 |
+
$boolean_text = 'Keep to Replace';
|
2230 |
+
}
|
2231 |
+
if ( $old_values['keep_existing'] != $boolean_value ) {
|
2232 |
+
$any_setting_changed = true;
|
2233 |
+
$message_list .= "<br>{$old_values['name']} changing Existing Text Value from {$boolean_text}.\r\n";
|
2234 |
+
$old_values['keep_existing'] = $boolean_value;
|
2235 |
+
}
|
2236 |
+
|
2237 |
+
if ( $any_setting_changed ) {
|
2238 |
+
$settings_changed = true;
|
2239 |
+
$current_values['custom'][ $new_key ] = $old_values;
|
2240 |
+
}
|
2241 |
+
} // new standard value
|
2242 |
+
|
2243 |
+
/*
|
2244 |
+
* Uncomment this for debugging.
|
2245 |
+
*/
|
2246 |
+
// $error_list .= $message_list;
|
2247 |
+
|
2248 |
+
return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
|
2249 |
+
} // _update_iptc_exif_custom_mapping
|
2250 |
+
|
2251 |
+
/**
|
2252 |
+
* Generate a list of all (post) Custom Field names
|
2253 |
+
*
|
2254 |
+
* @since 1.00
|
2255 |
+
*
|
2256 |
+
* @return array Custom field names from the postmeta table
|
2257 |
+
*/
|
2258 |
+
private static function _get_custom_field_names( ) {
|
2259 |
+
global $wpdb;
|
2260 |
+
$limit = (int) apply_filters( 'postmeta_form_limit', 30 );
|
2261 |
+
$keys = $wpdb->get_col( "
|
2262 |
+
SELECT meta_key
|
2263 |
+
FROM $wpdb->postmeta
|
2264 |
+
GROUP BY meta_key
|
2265 |
+
HAVING meta_key NOT LIKE '\_%'
|
2266 |
+
ORDER BY meta_key
|
2267 |
+
LIMIT $limit" );
|
2268 |
+
if ( $keys )
|
2269 |
+
natcasesort($keys);
|
2270 |
+
|
2271 |
+
return $keys;
|
2272 |
+
} // _get_custom_field_names
|
2273 |
+
|
2274 |
+
/**
|
2275 |
+
* Render and manage iptc/exif support options
|
2276 |
+
*
|
2277 |
+
* @since 1.00
|
2278 |
+
* @uses $mla_option_templates contains row and table templates
|
2279 |
+
*
|
2280 |
+
* @param string 'render', 'update', 'delete', or 'reset'
|
2281 |
+
* @param string option name, e.g., 'iptc_exif_mapping'
|
2282 |
+
* @param array option parameters
|
2283 |
+
* @param array Optional. null (default) for 'render' else option data, e.g., $_REQUEST
|
2284 |
+
*
|
2285 |
+
* @return string HTML table row markup for 'render' else message(s) reflecting the results of the operation.
|
2286 |
+
*/
|
2287 |
+
public static function mla_iptc_exif_option_handler( $action, $key, $value, $args = null ) {
|
2288 |
+
$current_values = self::mla_get_option( 'iptc_exif_mapping' );
|
2289 |
+
|
2290 |
+
switch ( $action ) {
|
2291 |
+
case 'render':
|
2292 |
+
|
2293 |
+
switch ( $key ) {
|
2294 |
+
case 'iptc_exif_standard_mapping':
|
2295 |
+
$row_template = self::$mla_option_templates['iptc-exif-standard-row'];
|
2296 |
+
$table_rows = '';
|
2297 |
+
|
2298 |
+
foreach ( $current_values['standard'] as $row_name => $row_value ) {
|
2299 |
+
$row_values = array (
|
2300 |
+
'key' => $row_name,
|
2301 |
+
'name' => $row_value['name'],
|
2302 |
+
'iptc_field_options' => self::_compose_iptc_option_list( $row_value['iptc_value'] ),
|
2303 |
+
'exif_size' => 20,
|
2304 |
+
'exif_text' => $row_value['exif_value'],
|
2305 |
+
'iptc_selected' => '',
|
2306 |
+
'exif_selected' => '',
|
2307 |
+
'keep_selected' => '',
|
2308 |
+
'replace_selected' => ''
|
2309 |
+
);
|
2310 |
+
|
2311 |
+
if ( $row_value['iptc_first'] )
|
2312 |
+
$row_values['iptc_selected'] = 'selected="selected"';
|
2313 |
+
else
|
2314 |
+
$row_values['exif_selected'] = 'selected="selected"';
|
2315 |
+
|
2316 |
+
if ( $row_value['keep_existing'] )
|
2317 |
+
$row_values['keep_selected'] = 'selected="selected"';
|
2318 |
+
else
|
2319 |
+
$row_values['replace_selected'] = 'selected="selected"';
|
2320 |
+
|
2321 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
2322 |
+
} // foreach row
|
2323 |
+
|
2324 |
+
$option_values = array (
|
2325 |
+
'table_rows' => $table_rows,
|
2326 |
+
'help' => $value['help']
|
2327 |
+
);
|
2328 |
+
|
2329 |
+
return MLAData::mla_parse_template( self::$mla_option_templates['iptc-exif-standard-table'], $option_values );
|
2330 |
+
case 'iptc_exif_taxonomy_mapping':
|
2331 |
+
$row_template = self::$mla_option_templates['iptc-exif-taxonomy-row'];
|
2332 |
+
$select_template = self::$mla_option_templates['iptc-exif-select'];
|
2333 |
+
$table_rows = '';
|
2334 |
+
$taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'objects' );
|
2335 |
+
|
2336 |
+
foreach ( $taxonomies as $row_name => $row_value ) {
|
2337 |
+
$row_values = array (
|
2338 |
+
'key' => $row_name,
|
2339 |
+
'name' => esc_html( $row_value->labels->name ),
|
2340 |
+
'hierarchical' => (string) $row_value->hierarchical,
|
2341 |
+
'iptc_field_options' => '',
|
2342 |
+
'exif_size' => 20,
|
2343 |
+
'exif_text' => '',
|
2344 |
+
'iptc_selected' => '',
|
2345 |
+
'exif_selected' => '',
|
2346 |
+
'keep_selected' => '',
|
2347 |
+
'replace_selected' => '',
|
2348 |
+
'parent_select' => ''
|
2349 |
+
);
|
2350 |
+
|
2351 |
+
if ( array_key_exists( $row_name, $current_values['taxonomy'] ) ) {
|
2352 |
+
$current_value = $current_values['taxonomy'][ $row_name ];
|
2353 |
+
$row_values['iptc_field_options'] = self::_compose_iptc_option_list( $current_value['iptc_value'] );
|
2354 |
+
$row_values['exif_text'] = $current_value['exif_value'];
|
2355 |
+
|
2356 |
+
if ( $current_value['iptc_first'] )
|
2357 |
+
$row_values['iptc_selected'] = 'selected="selected"';
|
2358 |
+
else
|
2359 |
+
$row_values['exif_selected'] = 'selected="selected"';
|
2360 |
+
|
2361 |
+
if ( $current_value['keep_existing'] )
|
2362 |
+
$row_values['keep_selected'] = 'selected="selected"';
|
2363 |
+
else
|
2364 |
+
$row_values['replace_selected'] = 'selected="selected"';
|
2365 |
+
|
2366 |
+
if ( $row_value->hierarchical ) {
|
2367 |
+
$parent = ( isset( $current_value['parent'] ) ) ? (integer) $current_value['parent'] : 0;
|
2368 |
+
$select_values = array (
|
2369 |
+
'array' => 'taxonomy',
|
2370 |
+
'key' => $row_name,
|
2371 |
+
'element' => 'parent',
|
2372 |
+
'options' => self::_compose_parent_option_list( $row_name, $parent )
|
2373 |
+
);
|
2374 |
+
$row_values['parent_select'] = MLAData::mla_parse_template( $select_template, $select_values );
|
2375 |
+
}
|
2376 |
+
}
|
2377 |
+
else {
|
2378 |
+
$row_values['iptc_field_options'] = self::_compose_iptc_option_list( 'none' );
|
2379 |
+
$row_values['iptc_selected'] = 'selected="selected"';
|
2380 |
+
$row_values['keep_selected'] = 'selected="selected"';
|
2381 |
+
|
2382 |
+
if ( $row_value->hierarchical ) {
|
2383 |
+
$select_values = array (
|
2384 |
+
'array' => 'taxonomy',
|
2385 |
+
'key' => $row_name,
|
2386 |
+
'element' => 'parent',
|
2387 |
+
'options' => self::_compose_parent_option_list( $row_name, 0 )
|
2388 |
+
);
|
2389 |
+
$row_values['parent_select'] = MLAData::mla_parse_template( $select_template, $select_values );
|
2390 |
+
}
|
2391 |
+
}
|
2392 |
+
|
2393 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
2394 |
+
} // foreach row
|
2395 |
+
|
2396 |
+
$option_values = array (
|
2397 |
+
'table_rows' => $table_rows,
|
2398 |
+
'help' => $value['help']
|
2399 |
+
);
|
2400 |
+
|
2401 |
+
return MLAData::mla_parse_template( self::$mla_option_templates['iptc-exif-taxonomy-table'], $option_values );
|
2402 |
+
case 'iptc_exif_custom_mapping':
|
2403 |
+
$custom_field_names = MLAOptions::_get_custom_field_names();
|
2404 |
+
$row_template = self::$mla_option_templates['iptc-exif-custom-row'];
|
2405 |
+
$table_rows = '';
|
2406 |
+
|
2407 |
+
/*
|
2408 |
+
* Add fields defined here but not yet assigned to any attachments
|
2409 |
+
*/
|
2410 |
+
foreach ( $current_values['custom'] as $row_name => $row_values ) {
|
2411 |
+
if ( in_array( $row_name, $custom_field_names ) )
|
2412 |
+
continue;
|
2413 |
+
|
2414 |
+
$custom_field_names[] = $row_name;
|
2415 |
+
}
|
2416 |
+
|
2417 |
+
foreach ( $custom_field_names as $row_name ) {
|
2418 |
+
$row_values = array (
|
2419 |
+
'key' => $row_name,
|
2420 |
+
'name' => $row_name,
|
2421 |
+
'iptc_field_options' => '',
|
2422 |
+
'exif_size' => 20,
|
2423 |
+
'exif_text' => '',
|
2424 |
+
'iptc_selected' => '',
|
2425 |
+
'exif_selected' => '',
|
2426 |
+
'keep_selected' => '',
|
2427 |
+
'replace_selected' => ''
|
2428 |
+
);
|
2429 |
+
|
2430 |
+
if ( array_key_exists( $row_name, $current_values['custom'] ) ) {
|
2431 |
+
$current_value = $current_values['custom'][ $row_name ];
|
2432 |
+
$row_values['iptc_field_options'] = self::_compose_iptc_option_list( $current_value['iptc_value'] );
|
2433 |
+
$row_values['exif_text'] = $current_value['exif_value'];
|
2434 |
+
|
2435 |
+
if ( $current_value['iptc_first'] )
|
2436 |
+
$row_values['iptc_selected'] = 'selected="selected"';
|
2437 |
+
else
|
2438 |
+
$row_values['exif_selected'] = 'selected="selected"';
|
2439 |
+
|
2440 |
+
if ( $current_value['keep_existing'] )
|
2441 |
+
$row_values['keep_selected'] = 'selected="selected"';
|
2442 |
+
else
|
2443 |
+
$row_values['replace_selected'] = 'selected="selected"';
|
2444 |
+
}
|
2445 |
+
else {
|
2446 |
+
$row_values['iptc_field_options'] = self::_compose_iptc_option_list( 'none' );
|
2447 |
+
$row_values['iptc_selected'] = 'selected="selected"';
|
2448 |
+
$row_values['keep_selected'] = 'selected="selected"';
|
2449 |
+
|
2450 |
+
}
|
2451 |
+
|
2452 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
2453 |
+
} // foreach row
|
2454 |
+
|
2455 |
+
/*
|
2456 |
+
* Add a row for defining a new Custom Field
|
2457 |
+
*/
|
2458 |
+
$row_values = array (
|
2459 |
+
'key' => self::MLA_NEW_CUSTOM_FIELD,
|
2460 |
+
'name' => ' <input name="iptc_exif_mapping[custom][' . self::MLA_NEW_CUSTOM_FIELD . '][name]" id="iptc_exif_standard_exif_field_' . self::MLA_NEW_CUSTOM_FIELD . '" type="text" size="20" value="" />',
|
2461 |
+
'iptc_field_options' => self::_compose_iptc_option_list( 'none' ),
|
2462 |
+
'exif_size' => 20,
|
2463 |
+
'exif_text' => '',
|
2464 |
+
'iptc_selected' => 'selected="selected"',
|
2465 |
+
'exif_selected' => '',
|
2466 |
+
'keep_selected' => 'selected="selected"',
|
2467 |
+
'replace_selected' => ''
|
2468 |
+
);
|
2469 |
+
$table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
|
2470 |
+
|
2471 |
+
$option_values = array (
|
2472 |
+
'table_rows' => $table_rows,
|
2473 |
+
'help' => $value['help']
|
2474 |
+
);
|
2475 |
+
|
2476 |
+
return MLAData::mla_parse_template( self::$mla_option_templates['iptc-exif-custom-table'], $option_values );
|
2477 |
+
default:
|
2478 |
+
return "<br>ERROR: Render unknown custom {$key}\r\n";
|
2479 |
+
} // switch $key
|
2480 |
+
case 'update':
|
2481 |
+
case 'delete':
|
2482 |
+
$settings_changed = false;
|
2483 |
+
$messages = '';
|
2484 |
+
|
2485 |
+
switch ( $key ) {
|
2486 |
+
case 'iptc_exif_standard_mapping':
|
2487 |
+
$results = self::_update_iptc_exif_standard_mapping( $current_values, $args );
|
2488 |
+
$messages .= $results['message'];
|
2489 |
+
$current_values = $results['values'];
|
2490 |
+
$settings_changed = $results['changed'];
|
2491 |
+
break;
|
2492 |
+
case 'iptc_exif_taxonomy_mapping':
|
2493 |
+
$results = self::_update_iptc_exif_taxonomy_mapping( $current_values, $args );
|
2494 |
+
$messages .= $results['message'];
|
2495 |
+
$current_values = $results['values'];
|
2496 |
+
$settings_changed = $results['changed'];
|
2497 |
+
break;
|
2498 |
+
case 'iptc_exif_custom_mapping':
|
2499 |
+
$results = self::_update_iptc_exif_custom_mapping( $current_values, $args );
|
2500 |
+
$messages .= $results['message'];
|
2501 |
+
$current_values = $results['values'];
|
2502 |
+
$settings_changed = $results['changed'];
|
2503 |
+
break;
|
2504 |
+
case 'iptc_exif_mapping':
|
2505 |
+
$results = self::_update_iptc_exif_standard_mapping( $current_values, $args );
|
2506 |
+
$messages .= $results['message'];
|
2507 |
+
$current_values = $results['values'];
|
2508 |
+
$settings_changed = $results['changed'];
|
2509 |
+
|
2510 |
+
$results = self::_update_iptc_exif_taxonomy_mapping( $current_values, $args );
|
2511 |
+
$messages .= $results['message'];
|
2512 |
+
$current_values = $results['values'];
|
2513 |
+
$settings_changed |= $results['changed'];
|
2514 |
+
|
2515 |
+
$results = self::_update_iptc_exif_custom_mapping( $current_values, $args );
|
2516 |
+
$messages .= $results['message'];
|
2517 |
+
$current_values = $results['values'];
|
2518 |
+
$settings_changed |= $results['changed'];
|
2519 |
+
break;
|
2520 |
+
default:
|
2521 |
+
return "<br>ERROR: Update/delete unknown custom {$key}\r\n";
|
2522 |
+
} // switch $key
|
2523 |
+
|
2524 |
+
if ( $settings_changed ) {
|
2525 |
+
$settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
|
2526 |
+
if ( $settings_changed )
|
2527 |
+
$results = "IPTC/EXIF mapping settings updated.\r\n";
|
2528 |
+
else
|
2529 |
+
$results = "ERROR: IPTC/EXIF settings update failed.\r\n";
|
2530 |
+
}
|
2531 |
+
else
|
2532 |
+
$results = "IPTC/EXIF no mapping changes detected.\r\n";
|
2533 |
+
|
2534 |
+
return $results . $messages;
|
2535 |
+
case 'reset':
|
2536 |
+
switch ( $key ) {
|
2537 |
+
case 'iptc_exif_standard_mapping':
|
2538 |
+
$current_values['standard'] = self::$mla_option_definitions['iptc_exif_mapping']['std']['standard'];
|
2539 |
+
$settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
|
2540 |
+
if ( $settings_changed )
|
2541 |
+
return "IPTC/EXIF Standard field settings saved.\r\n";
|
2542 |
+
else
|
2543 |
+
return "ERROR: IPTC/EXIF Standard field settings update failed.\r\n";
|
2544 |
+
case 'iptc_exif_taxonomy_mapping':
|
2545 |
+
$current_values['taxonomy'] = self::$mla_option_definitions['iptc_exif_mapping']['std']['taxonomy'];
|
2546 |
+
$settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
|
2547 |
+
if ( $settings_changed )
|
2548 |
+
return "IPTC/EXIF Taxonomy term settings saved.\r\n";
|
2549 |
+
else
|
2550 |
+
return "ERROR: IPTC/EXIF Taxonomy term settings update failed.\r\n";
|
2551 |
+
case 'iptc_exif_custom_mapping':
|
2552 |
+
$current_values['custom'] = self::$mla_option_definitions['iptc_exif_mapping']['std']['custom'];
|
2553 |
+
$settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
|
2554 |
+
if ( $settings_changed )
|
2555 |
+
return "IPTC/EXIF Custom field settings saved.\r\n";
|
2556 |
+
else
|
2557 |
+
return "ERROR: IPTC/EXIF Custom field settings reset failed.\r\n";
|
2558 |
+
case 'iptc_exif_mapping':
|
2559 |
+
self::mla_delete_option( $key );
|
2560 |
+
return "<br>Reset custom {$key}\r\n";
|
2561 |
+
default:
|
2562 |
+
return "<br>ERROR: Reset unknown custom {$key}\r\n";
|
2563 |
+
} // switch $key
|
2564 |
+
default:
|
2565 |
+
return "<br>ERROR: Custom {$key} unknown action: {$action}\r\n";
|
2566 |
+
} // switch $action
|
2567 |
+
} // mla_iptc_exif_option_handler
|
2568 |
+
} // class MLAOptions
|
2569 |
+
?>
|
includes/class-mla-settings.php
CHANGED
@@ -1,99 +1,120 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Manages the
|
4 |
*
|
5 |
* @package Media Library Assistant
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
|
9 |
/**
|
10 |
-
* Class MLA (Media Library Assistant) Settings
|
11 |
-
* and provides the settings page to edit them.
|
12 |
*
|
13 |
* @package Media Library Assistant
|
14 |
* @since 0.1
|
15 |
*/
|
16 |
class MLASettings {
|
17 |
/**
|
18 |
-
* Provides a unique name for the settings page
|
19 |
*/
|
20 |
const MLA_SETTINGS_SLUG = 'mla-settings-menu';
|
21 |
|
22 |
/**
|
23 |
-
*
|
24 |
-
* Each option is defined by an array with the following elements:
|
25 |
*
|
26 |
-
*
|
27 |
*
|
28 |
-
*
|
29 |
-
* type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea'
|
30 |
-
* std => default value
|
31 |
-
* help => help text
|
32 |
-
* size => text size, default 40
|
33 |
-
* cols => textbox columns, default 90
|
34 |
-
* rows => textbox rows, default 5
|
35 |
-
* options => array of radio or select option values
|
36 |
*/
|
37 |
-
|
38 |
-
'
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
'attachment_category' =>
|
43 |
-
array('name' => 'Attachment Categories',
|
44 |
-
'type' => 'checkbox',
|
45 |
-
'std' => 'checked',
|
46 |
-
'help' => 'Check this option to add support for Attachment Categories.'),
|
47 |
-
|
48 |
-
'attachment_tag' =>
|
49 |
-
array('name' => 'Attachment Tags',
|
50 |
-
'type' => 'checkbox',
|
51 |
-
'std' => 'checked',
|
52 |
-
'help' => 'Check this option to add support for Attachment Tags.'),
|
53 |
-
|
54 |
-
/* Here are examples of the other option types
|
55 |
-
'testvalues' =>
|
56 |
-
array('name' => 'Test Values',
|
57 |
-
'type' => 'header'),
|
58 |
-
|
59 |
-
'radio' =>
|
60 |
-
array('name' => 'Radio List',
|
61 |
-
'type' => 'radio',
|
62 |
-
'std' => 'No',
|
63 |
-
'options' => array('No', 'Yes'),
|
64 |
-
'help' => 'This is your help text.'),
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
'rows' => 4,
|
86 |
-
'help' => 'Enter the text area...'),
|
87 |
-
*/
|
88 |
-
);
|
89 |
|
90 |
/**
|
91 |
-
*
|
92 |
*
|
93 |
-
*
|
|
|
|
|
|
|
|
|
94 |
*/
|
95 |
-
public static function
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
@@ -101,11 +122,15 @@ class MLASettings {
|
|
101 |
* add settings link in the Plugins section entry for MLA.
|
102 |
*
|
103 |
* @since 0.1
|
|
|
|
|
104 |
*/
|
105 |
public static function mla_admin_menu_action( ) {
|
106 |
$hook = add_submenu_page( 'options-general.php', 'Media Library Assistant Settings', 'Media Library Assistant', 'manage_options', self::MLA_SETTINGS_SLUG, 'MLASettings::mla_render_settings_page' );
|
107 |
|
108 |
add_filter( 'plugin_action_links', 'MLASettings::mla_add_plugin_settings_link', 10, 2 );
|
|
|
|
|
109 |
}
|
110 |
|
111 |
/**
|
@@ -128,91 +153,293 @@ class MLASettings {
|
|
128 |
}
|
129 |
|
130 |
/**
|
131 |
-
*
|
132 |
-
*
|
133 |
-
* @since 0.1
|
134 |
*
|
135 |
-
* @
|
|
|
|
|
|
|
|
|
136 |
*
|
137 |
-
* @return
|
138 |
*/
|
139 |
-
|
140 |
-
if (
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
-
*
|
152 |
-
*
|
153 |
-
* @since 0.1
|
154 |
*
|
155 |
-
* @
|
156 |
-
* @
|
|
|
|
|
|
|
157 |
*
|
158 |
-
* @return
|
159 |
*/
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
-
return
|
165 |
}
|
166 |
|
167 |
/**
|
168 |
-
*
|
169 |
*
|
170 |
-
*
|
|
|
171 |
*
|
172 |
-
* @
|
173 |
*
|
174 |
-
* @
|
175 |
*/
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
-
|
|
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
-
*
|
186 |
*
|
187 |
-
* @since 0.
|
188 |
-
*
|
189 |
-
|
|
|
190 |
*/
|
191 |
-
|
192 |
-
if ( !current_user_can( 'manage_options' ) ) {
|
193 |
-
echo "Media Library Assistant - Error</h2>\r\n";
|
194 |
-
wp_die( __( 'You do not have permission to manage plugin settings.' ) );
|
195 |
-
}
|
196 |
-
|
197 |
-
/*
|
198 |
-
* Load template array and initialize page-level values.
|
199 |
-
*/
|
200 |
-
$page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-display-settings-page.tpl' );
|
201 |
-
$page_values = array(
|
202 |
-
'messages' => '',
|
203 |
-
'options_list' => '',
|
204 |
-
'mla_admin_action' => MLA::MLA_ADMIN_SINGLE_EDIT_UPDATE,
|
205 |
-
'page' => self::MLA_SETTINGS_SLUG,
|
206 |
-
'_wpnonce' => wp_nonce_field( MLA::MLA_ADMIN_NONCE )
|
207 |
-
);
|
208 |
-
|
209 |
/*
|
210 |
* Check for submit buttons to change or reset settings.
|
|
|
211 |
*/
|
212 |
-
if ( !empty( $_REQUEST['save'] ) ) {
|
213 |
-
|
214 |
-
|
215 |
-
|
|
|
|
|
216 |
} else {
|
217 |
$page_content = array(
|
218 |
'message' => '',
|
@@ -221,10 +448,16 @@ class MLASettings {
|
|
221 |
}
|
222 |
|
223 |
if ( !empty( $page_content['body'] ) ) {
|
224 |
-
|
225 |
-
return;
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
/*
|
229 |
* $custom_fields documents the name and description of custom fields
|
230 |
*/
|
@@ -233,245 +466,1207 @@ class MLASettings {
|
|
233 |
);
|
234 |
|
235 |
/*
|
236 |
-
* $shortcodes documents the name and description of
|
237 |
*/
|
238 |
$shortcodes = array(
|
239 |
// array("name" => "shortcode", "description" => "This shortcode...")
|
|
|
|
|
240 |
);
|
241 |
|
|
|
|
|
|
|
|
|
|
|
242 |
|
243 |
-
$
|
244 |
-
|
245 |
-
|
246 |
-
case 'checkbox':
|
247 |
-
$option_values = array(
|
248 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
249 |
-
'checked' => '',
|
250 |
-
'value' => $value['name'],
|
251 |
-
'help' => $value['help']
|
252 |
-
);
|
253 |
-
|
254 |
-
if ( 'checked' == self::mla_get_option( $key ) )
|
255 |
-
$option_values['checked'] = 'checked="checked"';
|
256 |
-
|
257 |
-
$options_list .= MLAData::mla_parse_template( $page_template_array['checkbox'], $option_values );
|
258 |
-
break;
|
259 |
-
case 'header':
|
260 |
-
$option_values = array(
|
261 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
262 |
-
'value' => $value['name']
|
263 |
-
);
|
264 |
-
|
265 |
-
$options_list .= MLAData::mla_parse_template( $page_template_array['header'], $option_values );
|
266 |
-
break;
|
267 |
-
case 'radio':
|
268 |
-
$radio_options = '';
|
269 |
-
foreach ( $value['options'] as $optid => $option ) {
|
270 |
-
$option_values = array(
|
271 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
272 |
-
'checked' => '',
|
273 |
-
'value' => $option
|
274 |
-
);
|
275 |
-
|
276 |
-
if ( $option == self::mla_get_option( $key ) )
|
277 |
-
$option_values['checked'] = 'checked="checked"';
|
278 |
-
|
279 |
-
$radio_options .= MLAData::mla_parse_template( $page_template_array['radio-option'], $option_values );
|
280 |
-
}
|
281 |
-
|
282 |
-
$option_values = array(
|
283 |
-
'value' => $value['name'],
|
284 |
-
'options' => $radio_options,
|
285 |
-
'help' => $value['help']
|
286 |
-
);
|
287 |
-
|
288 |
-
$options_list .= MLAData::mla_parse_template( $page_template_array['radio'], $option_values );
|
289 |
-
break;
|
290 |
-
case 'select':
|
291 |
-
$option_values = array(
|
292 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
293 |
-
'value' => $value['name'],
|
294 |
-
'options' => $radio_options,
|
295 |
-
'help' => $value['help']
|
296 |
-
);
|
297 |
-
|
298 |
-
$select_options = '';
|
299 |
-
foreach ( $value['options'] as $optid => $option ) {
|
300 |
-
$option_values = array(
|
301 |
-
'selected' => '',
|
302 |
-
'value' => $option
|
303 |
-
);
|
304 |
-
|
305 |
-
if ( $option == self::mla_get_option( $key ) )
|
306 |
-
$option_values['selected'] = 'selected="selected"';
|
307 |
-
|
308 |
-
$select_options .= MLAData::mla_parse_template( $page_template_array['select-option'], $option_values );
|
309 |
-
}
|
310 |
-
|
311 |
-
$option_values = array(
|
312 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
313 |
-
'value' => $value['name'],
|
314 |
-
'options' => $select_options,
|
315 |
-
'help' => $value['help']
|
316 |
-
);
|
317 |
-
|
318 |
-
$options_list .= MLAData::mla_parse_template( $page_template_array['select'], $option_values );
|
319 |
-
break;
|
320 |
-
case 'text':
|
321 |
-
$option_values = array(
|
322 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
323 |
-
'value' => $value['name'],
|
324 |
-
'options' => $select_options,
|
325 |
-
'help' => $value['help'],
|
326 |
-
'size' => '40',
|
327 |
-
'text' => ''
|
328 |
-
);
|
329 |
-
|
330 |
-
if ( !empty( $value['size'] ) )
|
331 |
-
$option_values['size'] = $value['size'];
|
332 |
-
|
333 |
-
$option_values['text'] = self::mla_get_option( $key );
|
334 |
-
|
335 |
-
$options_list .= MLAData::mla_parse_template( $page_template_array['text'], $option_values );
|
336 |
-
break;
|
337 |
-
case 'textarea':
|
338 |
-
$option_values = array(
|
339 |
-
'key' => MLA_OPTION_PREFIX . $key,
|
340 |
-
'value' => $value['name'],
|
341 |
-
'options' => $select_options,
|
342 |
-
'help' => $value['help'],
|
343 |
-
'cols' => '90',
|
344 |
-
'rows' => '5',
|
345 |
-
'text' => ''
|
346 |
-
);
|
347 |
-
|
348 |
-
if ( !empty( $value['cols'] ) )
|
349 |
-
$option_values['cols'] = $value['cols'];
|
350 |
-
|
351 |
-
if ( !empty( $value['rows'] ) )
|
352 |
-
$option_values['rows'] = $value['rows'];
|
353 |
-
|
354 |
-
$option_values['text'] = stripslashes( self::mla_get_option( $key ) );
|
355 |
-
|
356 |
-
$options_list .= MLAData::mla_parse_template( $page_template_array['textarea'], $option_values );
|
357 |
-
break;
|
358 |
-
default:
|
359 |
-
error_log( 'ERROR: mla_render_settings_page unknown type: ' . var_export( $value, true ), 0 );
|
360 |
-
}
|
361 |
}
|
362 |
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
|
368 |
$page_values['options_list'] = $options_list;
|
369 |
-
|
370 |
-
|
|
|
371 |
|
372 |
/**
|
373 |
-
*
|
374 |
-
*
|
375 |
-
* @since 0.1
|
376 |
-
*
|
377 |
-
* @param array HTML template(s) for the settings page
|
378 |
*
|
379 |
-
* @
|
|
|
|
|
|
|
380 |
*/
|
381 |
-
private static function
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
break;
|
395 |
-
case 'select':
|
396 |
-
self::mla_update_option( $key, $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
397 |
-
break;
|
398 |
-
case 'text':
|
399 |
-
self::mla_update_option( $key, trim( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) );
|
400 |
-
break;
|
401 |
-
case 'textarea':
|
402 |
-
self::mla_update_option( $key, trim( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) );
|
403 |
-
break;
|
404 |
-
default:
|
405 |
-
error_log( 'ERROR: _save_settings unknown type(1): ' . var_export( $value, true ), 0 );
|
406 |
-
}
|
407 |
-
|
408 |
-
$message .= '<br>update_option(' . $key . ')';
|
409 |
-
} else {
|
410 |
-
switch ( $value['type'] ) {
|
411 |
-
case 'checkbox':
|
412 |
-
self::mla_update_option( $key, 'unchecked' );
|
413 |
-
break;
|
414 |
-
case 'header':
|
415 |
-
break;
|
416 |
-
case 'radio':
|
417 |
-
self::mla_delete_option( $key );
|
418 |
-
break;
|
419 |
-
case 'select':
|
420 |
-
self::mla_delete_option( $key );
|
421 |
-
break;
|
422 |
-
case 'text':
|
423 |
-
self::mla_delete_option( $key );
|
424 |
-
break;
|
425 |
-
case 'textarea':
|
426 |
-
self::mla_delete_option( $key );
|
427 |
-
break;
|
428 |
-
default:
|
429 |
-
error_log( 'ERROR: _save_settings unknown type(2): ' . var_export( $value, true ), 0 );
|
430 |
-
}
|
431 |
-
|
432 |
-
$message .= '<br>delete_option(' . $key . ')';
|
433 |
-
}
|
434 |
}
|
435 |
|
436 |
-
$page_content
|
437 |
-
|
438 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
);
|
440 |
|
441 |
/*
|
442 |
* Uncomment this for debugging.
|
443 |
-
* $page_content['message'] .= $message;
|
444 |
*/
|
|
|
|
|
445 |
return $page_content;
|
446 |
-
} //
|
447 |
|
448 |
/**
|
449 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
*
|
451 |
* @since 0.1
|
452 |
*
|
453 |
-
* @
|
454 |
*
|
455 |
-
* @return array Message(s) reflecting the results of the operation
|
456 |
*/
|
457 |
-
private static function
|
458 |
-
$
|
459 |
|
460 |
-
foreach (
|
461 |
-
|
462 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
}
|
464 |
|
465 |
$page_content = array(
|
466 |
-
|
467 |
'body' => ''
|
468 |
);
|
469 |
|
470 |
/*
|
471 |
* Uncomment this for debugging.
|
472 |
-
* $page_content['message'] .= $message;
|
473 |
*/
|
|
|
|
|
474 |
return $page_content;
|
475 |
-
} //
|
476 |
} // class MLASettings
|
477 |
?>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Manages the settings page to edit the plugin option settings
|
4 |
*
|
5 |
* @package Media Library Assistant
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
|
9 |
/**
|
10 |
+
* Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings
|
|
|
11 |
*
|
12 |
* @package Media Library Assistant
|
13 |
* @since 0.1
|
14 |
*/
|
15 |
class MLASettings {
|
16 |
/**
|
17 |
+
* Provides a unique name for the settings page
|
18 |
*/
|
19 |
const MLA_SETTINGS_SLUG = 'mla-settings-menu';
|
20 |
|
21 |
/**
|
22 |
+
* Initialization function, similar to __construct()
|
|
|
23 |
*
|
24 |
+
* @since 0.1
|
25 |
*
|
26 |
+
* @return void
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
*/
|
28 |
+
public static function initialize( ) {
|
29 |
+
add_action( 'admin_menu', 'MLASettings::mla_admin_menu_action' );
|
30 |
+
self::_version_upgrade();
|
31 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
/**
|
34 |
+
* Database and option update check, for installing new versions
|
35 |
+
*
|
36 |
+
* @since 0.30
|
37 |
+
*
|
38 |
+
* @return void
|
39 |
+
*/
|
40 |
+
private static function _version_upgrade( ) {
|
41 |
+
$current_version = MLAOptions::mla_get_option( MLAOptions::MLA_VERSION_OPTION );
|
42 |
+
|
43 |
+
if ( ((float)'.30') > ((float)$current_version) ) {
|
44 |
+
/*
|
45 |
+
* Convert attachment_category and _tag to taxonomy_support;
|
46 |
+
* change the default if either option is unchecked
|
47 |
+
*/
|
48 |
+
$category_option = MLAOptions::mla_get_option( 'attachment_category' );
|
49 |
+
$tag_option = MLAOptions::mla_get_option( 'attachment_tag' );
|
50 |
+
if ( ! ( ( 'checked' == $category_option ) && ( 'checked' == $tag_option ) ) ) {
|
51 |
+
$tax_option = MLAOptions::mla_get_option( 'taxonomy_support' );
|
52 |
+
if ( 'checked' != $category_option ) {
|
53 |
+
if ( isset( $tax_option['tax_support']['attachment_category'] ) )
|
54 |
+
unset( $tax_option['tax_support']['attachment_category'] );
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( 'checked' != $tag_option ) {
|
58 |
+
if ( isset( $tax_option['tax_support']['attachment_tag'] ) )
|
59 |
+
unset( $tax_option['tax_support']['attachment_tag'] );
|
60 |
+
}
|
61 |
+
|
62 |
+
MLAOptions::mla_taxonomy_option_handler( 'update', 'taxonomy_support', MLAOptions::$mla_option_definitions['taxonomy_support'], $tax_option );
|
63 |
+
} // one or both options unchecked
|
64 |
+
|
65 |
+
MLAOptions::mla_delete_option( 'attachment_category' );
|
66 |
+
MLAOptions::mla_delete_option( 'attachment_tag' );
|
67 |
+
} // version is less than .30
|
68 |
+
|
69 |
+
if ( ((float)'1.13') > ((float)$current_version) ) {
|
70 |
+
/*
|
71 |
+
* Add quick_edit and bulk_edit values to custom field mapping rules
|
72 |
+
*/
|
73 |
+
$new_values = array();
|
74 |
+
|
75 |
+
foreach( MLAOptions::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
|
76 |
+
$value['quick_edit'] = ( isset( $value['quick_edit'] ) && $value['quick_edit'] ) ? true : false;
|
77 |
+
$value['bulk_edit'] = ( isset( $value['bulk_edit'] ) && $value['bulk_edit'] ) ? true : false;
|
78 |
+
$new_values[ $key ] = $value;
|
79 |
+
}
|
80 |
+
|
81 |
+
MLAOptions::mla_update_option( 'custom_field_mapping', $new_values );
|
82 |
+
} // version is less than 1.13
|
83 |
+
|
84 |
+
MLAOptions::mla_update_option( MLAOptions::MLA_VERSION_OPTION, MLA::CURRENT_MLA_VERSION );
|
85 |
+
}
|
86 |
|
87 |
+
/**
|
88 |
+
* Perform one-time actions on plugin activation
|
89 |
+
*
|
90 |
+
* Adds a view to the database to support sorting the listing on 'ALT Text'.
|
91 |
+
*
|
92 |
+
* @since 0.40
|
93 |
+
*
|
94 |
+
* @return void
|
95 |
+
*/
|
96 |
+
public static function mla_activation_hook( ) {
|
97 |
+
// self::_create_alt_text_view(); DELETED v1.10, NO LONGER REQUIRED
|
98 |
+
}
|
|
|
|
|
|
|
|
|
99 |
|
100 |
/**
|
101 |
+
* Perform one-time actions on plugin deactivation
|
102 |
*
|
103 |
+
* Removes (if present) a view from the database that supports sorting the listing on 'ALT Text'.
|
104 |
+
*
|
105 |
+
* @since 0.40
|
106 |
+
*
|
107 |
+
* @return void
|
108 |
*/
|
109 |
+
public static function mla_deactivation_hook( ) {
|
110 |
+
global $wpdb, $table_prefix;
|
111 |
+
|
112 |
+
$view_name = $table_prefix . MLA_OPTION_PREFIX . MLAData::MLA_ALT_TEXT_VIEW_SUFFIX;
|
113 |
+
$result = $wpdb->query( "SHOW TABLES LIKE '{$view_name}'" );
|
114 |
+
|
115 |
+
if ( $result) {
|
116 |
+
$result = $wpdb->query( "DROP VIEW {$view_name}" );
|
117 |
+
}
|
118 |
}
|
119 |
|
120 |
/**
|
122 |
* add settings link in the Plugins section entry for MLA.
|
123 |
*
|
124 |
* @since 0.1
|
125 |
+
*
|
126 |
+
* @return void
|
127 |
*/
|
128 |
public static function mla_admin_menu_action( ) {
|
129 |
$hook = add_submenu_page( 'options-general.php', 'Media Library Assistant Settings', 'Media Library Assistant', 'manage_options', self::MLA_SETTINGS_SLUG, 'MLASettings::mla_render_settings_page' );
|
130 |
|
131 |
add_filter( 'plugin_action_links', 'MLASettings::mla_add_plugin_settings_link', 10, 2 );
|
132 |
+
|
133 |
+
|
134 |
}
|
135 |
|
136 |
/**
|
153 |
}
|
154 |
|
155 |
/**
|
156 |
+
* Update or delete a single MLA option value
|
|
|
|
|
157 |
*
|
158 |
+
* @since 0.80
|
159 |
+
* @uses $_REQUEST
|
160 |
+
*
|
161 |
+
* @param string HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
|
162 |
+
* @param array Option parameters, e.g., 'type', 'std'
|
163 |
*
|
164 |
+
* @return string HTML markup for the option's table row
|
165 |
*/
|
166 |
+
private static function _update_option_row( $key, $value ) {
|
167 |
+
if ( isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ) {
|
168 |
+
$message = '<br>update_option(' . $key . ")\r\n";
|
169 |
+
switch ( $value['type'] ) {
|
170 |
+
case 'checkbox':
|
171 |
+
MLAOptions::mla_update_option( $key, 'checked' );
|
172 |
+
break;
|
173 |
+
case 'header':
|
174 |
+
case 'subheader':
|
175 |
+
$message = '';
|
176 |
+
break;
|
177 |
+
case 'radio':
|
178 |
+
MLAOptions::mla_update_option( $key, $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
179 |
+
break;
|
180 |
+
case 'select':
|
181 |
+
MLAOptions::mla_update_option( $key, $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
182 |
+
break;
|
183 |
+
case 'text':
|
184 |
+
MLAOptions::mla_update_option( $key, trim( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) );
|
185 |
+
break;
|
186 |
+
case 'textarea':
|
187 |
+
MLAOptions::mla_update_option( $key, trim( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) );
|
188 |
+
break;
|
189 |
+
case 'custom':
|
190 |
+
$message = MLAOptions::$value['update']( 'update', $key, $value, $_REQUEST );
|
191 |
+
break;
|
192 |
+
case 'hidden':
|
193 |
+
break;
|
194 |
+
default:
|
195 |
+
error_log( 'ERROR: _save_settings unknown type(1): ' . var_export( $value, true ), 0 );
|
196 |
+
} // $value['type']
|
197 |
+
} // isset $key
|
198 |
+
else {
|
199 |
+
$message = '<br>delete_option(' . $key . ')';
|
200 |
+
switch ( $value['type'] ) {
|
201 |
+
case 'checkbox':
|
202 |
+
MLAOptions::mla_update_option( $key, 'unchecked' );
|
203 |
+
break;
|
204 |
+
case 'header':
|
205 |
+
case 'subheader':
|
206 |
+
$message = '';
|
207 |
+
break;
|
208 |
+
case 'radio':
|
209 |
+
MLAOptions::mla_delete_option( $key );
|
210 |
+
break;
|
211 |
+
case 'select':
|
212 |
+
MLAOptions::mla_delete_option( $key );
|
213 |
+
break;
|
214 |
+
case 'text':
|
215 |
+
MLAOptions::mla_delete_option( $key );
|
216 |
+
break;
|
217 |
+
case 'textarea':
|
218 |
+
MLAOptions::mla_delete_option( $key );
|
219 |
+
break;
|
220 |
+
case 'custom':
|
221 |
+
$message = MLAOptions::$value['delete']( 'delete', $key, $value, $_REQUEST );
|
222 |
+
break;
|
223 |
+
case 'hidden':
|
224 |
+
break;
|
225 |
+
default:
|
226 |
+
error_log( 'ERROR: _save_settings unknown type(2): ' . var_export( $value, true ), 0 );
|
227 |
+
} // $value['type']
|
228 |
+
} // ! isset $key
|
229 |
+
|
230 |
+
return $message;
|
231 |
}
|
232 |
|
233 |
/**
|
234 |
+
* Compose the table row for a single MLA option
|
|
|
|
|
235 |
*
|
236 |
+
* @since 0.80
|
237 |
+
* @uses $page_template_array contains option and option-item templates
|
238 |
+
*
|
239 |
+
* @param string HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
|
240 |
+
* @param array Option parameters, e.g., 'type', 'std'
|
241 |
*
|
242 |
+
* @return string HTML markup for the option's table row
|
243 |
*/
|
244 |
+
private static function _compose_option_row( $key, $value ) {
|
245 |
+
switch ( $value['type'] ) {
|
246 |
+
case 'checkbox':
|
247 |
+
$option_values = array(
|
248 |
+
'key' => MLA_OPTION_PREFIX . $key,
|
249 |
+
'checked' => '',
|
250 |
+
'value' => $value['name'],
|
251 |
+
'help' => $value['help']
|
252 |
+
);
|
253 |
+
|
254 |
+
if ( 'checked' == MLAOptions::mla_get_option( $key ) )
|
255 |
+
$option_values['checked'] = 'checked="checked"';
|
256 |
+
|
257 |
+
return MLAData::mla_parse_template( self::$page_template_array['checkbox'], $option_values );
|
258 |
+
case 'header':
|
259 |
+
case 'subheader':
|
260 |
+
$option_values = array(
|
261 |
+
'key' => MLA_OPTION_PREFIX . $key,
|
262 |
+
'value' => $value['name']
|
263 |
+
);
|
264 |
+
|
265 |
+
return MLAData::mla_parse_template( self::$page_template_array[ $value['type'] ], $option_values );
|
266 |
+
case 'radio':
|
267 |
+
$radio_options = '';
|
268 |
+
foreach ( $value['options'] as $optid => $option ) {
|
269 |
+
$option_values = array(
|
270 |
+
'key' => MLA_OPTION_PREFIX . $key,
|
271 |
+
'option' => $option,
|
272 |
+
'checked' => '',
|
273 |
+
'value' => $value['texts'][$optid]
|
274 |
+
);
|
275 |
+
|
276 |
+
if ( $option == MLAOptions::mla_get_option( $key ) )
|
277 |
+
$option_values['checked'] = 'checked="checked"';
|
278 |
+
|
279 |
+
$radio_options .= MLAData::mla_parse_template( self::$page_template_array['radio-option'], $option_values );
|
280 |
+
}
|
281 |
+
|
282 |
+
$option_values = array(
|
283 |
+
'value' => $value['name'],
|
284 |
+
'options' => $radio_options,
|
285 |
+
'help' => $value['help']
|
286 |
+
);
|
287 |
+
|
288 |
+
return MLAData::mla_parse_template( self::$page_template_array['radio'], $option_values );
|
289 |
+
case 'select':
|
290 |
+
$select_options = '';
|
291 |
+
foreach ( $value['options'] as $optid => $option ) {
|
292 |
+
$option_values = array(
|
293 |
+
'selected' => '',
|
294 |
+
'value' => $option,
|
295 |
+
'text' => $value['texts'][$optid]
|
296 |
+
);
|
297 |
+
|
298 |
+
if ( $option == MLAOptions::mla_get_option( $key ) )
|
299 |
+
$option_values['selected'] = 'selected="selected"';
|
300 |
+
|
301 |
+
$select_options .= MLAData::mla_parse_template( self::$page_template_array['select-option'], $option_values );
|
302 |
+
}
|
303 |
+
|
304 |
+
$option_values = array(
|
305 |
+
'key' => MLA_OPTION_PREFIX . $key,
|
306 |
+
'value' => $value['name'],
|
307 |
+
'options' => $select_options,
|
308 |
+
'help' => $value['help']
|
309 |
+
);
|
310 |
+
|
311 |
+
return MLAData::mla_parse_template( self::$page_template_array['select'], $option_values );
|
312 |
+
case 'text':
|
313 |
+
$option_values = array(
|
314 |
+
'key' => MLA_OPTION_PREFIX . $key,
|
315 |
+
'value' => $value['name'],
|
316 |
+
'options' => $select_options,
|
317 |
+
'help' => $value['help'],
|
318 |
+
'size' => '40',
|
319 |
+
'text' => ''
|
320 |
+
);
|
321 |
+
|
322 |
+
if ( !empty( $value['size'] ) )
|
323 |
+
$option_values['size'] = $value['size'];
|
324 |
+
|
325 |
+
$option_values['text'] = MLAOptions::mla_get_option( $key );
|
326 |
+
|
327 |
+
return MLAData::mla_parse_template( self::$page_template_array['text'], $option_values );
|
328 |
+
case 'textarea':
|
329 |
+
$option_values = array(
|
330 |
+
'key' => MLA_OPTION_PREFIX . $key,
|
331 |
+
'value' => $value['name'],
|
332 |
+
'options' => $select_options,
|
333 |
+
'help' => $value['help'],
|
334 |
+
'cols' => '90',
|
335 |
+
'rows' => '5',
|
336 |
+
'text' => ''
|
337 |
+
);
|
338 |
+
|
339 |
+
if ( !empty( $value['cols'] ) )
|
340 |
+
$option_values['cols'] = $value['cols'];
|
341 |
+
|
342 |
+
if ( !empty( $value['rows'] ) )
|
343 |
+
$option_values['rows'] = $value['rows'];
|
344 |
+
|
345 |
+
$option_values['text'] = stripslashes( MLAOptions::mla_get_option( $key ) );
|
346 |
+
|
347 |
+
return MLAData::mla_parse_template( self::$page_template_array['textarea'], $option_values );
|
348 |
+
case 'custom':
|
349 |
+
if ( isset( $value['render'] ) )
|
350 |
+
return MLAOptions::$value['render']( 'render', $key, $value );
|
351 |
+
|
352 |
+
break;
|
353 |
+
case 'hidden':
|
354 |
+
break;
|
355 |
+
default:
|
356 |
+
error_log( 'ERROR: mla_render_settings_page unknown type: ' . var_export( $value, true ), 0 );
|
357 |
+
} //switch
|
358 |
|
359 |
+
return '';
|
360 |
}
|
361 |
|
362 |
/**
|
363 |
+
* Template file for the Settings page(s) and parts
|
364 |
*
|
365 |
+
* This array contains all of the template parts for the Settings page(s). The array is built once
|
366 |
+
* each page load and cached for subsequent use.
|
367 |
*
|
368 |
+
* @since 0.80
|
369 |
*
|
370 |
+
* @var array
|
371 |
*/
|
372 |
+
private static $page_template_array = null;
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Definitions for Settings page tab ids, titles and handlers
|
376 |
+
* Each tab is defined by an array with the following elements:
|
377 |
+
*
|
378 |
+
* array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
|
379 |
+
*
|
380 |
+
* title => tab label / heading text
|
381 |
+
* render => rendering function for tab messages and content. Usage:
|
382 |
+
* $tab_content = ['render']( );
|
383 |
+
*
|
384 |
+
* @since 0.80
|
385 |
+
*
|
386 |
+
* @var array
|
387 |
+
*/
|
388 |
+
private static $mla_tablist = array(
|
389 |
+
'general' => array( 'title' => 'General', 'render' => '_compose_general_tab' ),
|
390 |
+
'mla-gallery' => array( 'title' => 'MLA Gallery', 'render' => '_compose_mla_gallery_tab' ),
|
391 |
+
'custom-field' => array( 'title' => 'Custom Fields', 'render' => '_compose_custom_field_tab' ),
|
392 |
+
'iptc-exif' => array( 'title' => 'IPTC/EXIF', 'render' => '_compose_iptc_exif_tab' ),
|
393 |
+
'documentation' => array( 'title' => 'Documentation', 'render' => '_compose_documentation_tab' )
|
394 |
+
);
|
395 |
+
|
396 |
+
/**
|
397 |
+
* Compose the navigation tabs for the Settings subpage
|
398 |
+
*
|
399 |
+
* @since 0.80
|
400 |
+
* @uses $page_template_array contains tablist and tablist-item templates
|
401 |
+
*
|
402 |
+
* @param string Optional data-tab-id value for the active tab, default 'general'
|
403 |
+
*
|
404 |
+
* @return string HTML markup for the Settings subpage navigation tabs
|
405 |
+
*/
|
406 |
+
private static function _compose_settings_tabs( $active_tab = 'general' ) {
|
407 |
+
$tablist_item = self::$page_template_array['tablist-item'];
|
408 |
+
$tabs = '';
|
409 |
+
foreach ( self::$mla_tablist as $key => $item ) {
|
410 |
+
$item_values = array(
|
411 |
+
'data-tab-id' => $key,
|
412 |
+
'nav-tab-active' => ( $active_tab == $key ) ? 'nav-tab-active' : '',
|
413 |
+
'settings-page' => self::MLA_SETTINGS_SLUG,
|
414 |
+
'title' => $item['title']
|
415 |
+
);
|
416 |
+
|
417 |
+
$tabs .= MLAData::mla_parse_template( $tablist_item, $item_values );
|
418 |
+
} // foreach $item
|
419 |
|
420 |
+
$tablist_values = array( 'tablist' => $tabs );
|
421 |
+
return MLAData::mla_parse_template( self::$page_template_array['tablist'], $tablist_values );
|
422 |
}
|
423 |
|
424 |
/**
|
425 |
+
* Compose the General tab content for the Settings subpage
|
426 |
*
|
427 |
+
* @since 0.80
|
428 |
+
* @uses $page_template_array contains tab content template(s)
|
429 |
+
*
|
430 |
+
* @return array 'message' => status/error messages, 'body' => tab content
|
431 |
*/
|
432 |
+
private static function _compose_general_tab( ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
/*
|
434 |
* Check for submit buttons to change or reset settings.
|
435 |
+
* Initialize page messages and content.
|
436 |
*/
|
437 |
+
if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
|
438 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
439 |
+
$page_content = self::_save_general_settings( );
|
440 |
+
} elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
|
441 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
442 |
+
$page_content = self::_reset_general_settings( );
|
443 |
} else {
|
444 |
$page_content = array(
|
445 |
'message' => '',
|
448 |
}
|
449 |
|
450 |
if ( !empty( $page_content['body'] ) ) {
|
451 |
+
return $page_content;
|
|
|
452 |
}
|
453 |
|
454 |
+
$page_values = array(
|
455 |
+
'shortcode_list' => '',
|
456 |
+
'options_list' => '',
|
457 |
+
'_wpnonce' => wp_nonce_field( MLA::MLA_ADMIN_NONCE, '_wpnonce', true, false ),
|
458 |
+
'_wp_http_referer' => wp_referer_field( false )
|
459 |
+
);
|
460 |
+
|
461 |
/*
|
462 |
* $custom_fields documents the name and description of custom fields
|
463 |
*/
|
466 |
);
|
467 |
|
468 |
/*
|
469 |
+
* $shortcodes documents the name and description of plugin shortcodes
|
470 |
*/
|
471 |
$shortcodes = array(
|
472 |
// array("name" => "shortcode", "description" => "This shortcode...")
|
473 |
+
array( 'name' => 'mla_attachment_list', 'description' => 'renders a complete list of all attachments and references to them.' ),
|
474 |
+
array( 'name' => 'mla_gallery', 'description' => 'enhanced version of the WordPress [gallery] shortcode. For complete documentation <a href="?page=' . self::MLA_SETTINGS_SLUG . '&mla_tab=documentation">click here</a>.' )
|
475 |
);
|
476 |
|
477 |
+
$shortcode_list = '';
|
478 |
+
foreach ( $shortcodes as $shortcode ) {
|
479 |
+
$shortcode_values = array ( 'name' => $shortcode['name'], 'description' => $shortcode['description'] );
|
480 |
+
$shortcode_list .= MLAData::mla_parse_template( self::$page_template_array['shortcode-item'], $shortcode_values );
|
481 |
+
}
|
482 |
|
483 |
+
if ( ! empty( $shortcode_list ) ) {
|
484 |
+
$shortcode_values = array ( 'shortcode_list' => $shortcode_list );
|
485 |
+
$page_values['shortcode_list'] = MLAData::mla_parse_template( self::$page_template_array['shortcode-list'], $shortcode_values );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
486 |
}
|
487 |
|
488 |
+
/*
|
489 |
+
* Fill in the current list of sortable columns
|
490 |
+
*/
|
491 |
+
$default_orderby = MLA_List_Table::mla_get_sortable_columns( );
|
492 |
+
foreach ($default_orderby as $key => $value ) {
|
493 |
+
MLAOptions::$mla_option_definitions['default_orderby']['options'][] = $value[0];
|
494 |
+
MLAOptions::$mla_option_definitions['default_orderby']['texts'][] = $value[1];
|
495 |
+
}
|
496 |
+
|
497 |
+
$options_list = '';
|
498 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
499 |
+
if ( 'general' == $value['tab'] )
|
500 |
+
$options_list .= self::_compose_option_row( $key, $value );
|
501 |
+
}
|
502 |
|
503 |
$page_values['options_list'] = $options_list;
|
504 |
+
$page_content['body'] = MLAData::mla_parse_template( self::$page_template_array['general-tab'], $page_values );
|
505 |
+
return $page_content;
|
506 |
+
}
|
507 |
|
508 |
/**
|
509 |
+
* Compose the MLA Gallery tab content for the Settings subpage
|
|
|
|
|
|
|
|
|
510 |
*
|
511 |
+
* @since 0.80
|
512 |
+
* @uses $page_template_array contains tab content template(s)
|
513 |
+
*
|
514 |
+
* @return array 'message' => status/error messages, 'body' => tab content
|
515 |
*/
|
516 |
+
private static function _compose_mla_gallery_tab( ) {
|
517 |
+
/*
|
518 |
+
* Check for submit buttons to change or reset settings.
|
519 |
+
* Initialize page messages and content.
|
520 |
+
*/
|
521 |
+
if ( !empty( $_REQUEST['mla-gallery-options-save'] ) ) {
|
522 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
523 |
+
$page_content = self::_save_gallery_settings( );
|
524 |
+
} else {
|
525 |
+
$page_content = array(
|
526 |
+
'message' => '',
|
527 |
+
'body' => ''
|
528 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
529 |
}
|
530 |
|
531 |
+
if ( !empty( $page_content['body'] ) ) {
|
532 |
+
return $page_content;
|
533 |
+
}
|
534 |
+
|
535 |
+
$page_values = array(
|
536 |
+
'options_list' => '',
|
537 |
+
'style_options_list' => '',
|
538 |
+
'markup_options_list' => '',
|
539 |
+
'_wpnonce' => wp_nonce_field( MLA::MLA_ADMIN_NONCE, '_wpnonce', true, false ),
|
540 |
+
'_wp_http_referer' => wp_referer_field( false )
|
541 |
+
);
|
542 |
+
|
543 |
+
/*
|
544 |
+
* Build default template selection lists
|
545 |
+
*/
|
546 |
+
$templates = MLAOptions::mla_get_style_templates();
|
547 |
+
ksort($templates);
|
548 |
+
foreach ($templates as $key => $value ) {
|
549 |
+
MLAOptions::$mla_option_definitions['default_style']['options'][] = $key;
|
550 |
+
MLAOptions::$mla_option_definitions['default_style']['texts'][] = $key;
|
551 |
+
}
|
552 |
+
|
553 |
+
$templates = MLAOptions::mla_get_markup_templates();
|
554 |
+
ksort($templates);
|
555 |
+
foreach ($templates as $key => $value ) {
|
556 |
+
MLAOptions::$mla_option_definitions['default_markup']['options'][] = $key;
|
557 |
+
MLAOptions::$mla_option_definitions['default_markup']['texts'][] = $key;
|
558 |
+
}
|
559 |
+
|
560 |
+
/*
|
561 |
+
* Start with any page-level options
|
562 |
+
*/
|
563 |
+
$options_list = '';
|
564 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
565 |
+
if ( 'mla-gallery' == $value['tab'] )
|
566 |
+
$options_list .= self::_compose_option_row( $key, $value );
|
567 |
+
}
|
568 |
+
|
569 |
+
$page_values['options_list'] = $options_list;
|
570 |
+
|
571 |
+
/*
|
572 |
+
* Add style templates; default goes first
|
573 |
+
*/
|
574 |
+
$style_options_list = '';
|
575 |
+
$templates = MLAOptions::mla_get_style_templates();
|
576 |
+
|
577 |
+
$name = 'default';
|
578 |
+
$value =$templates['default'];
|
579 |
+
if ( ! empty( $value ) ) {
|
580 |
+
$template_values = array (
|
581 |
+
'help' => 'The default template cannot be altered or deleted, but you can copy the styles.'
|
582 |
+
);
|
583 |
+
$control_cells = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-default'], $template_values );
|
584 |
+
|
585 |
+
$template_values = array (
|
586 |
+
'readonly' => 'readonly="readonly"',
|
587 |
+
'name_name' => 'mla_style_templates_name[default]',
|
588 |
+
'name_id' => 'mla_style_templates_name_default',
|
589 |
+
'name_text' => 'default',
|
590 |
+
'control_cells' => $control_cells,
|
591 |
+
'value_name' => 'mla_style_templates_value[default]',
|
592 |
+
'value_id' => 'mla_style_templates_value_default',
|
593 |
+
'value_text' => esc_textarea( $value ),
|
594 |
+
'value_help' => 'List of substitution parameters, e.g., [+selector+], on Documentation tab.'
|
595 |
+
);
|
596 |
+
|
597 |
+
$style_options_list .= MLAData::mla_parse_template( self::$page_template_array['mla-gallery-style'], $template_values );
|
598 |
+
} // $value
|
599 |
+
|
600 |
+
foreach ( $templates as $name => $value ) {
|
601 |
+
$slug = sanitize_title( $name );
|
602 |
+
|
603 |
+
if ( 'default' == $name )
|
604 |
+
continue; // already handled above
|
605 |
+
|
606 |
+
$template_values = array (
|
607 |
+
'name' => 'mla_style_templates_delete[' . $slug . ']',
|
608 |
+
'id' => 'mla_style_templates_delete_' . $slug,
|
609 |
+
'value' => 'Delete this template',
|
610 |
+
'help' => 'Check the box to delete this template when you press Update at the bottom of the page.'
|
611 |
+
);
|
612 |
+
$control_cells = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-delete'], $template_values );
|
613 |
+
|
614 |
+
$template_values = array (
|
615 |
+
'readonly' => '',
|
616 |
+
'name_name' => 'mla_style_templates_name[' . $slug . ']',
|
617 |
+
'name_id' => 'mla_style_templates_name_' . $slug,
|
618 |
+
'name_text' => $slug,
|
619 |
+
'control_cells' => $control_cells,
|
620 |
+
'value_name' => 'mla_style_templates_value[' . $slug . ']',
|
621 |
+
'value_id' => 'mla_style_templates_value_' . $slug,
|
622 |
+
'value_text' => esc_textarea( $value ),
|
623 |
+
'value_help' => 'List of substitution parameters, e.g., [+selector+], on Documentation tab.'
|
624 |
+
);
|
625 |
+
|
626 |
+
$style_options_list .= MLAData::mla_parse_template( self::$page_template_array['mla-gallery-style'], $template_values );
|
627 |
+
} // foreach $templates
|
628 |
+
|
629 |
+
/*
|
630 |
+
* Add blank style template for additions
|
631 |
+
*/
|
632 |
+
if ( ! empty( $value ) ) {
|
633 |
+
$template_values = array (
|
634 |
+
'help' => 'Fill in a name and styles to add a new template.'
|
635 |
+
);
|
636 |
+
$control_cells = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-default'], $template_values );
|
637 |
+
|
638 |
+
$template_values = array (
|
639 |
+
'readonly' => '',
|
640 |
+
'name_name' => 'mla_style_templates_name[blank]',
|
641 |
+
'name_id' => 'mla_style_templates_name_blank',
|
642 |
+
'name_text' => '',
|
643 |
+
'control_cells' => $control_cells,
|
644 |
+
'value_name' => 'mla_style_templates_value[blank]',
|
645 |
+
'value_id' => 'mla_style_templates_value_blank',
|
646 |
+
'value_text' => '',
|
647 |
+
'value_help' => 'List of substitution parameters, e.g., [+selector+], on Documentation tab.'
|
648 |
+
);
|
649 |
+
|
650 |
+
$style_options_list .= MLAData::mla_parse_template( self::$page_template_array['mla-gallery-style'], $template_values );
|
651 |
+
} // $value
|
652 |
+
|
653 |
+
$page_values['style_options_list'] = $style_options_list;
|
654 |
+
|
655 |
+
/*
|
656 |
+
* Add markup templates; default goes first
|
657 |
+
*/
|
658 |
+
$markup_options_list = '';
|
659 |
+
$templates = MLAOptions::mla_get_markup_templates();
|
660 |
+
|
661 |
+
$name = 'default';
|
662 |
+
$value =$templates['default'];
|
663 |
+
if ( ! empty( $value ) ) {
|
664 |
+
$template_values = array (
|
665 |
+
'help' => 'The default template cannot be altered or deleted, but you can copy the markup.'
|
666 |
+
);
|
667 |
+
$control_cells = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-default'], $template_values );
|
668 |
+
|
669 |
+
$template_values = array (
|
670 |
+
'readonly' => 'readonly="readonly"',
|
671 |
+
'name_name' => 'mla_markup_templates_name[default]',
|
672 |
+
'name_id' => 'mla_markup_templates_name_default',
|
673 |
+
'name_text' => 'default',
|
674 |
+
'control_cells' => $control_cells,
|
675 |
+
|
676 |
+
'open_name' => 'mla_markup_templates_open[default]',
|
677 |
+
'open_id' => 'mla_markup_templates_open_default',
|
678 |
+
'open_text' => esc_textarea( $value['open'] ),
|
679 |
+
'open_help' => 'Markup for the beginning of the gallery. List of parameters, e.g., [+selector+], on Documentation tab.',
|
680 |
+
|
681 |
+
'row_open_name' => 'mla_markup_templates_row_open[default]',
|
682 |
+
'row_open_id' => 'mla_markup_templates_row_open_default',
|
683 |
+
'row_open_text' => esc_textarea( $value['row-open'] ),
|
684 |
+
'row_open_help' => 'Markup for the beginning of each row in the gallery.',
|
685 |
+
|
686 |
+
'item_name' => 'mla_markup_templates_item[default]',
|
687 |
+
'item_id' => 'mla_markup_templates_item_default',
|
688 |
+
'item_text' => esc_textarea( $value['item'] ),
|
689 |
+
'item_help' => 'Markup for each item/cell of the gallery.',
|
690 |
+
|
691 |
+
'row_close_name' => 'mla_markup_templates_row_close[default]',
|
692 |
+
'row_close_id' => 'mla_markup_templates_row_close_default',
|
693 |
+
'row_close_text' => esc_textarea( $value['row-close'] ),
|
694 |
+
'row_close_help' => 'Markup for the end of each row in the gallery.',
|
695 |
+
|
696 |
+
'close_name' => 'mla_markup_templates_close[default]',
|
697 |
+
'close_id' => 'mla_markup_templates_close_default',
|
698 |
+
'close_text' => esc_textarea( $value['close'] ),
|
699 |
+
'close_help' => 'Markup for the end of the gallery.'
|
700 |
+
);
|
701 |
+
|
702 |
+
$markup_options_list .= MLAData::mla_parse_template( self::$page_template_array['mla-gallery-markup'], $template_values );
|
703 |
+
} // $value
|
704 |
+
|
705 |
+
foreach ( $templates as $name => $value ) {
|
706 |
+
$slug = sanitize_title( $name );
|
707 |
+
|
708 |
+
if ( 'default' == $name )
|
709 |
+
continue; // already handled above
|
710 |
+
|
711 |
+
$template_values = array (
|
712 |
+
'name' => 'mla_markup_templates_delete[' . $slug . ']',
|
713 |
+
'id' => 'mla_markup_templates_delete_' . $slug,
|
714 |
+
'value' => 'Delete this template',
|
715 |
+
'help' => 'Check the box to delete this template when you press Update at the bottom of the page.'
|
716 |
+
);
|
717 |
+
$control_cells = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-delete'], $template_values );
|
718 |
+
|
719 |
+
$template_values = array (
|
720 |
+
'readonly' => '',
|
721 |
+
'name_name' => 'mla_markup_templates_name[' . $slug . ']',
|
722 |
+
'name_id' => 'mla_markup_templates_name_' . $slug,
|
723 |
+
'name_text' => $slug,
|
724 |
+
'control_cells' => $control_cells,
|
725 |
+
|
726 |
+
'open_name' => 'mla_markup_templates_open[' . $slug . ']',
|
727 |
+
'open_id' => 'mla_markup_templates_open_' . $slug,
|
728 |
+
'open_text' => esc_textarea( $value['open'] ),
|
729 |
+
'open_help' => 'Markup for the beginning of the gallery. List of parameters, e.g., [+selector+], on Documentation tab.',
|
730 |
+
|
731 |
+
'row_open_name' => 'mla_markup_templates_row_open[' . $slug . ']',
|
732 |
+
'row_open_id' => 'mla_markup_templates_row_open_' . $slug,
|
733 |
+
'row_open_text' => esc_textarea( $value['row-open'] ),
|
734 |
+
'row_open_help' => 'Markup for the beginning of each row.',
|
735 |
+
|
736 |
+
'item_name' => 'mla_markup_templates_item[' . $slug . ']',
|
737 |
+
'item_id' => 'mla_markup_templates_item_' . $slug,
|
738 |
+
'item_text' => esc_textarea( $value['item'] ),
|
739 |
+
'item_help' => 'Markup for each item/cell.',
|
740 |
+
|
741 |
+
'row_close_name' => 'mla_markup_templates_row_close[' . $slug . ']',
|
742 |
+
'row_close_id' => 'mla_markup_templates_row_close_' . $slug,
|
743 |
+
'row_close_text' => esc_textarea( $value['row-close'] ),
|
744 |
+
'row_close_help' => 'Markup for the end of each row.',
|
745 |
+
|
746 |
+
'close_name' => 'mla_markup_templates_close[' . $slug . ']',
|
747 |
+
'close_id' => 'mla_markup_templates_close_' . $slug,
|
748 |
+
'close_text' => esc_textarea( $value['close'] ),
|
749 |
+
'close_help' => 'Markup for the end of the gallery.'
|
750 |
+
);
|
751 |
+
|
752 |
+
$markup_options_list .= MLAData::mla_parse_template( self::$page_template_array['mla-gallery-markup'], $template_values );
|
753 |
+
} // foreach $templates
|
754 |
+
|
755 |
+
/*
|
756 |
+
* Add blank markup template for additions
|
757 |
+
*/
|
758 |
+
if ( ! empty( $value ) ) {
|
759 |
+
$template_values = array (
|
760 |
+
'help' => 'Fill in a name and markup to add a new template.'
|
761 |
+
);
|
762 |
+
$control_cells = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-default'], $template_values );
|
763 |
+
|
764 |
+
$template_values = array (
|
765 |
+
'readonly' => '',
|
766 |
+
'name_name' => 'mla_markup_templates_name[blank]',
|
767 |
+
'name_id' => 'mla_markup_templates_name_blank',
|
768 |
+
'name_text' => '',
|
769 |
+
'control_cells' => $control_cells,
|
770 |
+
|
771 |
+
'open_name' => 'mla_markup_templates_open[blank]',
|
772 |
+
'open_id' => 'mla_markup_templates_open_blank',
|
773 |
+
'open_text' => '',
|
774 |
+
'open_help' => 'Markup for the beginning of the gallery. List of parameters, e.g., [+selector+], on Documentation tab.',
|
775 |
+
|
776 |
+
'row_open_name' => 'mla_markup_templates_row_open[blank]',
|
777 |
+
'row_open_id' => 'mla_markup_templates_row_open_blank',
|
778 |
+
'row_open_text' => '',
|
779 |
+
'row_open_help' => 'Markup for the beginning of each row in the gallery.',
|
780 |
+
|
781 |
+
'item_name' => 'mla_markup_templates_item[blank]',
|
782 |
+
'item_id' => 'mla_markup_templates_item_blank',
|
783 |
+
'item_text' => '',
|
784 |
+
'item_help' => 'Markup for each item/cell of the gallery.',
|
785 |
+
|
786 |
+
'row_close_name' => 'mla_markup_templates_row_close[blank]',
|
787 |
+
'row_close_id' => 'mla_markup_templates_row_close_blank',
|
788 |
+
'row_close_text' => '',
|
789 |
+
'row_close_help' => 'Markup for the end of each row in the gallery.',
|
790 |
+
|
791 |
+
'close_name' => 'mla_markup_templates_close[blank]',
|
792 |
+
'close_id' => 'mla_markup_templates_close_blank',
|
793 |
+
'close_text' => '',
|
794 |
+
'close_help' => 'Markup for the end of the gallery.'
|
795 |
+
|
796 |
+
);
|
797 |
+
|
798 |
+
$markup_options_list .= MLAData::mla_parse_template( self::$page_template_array['mla-gallery-markup'], $template_values );
|
799 |
+
} // $value
|
800 |
+
|
801 |
+
$page_values['markup_options_list'] = $markup_options_list;
|
802 |
+
|
803 |
+
$page_content['body'] = MLAData::mla_parse_template( self::$page_template_array['mla-gallery-tab'], $page_values );
|
804 |
+
return $page_content;
|
805 |
+
}
|
806 |
+
|
807 |
+
/**
|
808 |
+
* Compose the Custom Field tab content for the Settings subpage
|
809 |
+
*
|
810 |
+
* @since 1.10
|
811 |
+
* @uses $page_template_array contains tab content template(s)
|
812 |
+
*
|
813 |
+
* @return array 'message' => status/error messages, 'body' => tab content
|
814 |
+
*/
|
815 |
+
private static function _compose_custom_field_tab( ) {
|
816 |
+
/*
|
817 |
+
* Check for action or submit buttons.
|
818 |
+
* Initialize page messages and content.
|
819 |
+
*/
|
820 |
+
if ( isset( $_REQUEST['custom_field_mapping'] ) && is_array( $_REQUEST['custom_field_mapping'] ) ) {
|
821 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
822 |
+
|
823 |
+
/*
|
824 |
+
* Check for page-level submit buttons to change settings or map attachments.
|
825 |
+
* Initialize page messages and content.
|
826 |
+
*/
|
827 |
+
if ( !empty( $_REQUEST['custom-field-options-save'] ) ) {
|
828 |
+
$page_content = self::_save_custom_field_settings( );
|
829 |
+
}
|
830 |
+
elseif ( !empty( $_REQUEST['custom-field-options-map'] ) ) {
|
831 |
+
$page_content = self::_process_custom_field_mapping( );
|
832 |
+
}
|
833 |
+
else {
|
834 |
+
$page_content = array(
|
835 |
+
'message' => '',
|
836 |
+
'body' => ''
|
837 |
+
);
|
838 |
+
|
839 |
+
/*
|
840 |
+
* Check for single-rule action buttons
|
841 |
+
*/
|
842 |
+
foreach( $_REQUEST['custom_field_mapping'] as $key => $value ) {
|
843 |
+
if ( isset( $value['action'] ) ) {
|
844 |
+
$settings = array( $key => $value );
|
845 |
+
foreach ( $value['action'] as $action => $label ) {
|
846 |
+
switch( $action ) {
|
847 |
+
case 'delete_field':
|
848 |
+
$delete_result = self::_delete_custom_field( $value );
|
849 |
+
case 'delete_rule':
|
850 |
+
case 'add_rule':
|
851 |
+
case 'add_field':
|
852 |
+
case 'update_rule':
|
853 |
+
$page_content = self::_save_custom_field_settings( $settings );
|
854 |
+
if ( isset( $delete_result ) )
|
855 |
+
$page_content['message'] = $delete_result . $page_content['message'];
|
856 |
+
break;
|
857 |
+
case 'map_now':
|
858 |
+
$page_content = self::_process_custom_field_mapping( $settings );
|
859 |
+
break;
|
860 |
+
case 'add_rule_map':
|
861 |
+
case 'add_field_map':
|
862 |
+
$page_content = self::_save_custom_field_settings( $settings );
|
863 |
+
$map_content = self::_process_custom_field_mapping( $settings );
|
864 |
+
$page_content['message'] .= '<br> <br>' . $map_content['message'];
|
865 |
+
break;
|
866 |
+
default:
|
867 |
+
// ignore everything else
|
868 |
+
} //switch action
|
869 |
+
} // foreach action
|
870 |
+
} /// isset action
|
871 |
+
} // foreach rule
|
872 |
+
} // specific rule check
|
873 |
+
} // isset custom_field_mapping
|
874 |
+
else {
|
875 |
+
$page_content = array(
|
876 |
+
'message' => '',
|
877 |
+
'body' => ''
|
878 |
+
);
|
879 |
+
}
|
880 |
+
|
881 |
+
if ( !empty( $page_content['body'] ) ) {
|
882 |
+
return $page_content;
|
883 |
+
}
|
884 |
+
|
885 |
+
$page_values = array(
|
886 |
+
'options_list' => '',
|
887 |
+
'custom_options_list' => '',
|
888 |
+
'_wpnonce' => wp_nonce_field( MLA::MLA_ADMIN_NONCE, '_wpnonce', true, false ),
|
889 |
+
'_wp_http_referer' => wp_referer_field( false )
|
890 |
+
);
|
891 |
+
|
892 |
+
/*
|
893 |
+
* Start with any page-level options
|
894 |
+
*/
|
895 |
+
$options_list = '';
|
896 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
897 |
+
if ( 'custom-field' == $value['tab'] )
|
898 |
+
$options_list .= self::_compose_option_row( $key, $value );
|
899 |
+
}
|
900 |
+
|
901 |
+
$page_values['options_list'] = $options_list;
|
902 |
+
|
903 |
+
/*
|
904 |
+
* Add mapping options
|
905 |
+
*/
|
906 |
+
$page_values['custom_options_list'] = MLAOptions::mla_custom_field_option_handler( 'render', 'custom_field_mapping', MLAOptions::$mla_option_definitions['custom_field_mapping'] );
|
907 |
+
|
908 |
+
$page_content['body'] = MLAData::mla_parse_template( self::$page_template_array['custom-field-tab'], $page_values );
|
909 |
+
return $page_content;
|
910 |
+
}
|
911 |
+
|
912 |
+
/**
|
913 |
+
* Compose the IPTC/EXIF tab content for the Settings subpage
|
914 |
+
*
|
915 |
+
* @since 1.00
|
916 |
+
* @uses $page_template_array contains tab content template(s)
|
917 |
+
*
|
918 |
+
* @return array 'message' => status/error messages, 'body' => tab content
|
919 |
+
*/
|
920 |
+
private static function _compose_iptc_exif_tab( ) {
|
921 |
+
/*
|
922 |
+
* Check for submit buttons to change or reset settings.
|
923 |
+
* Initialize page messages and content.
|
924 |
+
*/
|
925 |
+
if ( !empty( $_REQUEST['iptc-exif-options-save'] ) ) {
|
926 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
927 |
+
$page_content = self::_save_iptc_exif_settings( );
|
928 |
+
}
|
929 |
+
elseif ( !empty( $_REQUEST['iptc-exif-options-process-standard'] ) ) {
|
930 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
931 |
+
$page_content = self::_process_iptc_exif_standard( );
|
932 |
+
}
|
933 |
+
elseif ( !empty( $_REQUEST['iptc-exif-options-process-taxonomy'] ) ) {
|
934 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
935 |
+
$page_content = self::_process_iptc_exif_taxonomy( );
|
936 |
+
}
|
937 |
+
elseif ( !empty( $_REQUEST['iptc-exif-options-process-custom'] ) ) {
|
938 |
+
check_admin_referer( MLA::MLA_ADMIN_NONCE, '_wpnonce' );
|
939 |
+
$page_content = self::_process_iptc_exif_custom( );
|
940 |
+
} else {
|
941 |
+
$page_content = array(
|
942 |
+
'message' => '',
|
943 |
+
'body' => ''
|
944 |
+
);
|
945 |
+
}
|
946 |
+
|
947 |
+
if ( !empty( $page_content['body'] ) ) {
|
948 |
+
return $page_content;
|
949 |
+
}
|
950 |
+
|
951 |
+
$page_values = array(
|
952 |
+
'options_list' => '',
|
953 |
+
'standard_options_list' => '',
|
954 |
+
'taxonomy_options_list' => '',
|
955 |
+
'custom_options_list' => '',
|
956 |
+
'_wpnonce' => wp_nonce_field( MLA::MLA_ADMIN_NONCE, '_wpnonce', true, false ),
|
957 |
+
'_wp_http_referer' => wp_referer_field( false )
|
958 |
+
);
|
959 |
+
|
960 |
+
/*
|
961 |
+
* Start with any page-level options
|
962 |
+
*/
|
963 |
+
$options_list = '';
|
964 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
965 |
+
if ( 'iptc-exif' == $value['tab'] )
|
966 |
+
$options_list .= self::_compose_option_row( $key, $value );
|
967 |
+
}
|
968 |
+
|
969 |
+
$page_values['options_list'] = $options_list;
|
970 |
+
|
971 |
+
/*
|
972 |
+
* Add mapping options
|
973 |
+
*/
|
974 |
+
$page_values['standard_options_list'] = MLAOptions::mla_iptc_exif_option_handler( 'render', 'iptc_exif_standard_mapping', MLAOptions::$mla_option_definitions['iptc_exif_standard_mapping'] );
|
975 |
+
|
976 |
+
$page_values['taxonomy_options_list'] = MLAOptions::mla_iptc_exif_option_handler( 'render', 'iptc_exif_taxonomy_mapping', MLAOptions::$mla_option_definitions['iptc_exif_taxonomy_mapping'] );
|
977 |
+
|
978 |
+
$page_values['custom_options_list'] = MLAOptions::mla_iptc_exif_option_handler( 'render', 'iptc_exif_custom_mapping', MLAOptions::$mla_option_definitions['iptc_exif_custom_mapping'] );
|
979 |
+
|
980 |
+
$page_content['body'] = MLAData::mla_parse_template( self::$page_template_array['iptc-exif-tab'], $page_values );
|
981 |
+
return $page_content;
|
982 |
+
}
|
983 |
+
|
984 |
+
/**
|
985 |
+
* Compose the Documentation tab content for the Settings subpage
|
986 |
+
*
|
987 |
+
* @since 0.80
|
988 |
+
* @uses $page_template_array contains tab content template(s)
|
989 |
+
*
|
990 |
+
* @return array 'message' => status/error messages, 'body' => tab content
|
991 |
+
*/
|
992 |
+
private static function _compose_documentation_tab( ) {
|
993 |
+
$page_template = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/documentation-settings-tab.tpl' );
|
994 |
+
$page_values = array(
|
995 |
+
'phpDocs_url' => MLA_PLUGIN_URL . 'phpDocs/index.html'
|
996 |
+
);
|
997 |
+
|
998 |
+
return array(
|
999 |
+
'message' => '',
|
1000 |
+
'body' => MLAData::mla_parse_template( $page_template['documentation-tab'], $page_values )
|
1001 |
+
);
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
/**
|
1005 |
+
* Render (echo) the "Media Library Assistant" subpage in the Settings section
|
1006 |
+
*
|
1007 |
+
* @since 0.1
|
1008 |
+
*
|
1009 |
+
* @return void Echoes HTML markup for the Settings subpage
|
1010 |
+
*/
|
1011 |
+
public static function mla_render_settings_page( ) {
|
1012 |
+
if ( !current_user_can( 'manage_options' ) ) {
|
1013 |
+
echo "Media Library Assistant - Error</h2>\r\n";
|
1014 |
+
wp_die( __( 'You do not have permission to manage plugin settings.' ) );
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
/*
|
1018 |
+
* Load template array and initialize page-level values.
|
1019 |
+
*/
|
1020 |
+
self::$page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-display-settings-page.tpl' );
|
1021 |
+
$current_tab = isset( $_REQUEST['mla_tab'] ) ? $_REQUEST['mla_tab']: 'general';
|
1022 |
+
$page_values = array(
|
1023 |
+
'version' => 'v' . MLA::CURRENT_MLA_VERSION,
|
1024 |
+
'messages' => '',
|
1025 |
+
'tablist' => self::_compose_settings_tabs( $current_tab ),
|
1026 |
+
'tab_content' => ''
|
1027 |
+
);
|
1028 |
+
|
1029 |
+
/*
|
1030 |
+
* Compose tab content
|
1031 |
+
*/
|
1032 |
+
if ( array_key_exists( $current_tab, self::$mla_tablist ) ) {
|
1033 |
+
if ( isset( self::$mla_tablist[ $current_tab ]['render'] ) ) {
|
1034 |
+
$handler = self::$mla_tablist[ $current_tab ]['render'];
|
1035 |
+
$page_content = self::$handler( );
|
1036 |
+
} else {
|
1037 |
+
$page_content = array( 'message' => 'ERROR: cannot render content tab', 'body' => '' );
|
1038 |
+
}
|
1039 |
+
} else {
|
1040 |
+
$page_content = array( 'message' => 'ERROR: unknown content tab', 'body' => '' );
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
if ( ! empty( $page_content['message'] ) )
|
1044 |
+
$page_values['messages'] = MLAData::mla_parse_template( self::$page_template_array['messages'], array(
|
1045 |
+
'messages' => $page_content['message']
|
1046 |
+
) );
|
1047 |
+
|
1048 |
+
$page_values['tab_content'] = $page_content['body'];
|
1049 |
+
echo MLAData::mla_parse_template( self::$page_template_array['page'], $page_values );
|
1050 |
+
} // mla_render_settings_page
|
1051 |
+
|
1052 |
+
/**
|
1053 |
+
* Save MLA Gallery settings to the options table
|
1054 |
+
*
|
1055 |
+
* @since 0.80
|
1056 |
+
*
|
1057 |
+
* @uses $_REQUEST
|
1058 |
+
*
|
1059 |
+
* @return array Message(s) reflecting the results of the operation
|
1060 |
+
*/
|
1061 |
+
private static function _save_gallery_settings( ) {
|
1062 |
+
$settings_changed = false;
|
1063 |
+
$message_list = '';
|
1064 |
+
$error_list = '';
|
1065 |
+
|
1066 |
+
/*
|
1067 |
+
* Start with any page-level options
|
1068 |
+
*/
|
1069 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
1070 |
+
if ( 'mla-gallery' == $value['tab'] && ( 'select' == $value['type'] ) ) {
|
1071 |
+
$old_value = MLAOptions::mla_get_option( $key );
|
1072 |
+
if ( $old_value != $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
|
1073 |
+
$settings_changed = true;
|
1074 |
+
$message_list .= self::_update_option_row( $key, $value );
|
1075 |
+
}
|
1076 |
+
}
|
1077 |
+
} // foreach mla_options
|
1078 |
+
|
1079 |
+
/*
|
1080 |
+
* Get the current style contents for comparison
|
1081 |
+
*/
|
1082 |
+
$old_templates = MLAOptions::mla_get_style_templates();
|
1083 |
+
$new_templates = array();
|
1084 |
+
$new_names = $_REQUEST['mla_style_templates_name'];
|
1085 |
+
$new_values = stripslashes_deep( $_REQUEST['mla_style_templates_value'] );
|
1086 |
+
$new_deletes = isset( $_REQUEST['mla_style_templates_delete'] ) ? $_REQUEST['mla_style_templates_delete']: array();
|
1087 |
+
|
1088 |
+
/*
|
1089 |
+
* Build new style template array, noting changes
|
1090 |
+
*/
|
1091 |
+
$templates_changed = false;
|
1092 |
+
foreach ( $new_names as $name => $new_name ) {
|
1093 |
+
if ( 'default' == $name )
|
1094 |
+
continue;
|
1095 |
+
|
1096 |
+
if( array_key_exists( $name, $new_deletes ) ) {
|
1097 |
+
$message_list .= "<br>Deleting style template '{$name}'.";
|
1098 |
+
$templates_changed = true;
|
1099 |
+
continue;
|
1100 |
+
}
|
1101 |
+
|
1102 |
+
$new_slug = sanitize_title( $new_name );
|
1103 |
+
if ( 'blank' == $name ) {
|
1104 |
+
if ( '' == $new_slug )
|
1105 |
+
continue;
|
1106 |
+
elseif ( 'blank' == $new_slug ) {
|
1107 |
+
$error_list .= "<br>ERROR: reserved name '{$new_slug}', new style template discarded.";
|
1108 |
+
continue;
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
if( array_key_exists( $new_slug, $old_templates ) ) {
|
1112 |
+
$error_list .= "<br>ERROR: duplicate name '{$new_slug}', new style template discarded.";
|
1113 |
+
continue;
|
1114 |
+
}
|
1115 |
+
else {
|
1116 |
+
$message_list .= "<br>Adding new style template '{$new_slug}'.";
|
1117 |
+
$templates_changed = true;
|
1118 |
+
}
|
1119 |
+
} // 'blank' - reserved name
|
1120 |
+
|
1121 |
+
/*
|
1122 |
+
* Handle name changes, check for duplicates
|
1123 |
+
*/
|
1124 |
+
if ( '' == $new_slug ) {
|
1125 |
+
$error_list .= "<br>ERROR: blank style template name value, reverting to '{$name}'.";
|
1126 |
+
$new_slug = $name;
|
1127 |
+
}
|
1128 |
+
|
1129 |
+
if ( $new_slug != $name ) {
|
1130 |
+
if( array_key_exists( $new_slug, $old_templates ) ) {
|
1131 |
+
$error_list .= "<br>ERROR: duplicate new style template name '{$new_slug}', reverting to '{$name}'.";
|
1132 |
+
$new_slug = $name;
|
1133 |
+
}
|
1134 |
+
elseif ( 'blank' != $name ) {
|
1135 |
+
$message_list .= "<br>Changing style template name from '{$name}' to '{$new_slug}'.";
|
1136 |
+
$templates_changed = true;
|
1137 |
+
}
|
1138 |
+
} // name changed
|
1139 |
+
|
1140 |
+
if ( ( 'blank' != $name ) && ( $new_values[ $name ] != $old_templates[ $name ] ) ) {
|
1141 |
+
$message_list .= "<br>Updating contents of style template '{$new_slug}'.";
|
1142 |
+
$templates_changed = true;
|
1143 |
+
}
|
1144 |
+
|
1145 |
+
$new_templates[ $new_slug ] = $new_values[ $name ];
|
1146 |
+
} // foreach $name
|
1147 |
+
|
1148 |
+
if ( $templates_changed ) {
|
1149 |
+
$settings_changed = true;
|
1150 |
+
if ( false == MLAOptions::mla_put_style_templates( $new_templates ) )
|
1151 |
+
$error_list .= "<br>ERROR: update of style templates failed.";
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
/*
|
1155 |
+
* Get the current markup contents for comparison
|
1156 |
+
*/
|
1157 |
+
$old_templates = MLAOptions::mla_get_markup_templates();
|
1158 |
+
$new_templates = array();
|
1159 |
+
$new_names = $_REQUEST['mla_markup_templates_name'];
|
1160 |
+
$new_values['open'] = stripslashes_deep( $_REQUEST['mla_markup_templates_open'] );
|
1161 |
+
$new_values['row-open'] = stripslashes_deep( $_REQUEST['mla_markup_templates_row_open'] );
|
1162 |
+
$new_values['item'] = stripslashes_deep( $_REQUEST['mla_markup_templates_item'] );
|
1163 |
+
$new_values['row-close'] = stripslashes_deep( $_REQUEST['mla_markup_templates_row_close'] );
|
1164 |
+
$new_values['close'] = stripslashes_deep( $_REQUEST['mla_markup_templates_close'] );
|
1165 |
+
$new_deletes = isset( $_REQUEST['mla_markup_templates_delete'] ) ? $_REQUEST['mla_markup_templates_delete']: array();
|
1166 |
+
|
1167 |
+
/*
|
1168 |
+
* Build new markup template array, noting changes
|
1169 |
+
*/
|
1170 |
+
$templates_changed = false;
|
1171 |
+
foreach ( $new_names as $name => $new_name ) {
|
1172 |
+
if ( 'default' == $name )
|
1173 |
+
continue;
|
1174 |
+
|
1175 |
+
if( array_key_exists( $name, $new_deletes ) ) {
|
1176 |
+
$message_list .= "<br>Deleting markup template '{$name}'.";
|
1177 |
+
$templates_changed = true;
|
1178 |
+
continue;
|
1179 |
+
}
|
1180 |
+
|
1181 |
+
$new_slug = sanitize_title( $new_name );
|
1182 |
+
if ( 'blank' == $name ) {
|
1183 |
+
if ( '' == $new_slug )
|
1184 |
+
continue;
|
1185 |
+
|
1186 |
+
if ( 'blank' == $new_slug ) {
|
1187 |
+
$error_list .= "<br>ERROR: reserved name '{$new_slug}', new markup template discarded.";
|
1188 |
+
continue;
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
if( array_key_exists( $new_slug, $old_templates ) ) {
|
1192 |
+
$error_list .= "<br>ERROR: duplicate name '{$new_slug}', new markup template discarded.";
|
1193 |
+
continue;
|
1194 |
+
}
|
1195 |
+
else {
|
1196 |
+
$message_list .= "<br>Adding new markup template '{$new_slug}'.";
|
1197 |
+
$templates_changed = true;
|
1198 |
+
}
|
1199 |
+
} // 'blank' - reserved name
|
1200 |
+
|
1201 |
+
/*
|
1202 |
+
* Handle name changes, check for duplicates
|
1203 |
+
*/
|
1204 |
+
if ( '' == $new_slug ) {
|
1205 |
+
$error_list .= "<br>ERROR: blank markup template name value, reverting to '{$name}'.";
|
1206 |
+
$new_slug = $name;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
if ( $new_slug != $name ) {
|
1210 |
+
if( array_key_exists( $new_slug, $old_templates ) ) {
|
1211 |
+
$error_list .= "<br>ERROR: duplicate new markup template name '{$new_slug}', reverting to '{$name}'.";
|
1212 |
+
$new_slug = $name;
|
1213 |
+
}
|
1214 |
+
|
1215 |
+
if( array_key_exists( $new_slug, $old_templates ) ) {
|
1216 |
+
$error_list .= "<br>ERROR: duplicate new markup template name '{$new_slug}', reverting to '{$name}'.";
|
1217 |
+
$new_slug = $name;
|
1218 |
+
}
|
1219 |
+
elseif ( 'blank' != $name ) {
|
1220 |
+
$message_list .= "<br>Changing markup template name from '{$name}' to '{$new_slug}'.";
|
1221 |
+
$templates_changed = true;
|
1222 |
+
}
|
1223 |
+
} // name changed
|
1224 |
+
|
1225 |
+
if ( 'blank' != $name ) {
|
1226 |
+
if ( $new_values['open'][ $name ] != $old_templates[ $name ]['open'] ) {
|
1227 |
+
$message_list .= "<br>Updating open markup for '{$new_slug}'.";
|
1228 |
+
$templates_changed = true;
|
1229 |
+
}
|
1230 |
+
|
1231 |
+
if ( $new_values['row-open'][ $name ] != $old_templates[ $name ]['row-open'] ) {
|
1232 |
+
$message_list .= "<br>Updating row open markup for '{$new_slug}'.";
|
1233 |
+
$templates_changed = true;
|
1234 |
+
}
|
1235 |
+
|
1236 |
+
if ( $new_values['item'][ $name ] != $old_templates[ $name ]['item'] ) {
|
1237 |
+
$message_list .= "<br>Updating item markup for '{$new_slug}'.";
|
1238 |
+
$templates_changed = true;
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
if ( $new_values['row-close'][ $name ] != $old_templates[ $name ]['row-close'] ) {
|
1242 |
+
$message_list .= "<br>Updating row close markup for '{$new_slug}'.";
|
1243 |
+
$templates_changed = true;
|
1244 |
+
}
|
1245 |
+
|
1246 |
+
if ( $new_values['close'][ $name ] != $old_templates[ $name ]['close'] ) {
|
1247 |
+
$message_list .= "<br>Updating close markup for '{$new_slug}'.";
|
1248 |
+
$templates_changed = true;
|
1249 |
+
}
|
1250 |
+
} // ! 'blank'
|
1251 |
+
|
1252 |
+
$new_templates[ $new_slug ]['open'] = $new_values['open'][ $name ];
|
1253 |
+
$new_templates[ $new_slug ]['row-open'] = $new_values['row-open'][ $name ];
|
1254 |
+
$new_templates[ $new_slug ]['item'] = $new_values['item'][ $name ];
|
1255 |
+
$new_templates[ $new_slug ]['row-close'] = $new_values['row-close'][ $name ];
|
1256 |
+
$new_templates[ $new_slug ]['close'] = $new_values['close'][ $name ];
|
1257 |
+
} // foreach $name
|
1258 |
+
|
1259 |
+
if ( $templates_changed ) {
|
1260 |
+
$settings_changed = true;
|
1261 |
+
if ( false == MLAOptions::mla_put_markup_templates( $new_templates ) )
|
1262 |
+
$error_list .= "<br>ERROR: update of markup templates failed.";
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
if ( $settings_changed )
|
1266 |
+
$message = "MLA Gallery settings saved.\r\n";
|
1267 |
+
else
|
1268 |
+
$message = "MLA Gallery no changes detected.\r\n";
|
1269 |
+
|
1270 |
+
$page_content = array(
|
1271 |
+
'message' => $message . $error_list,
|
1272 |
+
'body' => ''
|
1273 |
);
|
1274 |
|
1275 |
/*
|
1276 |
* Uncomment this for debugging.
|
|
|
1277 |
*/
|
1278 |
+
// $page_content['message'] .= $message_list;
|
1279 |
+
|
1280 |
return $page_content;
|
1281 |
+
} // _save_gallery_settings
|
1282 |
|
1283 |
/**
|
1284 |
+
* Process custom field settings against all image attachments
|
1285 |
+
* without saving the settings to the mla_option
|
1286 |
+
*
|
1287 |
+
* @since 1.10
|
1288 |
+
* @uses $_REQUEST if passed a NULL parameter
|
1289 |
+
*
|
1290 |
+
* @param array | NULL specific custom_field_mapping values
|
1291 |
+
*
|
1292 |
+
* @return array Message(s) reflecting the results of the operation
|
1293 |
+
*/
|
1294 |
+
private static function _process_custom_field_mapping( $settings = NULL ) {
|
1295 |
+
global $wpdb;
|
1296 |
+
|
1297 |
+
if ( NULL == $settings ) {
|
1298 |
+
$settings = ( isset( $_REQUEST['custom_field_mapping'] ) ) ? $_REQUEST['custom_field_mapping'] : array();
|
1299 |
+
if ( isset( $settings[ MLAOptions::MLA_NEW_CUSTOM_FIELD ] ) )
|
1300 |
+
unset( $settings[ MLAOptions::MLA_NEW_CUSTOM_FIELD ] );
|
1301 |
+
if ( isset( $settings[ MLAOptions::MLA_NEW_CUSTOM_RULE ] ) )
|
1302 |
+
unset( $settings[ MLAOptions::MLA_NEW_CUSTOM_RULE ] );
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
if ( empty( $settings ) )
|
1306 |
+
return array(
|
1307 |
+
'message' => 'ERROR: No custom field mapping rules to process.',
|
1308 |
+
'body' => ''
|
1309 |
+
);
|
1310 |
+
|
1311 |
+
$examine_count = 0;
|
1312 |
+
$update_count = 0;
|
1313 |
+
$post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE `post_type` = 'attachment'" );
|
1314 |
+
|
1315 |
+
foreach( $post_ids as $key => $post_id ) {
|
1316 |
+
$updates = MLAOptions::mla_evaluate_custom_field_mapping( (integer) $post_id, 'custom_field_mapping', $settings );
|
1317 |
+
|
1318 |
+
$examine_count += 1;
|
1319 |
+
if ( ! empty( $updates ) ) {
|
1320 |
+
$results = MLAData::mla_update_single_item( (integer) $post_id, $updates );
|
1321 |
+
if ( stripos( $results['message'], 'updated.' ) )
|
1322 |
+
$update_count += 1;
|
1323 |
+
}
|
1324 |
+
} // foreach post
|
1325 |
+
|
1326 |
+
if ( $update_count )
|
1327 |
+
$message = "Custom field mapping completed; {$examine_count} attachment(s) examined, {$update_count} updated.\r\n";
|
1328 |
+
else
|
1329 |
+
$message = "Custom field mapping completed; {$examine_count} attachment(s) examined, no changes detected.\r\n";
|
1330 |
+
|
1331 |
+
return array(
|
1332 |
+
'message' => $message,
|
1333 |
+
'body' => ''
|
1334 |
+
);
|
1335 |
+
} // _process_custom_field_mapping
|
1336 |
+
|
1337 |
+
/**
|
1338 |
+
* Delete a custom field from the wp_postmeta table
|
1339 |
+
*
|
1340 |
+
* @since 1.10
|
1341 |
+
*
|
1342 |
+
* @param array specific custom_field_mapping rule
|
1343 |
+
*
|
1344 |
+
* @return array Message(s) reflecting the results of the operation
|
1345 |
+
*/
|
1346 |
+
private static function _delete_custom_field( $value ) {
|
1347 |
+
global $wpdb;
|
1348 |
+
|
1349 |
+
$post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->postmeta} LEFT JOIN {$wpdb->posts} ON ( {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id ) WHERE {$wpdb->postmeta}.meta_key = '%s' AND {$wpdb->posts}.post_type = 'attachment'", $value['name'] ));
|
1350 |
+
foreach ( $post_meta_ids as $mid )
|
1351 |
+
delete_metadata_by_mid( 'post', $mid );
|
1352 |
+
|
1353 |
+
$count = count( $post_meta_ids );
|
1354 |
+
if ( $count )
|
1355 |
+
return sprintf( 'Deleted custom field value from ' . _n('%s attachment.', '%s attachments.', $count), $count);
|
1356 |
+
else
|
1357 |
+
return 'No attachments contained this custom field';
|
1358 |
+
} // _delete_custom_field
|
1359 |
+
|
1360 |
+
/**
|
1361 |
+
* Save custom field settings to the options table
|
1362 |
+
*
|
1363 |
+
* @since 1.10
|
1364 |
+
* @uses $_REQUEST if passed a NULL parameter
|
1365 |
+
*
|
1366 |
+
* @param array | NULL specific custom_field_mapping values
|
1367 |
+
*
|
1368 |
+
* @return array Message(s) reflecting the results of the operation
|
1369 |
+
*/
|
1370 |
+
private static function _save_custom_field_settings( $new_values = NULL ) {
|
1371 |
+
$message_list = '';
|
1372 |
+
$option_messages = '';
|
1373 |
+
|
1374 |
+
if ( NULL == $new_values ) {
|
1375 |
+
/*
|
1376 |
+
* Start with any page-level options
|
1377 |
+
*/
|
1378 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
1379 |
+
if ( 'custom-field' == $value['tab'] )
|
1380 |
+
$option_messages .= self::_update_option_row( $key, $value );
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
/*
|
1384 |
+
* Add mapping options
|
1385 |
+
*/
|
1386 |
+
$new_values = ( isset( $_REQUEST['custom_field_mapping'] ) ) ? $_REQUEST['custom_field_mapping'] : array();
|
1387 |
+
} // NULL
|
1388 |
+
|
1389 |
+
/*
|
1390 |
+
* Uncomment this for debugging.
|
1391 |
+
*/
|
1392 |
+
// $message_list = $option_messages . '<br>';
|
1393 |
+
|
1394 |
+
return array(
|
1395 |
+
'message' => $message_list . MLAOptions::mla_custom_field_option_handler( 'update', 'custom_field_mapping', MLAOptions::$mla_option_definitions['custom_field_mapping'], $new_values ),
|
1396 |
+
'body' => ''
|
1397 |
+
);
|
1398 |
+
} // _save_custom_field_settings
|
1399 |
+
|
1400 |
+
/**
|
1401 |
+
* Process IPTC/EXIF standard field settings against all image attachments
|
1402 |
+
* without saving the settings to the mla_option
|
1403 |
+
*
|
1404 |
+
* @since 1.00
|
1405 |
+
*
|
1406 |
+
* @uses $_REQUEST
|
1407 |
+
*
|
1408 |
+
* @return array Message(s) reflecting the results of the operation
|
1409 |
+
*/
|
1410 |
+
private static function _process_iptc_exif_standard( ) {
|
1411 |
+
if ( ! isset( $_REQUEST['iptc_exif_mapping']['standard'] ) )
|
1412 |
+
return array(
|
1413 |
+
'message' => 'ERROR: No standard field settings to process.',
|
1414 |
+
'body' => ''
|
1415 |
+
);
|
1416 |
+
|
1417 |
+
$examine_count = 0;
|
1418 |
+
$update_count = 0;
|
1419 |
+
|
1420 |
+
$query = array( 'orderby' => 'none', 'post_parent' => 'all' );
|
1421 |
+
$posts = MLAShortcodes::mla_get_shortcode_attachments( 0, $query );
|
1422 |
+
|
1423 |
+
foreach( $posts as $key => $post ) {
|
1424 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $post, 'iptc_exif_standard_mapping', $_REQUEST['iptc_exif_mapping'] );
|
1425 |
+
|
1426 |
+
$examine_count += 1;
|
1427 |
+
if ( ! empty( $updates ) ) {
|
1428 |
+
MLAData::mla_update_single_item( $post->ID, $updates );
|
1429 |
+
$update_count += 1;
|
1430 |
+
}
|
1431 |
+
} // foreach post
|
1432 |
+
|
1433 |
+
if ( $update_count )
|
1434 |
+
$message = "IPTC/EXIF Standard field mapping completed; {$examine_count} attachment(s) examined, {$update_count} updated.\r\n";
|
1435 |
+
else
|
1436 |
+
$message = "IPTC/EXIF Standard field mapping completed; {$examine_count} attachment(s) examined, no changes detected.\r\n";
|
1437 |
+
|
1438 |
+
return array(
|
1439 |
+
'message' => $message,
|
1440 |
+
'body' => ''
|
1441 |
+
);
|
1442 |
+
} // _process_iptc_exif_standard
|
1443 |
+
|
1444 |
+
/**
|
1445 |
+
* Process IPTC/EXIF taxonomy term settings against all image attachments
|
1446 |
+
* without saving the settings to the mla_option
|
1447 |
+
*
|
1448 |
+
* @since 1.00
|
1449 |
+
*
|
1450 |
+
* @uses $_REQUEST
|
1451 |
+
*
|
1452 |
+
* @return array Message(s) reflecting the results of the operation
|
1453 |
+
*/
|
1454 |
+
private static function _process_iptc_exif_taxonomy( ) {
|
1455 |
+
if ( ! isset( $_REQUEST['iptc_exif_mapping']['taxonomy'] ) )
|
1456 |
+
return array(
|
1457 |
+
'message' => 'ERROR: No taxonomy term settings to process.',
|
1458 |
+
'body' => ''
|
1459 |
+
);
|
1460 |
+
|
1461 |
+
$examine_count = 0;
|
1462 |
+
$update_count = 0;
|
1463 |
+
|
1464 |
+
$query = array( 'orderby' => 'none', 'post_parent' => 'all' );
|
1465 |
+
$posts = MLAShortcodes::mla_get_shortcode_attachments( 0, $query );
|
1466 |
+
|
1467 |
+
foreach( $posts as $key => $post ) {
|
1468 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $post, 'iptc_exif_taxonomy_mapping', $_REQUEST['iptc_exif_mapping'] );
|
1469 |
+
|
1470 |
+
$examine_count += 1;
|
1471 |
+
if ( ! empty( $updates ) ) {
|
1472 |
+
$results = MLAData::mla_update_single_item( $post->ID, array(), $updates['taxonomy_updates']['inputs'], $updates['taxonomy_updates']['actions'] );
|
1473 |
+
if ( stripos( $results['message'], 'updated.' ) )
|
1474 |
+
$update_count += 1;
|
1475 |
+
}
|
1476 |
+
} // foreach post
|
1477 |
+
|
1478 |
+
if ( $update_count )
|
1479 |
+
$message = "IPTC/EXIF Taxonomy term mapping completed; {$examine_count} attachment(s) examined, {$update_count} updated.\r\n";
|
1480 |
+
else
|
1481 |
+
$message = "IPTC/EXIF Taxonomy term mapping completed; {$examine_count} attachment(s) examined, no changes detected.\r\n";
|
1482 |
+
|
1483 |
+
return array(
|
1484 |
+
'message' => $message,
|
1485 |
+
'body' => ''
|
1486 |
+
);
|
1487 |
+
} // _process_iptc_exif_taxonomy
|
1488 |
+
|
1489 |
+
/**
|
1490 |
+
* Process IPTC/EXIF custom field settings against all image attachments
|
1491 |
+
* without saving the settings to the mla_option
|
1492 |
+
*
|
1493 |
+
* @since 1.00
|
1494 |
+
*
|
1495 |
+
* @uses $_REQUEST
|
1496 |
+
*
|
1497 |
+
* @return array Message(s) reflecting the results of the operation
|
1498 |
+
*/
|
1499 |
+
private static function _process_iptc_exif_custom( ) {
|
1500 |
+
if ( isset( $_REQUEST['iptc_exif_mapping']['custom'][ MLAOptions::MLA_NEW_CUSTOM_FIELD ] ) )
|
1501 |
+
unset( $_REQUEST['iptc_exif_mapping']['custom'][ MLAOptions::MLA_NEW_CUSTOM_FIELD ] );
|
1502 |
+
|
1503 |
+
if ( ! isset( $_REQUEST['iptc_exif_mapping']['custom'] ) )
|
1504 |
+
return array(
|
1505 |
+
'message' => 'ERROR: No custom field settings to process.',
|
1506 |
+
'body' => ''
|
1507 |
+
);
|
1508 |
+
|
1509 |
+
$examine_count = 0;
|
1510 |
+
$update_count = 0;
|
1511 |
+
|
1512 |
+
$query = array( 'orderby' => 'none', 'post_parent' => 'all' );
|
1513 |
+
$posts = MLAShortcodes::mla_get_shortcode_attachments( 0, $query );
|
1514 |
+
|
1515 |
+
foreach( $posts as $key => $post ) {
|
1516 |
+
$updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $post, 'iptc_exif_custom_mapping', $_REQUEST['iptc_exif_mapping'] );
|
1517 |
+
|
1518 |
+
$examine_count += 1;
|
1519 |
+
if ( ! empty( $updates ) ) {
|
1520 |
+
$results = MLAData::mla_update_single_item( $post->ID, $updates );
|
1521 |
+
if ( stripos( $results['message'], 'updated.' ) )
|
1522 |
+
$update_count += 1;
|
1523 |
+
}
|
1524 |
+
} // foreach post
|
1525 |
+
|
1526 |
+
if ( $update_count )
|
1527 |
+
$message = "IPTC/EXIF custom field mapping completed; {$examine_count} attachment(s) examined, {$update_count} updated.\r\n";
|
1528 |
+
else
|
1529 |
+
$message = "IPTC/EXIF custom field mapping completed; {$examine_count} attachment(s) examined, no changes detected.\r\n";
|
1530 |
+
|
1531 |
+
return array(
|
1532 |
+
'message' => $message,
|
1533 |
+
'body' => ''
|
1534 |
+
);
|
1535 |
+
} // _process_iptc_exif_custom
|
1536 |
+
|
1537 |
+
/**
|
1538 |
+
* Save IPTC/EXIF settings to the options table
|
1539 |
+
*
|
1540 |
+
* @since 1.00
|
1541 |
+
*
|
1542 |
+
* @uses $_REQUEST
|
1543 |
+
*
|
1544 |
+
* @return array Message(s) reflecting the results of the operation
|
1545 |
+
*/
|
1546 |
+
private static function _save_iptc_exif_settings( ) {
|
1547 |
+
$message_list = '';
|
1548 |
+
$option_messages = '';
|
1549 |
+
|
1550 |
+
/*
|
1551 |
+
* Start with any page-level options
|
1552 |
+
*/
|
1553 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
1554 |
+
if ( 'iptc-exif' == $value['tab'] )
|
1555 |
+
$option_messages .= self::_update_option_row( $key, $value );
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
/*
|
1559 |
+
* Uncomment this for debugging.
|
1560 |
+
*/
|
1561 |
+
// $message_list = $option_messages . '<br>';
|
1562 |
+
|
1563 |
+
/*
|
1564 |
+
* Add mapping options
|
1565 |
+
*/
|
1566 |
+
$new_values = ( isset( $_REQUEST['iptc_exif_mapping'] ) ) ? $_REQUEST['iptc_exif_mapping'] : array( 'standard' => array(), 'taxonomy' => array(), 'custom' => array() );
|
1567 |
+
|
1568 |
+
return array(
|
1569 |
+
'message' => $message_list . MLAOptions::mla_iptc_exif_option_handler( 'update', 'iptc_exif_mapping', MLAOptions::$mla_option_definitions['iptc_exif_mapping'], $new_values ),
|
1570 |
+
'body' => ''
|
1571 |
+
);
|
1572 |
+
} // _save_iptc_exif_settings
|
1573 |
+
|
1574 |
+
/**
|
1575 |
+
* Save General settings to the options table
|
1576 |
*
|
1577 |
* @since 0.1
|
1578 |
*
|
1579 |
+
* @uses $_REQUEST
|
1580 |
*
|
1581 |
+
* @return array Message(s) reflecting the results of the operation
|
1582 |
*/
|
1583 |
+
private static function _save_general_settings( ) {
|
1584 |
+
$message_list = '';
|
1585 |
|
1586 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
1587 |
+
if ( 'general' == $value['tab'] ) {
|
1588 |
+
switch ( $key ) {
|
1589 |
+
case MLAOptions::MLA_FEATURED_IN_TUNING:
|
1590 |
+
MLAOptions::$process_featured_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
1591 |
+
break;
|
1592 |
+
case MLAOptions::MLA_INSERTED_IN_TUNING:
|
1593 |
+
MLAOptions::$process_inserted_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
1594 |
+
break;
|
1595 |
+
case MLAOptions::MLA_GALLERY_IN_TUNING:
|
1596 |
+
MLAOptions::$process_gallery_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
1597 |
+
|
1598 |
+
if ( 'refresh' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
|
1599 |
+
MLAData::mla_flush_mla_galleries( MLAOptions::MLA_GALLERY_IN_TUNING );
|
1600 |
+
$message_list .= "<br>Gallery in - references updated.\r\n";
|
1601 |
+
$_REQUEST[ MLA_OPTION_PREFIX . $key ] = 'cached';
|
1602 |
+
}
|
1603 |
+
break;
|
1604 |
+
case MLAOptions::MLA_MLA_GALLERY_IN_TUNING:
|
1605 |
+
MLAOptions::$process_mla_gallery_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
|
1606 |
+
|
1607 |
+
if ( 'refresh' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
|
1608 |
+
MLAData::mla_flush_mla_galleries( MLAOptions::MLA_MLA_GALLERY_IN_TUNING );
|
1609 |
+
$message_list .= "<br>MLA Gallery in - references updated.\r\n";
|
1610 |
+
$_REQUEST[ MLA_OPTION_PREFIX . $key ] = 'cached';
|
1611 |
+
}
|
1612 |
+
break;
|
1613 |
+
default:
|
1614 |
+
// ignore everything else
|
1615 |
+
} // switch
|
1616 |
+
|
1617 |
+
$message_list .= self::_update_option_row( $key, $value );
|
1618 |
+
} // general option
|
1619 |
+
} // foreach mla_options
|
1620 |
+
|
1621 |
+
$page_content = array(
|
1622 |
+
'message' => "General settings saved.\r\n",
|
1623 |
+
'body' => ''
|
1624 |
+
);
|
1625 |
+
|
1626 |
+
/*
|
1627 |
+
* Uncomment this for debugging.
|
1628 |
+
*/
|
1629 |
+
// $page_content['message'] .= $message_list;
|
1630 |
+
|
1631 |
+
return $page_content;
|
1632 |
+
} // _save_general_settings
|
1633 |
+
|
1634 |
+
/**
|
1635 |
+
* Delete saved settings, restoring default values
|
1636 |
+
*
|
1637 |
+
* @since 0.1
|
1638 |
+
*
|
1639 |
+
* @return array Message(s) reflecting the results of the operation
|
1640 |
+
*/
|
1641 |
+
private static function _reset_general_settings( ) {
|
1642 |
+
$message_list = '';
|
1643 |
+
|
1644 |
+
foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
|
1645 |
+
if ( 'custom' == $value['type'] ) {
|
1646 |
+
$message = MLAOptions::$value['reset']( 'reset', $key, $value, $_REQUEST );
|
1647 |
+
}
|
1648 |
+
elseif ( ('header' == $value['type']) || ('hidden' == $value['type']) ) {
|
1649 |
+
$message = '';
|
1650 |
+
}
|
1651 |
+
else {
|
1652 |
+
MLAOptions::mla_delete_option( $key );
|
1653 |
+
$message = '<br>delete_option(' . $key . ')';
|
1654 |
+
}
|
1655 |
+
|
1656 |
+
$message_list .= $message;
|
1657 |
}
|
1658 |
|
1659 |
$page_content = array(
|
1660 |
+
'message' => 'Settings reset to default values.',
|
1661 |
'body' => ''
|
1662 |
);
|
1663 |
|
1664 |
/*
|
1665 |
* Uncomment this for debugging.
|
|
|
1666 |
*/
|
1667 |
+
// $page_content['message'] .= $message_list;
|
1668 |
+
|
1669 |
return $page_content;
|
1670 |
+
} // _reset_general_settings
|
1671 |
} // class MLASettings
|
1672 |
?>
|
includes/class-mla-shortcodes.php
ADDED
@@ -0,0 +1,1508 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Media Library Assistant Shortcode handler(s)
|
4 |
+
*
|
5 |
+
* @package Media Library Assistant
|
6 |
+
* @since 0.1
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users
|
11 |
+
*
|
12 |
+
* @package Media Library Assistant
|
13 |
+
* @since 0.20
|
14 |
+
*/
|
15 |
+
class MLAShortcodes {
|
16 |
+
/**
|
17 |
+
* Initialization function, similar to __construct()
|
18 |
+
*
|
19 |
+
* @since 0.20
|
20 |
+
*
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
public static function initialize() {
|
24 |
+
add_shortcode( 'mla_attachment_list', 'MLAShortcodes::mla_attachment_list_shortcode' );
|
25 |
+
add_shortcode( 'mla_gallery', 'MLAShortcodes::mla_gallery_shortcode' );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* WordPress Shortcode; renders a complete list of all attachments and references to them
|
30 |
+
*
|
31 |
+
* @since 0.1
|
32 |
+
*
|
33 |
+
* @return void echoes HTML markup for the attachment list
|
34 |
+
*/
|
35 |
+
public static function mla_attachment_list_shortcode( /* $atts */ ) {
|
36 |
+
global $wpdb;
|
37 |
+
|
38 |
+
/* extract(shortcode_atts(array(
|
39 |
+
'item_type'=>'attachment',
|
40 |
+
'organize_by'=>'title',
|
41 |
+
), $atts)); */
|
42 |
+
|
43 |
+
/*
|
44 |
+
* Process the where-used settings option
|
45 |
+
*/
|
46 |
+
if ('checked' == MLAOptions::mla_get_option( 'exclude_revisions' ) )
|
47 |
+
$exclude_revisions = "(post_type <> 'revision') AND ";
|
48 |
+
else
|
49 |
+
$exclude_revisions = '';
|
50 |
+
|
51 |
+
$attachments = $wpdb->get_results(
|
52 |
+
"
|
53 |
+
SELECT ID, post_title, post_name, post_parent
|
54 |
+
FROM {$wpdb->posts}
|
55 |
+
WHERE {$exclude_revisions}post_type = 'attachment'
|
56 |
+
"
|
57 |
+
);
|
58 |
+
|
59 |
+
foreach ( $attachments as $attachment ) {
|
60 |
+
$references = MLAData::mla_fetch_attachment_references( $attachment->ID, $attachment->post_parent );
|
61 |
+
|
62 |
+
echo ' <br><h3>' . $attachment->ID . ', ' . esc_attr( $attachment->post_title ) . ', Parent: ' . $attachment->post_parent . '<br>' . esc_attr( $attachment->post_name ) . '<br>' . esc_html( $references['base_file'] ) . "</h3>\r\n";
|
63 |
+
|
64 |
+
/*
|
65 |
+
* Look for the "Featured Image(s)"
|
66 |
+
*/
|
67 |
+
if ( empty( $references['features'] ) ) {
|
68 |
+
echo " not featured in any posts.<br>\r\n";
|
69 |
+
} else {
|
70 |
+
echo " Featured in<br>\r\n";
|
71 |
+
foreach ( $references['features'] as $feature_id => $feature ) {
|
72 |
+
echo ' ';
|
73 |
+
|
74 |
+
if ( $feature_id == $attachment->post_parent ) {
|
75 |
+
echo 'PARENT ';
|
76 |
+
$found_parent = true;
|
77 |
+
}
|
78 |
+
|
79 |
+
echo $feature_id . ' (' . $feature->post_type . '), ' . esc_attr( $feature->post_title ) . "<br>\r\n";
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/*
|
84 |
+
* Look for item(s) inserted in post_content
|
85 |
+
*/
|
86 |
+
if ( empty( $references['inserts'] ) ) {
|
87 |
+
echo " no inserts in any post_content.<br>\r\n";
|
88 |
+
} else {
|
89 |
+
foreach ( $references['inserts'] as $file => $inserts ) {
|
90 |
+
echo ' ' . $file . " inserted in<br>\r\n";
|
91 |
+
foreach ( $inserts as $insert ) {
|
92 |
+
echo ' ';
|
93 |
+
|
94 |
+
if ( $insert->ID == $attachment->post_parent ) {
|
95 |
+
echo 'PARENT ';
|
96 |
+
$found_parent = true;
|
97 |
+
}
|
98 |
+
|
99 |
+
echo $insert->ID . ' (' . $insert->post_type . '), ' . esc_attr( $insert->post_title ) . "<br>\r\n";
|
100 |
+
} // foreach $insert
|
101 |
+
} // foreach $file
|
102 |
+
}
|
103 |
+
|
104 |
+
$errors = '';
|
105 |
+
|
106 |
+
if ( !$references['found_reference'] )
|
107 |
+
$errors .= '(ORPHAN) ';
|
108 |
+
|
109 |
+
if ( $references['is_unattached'] )
|
110 |
+
$errors .= '(UNATTACHED) ';
|
111 |
+
else {
|
112 |
+
if ( !$references['found_parent'] ) {
|
113 |
+
if ( isset( $references['parent_title'] ) )
|
114 |
+
$errors .= '(BAD PARENT) ';
|
115 |
+
else
|
116 |
+
$errors .= '(INVALID PARENT) ';
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
if ( !empty( $errors ) )
|
121 |
+
echo ' ' . $errors . "<br>\r\n";
|
122 |
+
} // foreach attachment
|
123 |
+
|
124 |
+
echo "<br>----- End of Report -----\r\n";
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Accumulates debug messages
|
129 |
+
*
|
130 |
+
* @since 0.60
|
131 |
+
*
|
132 |
+
* @var string
|
133 |
+
*/
|
134 |
+
public static $mla_debug_messages = '';
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Turn debug collection and display on or off
|
138 |
+
*
|
139 |
+
* @since 0.70
|
140 |
+
*
|
141 |
+
* @var boolean
|
142 |
+
*/
|
143 |
+
private static $mla_debug = false;
|
144 |
+
|
145 |
+
/**
|
146 |
+
* WP_Query filter "parameters"
|
147 |
+
*
|
148 |
+
* This array defines parameters for the query's where filter, mla_shortcode_query_posts_where_filter.
|
149 |
+
* The parameters are set up in the mla_get_shortcode_attachments function, and
|
150 |
+
* any further logic required to translate those values is contained in the filter.
|
151 |
+
*
|
152 |
+
* Array index values are: post_parent
|
153 |
+
*
|
154 |
+
* @since 1.13
|
155 |
+
*
|
156 |
+
* @var array
|
157 |
+
*/
|
158 |
+
private static $query_parameters = array();
|
159 |
+
|
160 |
+
/**
|
161 |
+
* The MLA Gallery shortcode.
|
162 |
+
*
|
163 |
+
* This is a superset of the WordPress Gallery shortcode for displaying images on a post,
|
164 |
+
* page or custom post type. It is adapted from /wp-includes/media.php gallery_shortcode.
|
165 |
+
* Enhancements include many additional selection parameters and full taxonomy support.
|
166 |
+
*
|
167 |
+
* @since .50
|
168 |
+
*
|
169 |
+
* @param array $attr Attributes of the shortcode.
|
170 |
+
*
|
171 |
+
* @return string HTML content to display gallery.
|
172 |
+
*/
|
173 |
+
public static function mla_gallery_shortcode($attr) {
|
174 |
+
global $post;
|
175 |
+
|
176 |
+
/*
|
177 |
+
* Some do_shortcode callers may not have a specific post in mind
|
178 |
+
*/
|
179 |
+
if ( ! is_object( $post ) )
|
180 |
+
$post = (object) array( 'ID' => 0 );
|
181 |
+
|
182 |
+
/*
|
183 |
+
* These are the parameters for gallery display
|
184 |
+
*/
|
185 |
+
$default_arguments = array(
|
186 |
+
'size' => 'thumbnail', // or 'medium', 'large', 'full' or registered size
|
187 |
+
'itemtag' => 'dl',
|
188 |
+
'icontag' => 'dt',
|
189 |
+
'captiontag' => 'dd',
|
190 |
+
'columns' => 3,
|
191 |
+
'link' => 'permalink', // or 'file' or a registered size
|
192 |
+
// MLA-specific
|
193 |
+
'mla_style' => MLAOptions::mla_get_option('default_style'),
|
194 |
+
'mla_markup' => MLAOptions::mla_get_option('default_markup'),
|
195 |
+
'mla_float' => is_rtl() ? 'right' : 'left',
|
196 |
+
'mla_itemwidth' => NULL,
|
197 |
+
'mla_margin' => '1.5',
|
198 |
+
'mla_link_text' => '',
|
199 |
+
'mla_rollover_text' => '',
|
200 |
+
'mla_caption' => '',
|
201 |
+
'mla_target' => '',
|
202 |
+
'mla_debug' => false,
|
203 |
+
'mla_viewer' => false,
|
204 |
+
'mla_viewer_extensions' => 'doc,xls,ppt,pdf,txt',
|
205 |
+
'mla_viewer_page' => '1',
|
206 |
+
'mla_viewer_width' => '150',
|
207 |
+
// Photonic-specific
|
208 |
+
'id' => NULL,
|
209 |
+
'style' => NULL,
|
210 |
+
'type' => 'default',
|
211 |
+
'thumb_width' => 75,
|
212 |
+
'thumb_height' => 75,
|
213 |
+
'thumbnail_size' => 'thumbnail',
|
214 |
+
'slide_size' => 'large',
|
215 |
+
'slideshow_height' => 500,
|
216 |
+
'fx' => 'fade',
|
217 |
+
'timeout' => 4000,
|
218 |
+
'speed' => 1000,
|
219 |
+
'pause' => true
|
220 |
+
);
|
221 |
+
|
222 |
+
/*
|
223 |
+
* Merge gallery arguments with defaults, pass the query arguments on to mla_get_shortcode_attachments.
|
224 |
+
*/
|
225 |
+
|
226 |
+
$arguments = shortcode_atts( $default_arguments, $attr );
|
227 |
+
self::$mla_debug = !empty( $arguments['mla_debug'] ) && ( 'true' == strtolower( $arguments['mla_debug'] ) );
|
228 |
+
|
229 |
+
$attachments = self::mla_get_shortcode_attachments( $post->ID, $attr );
|
230 |
+
|
231 |
+
if ( is_string( $attachments ) )
|
232 |
+
return $attachments;
|
233 |
+
|
234 |
+
if ( empty($attachments) ) {
|
235 |
+
if ( self::$mla_debug ) {
|
236 |
+
$output = '<p><strong>mla_debug</strong> empty gallery, query = ' . var_export( $attr, true ) . '</p>';
|
237 |
+
$output .= self::$mla_debug_messages;
|
238 |
+
self::$mla_debug_messages = '';
|
239 |
+
return $output;
|
240 |
+
}
|
241 |
+
else {
|
242 |
+
return '';
|
243 |
+
}
|
244 |
+
} // empty $attachments
|
245 |
+
|
246 |
+
/*
|
247 |
+
* Look for Photonic-enhanced gallery
|
248 |
+
*/
|
249 |
+
global $photonic;
|
250 |
+
|
251 |
+
if ( is_object( $photonic ) && ! empty( $arguments['style'] ) ) {
|
252 |
+
if ( 'default' != strtolower( $arguments['type'] ) )
|
253 |
+
return '<p><strong>Photonic-enhanced [mla_gallery]</strong> type must be <strong>default</strong>, query = ' . var_export( $attr, true ) . '</p>';
|
254 |
+
|
255 |
+
$images = array();
|
256 |
+
foreach ($attachments as $key => $val) {
|
257 |
+
$images[$val->ID] = $attachments[$key];
|
258 |
+
}
|
259 |
+
|
260 |
+
$output = $photonic->build_gallery( $images, $arguments['style'], $arguments );
|
261 |
+
return $output;
|
262 |
+
}
|
263 |
+
|
264 |
+
$size = $size_class = $arguments['size'];
|
265 |
+
if ( 'icon' == strtolower( $size) ) {
|
266 |
+
$size = array( 60, 60 );
|
267 |
+
$show_icon = true;
|
268 |
+
}
|
269 |
+
else
|
270 |
+
$show_icon = false;
|
271 |
+
|
272 |
+
if ( is_feed() ) {
|
273 |
+
$output = "\n";
|
274 |
+
foreach ( $attachments as $att_id => $attachment )
|
275 |
+
$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
|
276 |
+
return $output;
|
277 |
+
}
|
278 |
+
|
279 |
+
/*
|
280 |
+
* Check for Google File Viewer arguments
|
281 |
+
*/
|
282 |
+
$arguments['mla_viewer'] = !empty( $arguments['mla_viewer'] ) && ( 'true' == strtolower( $arguments['mla_viewer'] ) );
|
283 |
+
if ( $arguments['mla_viewer'] ) {
|
284 |
+
$arguments['mla_viewer_extensions'] = array_filter( array_map( 'trim', explode( ',', $arguments['mla_viewer_extensions'] ) ) );
|
285 |
+
$arguments['mla_viewer_page'] = absint( $arguments['mla_viewer_page'] );
|
286 |
+
$arguments['mla_viewer_width'] = absint( $arguments['mla_viewer_width'] );
|
287 |
+
}
|
288 |
+
|
289 |
+
// $instance supports multiple galleries in one page/post
|
290 |
+
static $instance = 0;
|
291 |
+
$instance++;
|
292 |
+
|
293 |
+
/*
|
294 |
+
* The default style template includes "margin: 1.5%" to put a bit of
|
295 |
+
* minimum space between the columns. "mla_margin" can be used to increase
|
296 |
+
* this. "mla_itemwidth" can be used with "columns=0" to achieve a "responsive"
|
297 |
+
* layout.
|
298 |
+
*/
|
299 |
+
|
300 |
+
$margin = absint( 2 * (float) $arguments['mla_margin'] );
|
301 |
+
if ( isset ( $arguments['mla_itemwidth'] ) ) {
|
302 |
+
$itemwidth = absint( $arguments['mla_itemwidth'] );
|
303 |
+
}
|
304 |
+
else {
|
305 |
+
$itemwidth = $arguments['columns'] > 0 ? (floor(100/$arguments['columns']) - $margin) : 100 - $margin;
|
306 |
+
}
|
307 |
+
|
308 |
+
$float = strtolower( $arguments['mla_float'] );
|
309 |
+
if ( ! in_array( $float, array( 'left', 'none', 'right' ) ) )
|
310 |
+
$float = is_rtl() ? 'right' : 'left';
|
311 |
+
|
312 |
+
$style_values = array(
|
313 |
+
'mla_style' => $arguments['mla_style'],
|
314 |
+
'mla_markup' => $arguments['mla_markup'],
|
315 |
+
'instance' => $instance,
|
316 |
+
'id' => $post->ID,
|
317 |
+
'itemtag' => tag_escape( $arguments['itemtag'] ),
|
318 |
+
'icontag' => tag_escape( $arguments['icontag'] ),
|
319 |
+
'captiontag' => tag_escape( $arguments['captiontag'] ),
|
320 |
+
'columns' => intval( $arguments['columns']),
|
321 |
+
'itemwidth' => intval( $itemwidth ),
|
322 |
+
'margin' => $arguments['mla_margin'],
|
323 |
+
'float' => $float,
|
324 |
+
'selector' => "mla_gallery-{$instance}",
|
325 |
+
'size_class' => sanitize_html_class( $size_class )
|
326 |
+
);
|
327 |
+
|
328 |
+
$style_template = $gallery_style = '';
|
329 |
+
$use_mla_gallery_style = ( 'none' != strtolower( $style_values['mla_style'] ) );
|
330 |
+
if ( apply_filters( 'use_mla_gallery_style', $use_mla_gallery_style ) ) {
|
331 |
+
$style_template = MLAOptions::mla_fetch_gallery_template( $style_values['mla_style'], 'style' );
|
332 |
+
if ( empty( $style_template ) ) {
|
333 |
+
$style_values['mla_style'] = 'default';
|
334 |
+
$style_template = MLAOptions::mla_fetch_gallery_template( 'default', 'style' );
|
335 |
+
}
|
336 |
+
|
337 |
+
if ( ! empty ( $style_template ) ) {
|
338 |
+
$gallery_style = MLAData::mla_parse_template( $style_template, $style_values );
|
339 |
+
} // !empty template
|
340 |
+
} // use_mla_gallery_style
|
341 |
+
|
342 |
+
$upload_dir = wp_upload_dir();
|
343 |
+
$markup_values = $style_values;
|
344 |
+
$markup_values['base_url'] = $upload_dir['baseurl'];
|
345 |
+
$markup_values['base_dir'] = $upload_dir['basedir'];
|
346 |
+
|
347 |
+
/*
|
348 |
+
* Variable item-level placeholders
|
349 |
+
*/
|
350 |
+
$terms_placeholders = array();
|
351 |
+
$custom_placeholders = array();
|
352 |
+
$iptc_placeholders = array();
|
353 |
+
$exif_placeholders = array();
|
354 |
+
|
355 |
+
$markup_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-open', 'markup' );
|
356 |
+
if ( empty( $markup_template ) ) {
|
357 |
+
$markup_values['mla_markup'] = 'default';
|
358 |
+
$markup_template = MLAOptions::mla_fetch_gallery_template( 'default-open', 'markup' );
|
359 |
+
}
|
360 |
+
|
361 |
+
if ( ! empty( $markup_template ) ) {
|
362 |
+
$gallery_div = MLAData::mla_parse_template( $markup_template, $markup_values );
|
363 |
+
|
364 |
+
$row_open_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-row-open', 'markup' );
|
365 |
+
if ( empty( $row_open_template ) )
|
366 |
+
$row_open_template = '';
|
367 |
+
|
368 |
+
$item_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-item', 'markup' );
|
369 |
+
if ( empty( $item_template ) )
|
370 |
+
$item_template = '';
|
371 |
+
else {
|
372 |
+
/*
|
373 |
+
* Look for variable item-level placeholders
|
374 |
+
*/
|
375 |
+
$new_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_link_text'] . $arguments['mla_rollover_text'] . $arguments['mla_caption'] ) );
|
376 |
+
$placeholders = MLAData::mla_get_template_placeholders( $item_template . $new_text );
|
377 |
+
foreach ($placeholders as $key => $value ) {
|
378 |
+
switch ( $value['prefix'] ) {
|
379 |
+
case 'terms':
|
380 |
+
$terms_placeholders[ $key ] = $value;
|
381 |
+
break;
|
382 |
+
case 'custom':
|
383 |
+
$custom_placeholders[ $key ] = $value;
|
384 |
+
break;
|
385 |
+
case 'iptc':
|
386 |
+
$iptc_placeholders[ $key ] = $value;
|
387 |
+
break;
|
388 |
+
case 'exif':
|
389 |
+
$exif_placeholders[ $key ] = $value;
|
390 |
+
break;
|
391 |
+
default:
|
392 |
+
// ignore anything else
|
393 |
+
} // switch
|
394 |
+
} // $placeholders
|
395 |
+
} // $item_template
|
396 |
+
|
397 |
+
$row_close_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-row-close', 'markup' );
|
398 |
+
if ( empty( $row_close_template ) )
|
399 |
+
$row_close_template = '';
|
400 |
+
|
401 |
+
$close_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-close', 'markup' );
|
402 |
+
if ( empty( $close_template ) )
|
403 |
+
$close_template = '';
|
404 |
+
}
|
405 |
+
|
406 |
+
if ( self::$mla_debug ) {
|
407 |
+
$output = self::$mla_debug_messages;
|
408 |
+
self::$mla_debug_messages = '';
|
409 |
+
}
|
410 |
+
else
|
411 |
+
$output = '';
|
412 |
+
|
413 |
+
$output .= apply_filters( 'mla_gallery_style', $gallery_style . $gallery_div, $style_values, $markup_values, $style_template, $markup_template );
|
414 |
+
|
415 |
+
$i = 0;
|
416 |
+
foreach ( $attachments as $id => $attachment ) {
|
417 |
+
/*
|
418 |
+
* fill in item-specific elements
|
419 |
+
*/
|
420 |
+
$markup_values['index'] = (string) 1 + $i;
|
421 |
+
|
422 |
+
$markup_values['excerpt'] = wptexturize( $attachment->post_excerpt );
|
423 |
+
$markup_values['attachment_ID'] = $attachment->ID;
|
424 |
+
$markup_values['mime_type'] = $attachment->post_mime_type;
|
425 |
+
$markup_values['menu_order'] = $attachment->menu_order;
|
426 |
+
$markup_values['date'] = $attachment->post_date;
|
427 |
+
$markup_values['modified'] = $attachment->post_modified;
|
428 |
+
$markup_values['parent'] = $attachment->post_parent;
|
429 |
+
$markup_values['parent_title'] = '(unattached)';
|
430 |
+
$markup_values['parent_type'] = '';
|
431 |
+
$markup_values['parent_date'] = '';
|
432 |
+
$markup_values['title'] = wptexturize( $attachment->post_title );
|
433 |
+
$markup_values['slug'] = wptexturize( $attachment->post_name );
|
434 |
+
$markup_values['width'] = '';
|
435 |
+
$markup_values['height'] = '';
|
436 |
+
$markup_values['image_meta'] = '';
|
437 |
+
$markup_values['image_alt'] = '';
|
438 |
+
$markup_values['base_file'] = '';
|
439 |
+
$markup_values['path'] = '';
|
440 |
+
$markup_values['file'] = '';
|
441 |
+
$markup_values['description'] = wptexturize( $attachment->post_content );
|
442 |
+
$markup_values['file_url'] = wptexturize( $attachment->guid );
|
443 |
+
$markup_values['author_id'] = $attachment->post_author;
|
444 |
+
|
445 |
+
$user = get_user_by( 'id', $attachment->post_author );
|
446 |
+
if ( isset( $user->data->display_name ) )
|
447 |
+
$markup_values['author'] = wptexturize( $user->data->display_name );
|
448 |
+
else
|
449 |
+
$markup_values['author'] = 'unknown';
|
450 |
+
|
451 |
+
$post_meta = MLAData::mla_fetch_attachment_metadata( $attachment->ID );
|
452 |
+
if ( !empty( $post_meta['mla_wp_attachment_metadata'] ) ) {
|
453 |
+
$base_file = $post_meta['mla_wp_attachment_metadata']['file'];
|
454 |
+
$sizes = $post_meta['mla_wp_attachment_metadata']['sizes'];
|
455 |
+
$markup_values['width'] = $post_meta['mla_wp_attachment_metadata']['width'];
|
456 |
+
$markup_values['height'] = $post_meta['mla_wp_attachment_metadata']['height'];
|
457 |
+
$markup_values['image_meta'] = wptexturize( var_export( $post_meta['mla_wp_attachment_metadata']['image_meta'], true ) );
|
458 |
+
}
|
459 |
+
else {
|
460 |
+
$base_file = $post_meta['mla_wp_attached_file'];
|
461 |
+
$sizes = array();
|
462 |
+
}
|
463 |
+
|
464 |
+
if ( isset( $post_meta['mla_wp_attachment_image_alt'] ) )
|
465 |
+
$markup_values['image_alt'] = wptexturize( $post_meta['mla_wp_attachment_image_alt'] );
|
466 |
+
|
467 |
+
if ( ! empty( $base_file ) ) {
|
468 |
+
$last_slash = strrpos( $base_file, '/' );
|
469 |
+
if ( false === $last_slash ) {
|
470 |
+
$file_name = $base_file;
|
471 |
+
$markup_values['base_file'] = wptexturize( $base_file );
|
472 |
+
$markup_values['file'] = wptexturize( $base_file );
|
473 |
+
}
|
474 |
+
else {
|
475 |
+
$file_name = substr( $base_file, $last_slash + 1 );
|
476 |
+
$markup_values['base_file'] = wptexturize( $base_file );
|
477 |
+
$markup_values['path'] = wptexturize( substr( $base_file, 0, $last_slash + 1 ) );
|
478 |
+
$markup_values['file'] = wptexturize( $file_name );
|
479 |
+
}
|
480 |
+
}
|
481 |
+
else
|
482 |
+
$file_name = '';
|
483 |
+
|
484 |
+
$parent_info = MLAData::mla_fetch_attachment_parent_data( $attachment->post_parent );
|
485 |
+
if ( isset( $parent_info['parent_title'] ) )
|
486 |
+
$markup_values['parent_title'] = wptexturize( $parent_info['parent_title'] );
|
487 |
+
|
488 |
+
if ( isset( $parent_info['parent_date'] ) )
|
489 |
+
$markup_values['parent_date'] = wptexturize( $parent_info['parent_date'] );
|
490 |
+
|
491 |
+
if ( isset( $parent_info['parent_type'] ) )
|
492 |
+
$markup_values['parent_type'] = wptexturize( $parent_info['parent_type'] );
|
493 |
+
|
494 |
+
/*
|
495 |
+
* Add variable placeholders
|
496 |
+
*/
|
497 |
+
foreach ( $terms_placeholders as $key => $value ) {
|
498 |
+
$text = '';
|
499 |
+
$terms = wp_get_object_terms( $attachment->ID, $value['value'] );
|
500 |
+
|
501 |
+
if ( is_wp_error( $terms ) || empty( $terms ) )
|
502 |
+
$text = '';
|
503 |
+
else {
|
504 |
+
if ( $value['single'] )
|
505 |
+
$text = sanitize_term_field( 'name', $terms[0]->name, $terms[0]->term_id, $value, 'display' );
|
506 |
+
else
|
507 |
+
foreach ( $terms as $term ) {
|
508 |
+
$term_name = sanitize_term_field( 'name', $term->name, $term->term_id, $value, 'display' );
|
509 |
+
$text .= strlen( $text ) ? ', ' . $term_name : $term_name;
|
510 |
+
}
|
511 |
+
}
|
512 |
+
|
513 |
+
$markup_values[ $key ] = $text;
|
514 |
+
} // $terms_placeholders
|
515 |
+
|
516 |
+
foreach ( $custom_placeholders as $key => $value ) {
|
517 |
+
$record = get_metadata( 'post', $attachment->ID, $value['value'], $value['single'] );
|
518 |
+
|
519 |
+
if ( is_wp_error( $record ) || empty( $record ) )
|
520 |
+
$text = '';
|
521 |
+
elseif ( is_scalar( $record ) )
|
522 |
+
$text = (string) $record;
|
523 |
+
elseif ( is_array( $record ) ) {
|
524 |
+
$text = '';
|
525 |
+
foreach ( $record as $term ) {
|
526 |
+
$term_name = sanitize_text_field( $term );
|
527 |
+
$text .= strlen( $text ) ? ', ' . $term_name : $term_name;
|
528 |
+
}
|
529 |
+
} // is_array
|
530 |
+
else
|
531 |
+
$text = '';
|
532 |
+
|
533 |
+
$markup_values[ $key ] = $text;
|
534 |
+
} // $custom_placeholders
|
535 |
+
|
536 |
+
if ( !empty( $iptc_placeholders ) || !empty( $exif_placeholders ) ) {
|
537 |
+
$image_metadata = MLAData::mla_fetch_attachment_image_metadata( $attachment->ID );
|
538 |
+
}
|
539 |
+
|
540 |
+
foreach ( $iptc_placeholders as $key => $value ) {
|
541 |
+
// convert friendly name/slug to identifier
|
542 |
+
if ( array_key_exists( $value['value'], self::$mla_iptc_keys ) ) {
|
543 |
+
$value['value'] = self::$mla_iptc_keys[ $value['value'] ];
|
544 |
+
}
|
545 |
+
|
546 |
+
$text = '';
|
547 |
+
if ( array_key_exists( $value['value'], $image_metadata['mla_iptc_metadata'] ) ) {
|
548 |
+
$record = $image_metadata['mla_iptc_metadata'][ $value['value'] ];
|
549 |
+
if ( is_array( $record ) ) {
|
550 |
+
if ( $value['single'] )
|
551 |
+
$text = $record[0];
|
552 |
+
else
|
553 |
+
foreach ( $record as $term ) {
|
554 |
+
$term_name = sanitize_text_field( $term );
|
555 |
+
$text .= strlen( $text ) ? ', ' . $term_name : $term_name;
|
556 |
+
}
|
557 |
+
} // is_array
|
558 |
+
else
|
559 |
+
$text = $record;
|
560 |
+
}
|
561 |
+
|
562 |
+
$markup_values[ $key ] = $text;
|
563 |
+
} // $iptc_placeholders
|
564 |
+
|
565 |
+
foreach ( $exif_placeholders as $key => $value ) {
|
566 |
+
$markup_values[ $key ] = MLAData::mla_exif_metadata_value( $value['value'], $image_metadata );
|
567 |
+
} // $exif_placeholders
|
568 |
+
|
569 |
+
unset(
|
570 |
+
$markup_values['caption'],
|
571 |
+
$markup_values['pagelink'],
|
572 |
+
$markup_values['filelink'],
|
573 |
+
$markup_values['link'],
|
574 |
+
$markup_values['pagelink_url'],
|
575 |
+
$markup_values['filelink_url'],
|
576 |
+
$markup_values['link_url'],
|
577 |
+
$markup_values['thumbnail_content'],
|
578 |
+
$markup_values['thumbnail_width'],
|
579 |
+
$markup_values['thumbnail_height'],
|
580 |
+
$markup_values['thumbnail_url']
|
581 |
+
);
|
582 |
+
|
583 |
+
if ( $markup_values['captiontag'] ) {
|
584 |
+
if ( ! empty( $arguments['mla_caption'] ) ) {
|
585 |
+
$new_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_caption'] ) );
|
586 |
+
$markup_values['caption'] = wptexturize( MLAData::mla_parse_template( $new_text, $markup_values ) );
|
587 |
+
}
|
588 |
+
else
|
589 |
+
$markup_values['caption'] = wptexturize( $attachment->post_excerpt );
|
590 |
+
}
|
591 |
+
else
|
592 |
+
$markup_values['caption'] = '';
|
593 |
+
|
594 |
+
if ( ! empty( $arguments['mla_link_text'] ) ) {
|
595 |
+
$link_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_link_text'] ) );
|
596 |
+
$link_text = MLAData::mla_parse_template( $link_text, $markup_values );
|
597 |
+
}
|
598 |
+
else
|
599 |
+
$link_text = false;
|
600 |
+
|
601 |
+
$markup_values['pagelink'] = wp_get_attachment_link($attachment->ID, $size, true, $show_icon, $link_text);
|
602 |
+
$markup_values['filelink'] = wp_get_attachment_link($attachment->ID, $size, false, $show_icon, $link_text);
|
603 |
+
|
604 |
+
if ( ! empty( $arguments['mla_target'] ) ) {
|
605 |
+
$markup_values['pagelink'] = str_replace( '<a href=', '<a target="' . $arguments['mla_target'] . '" href=', $markup_values['pagelink'] );
|
606 |
+
$markup_values['filelink'] = str_replace( '<a href=', '<a target="' . $arguments['mla_target'] . '" href=', $markup_values['filelink'] );
|
607 |
+
}
|
608 |
+
|
609 |
+
if ( ! empty( $arguments['mla_rollover_text'] ) ) {
|
610 |
+
$new_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_rollover_text'] ) );
|
611 |
+
$new_text = MLAData::mla_parse_template( $new_text, $markup_values );
|
612 |
+
|
613 |
+
/*
|
614 |
+
* Replace single- and double-quote delimited values
|
615 |
+
*/
|
616 |
+
$markup_values['pagelink'] = preg_replace('# title=\'([^\']*)\'#', " title='{$new_text}'", $markup_values['pagelink'] );
|
617 |
+
$markup_values['pagelink'] = preg_replace('# title=\"([^\"]*)\"#', " title=\"{$new_text}\"", $markup_values['pagelink'] );
|
618 |
+
$markup_values['filelink'] = preg_replace('# title=\'([^\']*)\'#', " title='{$new_text}'", $markup_values['filelink'] );
|
619 |
+
$markup_values['filelink'] = preg_replace('# title=\"([^\"]*)\"#', " title=\"{$new_text}\"", $markup_values['filelink'] );
|
620 |
+
}
|
621 |
+
|
622 |
+
switch ( $arguments['link'] ) {
|
623 |
+
case 'permalink':
|
624 |
+
$markup_values['link'] = $markup_values['pagelink'];
|
625 |
+
break;
|
626 |
+
case 'file':
|
627 |
+
case 'full':
|
628 |
+
$markup_values['link'] = $markup_values['filelink'];
|
629 |
+
break;
|
630 |
+
default:
|
631 |
+
$markup_values['link'] = $markup_values['filelink'];
|
632 |
+
|
633 |
+
/*
|
634 |
+
* Check for link to specific (registered) file size
|
635 |
+
*/
|
636 |
+
if ( array_key_exists( $arguments['link'], $sizes ) ) {
|
637 |
+
$target_file = $sizes[ $arguments['link'] ]['file'];
|
638 |
+
$markup_values['link'] = str_replace( $file_name, $target_file, $markup_values['filelink'] );
|
639 |
+
}
|
640 |
+
} // switch 'link'
|
641 |
+
|
642 |
+
/*
|
643 |
+
* Extract target and thumbnail fields
|
644 |
+
*/
|
645 |
+
$match_count = preg_match_all( '#href=\'([^\']+)\' title=\'([^\']*)\'#', $markup_values['pagelink'], $matches, PREG_OFFSET_CAPTURE );
|
646 |
+
if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
|
647 |
+
$markup_values['pagelink_url'] = $matches[1][0][0];
|
648 |
+
}
|
649 |
+
else
|
650 |
+
$markup_values['pagelink_url'] = '';
|
651 |
+
|
652 |
+
$match_count = preg_match_all( '#href=\'([^\']+)\'#', $markup_values['filelink'], $matches, PREG_OFFSET_CAPTURE );
|
653 |
+
if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
|
654 |
+
$markup_values['filelink_url'] = $matches[1][0][0];
|
655 |
+
}
|
656 |
+
else
|
657 |
+
$markup_values['filelink_url'] = '';
|
658 |
+
|
659 |
+
$match_count = preg_match_all( '#href=\'([^\']+)\'#', $markup_values['link'], $matches, PREG_OFFSET_CAPTURE );
|
660 |
+
if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
|
661 |
+
$markup_values['link_url'] = $matches[1][0][0];
|
662 |
+
}
|
663 |
+
else
|
664 |
+
$markup_values['link_url'] = '';
|
665 |
+
|
666 |
+
$match_count = preg_match_all( '#\<a [^\>]+\>(.*)\</a\>#', $markup_values['link'], $matches, PREG_OFFSET_CAPTURE );
|
667 |
+
if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
|
668 |
+
$markup_values['thumbnail_content'] = $matches[1][0][0];
|
669 |
+
}
|
670 |
+
else
|
671 |
+
$markup_values['thumbnail_content'] = '';
|
672 |
+
|
673 |
+
$match_count = preg_match_all( '#img width=\"([^\"]+)\" height=\"([^\"]+)\" src=\"([^\"]+)\"#', $markup_values['link'], $matches, PREG_OFFSET_CAPTURE );
|
674 |
+
if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
|
675 |
+
$markup_values['thumbnail_width'] = $matches[1][0][0];
|
676 |
+
$markup_values['thumbnail_height'] = $matches[2][0][0];
|
677 |
+
$markup_values['thumbnail_url'] = $matches[3][0][0];
|
678 |
+
}
|
679 |
+
else {
|
680 |
+
$markup_values['thumbnail_width'] = '';
|
681 |
+
$markup_values['thumbnail_height'] = '';
|
682 |
+
$markup_values['thumbnail_url'] = '';
|
683 |
+
}
|
684 |
+
|
685 |
+
/*
|
686 |
+
* Check for Google file viewer substitution
|
687 |
+
*/
|
688 |
+
if ( $arguments['mla_viewer'] && empty( $markup_values['thumbnail_url'] ) ) {
|
689 |
+
$last_dot = strrpos( $markup_values['file'], '.' );
|
690 |
+
if ( !( false === $last_dot) ) {
|
691 |
+
$extension = substr( $markup_values['file'], $last_dot + 1 );
|
692 |
+
if ( in_array( $extension, $arguments['mla_viewer_extensions'] ) ) {
|
693 |
+
$markup_values['thumbnail_content'] = sprintf( '<img src="http://docs.google.com/viewer?url=%1$s&a=bi&pagenumber=%2$d&w=%3$d">', $markup_values['filelink_url'], $arguments['mla_viewer_page'], $arguments['mla_viewer_width'] );
|
694 |
+
$markup_values['pagelink'] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $markup_values['pagelink_url'], $markup_values['title'], $markup_values['thumbnail_content'] );
|
695 |
+
$markup_values['filelink'] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $markup_values['filelink_url'], $markup_values['title'], $markup_values['thumbnail_content'] );
|
696 |
+
|
697 |
+
if ( 'permalink' == $arguments['link'] )
|
698 |
+
$markup_values['link'] = $markup_values['pagelink'];
|
699 |
+
else
|
700 |
+
$markup_values['link'] = $markup_values['filelink'];
|
701 |
+
} // viewer extension
|
702 |
+
} // has extension
|
703 |
+
} // mla_viewer
|
704 |
+
|
705 |
+
/*
|
706 |
+
* Start of row markup
|
707 |
+
*/
|
708 |
+
if ( $markup_values['columns'] > 0 && $i % $markup_values['columns'] == 0 )
|
709 |
+
$output .= MLAData::mla_parse_template( $row_open_template, $markup_values );
|
710 |
+
|
711 |
+
/*
|
712 |
+
* item markup
|
713 |
+
*/
|
714 |
+
$output .= MLAData::mla_parse_template( $item_template, $markup_values );
|
715 |
+
|
716 |
+
/*
|
717 |
+
* End of row markup
|
718 |
+
*/
|
719 |
+
$i++;
|
720 |
+
if ( $markup_values['columns'] > 0 && $i % $markup_values['columns'] == 0 )
|
721 |
+
$output .= MLAData::mla_parse_template( $row_close_template, $markup_values );
|
722 |
+
}
|
723 |
+
|
724 |
+
/*
|
725 |
+
* Close out partial row
|
726 |
+
*/
|
727 |
+
if ( ! ($markup_values['columns'] > 0 && $i % $markup_values['columns'] == 0 ) )
|
728 |
+
$output .= MLAData::mla_parse_template( $row_close_template, $markup_values );
|
729 |
+
|
730 |
+
$output .= MLAData::mla_parse_template( $close_template, $markup_values );
|
731 |
+
|
732 |
+
return $output;
|
733 |
+
}
|
734 |
+
|
735 |
+
/**
|
736 |
+
* Cleans up damage caused by the Visual Editor to the tax_query and meta_query specifications
|
737 |
+
*
|
738 |
+
* @since 1.14
|
739 |
+
*
|
740 |
+
* @param string query specification; PHP nested arrays
|
741 |
+
*
|
742 |
+
* @return string query specification with HTML escape sequences and line breaks removed
|
743 |
+
*/
|
744 |
+
private static function _sanitize_query_specification( $specification ) {
|
745 |
+
$specification = wp_specialchars_decode( $specification );
|
746 |
+
$specification = str_replace( array( '<br />', '<p>', '</p>', "\r", "\n" ), ' ', $specification );
|
747 |
+
return $specification;
|
748 |
+
}
|
749 |
+
|
750 |
+
/**
|
751 |
+
* Parses shortcode parameters and returns the gallery objects
|
752 |
+
*
|
753 |
+
* @since .50
|
754 |
+
*
|
755 |
+
* @param int Post ID of the parent
|
756 |
+
* @param array Attributes of the shortcode
|
757 |
+
*
|
758 |
+
* @return array List of attachments returned from WP_Query
|
759 |
+
*/
|
760 |
+
public static function mla_get_shortcode_attachments( $post_parent, $attr ) {
|
761 |
+
/*
|
762 |
+
* These are the parameters for the query
|
763 |
+
*/
|
764 |
+
$default_arguments = array(
|
765 |
+
'order' => 'ASC', // or 'DESC' or 'RAND'
|
766 |
+
'orderby' => 'menu_order ID',
|
767 |
+
'id' => NULL,
|
768 |
+
'ids' => array(),
|
769 |
+
'include' => array(),
|
770 |
+
'exclude' => array(),
|
771 |
+
// MLA extensions, from WP_Query
|
772 |
+
// Force 'get_children' style query
|
773 |
+
'post_parent' => NULL, // post/page ID or 'current' or 'all'
|
774 |
+
// Author
|
775 |
+
'author' => NULL,
|
776 |
+
'author_name' => '',
|
777 |
+
// Category
|
778 |
+
'cat' => 0,
|
779 |
+
'category_name' => '',
|
780 |
+
'category__and' => array(),
|
781 |
+
'category__in' => array(),
|
782 |
+
'category__not_in' => array(),
|
783 |
+
// Tag
|
784 |
+
'tag' => '',
|
785 |
+
'tag_id' => 0,
|
786 |
+
'tag__and' => array(),
|
787 |
+
'tag__in' => array(),
|
788 |
+
'tag__not_in' => array(),
|
789 |
+
'tag_slug__and' => array(),
|
790 |
+
'tag_slug__in' => array(),
|
791 |
+
// Taxonomy parameters are handled separately
|
792 |
+
// {tax_slug} => 'term' | array ( 'term, 'term, ... )
|
793 |
+
// 'tax_query' => ''
|
794 |
+
'tax_operator' => '',
|
795 |
+
// Post
|
796 |
+
'post_type' => 'attachment',
|
797 |
+
'post_status' => 'inherit',
|
798 |
+
'post_mime_type' => 'image',
|
799 |
+
// Pagination - no default for most of these
|
800 |
+
'nopaging' => true,
|
801 |
+
'posts_per_page' => 0,
|
802 |
+
'posts_per_archive_page' => 0,
|
803 |
+
'paged' => NULL, // page number or 'current'
|
804 |
+
'offset' => NULL,
|
805 |
+
// TBD Time
|
806 |
+
// Custom Field
|
807 |
+
'meta_key' => '',
|
808 |
+
'meta_value' => '',
|
809 |
+
'meta_value_num' => NULL,
|
810 |
+
'meta_compare' => '',
|
811 |
+
'meta_query' => '',
|
812 |
+
// Search
|
813 |
+
's' => ''
|
814 |
+
);
|
815 |
+
|
816 |
+
/*
|
817 |
+
* Merge input arguments with defaults, then extract the query arguments.
|
818 |
+
*/
|
819 |
+
|
820 |
+
if ( is_string( $attr ) )
|
821 |
+
$attr = shortcode_parse_atts( $attr );
|
822 |
+
|
823 |
+
$arguments = shortcode_atts( $default_arguments, $attr );
|
824 |
+
self::$query_parameters = array();
|
825 |
+
|
826 |
+
/*
|
827 |
+
* 'RAND' is not documented in the codex, but is present in the code.
|
828 |
+
*/
|
829 |
+
if ( 'RAND' == strtoupper( $arguments['order'] ) ) {
|
830 |
+
$arguments['orderby'] = 'none';
|
831 |
+
unset( $arguments['order'] );
|
832 |
+
}
|
833 |
+
|
834 |
+
if ( !empty( $arguments['ids'] ) ) {
|
835 |
+
// 'ids' is explicitly ordered, unless you specify otherwise.
|
836 |
+
if ( empty( $attr['orderby'] ) )
|
837 |
+
$arguments['orderby'] = 'post__in';
|
838 |
+
|
839 |
+
$arguments['include'] = $arguments['ids'];
|
840 |
+
}
|
841 |
+
unset( $arguments['ids'] );
|
842 |
+
|
843 |
+
/*
|
844 |
+
* Extract taxonomy arguments
|
845 |
+
*/
|
846 |
+
$taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'names' ); // 'objects'
|
847 |
+
$query_arguments = array();
|
848 |
+
if ( ! empty( $attr ) ) {
|
849 |
+
foreach ( $attr as $key => $value ) {
|
850 |
+
if ( 'tax_query' == $key ) {
|
851 |
+
if ( is_array( $value ) )
|
852 |
+
$query_arguments[ $key ] = $value;
|
853 |
+
else {
|
854 |
+
$value = self::_sanitize_query_specification( $value );
|
855 |
+
$function = @create_function('', 'return ' . $value . ';' );
|
856 |
+
|
857 |
+
if ( is_callable( $function ) )
|
858 |
+
$query_arguments[ $key ] = $function();
|
859 |
+
else
|
860 |
+
return '<p>ERROR: invalid mla_gallery tax_query = ' . var_export( $value, true ) . '</p>';
|
861 |
+
} // not array
|
862 |
+
} // tax_query
|
863 |
+
elseif ( array_key_exists( $key, $taxonomies ) ) {
|
864 |
+
$query_arguments[ $key ] = implode(',', array_filter( array_map( 'trim', explode( ',', $value ) ) ) );
|
865 |
+
|
866 |
+
if ( in_array( strtoupper( $arguments['tax_operator'] ), array( 'IN', 'NOT IN', 'AND' ) ) ) {
|
867 |
+
$query_arguments['tax_query'] = array( array( 'taxonomy' => $key, 'field' => 'slug', 'terms' => explode( ',', $query_arguments[ $key ] ), 'operator' => strtoupper( $arguments['tax_operator'] ) ) );
|
868 |
+
unset( $query_arguments[ $key ] );
|
869 |
+
}
|
870 |
+
|
871 |
+
} // array_key_exists
|
872 |
+
} //foreach $attr
|
873 |
+
} // ! empty
|
874 |
+
|
875 |
+
// We're trusting author input, but let's at least make sure it looks like a valid orderby statement
|
876 |
+
if ( isset( $arguments['orderby'] ) ) {
|
877 |
+
$arguments['orderby'] = sanitize_sql_orderby( $arguments['orderby'] );
|
878 |
+
if ( ! $arguments['orderby'] )
|
879 |
+
unset( $arguments['orderby'] );
|
880 |
+
}
|
881 |
+
|
882 |
+
/*
|
883 |
+
* $query_arguments has been initialized in the taxonomy code above.
|
884 |
+
*/
|
885 |
+
$use_children = empty( $query_arguments );
|
886 |
+
foreach ($arguments as $key => $value ) {
|
887 |
+
/*
|
888 |
+
* There are several "fallthru" cases in this switch statement that decide
|
889 |
+
* whether or not to limit the query to children of a specific post.
|
890 |
+
*/
|
891 |
+
$children_ok = true;
|
892 |
+
switch ( $key ) {
|
893 |
+
case 'post_parent':
|
894 |
+
switch ( strtolower( $value ) ) {
|
895 |
+
case 'all':
|
896 |
+
$value = NULL;
|
897 |
+
$use_children = false;
|
898 |
+
break;
|
899 |
+
case 'any':
|
900 |
+
self::$query_parameters['post_parent'] = 'any';
|
901 |
+
$value = NULL;
|
902 |
+
$use_children = false;
|
903 |
+
break;
|
904 |
+
case 'current':
|
905 |
+
$value = $post_parent;
|
906 |
+
break;
|
907 |
+
case 'none':
|
908 |
+
self::$query_parameters['post_parent'] = 'none';
|
909 |
+
$value = NULL;
|
910 |
+
$use_children = false;
|
911 |
+
break;
|
912 |
+
}
|
913 |
+
// fallthru
|
914 |
+
case 'id':
|
915 |
+
case 'posts_per_page':
|
916 |
+
case 'posts_per_archive_page':
|
917 |
+
if ( is_numeric( $value ) ) {
|
918 |
+
$value = intval( $value );
|
919 |
+
if ( ! empty( $value ) ) {
|
920 |
+
$query_arguments[ $key ] = $value;
|
921 |
+
if ( ! $children_ok )
|
922 |
+
$use_children = false;
|
923 |
+
}
|
924 |
+
}
|
925 |
+
unset( $arguments[ $key ] );
|
926 |
+
break;
|
927 |
+
case 'meta_value_num':
|
928 |
+
$children_ok = false;
|
929 |
+
// fallthru
|
930 |
+
case 'offset':
|
931 |
+
if ( is_numeric( $value ) ) {
|
932 |
+
$query_arguments[ $key ] = intval( $value );
|
933 |
+
if ( ! $children_ok )
|
934 |
+
$use_children = false;
|
935 |
+
}
|
936 |
+
unset( $arguments[ $key ] );
|
937 |
+
break;
|
938 |
+
case 'paged':
|
939 |
+
if ( 'current' == strtolower( $value ) )
|
940 |
+
$query_arguments[ $key ] = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
941 |
+
elseif ( is_numeric( $value ) )
|
942 |
+
$query_arguments[ $key ] = intval( $value );
|
943 |
+
unset( $arguments[ $key ] );
|
944 |
+
break;
|
945 |
+
case 'author':
|
946 |
+
case 'cat':
|
947 |
+
case 'tag_id':
|
948 |
+
if ( ! empty( $value ) ) {
|
949 |
+
if ( is_array( $value ) )
|
950 |
+
$query_arguments[ $key ] = array_filter( $value );
|
951 |
+
else
|
952 |
+
$query_arguments[ $key ] = array_filter( array_map( 'intval', explode( ",", $value ) ) );
|
953 |
+
|
954 |
+
if ( 1 == count( $query_arguments[ $key ] ) )
|
955 |
+
$query_arguments[ $key ] = $query_arguments[ $key ][0];
|
956 |
+
else
|
957 |
+
$query_arguments[ $key ] = implode(',', $query_arguments[ $key ] );
|
958 |
+
|
959 |
+
$use_children = false;
|
960 |
+
}
|
961 |
+
unset( $arguments[ $key ] );
|
962 |
+
break;
|
963 |
+
case 'category__and':
|
964 |
+
case 'category__in':
|
965 |
+
case 'category__not_in':
|
966 |
+
case 'tag__and':
|
967 |
+
case 'tag__in':
|
968 |
+
case 'tag__not_in':
|
969 |
+
case 'include':
|
970 |
+
$children_ok = false;
|
971 |
+
// fallthru
|
972 |
+
case 'exclude':
|
973 |
+
if ( ! empty( $value ) ) {
|
974 |
+
if ( is_array( $value ) )
|
975 |
+
$query_arguments[ $key ] = array_filter( $value );
|
976 |
+
else
|
977 |
+
$query_arguments[ $key ] = array_filter( array_map( 'intval', explode( ",", $value ) ) );
|
978 |
+
|
979 |
+
if ( ! $children_ok )
|
980 |
+
$use_children = false;
|
981 |
+
}
|
982 |
+
unset( $arguments[ $key ] );
|
983 |
+
break;
|
984 |
+
case 'tag_slug__and':
|
985 |
+
case 'tag_slug__in':
|
986 |
+
if ( ! empty( $value ) ) {
|
987 |
+
if ( is_array( $value ) )
|
988 |
+
$query_arguments[ $key ] = $value;
|
989 |
+
else
|
990 |
+
$query_arguments[ $key ] = array_filter( array_map( 'trim', explode( ",", $value ) ) );
|
991 |
+
|
992 |
+
$use_children = false;
|
993 |
+
}
|
994 |
+
unset( $arguments[ $key ] );
|
995 |
+
break;
|
996 |
+
case 'nopaging': // boolean
|
997 |
+
if ( ! empty( $value ) && ( 'false' != strtolower( $value ) ) )
|
998 |
+
$query_arguments[ $key ] = true;
|
999 |
+
unset( $arguments[ $key ] );
|
1000 |
+
break;
|
1001 |
+
case 'author_name':
|
1002 |
+
case 'category_name':
|
1003 |
+
case 'tag':
|
1004 |
+
case 'meta_key':
|
1005 |
+
case 'meta_value':
|
1006 |
+
case 'meta_compare':
|
1007 |
+
case 's':
|
1008 |
+
$children_ok = false;
|
1009 |
+
// fallthru
|
1010 |
+
case 'post_type':
|
1011 |
+
case 'post_status':
|
1012 |
+
case 'post_mime_type':
|
1013 |
+
case 'orderby':
|
1014 |
+
if ( ! empty( $value ) ) {
|
1015 |
+
$query_arguments[ $key ] = $value;
|
1016 |
+
|
1017 |
+
if ( ! $children_ok )
|
1018 |
+
$use_children = false;
|
1019 |
+
}
|
1020 |
+
unset( $arguments[ $key ] );
|
1021 |
+
break;
|
1022 |
+
case 'order':
|
1023 |
+
if ( ! empty( $value ) ) {
|
1024 |
+
$value = strtoupper( $value );
|
1025 |
+
if ( in_array( $value, array( 'ASC', 'DESC' ) ) )
|
1026 |
+
$query_arguments[ $key ] = $value;
|
1027 |
+
}
|
1028 |
+
unset( $arguments[ $key ] );
|
1029 |
+
break;
|
1030 |
+
case 'meta_query':
|
1031 |
+
if ( ! empty( $value ) ) {
|
1032 |
+
if ( is_array( $value ) )
|
1033 |
+
$query_arguments[ $key ] = $value;
|
1034 |
+
else {
|
1035 |
+
$function = @create_function('', 'return ' . $value . ';' );
|
1036 |
+
|
1037 |
+
if ( is_callable( $function ) )
|
1038 |
+
$query_arguments[ $key ] = $function();
|
1039 |
+
else
|
1040 |
+
return '<p>ERROR: invalid mla_gallery meta_query = ' . var_export( $value, true ) . '</p>';
|
1041 |
+
} // not array
|
1042 |
+
|
1043 |
+
$use_children = false;
|
1044 |
+
}
|
1045 |
+
unset( $arguments[ $key ] );
|
1046 |
+
break;
|
1047 |
+
default:
|
1048 |
+
// ignore anything else
|
1049 |
+
} // switch $key
|
1050 |
+
} // foreach $arguments
|
1051 |
+
|
1052 |
+
/*
|
1053 |
+
* Decide whether to use a "get_children" style query
|
1054 |
+
*/
|
1055 |
+
if ( $use_children && empty( $query_arguments['post_parent'] ) ) {
|
1056 |
+
if ( empty( $query_arguments['id'] ) )
|
1057 |
+
$query_arguments['post_parent'] = $post_parent;
|
1058 |
+
else
|
1059 |
+
$query_arguments['post_parent'] = $query_arguments['id'];
|
1060 |
+
|
1061 |
+
unset( $query_arguments['id'] );
|
1062 |
+
}
|
1063 |
+
|
1064 |
+
if ( isset( $query_arguments['posts_per_page'] ) || isset( $query_arguments['posts_per_archive_page'] ) ||
|
1065 |
+
isset( $query_arguments['paged'] ) || isset( $query_arguments['offset'] ) ) {
|
1066 |
+
unset ( $query_arguments['nopaging'] );
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
if ( isset( $query_arguments['orderby'] ) && ('rand' == $query_arguments['orderby'] ) )
|
1070 |
+
unset ( $query_arguments['order'] );
|
1071 |
+
|
1072 |
+
if ( isset( $query_arguments['post_mime_type'] ) && ('all' == strtolower( $query_arguments['post_mime_type'] ) ) )
|
1073 |
+
unset ( $query_arguments['post_mime_type'] );
|
1074 |
+
|
1075 |
+
if ( ! empty($query_arguments['include']) ) {
|
1076 |
+
$incposts = wp_parse_id_list( $query_arguments['include'] );
|
1077 |
+
$query_arguments['posts_per_page'] = count($incposts); // only the number of posts included
|
1078 |
+
$query_arguments['post__in'] = $incposts;
|
1079 |
+
} elseif ( ! empty($query_arguments['exclude']) )
|
1080 |
+
$query_arguments['post__not_in'] = wp_parse_id_list( $query_arguments['exclude'] );
|
1081 |
+
|
1082 |
+
$query_arguments['ignore_sticky_posts'] = true;
|
1083 |
+
$query_arguments['no_found_rows'] = true;
|
1084 |
+
|
1085 |
+
add_filter( 'posts_where', 'MLAShortcodes::mla_shortcode_query_posts_where_filter' );
|
1086 |
+
$get_posts = new WP_Query;
|
1087 |
+
$attachments = $get_posts->query($query_arguments);
|
1088 |
+
remove_filter( 'posts_where', 'MLAShortcodes::mla_shortcode_query_posts_where_filter' );
|
1089 |
+
|
1090 |
+
if ( self::$mla_debug ) {
|
1091 |
+
self::$mla_debug_messages .= '<p><strong>mla_debug</strong> query = ' . var_export( $query_arguments, true ) . '</p>';
|
1092 |
+
self::$mla_debug_messages .= '<p><strong>mla_debug</strong> request = ' . var_export( $get_posts->request, true ) . '</p>';
|
1093 |
+
self::$mla_debug_messages .= '<p><strong>mla_debug</strong> query_vars = ' . var_export( $get_posts->query_vars, true ) . '</p>';
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
return $attachments;
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
/**
|
1100 |
+
* Filters the WHERE clause for shortcode queries
|
1101 |
+
*
|
1102 |
+
* Captures debug information. Adds whitespace to the post_type = 'attachment'
|
1103 |
+
* phrase to circumvent subsequent Role Scoper modification of the clause.
|
1104 |
+
* Handles post_parent "any" and "none" cases.
|
1105 |
+
* Defined as public because it's a filter.
|
1106 |
+
*
|
1107 |
+
* @since 0.70
|
1108 |
+
*
|
1109 |
+
* @param string query clause before modification
|
1110 |
+
*
|
1111 |
+
* @return string query clause after modification
|
1112 |
+
*/
|
1113 |
+
public static function mla_shortcode_query_posts_where_filter( $where_clause ) {
|
1114 |
+
global $table_prefix;
|
1115 |
+
|
1116 |
+
if ( self::$mla_debug ) {
|
1117 |
+
$old_clause = $where_clause;
|
1118 |
+
self::$mla_debug_messages .= '<p><strong>mla_debug</strong> WHERE filter = ' . var_export( $where_clause, true ) . '</p>';
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
if ( strpos( $where_clause, "post_type = 'attachment'" ) ) {
|
1122 |
+
$where_clause = str_replace( "post_type = 'attachment'", "post_type = 'attachment'", $where_clause );
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
if ( isset( self::$query_parameters['post_parent'] ) ) {
|
1126 |
+
switch ( self::$query_parameters['post_parent'] ) {
|
1127 |
+
case 'any':
|
1128 |
+
$where_clause .= " AND {$table_prefix}posts.post_parent > 0";
|
1129 |
+
break;
|
1130 |
+
case 'none':
|
1131 |
+
$where_clause .= " AND {$table_prefix}posts.post_parent < 1";
|
1132 |
+
break;
|
1133 |
+
}
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
if ( self::$mla_debug && ( $old_clause != $where_clause ) )
|
1137 |
+
self::$mla_debug_messages .= '<p><strong>mla_debug</strong> modified WHERE filter = ' . var_export( $where_clause, true ) . '</p>';
|
1138 |
+
|
1139 |
+
return $where_clause;
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
/**
|
1143 |
+
* IPTC Dataset identifiers and names
|
1144 |
+
*
|
1145 |
+
* This array contains the identifiers and names of Datasets defined in
|
1146 |
+
* the "IPTC-NAA Information Interchange Model Version No. 4.1".
|
1147 |
+
*
|
1148 |
+
* @since 0.90
|
1149 |
+
*
|
1150 |
+
* @var array
|
1151 |
+
*/
|
1152 |
+
private static $mla_iptc_records = array(
|
1153 |
+
// Envelope Record
|
1154 |
+
"1#000" => "Model Version",
|
1155 |
+
"1#005" => "Destination",
|
1156 |
+
"1#020" => "File Format",
|
1157 |
+
"1#022" => "File Format Version",
|
1158 |
+
"1#030" => "Service Identifier",
|
1159 |
+
"1#040" => "Envelope Number",
|
1160 |
+
"1#050" => "Product ID",
|
1161 |
+
"1#060" => "Envelope Priority",
|
1162 |
+
"1#070" => "Date Sent",
|
1163 |
+
"1#080" => "Time Sent",
|
1164 |
+
"1#090" => "Coded Character Set",
|
1165 |
+
"1#100" => "UNO",
|
1166 |
+
"1#120" => "ARM Identifier",
|
1167 |
+
"1#122" => "ARM Version",
|
1168 |
+
|
1169 |
+
// Application Record
|
1170 |
+
"2#000" => "Record Version",
|
1171 |
+
"2#003" => "Object Type Reference",
|
1172 |
+
"2#004" => "Object Attribute Reference",
|
1173 |
+
"2#005" => "Object Name",
|
1174 |
+
"2#007" => "Edit Status",
|
1175 |
+
"2#008" => "Editorial Update",
|
1176 |
+
"2#010" => "Urgency",
|
1177 |
+
"2#012" => "Subject Reference",
|
1178 |
+
"2#015" => "Category",
|
1179 |
+
"2#020" => "Supplemental Category",
|
1180 |
+
"2#022" => "Fixture Identifier",
|
1181 |
+
"2#025" => "Keywords",
|
1182 |
+
"2#026" => "Content Location Code",
|
1183 |
+
"2#027" => "Content Location Name",
|
1184 |
+
"2#030" => "Release Date",
|
1185 |
+
"2#035" => "Release Time",
|
1186 |
+
"2#037" => "Expiration Date",
|
1187 |
+
"2#038" => "Expiration Time",
|
1188 |
+
"2#040" => "Special Instructions",
|
1189 |
+
"2#042" => "Action Advised",
|
1190 |
+
"2#045" => "Reference Service",
|
1191 |
+
"2#047" => "Reference Date",
|
1192 |
+
"2#050" => "Reference Number",
|
1193 |
+
"2#055" => "Date Created",
|
1194 |
+
"2#060" => "Time Created",
|
1195 |
+
"2#062" => "Digital Creation Date",
|
1196 |
+
"2#063" => "Digital Creation Time",
|
1197 |
+
"2#065" => "Originating Program",
|
1198 |
+
"2#070" => "Program Version",
|
1199 |
+
"2#075" => "Object Cycle",
|
1200 |
+
"2#080" => "By-line",
|
1201 |
+
"2#085" => "By-line Title",
|
1202 |
+
"2#090" => "City",
|
1203 |
+
"2#092" => "Sub-location",
|
1204 |
+
"2#095" => "Province or State",
|
1205 |
+
"2#100" => "Country or Primary Location Code",
|
1206 |
+
"2#101" => "Country or Primary Location Name",
|
1207 |
+
"2#103" => "Original Transmission Reference",
|
1208 |
+
"2#105" => "Headline",
|
1209 |
+
"2#110" => "Credit",
|
1210 |
+
"2#115" => "Source",
|
1211 |
+
"2#116" => "Copyright Notice",
|
1212 |
+
"2#118" => "Contact",
|
1213 |
+
"2#120" => "Caption or Abstract",
|
1214 |
+
"2#122" => "Caption Writer or Editor",
|
1215 |
+
"2#125" => "Rasterized Caption",
|
1216 |
+
"2#130" => "Image Type",
|
1217 |
+
"2#131" => "Image Orientation",
|
1218 |
+
"2#135" => "Language Identifier",
|
1219 |
+
"2#150" => "Audio Type",
|
1220 |
+
"2#151" => "Audio Sampling Rate",
|
1221 |
+
"2#152" => "Audio Sampling Resolution",
|
1222 |
+
"2#153" => "Audio Duration",
|
1223 |
+
"2#154" => "Audio Outcue",
|
1224 |
+
"2#200" => "ObjectData Preview File Format",
|
1225 |
+
"2#201" => "ObjectData Preview File Format Version",
|
1226 |
+
"2#202" => "ObjectData Preview Data",
|
1227 |
+
|
1228 |
+
// Pre ObjectData Descriptor Record
|
1229 |
+
"7#010" => "Size Mode",
|
1230 |
+
"7#020" => "Max Subfile Size",
|
1231 |
+
"7#090" => "ObjectData Size Announced",
|
1232 |
+
"7#095" => "Maximum ObjectData Size",
|
1233 |
+
|
1234 |
+
// ObjectData Record
|
1235 |
+
"8#010" => "Subfile",
|
1236 |
+
|
1237 |
+
// Post ObjectData Descriptor Record
|
1238 |
+
"9#010" => "Confirmed ObjectData Size"
|
1239 |
+
);
|
1240 |
+
|
1241 |
+
/**
|
1242 |
+
* IPTC Dataset friendly name/slug and identifiers
|
1243 |
+
*
|
1244 |
+
* This array contains the sanitized names and identifiers of Datasets defined in
|
1245 |
+
* the "IPTC-NAA Information Interchange Model Version No. 4.1".
|
1246 |
+
*
|
1247 |
+
* @since 0.90
|
1248 |
+
*
|
1249 |
+
* @var array
|
1250 |
+
*/
|
1251 |
+
public static $mla_iptc_keys = array(
|
1252 |
+
// Envelope Record
|
1253 |
+
'model-version' => '1#000',
|
1254 |
+
'destination' => '1#005',
|
1255 |
+
'file-format' => '1#020',
|
1256 |
+
'file-format-version' => '1#022',
|
1257 |
+
'service-identifier' => '1#030',
|
1258 |
+
'envelope-number' => '1#040',
|
1259 |
+
'product-id' => '1#050',
|
1260 |
+
'envelope-priority' => '1#060',
|
1261 |
+
'date-sent' => '1#070',
|
1262 |
+
'time-sent' => '1#080',
|
1263 |
+
'coded-character-set' => '1#090',
|
1264 |
+
'uno' => '1#100',
|
1265 |
+
'arm-identifier' => '1#120',
|
1266 |
+
'arm-version' => '1#122',
|
1267 |
+
|
1268 |
+
// Application Record
|
1269 |
+
'record-version' => '2#000',
|
1270 |
+
'object-type-reference' => '2#003',
|
1271 |
+
'object-attribute-reference' => '2#004',
|
1272 |
+
'object-name' => '2#005',
|
1273 |
+
'edit-status' => '2#007',
|
1274 |
+
'editorial-update' => '2#008',
|
1275 |
+
'urgency' => '2#010',
|
1276 |
+
'subject-reference' => '2#012',
|
1277 |
+
'category' => '2#015',
|
1278 |
+
'supplemental-category' => '2#020',
|
1279 |
+
'fixture-identifier' => '2#022',
|
1280 |
+
'keywords' => '2#025',
|
1281 |
+
'content-location-code' => '2#026',
|
1282 |
+
'content-location-name' => '2#027',
|
1283 |
+
'release-date' => '2#030',
|
1284 |
+
'release-time' => '2#035',
|
1285 |
+
'expiration-date' => '2#037',
|
1286 |
+
'expiration-time' => '2#038',
|
1287 |
+
'special-instructions' => '2#040',
|
1288 |
+
'action-advised' => '2#042',
|
1289 |
+
'reference-service' => '2#045',
|
1290 |
+
'reference-date' => '2#047',
|
1291 |
+
'reference-number' => '2#050',
|
1292 |
+
'date-created' => '2#055',
|
1293 |
+
'time-created' => '2#060',
|
1294 |
+
'digital-creation-date' => '2#062',
|
1295 |
+
'digital-creation-time' => '2#063',
|
1296 |
+
'originating-program' => '2#065',
|
1297 |
+
'program-version' => '2#070',
|
1298 |
+
'object-cycle' => '2#075',
|
1299 |
+
'by-line' => '2#080',
|
1300 |
+
'by-line-title' => '2#085',
|
1301 |
+
'city' => '2#090',
|
1302 |
+
'sub-location' => '2#092',
|
1303 |
+
'province-or-state' => '2#095',
|
1304 |
+
'country-or-primary-location-code' => '2#100',
|
1305 |
+
'country-or-primary-location-name' => '2#101',
|
1306 |
+
'original-transmission-reference' => '2#103',
|
1307 |
+
'headline' => '2#105',
|
1308 |
+
'credit' => '2#110',
|
1309 |
+
'source' => '2#115',
|
1310 |
+
'copyright-notice' => '2#116',
|
1311 |
+
'contact' => '2#118',
|
1312 |
+
'caption-or-abstract' => '2#120',
|
1313 |
+
'caption-writer-or-editor' => '2#122',
|
1314 |
+
'rasterized-caption' => '2#125',
|
1315 |
+
'image-type' => '2#130',
|
1316 |
+
'image-orientation' => '2#131',
|
1317 |
+
'language-identifier' => '2#135',
|
1318 |
+
'audio-type' => '2#150',
|
1319 |
+
'audio-sampling-rate' => '2#151',
|
1320 |
+
'audio-sampling-resolution' => '2#152',
|
1321 |
+
'audio-duration' => '2#153',
|
1322 |
+
'audio-outcue' => '2#154',
|
1323 |
+
'objectdata-preview-file-format' => '2#200',
|
1324 |
+
'objectdata-preview-file-format-version' => '2#201',
|
1325 |
+
'objectdata-preview-data' => '2#202',
|
1326 |
+
|
1327 |
+
// Pre ObjectData Descriptor Record
|
1328 |
+
'size-mode' => '7#010',
|
1329 |
+
'max-subfile-size' => '7#020',
|
1330 |
+
'objectdata-size-announced' => '7#090',
|
1331 |
+
'maximum-objectdata-size' => '7#095',
|
1332 |
+
|
1333 |
+
// ObjectData Record
|
1334 |
+
'subfile' => '8#010',
|
1335 |
+
|
1336 |
+
// Post ObjectData Descriptor Record
|
1337 |
+
'confirmed-objectdata-size' => '9#010'
|
1338 |
+
);
|
1339 |
+
|
1340 |
+
/**
|
1341 |
+
* IPTC Dataset descriptions
|
1342 |
+
*
|
1343 |
+
* This array contains the descriptions of Datasets defined in
|
1344 |
+
* the "IPTC-NAA Information Interchange Model Version No. 4.1".
|
1345 |
+
*
|
1346 |
+
* @since 0.90
|
1347 |
+
*
|
1348 |
+
* @var array
|
1349 |
+
*/
|
1350 |
+
private static $mla_iptc_descriptions = array(
|
1351 |
+
// Envelope Record
|
1352 |
+
"1#000" => "2 octet binary IIM version number",
|
1353 |
+
"1#005" => "Max 1024 characters of Destination (ISO routing information); repeatable",
|
1354 |
+
"1#020" => "2 octet binary file format number, see IPTC-NAA V4 Appendix A",
|
1355 |
+
"1#022" => "2 octet binary file format version number",
|
1356 |
+
"1#030" => "Max 10 characters of Service Identifier and product",
|
1357 |
+
"1#040" => "8 Character Envelope Number",
|
1358 |
+
"1#050" => "Max 32 characters subset of provider's overall service; repeatable",
|
1359 |
+
"1#060" => "1 numeric character of envelope handling priority (not urgency)",
|
1360 |
+
"1#070" => "8 numeric characters of Date Sent by service - CCYYMMDD",
|
1361 |
+
"1#080" => "11 characters of Time Sent by service - HHMMSS±HHMM",
|
1362 |
+
"1#090" => "Max 32 characters of control functions, etc.",
|
1363 |
+
"1#100" => "14 to 80 characters of eternal, globally unique identification for objects",
|
1364 |
+
"1#120" => "2 octet binary Abstract Relationship Model Identifier",
|
1365 |
+
"1#122" => "2 octet binary Abstract Relationship Model Version",
|
1366 |
+
|
1367 |
+
// Application Record
|
1368 |
+
"2#000" => "2 octet binary Information Interchange Model, Part II version number",
|
1369 |
+
"2#003" => "3 to 67 Characters of Object Type Reference number and optional text",
|
1370 |
+
"2#004" => "3 to 67 Characters of Object Attribute Reference number and optional text; repeatable",
|
1371 |
+
"2#005" => "Max 64 characters of the object name or shorthand reference",
|
1372 |
+
"2#007" => "Max 64 characters of the status of the objectdata",
|
1373 |
+
"2#008" => "2 numeric characters of the type of update this object provides",
|
1374 |
+
"2#010" => "1 numeric character of the editorial urgency of content",
|
1375 |
+
"2#012" => "13 to 236 characters of a structured definition of the subject matter; repeatable",
|
1376 |
+
"2#015" => "Max 3 characters of the subject of the objectdata, DEPRECATED",
|
1377 |
+
"2#020" => "Max 32 characters (each) of further refinement of subject, DEPRECATED; repeatable",
|
1378 |
+
"2#022" => "Max 32 characters identifying recurring, predictable content",
|
1379 |
+
"2#025" => "Max 64 characters (each) of tags; repeatable",
|
1380 |
+
"2#026" => "3 characters of ISO3166 country code or IPTC-assigned code; repeatable",
|
1381 |
+
"2#027" => "Max 64 characters of publishable country/geographical location name; repeatable",
|
1382 |
+
"2#030" => "8 numeric characters of Release Date - CCYYMMDD",
|
1383 |
+
"2#035" => "11 characters of Release Time (earliest use) - HHMMSS±HHMM",
|
1384 |
+
"2#037" => "8 numeric characters of Expiration Date (latest use) - CCYYMDD",
|
1385 |
+
"2#038" => "11 characters of Expiration Time (latest use) - HHMMSS±HHMM",
|
1386 |
+
"2#040" => "Max 256 Characters of editorial instructions, e.g., embargoes and warnings",
|
1387 |
+
"2#042" => "2 numeric characters of type of action this object provides to a previous object",
|
1388 |
+
"2#045" => "Max 10 characters of the Service ID (1#030) of a prior envelope; repeatable",
|
1389 |
+
"2#047" => "8 numeric characters of prior envelope Reference Date (1#070) - CCYYMMDD; repeatable",
|
1390 |
+
"2#050" => "8 characters of prior envelope Reference Number (1#040); repeatable",
|
1391 |
+
"2#055" => "8 numeric characters of intellectual content Date Created - CCYYMMDD",
|
1392 |
+
"2#060" => "11 characters of intellectual content Time Created - HHMMSS±HHMM",
|
1393 |
+
"2#062" => "8 numeric characters of digital representation creation date - CCYYMMDD",
|
1394 |
+
"2#063" => "11 characters of digital representation creation time - HHMMSS±HHMM",
|
1395 |
+
"2#065" => "Max 32 characters of the program used to create the objectdata",
|
1396 |
+
"2#070" => "Program Version - Max 10 characters of the version of the program used to create the objectdata",
|
1397 |
+
"2#075" => "1 character where a=morning, p=evening, b=both",
|
1398 |
+
"2#080" => "Max 32 Characters of the name of the objectdata creator, e.g., the writer, photographer; repeatable",
|
1399 |
+
"2#085" => "Max 32 characters of the title of the objectdata creator; repeatable",
|
1400 |
+
"2#090" => "Max 32 Characters of the city of objectdata origin",
|
1401 |
+
"2#092" => "Max 32 Characters of the location within the city of objectdata origin",
|
1402 |
+
"2#095" => "Max 32 Characters of the objectdata origin Province or State",
|
1403 |
+
"2#100" => "3 characters of ISO3166 or IPTC-assigned code for Country of objectdata origin",
|
1404 |
+
"2#101" => "Max 64 characters of publishable country/geographical location name of objectdata origin",
|
1405 |
+
"2#103" => "Max 32 characters of a code representing the location of original transmission",
|
1406 |
+
"2#105" => "Max 256 Characters of a publishable entry providing a synopsis of the contents of the objectdata",
|
1407 |
+
"2#110" => "Max 32 Characters that identifies the provider of the objectdata (Vs the owner/creator)",
|
1408 |
+
"2#115" => "Max 32 Characters that identifies the original owner of the intellectual content",
|
1409 |
+
"2#116" => "Max 128 Characters that contains any necessary copyright notice",
|
1410 |
+
"2#118" => "Max 128 characters that identifies the person or organisation which can provide further background information; repeatable",
|
1411 |
+
"2#120" => "Max 2000 Characters of a textual description of the objectdata",
|
1412 |
+
"2#122" => "Max 32 Characters that the identifies the person involved in the writing, editing or correcting the objectdata or caption/abstract; repeatable",
|
1413 |
+
"2#125" => "7360 binary octets of the rasterized caption - 1 bit per pixel, 460x128-pixel image",
|
1414 |
+
"2#130" => "2 characters of color composition type and information",
|
1415 |
+
"2#131" => "1 alphabetic character indicating the image area layout - P=portrait, L=landscape, S=square",
|
1416 |
+
"2#135" => "2 or 3 aphabetic characters containing the major national language of the object, according to the ISO 639:1988 codes",
|
1417 |
+
"2#150" => "2 characters identifying monaural/stereo and exact type of audio content",
|
1418 |
+
"2#151" => "6 numeric characters representing the audio sampling rate in hertz (Hz)",
|
1419 |
+
"2#152" => "2 numeric characters representing the number of bits in each audio sample",
|
1420 |
+
"2#153" => "6 numeric characters of the Audio Duration - HHMMSS",
|
1421 |
+
"2#154" => "Max 64 characters of the content of the end of an audio objectdata",
|
1422 |
+
"2#200" => "2 octet binary file format of the ObjectData Preview",
|
1423 |
+
"2#201" => "2 octet binary particular version of the ObjectData Preview File Format",
|
1424 |
+
"2#202" => "Max 256000 binary octets containing the ObjectData Preview data",
|
1425 |
+
|
1426 |
+
// Pre ObjectData Descriptor Record
|
1427 |
+
"7#010" => "1 numeric character - 0=objectdata size not known, 1=objectdata size known at beginning of transfer",
|
1428 |
+
"7#020" => "4 octet binary maximum subfile dataset(s) size",
|
1429 |
+
"7#090" => "4 octet binary objectdata size if known at beginning of transfer",
|
1430 |
+
"7#095" => "4 octet binary largest possible objectdata size",
|
1431 |
+
|
1432 |
+
// ObjectData Record
|
1433 |
+
"8#010" => "Subfile DataSet containing the objectdata itself; repeatable",
|
1434 |
+
|
1435 |
+
// Post ObjectData Descriptor Record
|
1436 |
+
"9#010" => "4 octet binary total objectdata size"
|
1437 |
+
);
|
1438 |
+
|
1439 |
+
/**
|
1440 |
+
* IPTC file format identifiers and descriptions
|
1441 |
+
*
|
1442 |
+
* This array contains the file format identifiers and descriptions defined in
|
1443 |
+
* the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 1#020.
|
1444 |
+
*
|
1445 |
+
* @since 0.90
|
1446 |
+
*
|
1447 |
+
* @var array
|
1448 |
+
*/
|
1449 |
+
private static $mla_iptc_formats = array(
|
1450 |
+
00 => "No ObjectData",
|
1451 |
+
01 => "IPTC-NAA Digital Newsphoto Parameter Record",
|
1452 |
+
02 => "IPTC7901 Recommended Message Format",
|
1453 |
+
03 => "Tagged Image File Format (Adobe/Aldus Image data)",
|
1454 |
+
04 => "Illustrator (Adobe Graphics data)",
|
1455 |
+
05 => "AppleSingle (Apple Computer Inc)",
|
1456 |
+
06 => "NAA 89-3 (ANPA 1312)",
|
1457 |
+
07 => "MacBinary II",
|
1458 |
+
08 => "IPTC Unstructured Character Oriented File Format (UCOFF)",
|
1459 |
+
09 => "United Press International ANPA 1312 variant",
|
1460 |
+
10 => "United Press International Down-Load Message",
|
1461 |
+
11 => "JPEG File Interchange (JFIF)",
|
1462 |
+
12 => "Photo-CD Image-Pac (Eastman Kodak)",
|
1463 |
+
13 => "Microsoft Bit Mapped Graphics File [*.BMP]",
|
1464 |
+
14 => "Digital Audio File [*.WAV] (Microsoft & Creative Labs)",
|
1465 |
+
15 => "Audio plus Moving Video [*.AVI] (Microsoft)",
|
1466 |
+
16 => "PC DOS/Windows Executable Files [*.COM][*.EXE]",
|
1467 |
+
17 => "Compressed Binary File [*.ZIP] (PKWare Inc)",
|
1468 |
+
18 => "Audio Interchange File Format AIFF (Apple Computer Inc)",
|
1469 |
+
19 => "RIFF Wave (Microsoft Corporation)",
|
1470 |
+
20 => "Freehand (Macromedia/Aldus)",
|
1471 |
+
21 => "Hypertext Markup Language - HTML (The Internet Society)",
|
1472 |
+
22 => "MPEG 2 Audio Layer 2 (Musicom), ISO/IEC",
|
1473 |
+
23 => "MPEG 2 Audio Layer 3, ISO/IEC",
|
1474 |
+
24 => "Portable Document File (*.PDF) Adobe",
|
1475 |
+
25 => "News Industry Text Format (NITF)",
|
1476 |
+
26 => "Tape Archive (*.TAR)",
|
1477 |
+
27 => "Tidningarnas Telegrambyrå NITF version (TTNITF DTD)",
|
1478 |
+
28 => "Ritzaus Bureau NITF version (RBNITF DTD)",
|
1479 |
+
29 => "Corel Draw [*.CDR]"
|
1480 |
+
);
|
1481 |
+
|
1482 |
+
/**
|
1483 |
+
* IPTC image type identifiers and descriptions
|
1484 |
+
*
|
1485 |
+
* This array contains the image type identifiers and descriptions defined in
|
1486 |
+
* the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 2#130, octet 2.
|
1487 |
+
*
|
1488 |
+
* @since 0.90
|
1489 |
+
*
|
1490 |
+
* @var array
|
1491 |
+
*/
|
1492 |
+
private static $mla_iptc_image_types = array(
|
1493 |
+
"M" => "Monochrome",
|
1494 |
+
"Y" => "Yellow Component",
|
1495 |
+
"M" => "Magenta Component",
|
1496 |
+
"C" => "Cyan Component",
|
1497 |
+
"K" => "Black Component",
|
1498 |
+
"R" => "Red Component",
|
1499 |
+
"G" => "Green Component",
|
1500 |
+
"B" => "Blue Component",
|
1501 |
+
"T" => "Text Only",
|
1502 |
+
"F" => "Full colour composite, frame sequential",
|
1503 |
+
"L" => "Full colour composite, line sequential",
|
1504 |
+
"P" => "Full colour composite, pixel sequential",
|
1505 |
+
"S" => "Full colour composite, special interleaving"
|
1506 |
+
);
|
1507 |
+
} // Class MLAShortcodes
|
1508 |
+
?>
|
includes/mla-objects.php
DELETED
@@ -1,172 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Media Library Assistant Custom Taxonomy and Post Type objects
|
4 |
-
*
|
5 |
-
* @package Media Library Assistant
|
6 |
-
* @since 0.1
|
7 |
-
*/
|
8 |
-
|
9 |
-
/**
|
10 |
-
* WordPress Action; registers Attachment Categories and Attachment Tags custom taxonomies
|
11 |
-
*
|
12 |
-
* @since 0.1
|
13 |
-
*/
|
14 |
-
function mla_build_taxonomies_action( ) {
|
15 |
-
$labels = array(
|
16 |
-
'name' => _x( 'Attachment Categories', 'taxonomy general name' ),
|
17 |
-
'singular_name' => _x( 'Attachment Category', 'taxonomy singular name' ),
|
18 |
-
'search_items' => __( 'Search Attachment Categories' ),
|
19 |
-
'all_items' => __( 'All Attachment Categories' ),
|
20 |
-
'parent_item' => __( 'Parent Attachment Category' ),
|
21 |
-
'parent_item_colon' => __( 'Parent Attachment Category:' ),
|
22 |
-
'edit_item' => __( 'Edit Attachment Category' ),
|
23 |
-
'update_item' => __( 'Update Attachment Category' ),
|
24 |
-
'add_new_item' => __( 'Add New Attachment Category' ),
|
25 |
-
'new_item_name' => __( 'New Attachment Category Name' ),
|
26 |
-
'menu_name' => __( 'Attachment Category' )
|
27 |
-
);
|
28 |
-
|
29 |
-
if ( 'checked' == MLASettings::mla_get_option( 'attachment_category' ) ) {
|
30 |
-
register_taxonomy(
|
31 |
-
'attachment_category',
|
32 |
-
array( 'attachment' ),
|
33 |
-
array(
|
34 |
-
'hierarchical' => true,
|
35 |
-
'labels' => $labels,
|
36 |
-
'show_ui' => true,
|
37 |
-
'query_var' => true,
|
38 |
-
'rewrite' => true
|
39 |
-
)
|
40 |
-
);
|
41 |
-
|
42 |
-
add_filter( 'manage_edit-attachment_category_columns', 'mla_attachment_category_get_columns_filter', 10, 1 ); // $columns
|
43 |
-
add_filter( 'manage_attachment_category_custom_column', 'mla_attachment_category_column_filter', 10, 3 ); // $place_holder, $column_name, $tag->term_id
|
44 |
-
}
|
45 |
-
|
46 |
-
$labels = array(
|
47 |
-
'name' => _x( 'Attachment Tags', 'taxonomy general name' ),
|
48 |
-
'singular_name' => _x( 'Attachment Tag', 'taxonomy singular name' ),
|
49 |
-
'search_items' => __( 'Search Attachment Tags' ),
|
50 |
-
'all_items' => __( 'All Attachment Tags' ),
|
51 |
-
'parent_item' => __( 'Parent Attachment Tag' ),
|
52 |
-
'parent_item_colon' => __( 'Parent Attachment Tag:' ),
|
53 |
-
'edit_item' => __( 'Edit Attachment Tag' ),
|
54 |
-
'update_item' => __( 'Update Attachment Tag' ),
|
55 |
-
'add_new_item' => __( 'Add New Attachment Tag' ),
|
56 |
-
'new_item_name' => __( 'New Attachment Tag Name' ),
|
57 |
-
'menu_name' => __( 'Attachment Tag' )
|
58 |
-
);
|
59 |
-
|
60 |
-
if ( 'checked' == MLASettings::mla_get_option( 'attachment_tag' ) ) {
|
61 |
-
register_taxonomy(
|
62 |
-
'attachment_tag',
|
63 |
-
array( 'attachment' ),
|
64 |
-
array(
|
65 |
-
'hierarchical' => false,
|
66 |
-
'labels' => $labels,
|
67 |
-
'show_ui' => true,
|
68 |
-
'query_var' => true,
|
69 |
-
'rewrite' => true
|
70 |
-
)
|
71 |
-
);
|
72 |
-
|
73 |
-
add_filter( 'manage_edit-attachment_tag_columns', 'mla_attachment_tag_get_columns_filter', 10, 1 ); // $columns
|
74 |
-
add_filter( 'manage_attachment_tag_custom_column', 'mla_attachment_tag_column_filter', 10, 3 ); // $place_holder, $column_name, $tag->term_id
|
75 |
-
}
|
76 |
-
|
77 |
-
} // mla_build_taxonomies_action
|
78 |
-
add_action( 'init', 'mla_build_taxonomies_action', 0 );
|
79 |
-
|
80 |
-
/**
|
81 |
-
* WordPress Filter for Attachment Category "Attachments" column,
|
82 |
-
* which replaces the "Posts" column with an equivalent "Attachments" column.
|
83 |
-
*
|
84 |
-
* @since 0.1
|
85 |
-
*
|
86 |
-
* @param array column definitions for the Attachment Category list table.
|
87 |
-
*
|
88 |
-
* @return array updated column definitions for the Attachment Category list table.
|
89 |
-
*/
|
90 |
-
function mla_attachment_category_get_columns_filter( $columns ) {
|
91 |
-
unset( $columns[ 'posts' ] );
|
92 |
-
$columns[ 'attachments' ] = 'Attachments';
|
93 |
-
return $columns;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* WordPress Filter for Attachment Category "Attachments" column,
|
98 |
-
* which returns a count of the attachments assigned a given category
|
99 |
-
*
|
100 |
-
* @since 0.1
|
101 |
-
*
|
102 |
-
* @param string unknown, undocumented parameter.
|
103 |
-
* @param array name of the column.
|
104 |
-
* @param array ID of the term for which the count is desired.
|
105 |
-
*
|
106 |
-
* @return array HTML markup for the column content; number of attachments in the category
|
107 |
-
* and alink to retrieve a list of them.
|
108 |
-
*/
|
109 |
-
function mla_attachment_category_column_filter( $place_holder, $column_name, $term_id ) {
|
110 |
-
$objects = get_objects_in_term( $term_id, 'attachment_category', array( ) );
|
111 |
-
$term = get_term( $term_id, 'attachment_category' );
|
112 |
-
|
113 |
-
if ( is_wp_error( $term ) ) {
|
114 |
-
error_log( 'ERROR: mla_attachment_category_column_filter - get_term ' . $objects->get_error_message(), 0 );
|
115 |
-
return 0;
|
116 |
-
}
|
117 |
-
|
118 |
-
if ( is_wp_error( $objects ) ) {
|
119 |
-
error_log( 'ERROR: mla_attachment_category_column_filter - get_objects_in_term ' . $objects->get_error_message(), 0 );
|
120 |
-
return 0;
|
121 |
-
}
|
122 |
-
|
123 |
-
return sprintf( '<a href="%s">%d</a>', esc_url( add_query_arg(
|
124 |
-
array( 'page' => 'mla-menu', 'attachment_category' => $term->slug, 'heading_suffix' => urlencode( $term->name ) ), 'upload.php' ) ), count( $objects ) );
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* WordPress Filter for Attachment Tag "Attachments" column,
|
129 |
-
* which replaces the "Posts" column with an equivalent "Attachments" column.
|
130 |
-
*
|
131 |
-
* @since 0.1
|
132 |
-
*
|
133 |
-
* @param array column definitions for the Attachment Category list table.
|
134 |
-
*
|
135 |
-
* @return array updated column definitions for the Attachment Category list table.
|
136 |
-
*/
|
137 |
-
function mla_attachment_tag_get_columns_filter( $columns ) {
|
138 |
-
unset( $columns[ 'posts' ] );
|
139 |
-
$columns[ 'attachments' ] = 'Attachments';
|
140 |
-
return $columns;
|
141 |
-
}
|
142 |
-
|
143 |
-
/**
|
144 |
-
* WordPress Filter for Attachment Tag "Attachments" column,
|
145 |
-
* which returns a count of the attachments assigned a given tag
|
146 |
-
*
|
147 |
-
* @since 0.1
|
148 |
-
*
|
149 |
-
* @param string unknown, undocumented parameter
|
150 |
-
* @param array name of the column
|
151 |
-
* @param array ID of the term for which the count is desired
|
152 |
-
*
|
153 |
-
* @return array HTML markup for the column content; number of attachments with the tag
|
154 |
-
* and alink to retrieve a list of them.
|
155 |
-
*/
|
156 |
-
function mla_attachment_tag_column_filter( $place_holder, $column_name, $term_id ) {
|
157 |
-
$objects = get_objects_in_term( $term_id, 'attachment_tag', array( ) );
|
158 |
-
$term = get_term( $term_id, 'attachment_tag' );
|
159 |
-
if ( is_wp_error( $term ) ) {
|
160 |
-
error_log( 'ERROR: mla_attachment_tag_column_filter - get_term ' . $objects->get_error_message(), 0 );
|
161 |
-
return 0;
|
162 |
-
}
|
163 |
-
|
164 |
-
if ( is_wp_error( $objects ) ) {
|
165 |
-
error_log( 'ERROR: mla_attachment_tag_column_filter - get_objects_in_term ' . $objects->get_error_message(), 0 );
|
166 |
-
return 0;
|
167 |
-
}
|
168 |
-
|
169 |
-
return sprintf( '<a href="%s">%d</a>', esc_url( add_query_arg(
|
170 |
-
array( 'page' => 'mla-menu', 'attachment_tag' => $term->slug, 'heading_suffix' => urlencode( $term->name ) ), 'upload.php' ) ), count( $objects ) );
|
171 |
-
}
|
172 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/mla-plugin-loader.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Media Library Assistant Plugin Loader
|
4 |
+
*
|
5 |
+
* Defines constants and loads all of the classes and functions required to run the plugin.
|
6 |
+
* This file is only loaded if the naming conflict tests in index.php are passed.
|
7 |
+
*
|
8 |
+
* @package Media Library Assistant
|
9 |
+
* @since 0.20
|
10 |
+
*/
|
11 |
+
|
12 |
+
if (!defined('MLA_OPTION_PREFIX'))
|
13 |
+
/**
|
14 |
+
* Gives a unique prefix for plugin options; can be set in wp-config.php
|
15 |
+
*/
|
16 |
+
define('MLA_OPTION_PREFIX', 'mla_');
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Accumulates error messages from name conflict tests
|
20 |
+
*
|
21 |
+
* @since 1.14
|
22 |
+
*/
|
23 |
+
$mla_plugin_loader_error_messages = '';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Displays version conflict error messages at the top of the Dashboard
|
27 |
+
*
|
28 |
+
* @since 1.14
|
29 |
+
*/
|
30 |
+
function mla_plugin_loader_reporting_action () {
|
31 |
+
global $mla_plugin_loader_error_messages;
|
32 |
+
|
33 |
+
echo '<div class="error"><p><strong>The Media Library Assistant cannot load.</strong></p>'."\r\n";
|
34 |
+
echo "<ul>{$mla_plugin_loader_error_messages}</ul>\r\n";
|
35 |
+
echo '<p>You must resolve these conflicts before this plugin can safely load.</p></div>'."\r\n";
|
36 |
+
}
|
37 |
+
|
38 |
+
/*
|
39 |
+
* Basic library of run-time tests.
|
40 |
+
*/
|
41 |
+
require_once( MLA_PLUGIN_PATH . 'tests/class-mla-tests.php' );
|
42 |
+
|
43 |
+
$mla_plugin_loader_error_messages .= MLATest::min_php_version( '5.2' );
|
44 |
+
$mla_plugin_loader_error_messages .= MLATest::min_WordPress_version( '3.3' );
|
45 |
+
|
46 |
+
if ( ! empty( $mla_plugin_loader_error_messages ) ) {
|
47 |
+
add_action( 'admin_notices', 'mla_plugin_loader_reporting_action' );
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
add_action( 'init', 'MLATest::initialize' );
|
51 |
+
|
52 |
+
/*
|
53 |
+
* Template file and database access functions.
|
54 |
+
*/
|
55 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-data.php' );
|
56 |
+
add_action( 'init', 'MLAData::initialize' );
|
57 |
+
|
58 |
+
/*
|
59 |
+
* Custom Taxonomies and WordPress objects.
|
60 |
+
*/
|
61 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-objects.php' );
|
62 |
+
add_action('init', 'MLAObjects::initialize');
|
63 |
+
|
64 |
+
/*
|
65 |
+
* Shortcodes
|
66 |
+
*/
|
67 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-shortcodes.php');
|
68 |
+
add_action('init', 'MLAShortcodes::initialize');
|
69 |
+
|
70 |
+
/*
|
71 |
+
* WordPress 3.5 and later Edit Media screen additions, e.g., meta boxes
|
72 |
+
*/
|
73 |
+
if ( version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
|
74 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-edit-media.php');
|
75 |
+
add_action('init', 'MLAEdit::initialize');
|
76 |
+
}
|
77 |
+
|
78 |
+
/*
|
79 |
+
* WordPress 3.5 and later Media Manager (Modal window) additions
|
80 |
+
*/
|
81 |
+
/* if ( version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
|
82 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-media-modal.php');
|
83 |
+
add_action('init', 'MLAModal::initialize');
|
84 |
+
} // */
|
85 |
+
|
86 |
+
/*
|
87 |
+
* Plugin settings management
|
88 |
+
*/
|
89 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-options.php' );
|
90 |
+
add_action( 'init', 'MLAOptions::initialize' );
|
91 |
+
|
92 |
+
/*
|
93 |
+
* Plugin settings management page
|
94 |
+
*/
|
95 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings.php' );
|
96 |
+
add_action( 'init', 'MLASettings::initialize' );
|
97 |
+
|
98 |
+
/*
|
99 |
+
* Custom list table package that extends the core WP_List_Table class.
|
100 |
+
* Doesn't need an initialize function; has a constructor.
|
101 |
+
*/
|
102 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-list-table.php' );
|
103 |
+
|
104 |
+
/*
|
105 |
+
* Main program
|
106 |
+
*/
|
107 |
+
require_once( MLA_PLUGIN_PATH . 'includes/class-mla-main.php');
|
108 |
+
add_action('init', 'MLA::initialize');
|
109 |
+
}
|
110 |
+
?>
|
includes/mla-shortcodes.php
DELETED
@@ -1,94 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Media Library Assistant Shortcode handler(s)
|
4 |
-
*
|
5 |
-
* @package Media Library Assistant
|
6 |
-
* @since 0.1
|
7 |
-
*/
|
8 |
-
|
9 |
-
/**
|
10 |
-
* WordPress Shortcode; renders a complete list of all attachments and references to them
|
11 |
-
*
|
12 |
-
* @since 0.1
|
13 |
-
*
|
14 |
-
* @return string HTML markup for the attachment list
|
15 |
-
*/
|
16 |
-
function mla_attachment_list_shortcode( /* $atts */ ) {
|
17 |
-
global $wpdb;
|
18 |
-
|
19 |
-
/* extract(shortcode_atts(array(
|
20 |
-
'item_type'=>'attachment',
|
21 |
-
'organize_by'=>'title',
|
22 |
-
), $atts)); */
|
23 |
-
|
24 |
-
$attachments = $wpdb->get_results( "
|
25 |
-
SELECT ID, post_title, post_name, post_parent
|
26 |
-
FROM $wpdb->posts
|
27 |
-
WHERE post_type = 'attachment'
|
28 |
-
" );
|
29 |
-
|
30 |
-
foreach ( $attachments as $attachment ) {
|
31 |
-
$references = MLAData::mla_fetch_attachment_references( $attachment->ID, $attachment->post_parent );
|
32 |
-
|
33 |
-
echo ' <br><h3>' . $attachment->ID . ', ' . $attachment->post_title . ', Parent: ' . $attachment->post_parent . '<br>' . $attachment->post_name . '<br>' . $references['base_file'] . "</h3>\r\n";
|
34 |
-
|
35 |
-
/*
|
36 |
-
* Look for the "Featured Image(s)"
|
37 |
-
*/
|
38 |
-
if ( empty( $references['features'] ) ) {
|
39 |
-
echo " not featured in any posts.<br>\r\n";
|
40 |
-
} else {
|
41 |
-
echo " Featured in<br>\r\n";
|
42 |
-
foreach ( $references['features'] as $feature_id => $feature ) {
|
43 |
-
echo ' ';
|
44 |
-
|
45 |
-
if ( $feature_id == $attachment->post_parent ) {
|
46 |
-
echo 'PARENT ';
|
47 |
-
$found_parent = true;
|
48 |
-
}
|
49 |
-
|
50 |
-
echo $feature_id . ' (' . $feature->post_type . '), ' . $feature->post_title . "<br>\r\n";
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
/*
|
55 |
-
* Look for item(s) inserted in post_content
|
56 |
-
*/
|
57 |
-
if ( empty( $references['inserts'] ) ) {
|
58 |
-
echo " no inserts in any post_content.<br>\r\n";
|
59 |
-
} else {
|
60 |
-
foreach ( $references['inserts'] as $file => $inserts ) {
|
61 |
-
echo ' ' . $file . " inserted in<br>\r\n";
|
62 |
-
foreach ( $inserts as $insert ) {
|
63 |
-
echo ' ';
|
64 |
-
|
65 |
-
if ( $insert->ID == $attachment->post_parent ) {
|
66 |
-
echo 'PARENT ';
|
67 |
-
$found_parent = true;
|
68 |
-
}
|
69 |
-
|
70 |
-
echo $insert->ID . ' (' . $insert->post_type . '), ' . $insert->post_title . "<br>\r\n";
|
71 |
-
} // foreach $insert
|
72 |
-
} // foreach $file
|
73 |
-
}
|
74 |
-
|
75 |
-
$errors = '';
|
76 |
-
|
77 |
-
if ( !$references['found_reference'] )
|
78 |
-
$errors .= '(ORPHAN) ';
|
79 |
-
|
80 |
-
if ( $references['is_unattached'] )
|
81 |
-
$errors .= '(UNATTACHED) ';
|
82 |
-
else {
|
83 |
-
if ( !$references['found_parent'] )
|
84 |
-
$errors .= '(BAD PARENT) ';
|
85 |
-
}
|
86 |
-
|
87 |
-
if ( !empty( $errors ) )
|
88 |
-
echo ' ' . $errors . "<br>\r\n";
|
89 |
-
} // foreach attachment
|
90 |
-
|
91 |
-
echo "<br>----- End of Report -----\r\n";
|
92 |
-
}
|
93 |
-
add_shortcode( 'mla_attachment_list', 'mla_attachment_list_shortcode' );
|
94 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index.php
CHANGED
@@ -2,73 +2,112 @@
|
|
2 |
/**
|
3 |
* Provides several enhancements to the handling of images and files held in the WordPress Media Library
|
4 |
*
|
|
|
|
|
|
|
5 |
* @package Media Library Assistant
|
6 |
-
* @version
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
Plugin Name: Media Library Assistant
|
11 |
-
Plugin URI:
|
12 |
-
Description:
|
13 |
Author: David Lingren
|
14 |
-
Version:
|
15 |
-
Author URI: http://
|
16 |
*/
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Provides path information to the plugin root in URL format.
|
25 |
*/
|
26 |
-
|
27 |
-
|
28 |
-
if (
|
|
|
|
|
|
|
29 |
/**
|
30 |
-
*
|
31 |
*/
|
32 |
-
define('
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
require_once('includes/class-mla-list-table.php');
|
45 |
-
|
46 |
-
/*
|
47 |
-
* Custom Taxonomies and WordPress objects.
|
48 |
-
*/
|
49 |
-
require_once('includes/mla-objects.php');
|
50 |
|
51 |
-
|
52 |
-
*
|
|
|
|
|
|
|
53 |
*/
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
/*
|
57 |
-
*
|
58 |
*/
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
-
|
62 |
-
*
|
|
|
|
|
63 |
*/
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
add_action('init', 'MLASettings::initialize');
|
67 |
-
|
68 |
/*
|
69 |
-
*
|
70 |
*/
|
71 |
-
|
|
|
72 |
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Provides several enhancements to the handling of images and files held in the WordPress Media Library
|
4 |
*
|
5 |
+
* This file contains several tests for name conflicts with other plugins. Only if the tests are passed
|
6 |
+
* will the rest of the plugin be loaded and run.
|
7 |
+
*
|
8 |
* @package Media Library Assistant
|
9 |
+
* @version 1.14
|
10 |
*/
|
11 |
|
12 |
/*
|
13 |
Plugin Name: Media Library Assistant
|
14 |
+
Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
|
15 |
+
Description: Enhances the Media Library; powerful[mla_gallery], taxonomy support, IPTC/EXIF processing, bulk & quick edit actions and where-used reporting.
|
16 |
Author: David Lingren
|
17 |
+
Version: 1.14
|
18 |
+
Author URI: http://fairtradejudaica.org/our-story/staff/
|
19 |
*/
|
20 |
|
21 |
/**
|
22 |
+
* Accumulates error messages from name conflict tests
|
23 |
+
*
|
24 |
+
* @since 0.20
|
|
|
|
|
|
|
25 |
*/
|
26 |
+
$mla_name_conflict_error_messages = '';
|
27 |
+
|
28 |
+
if ( defined( 'MLA_PLUGIN_PATH' ) ) {
|
29 |
+
$mla_name_conflict_error_messages .= '<li>constant MLA_PLUGIN_PATH</li>';
|
30 |
+
}
|
31 |
+
else {
|
32 |
/**
|
33 |
+
* Provides path information to the plugin root in file system format.
|
34 |
*/
|
35 |
+
define( 'MLA_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( defined( 'MLA_PLUGIN_URL' ) ) {
|
39 |
+
$mla_name_conflict_error_messages .= '<li>constant MLA_PLUGIN_URL</li>';
|
40 |
+
}
|
41 |
+
else {
|
42 |
+
/**
|
43 |
+
* Provides path information to the plugin root in URL format.
|
44 |
+
*/
|
45 |
+
define( 'MLA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
46 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
/**
|
49 |
+
* Defines classes, functions and constants for name conflict tests. There are no global functions
|
50 |
+
* or other constants in this version; everything is wrapped in classes to minimize potential conflicts.
|
51 |
+
*
|
52 |
+
* @since 0.20
|
53 |
*/
|
54 |
+
$mla_name_conflict_candidates =
|
55 |
+
array (
|
56 |
+
'MLA' => 'class',
|
57 |
+
'MLAData' => 'class',
|
58 |
+
'MLAEdit' => 'class',
|
59 |
+
'MLAModal' => 'class',
|
60 |
+
'MLAObjects' => 'class',
|
61 |
+
'MLASettings' => 'class',
|
62 |
+
'MLAShortcodes' => 'class',
|
63 |
+
'MLATest' => 'class',
|
64 |
+
'MLA_List_Table' => 'class'
|
65 |
+
);
|
66 |
|
67 |
/*
|
68 |
+
* Check for conflicting names, i.e., already defined by some other plugin or theme
|
69 |
*/
|
70 |
+
foreach ( $mla_name_conflict_candidates as $value => $type ) {
|
71 |
+
switch ($type) {
|
72 |
+
case 'class':
|
73 |
+
if ( class_exists( $value ) )
|
74 |
+
$mla_name_conflict_error_messages .= "<li>class {$value}</li>";
|
75 |
+
break;
|
76 |
+
case 'function':
|
77 |
+
if ( function_exists( $value ) )
|
78 |
+
$mla_name_conflict_error_messages .= "<li>function {$value}</li>";
|
79 |
+
break;
|
80 |
+
case 'constant':
|
81 |
+
if ( defined( $value ) )
|
82 |
+
$mla_name_conflict_error_messages .= "<li>constant {$value}</li>";
|
83 |
+
break;
|
84 |
+
default:
|
85 |
+
} // switch $type
|
86 |
+
}
|
87 |
|
88 |
+
/**
|
89 |
+
* Displays name conflict error messages at the top of the Dashboard
|
90 |
+
*
|
91 |
+
* @since 0.20
|
92 |
*/
|
93 |
+
function mla_name_conflict_reporting_action () {
|
94 |
+
global $mla_name_conflict_error_messages;
|
95 |
+
|
96 |
+
echo '<div class="error"><p><strong>The Media Library Assistant cannot load.</strong> Another plugin or theme has declared conflicting class, function or constant names:</p>'."\r\n";
|
97 |
+
echo "<ul>{$mla_name_conflict_error_messages}</ul>\r\n";
|
98 |
+
echo '<p>You must resolve these conflicts before this plugin can safely load.</p></div>'."\r\n";
|
99 |
+
}
|
100 |
|
|
|
|
|
101 |
/*
|
102 |
+
* Load the plugin or display conflict message(s)
|
103 |
*/
|
104 |
+
if ( empty( $mla_name_conflict_error_messages ) ) {
|
105 |
+
require_once('includes/mla-plugin-loader.php');
|
106 |
|
107 |
+
register_activation_hook( __FILE__, array( 'MLASettings', 'mla_activation_hook' ) );
|
108 |
+
register_deactivation_hook( __FILE__, array( 'MLASettings', 'mla_deactivation_hook' ) );
|
109 |
+
}
|
110 |
+
else {
|
111 |
+
add_action( 'admin_notices', 'mla_name_conflict_reporting_action' );
|
112 |
+
}
|
113 |
+
?>
|
js/mla-inline-edit-scripts.js
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// These functions are adapted from wp-admin/js/inline-edit-post.js
|
2 |
+
(function($) {
|
3 |
+
inlineEditAttachment = {
|
4 |
+
|
5 |
+
init : function(){
|
6 |
+
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
|
7 |
+
|
8 |
+
t.type = 'attachment';
|
9 |
+
t.what = '#attachment-';
|
10 |
+
|
11 |
+
// prepare the edit rows
|
12 |
+
qeRow.keyup(function(e){
|
13 |
+
if (e.which == 27)
|
14 |
+
return inlineEditAttachment.revert();
|
15 |
+
});
|
16 |
+
bulkRow.keyup(function(e){
|
17 |
+
if (e.which == 27)
|
18 |
+
return inlineEditAttachment.revert();
|
19 |
+
});
|
20 |
+
|
21 |
+
$('a.cancel', qeRow).click(function(){
|
22 |
+
return inlineEditAttachment.revert();
|
23 |
+
});
|
24 |
+
$('a.save', qeRow).click(function(){
|
25 |
+
return inlineEditAttachment.save(this);
|
26 |
+
});
|
27 |
+
$('td', qeRow).keydown(function(e){
|
28 |
+
if ( e.which == 13 )
|
29 |
+
return inlineEditAttachment.save(this);
|
30 |
+
});
|
31 |
+
|
32 |
+
$('a.cancel', bulkRow).click(function(){
|
33 |
+
return inlineEditAttachment.revert();
|
34 |
+
});
|
35 |
+
|
36 |
+
// add events
|
37 |
+
$('a.editinline').live('click', function(){
|
38 |
+
inlineEditAttachment.edit(this);
|
39 |
+
return false;
|
40 |
+
});
|
41 |
+
|
42 |
+
// hiearchical taxonomies expandable?
|
43 |
+
$('span.catshow').click(function(){
|
44 |
+
$(this).hide().next().show().parent().next().addClass("cat-hover");
|
45 |
+
});
|
46 |
+
|
47 |
+
$('span.cathide').click(function(){
|
48 |
+
$(this).hide().prev().show().parent().next().removeClass("cat-hover");
|
49 |
+
});
|
50 |
+
|
51 |
+
$('select[name="_status"] option[value="future"]', bulkRow).remove();
|
52 |
+
|
53 |
+
$('#doaction, #doaction2').click(function(e){
|
54 |
+
var n = $(this).attr('id').substr(2);
|
55 |
+
|
56 |
+
if ( $('select[name="'+n+'"]').val() == 'edit' ) {
|
57 |
+
e.preventDefault();
|
58 |
+
t.setBulk();
|
59 |
+
} else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
|
60 |
+
t.revert();
|
61 |
+
}
|
62 |
+
});
|
63 |
+
|
64 |
+
// Filter button (dates, categories) in top nav bar
|
65 |
+
$('#post-query-submit').mousedown(function(e){
|
66 |
+
t.revert();
|
67 |
+
$('select[name^="action"]').val('-1');
|
68 |
+
});
|
69 |
+
},
|
70 |
+
|
71 |
+
toggle : function(el){
|
72 |
+
var t = this;
|
73 |
+
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
|
74 |
+
},
|
75 |
+
|
76 |
+
setBulk : function(){
|
77 |
+
var te = '', c = true;
|
78 |
+
this.revert();
|
79 |
+
|
80 |
+
$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
|
81 |
+
$('table.widefat tbody').prepend( $('#bulk-edit') );
|
82 |
+
$('#bulk-edit').addClass('inline-editor').show();
|
83 |
+
|
84 |
+
$('tbody th.check-column input[type="checkbox"]').each(function(i){
|
85 |
+
if ( $(this).prop('checked') ) {
|
86 |
+
c = false;
|
87 |
+
var id = $(this).val(), theTitle;
|
88 |
+
theTitle = $('#inline_'+id+' .post_title').text() || mla_inline_edit_vars.notitle;
|
89 |
+
te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+mla_inline_edit_vars.ntdeltitle+'">X</a>'+theTitle+'</div>';
|
90 |
+
}
|
91 |
+
});
|
92 |
+
|
93 |
+
if ( c )
|
94 |
+
return this.revert();
|
95 |
+
|
96 |
+
$('#bulk-titles').html(te);
|
97 |
+
$('#bulk-titles a').click(function(){
|
98 |
+
var id = $(this).attr('id').substr(1);
|
99 |
+
|
100 |
+
$('table.widefat input[value="' + id + '"]').prop('checked', false);
|
101 |
+
$('#ttle'+id).remove();
|
102 |
+
});
|
103 |
+
|
104 |
+
//flat taxonomies
|
105 |
+
$('textarea.mla_tags').each(function(){
|
106 |
+
var taxname = $(this).attr('name').replace(']', '').replace('tax_input[', '');
|
107 |
+
|
108 |
+
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
109 |
+
});
|
110 |
+
|
111 |
+
$('html, body').animate( { scrollTop: 0 }, 'fast' );
|
112 |
+
},
|
113 |
+
|
114 |
+
edit : function(id) {
|
115 |
+
var t = this, fields, editRow, rowData, fIndex;
|
116 |
+
t.revert();
|
117 |
+
|
118 |
+
if ( typeof(id) == 'object' )
|
119 |
+
id = t.getId(id);
|
120 |
+
|
121 |
+
fields = mla_inline_edit_vars.fields;
|
122 |
+
|
123 |
+
// add the new blank row
|
124 |
+
editRow = $('#inline-edit').clone(true);
|
125 |
+
$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
|
126 |
+
|
127 |
+
if ( $(t.what+id).hasClass('alternate') )
|
128 |
+
$(editRow).addClass('alternate');
|
129 |
+
$(t.what+id).hide().after(editRow);
|
130 |
+
|
131 |
+
// populate the data
|
132 |
+
rowData = $('#inline_'+id);
|
133 |
+
if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) {
|
134 |
+
// author no longer has edit caps, so we need to add them to the list of authors
|
135 |
+
$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
|
136 |
+
}
|
137 |
+
|
138 |
+
if ( $(':input[name="post_author"] option', editRow).length == 1 ) {
|
139 |
+
$('label.inline-edit-author', editRow).hide();
|
140 |
+
}
|
141 |
+
|
142 |
+
for ( fIndex = 0; fIndex < fields.length; fIndex++ ) {
|
143 |
+
$(':input[name="' + fields[fIndex] + '"]', editRow).val( $('.'+fields[fIndex], rowData).text() );
|
144 |
+
}
|
145 |
+
|
146 |
+
if ( $('.image_alt', rowData).length == 0) {
|
147 |
+
$('label.inline-edit-image-alt', editRow).hide();
|
148 |
+
}
|
149 |
+
|
150 |
+
// hierarchical taxonomies
|
151 |
+
$('.mla_category', rowData).each(function(){
|
152 |
+
var term_ids = $(this).text();
|
153 |
+
|
154 |
+
if ( term_ids ) {
|
155 |
+
taxname = $(this).attr('id').replace('_'+id, '');
|
156 |
+
$('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
|
157 |
+
}
|
158 |
+
});
|
159 |
+
|
160 |
+
//flat taxonomies
|
161 |
+
$('.mla_tags', rowData).each(function(){
|
162 |
+
var terms = $(this).text(),
|
163 |
+
taxname = $(this).attr('id').replace('_' + id, ''),
|
164 |
+
textarea = $('textarea.tax_input_' + taxname, editRow),
|
165 |
+
comma = mla_inline_edit_vars.comma;
|
166 |
+
|
167 |
+
if ( terms ) {
|
168 |
+
if ( ',' !== comma )
|
169 |
+
terms = terms.replace(/,/g, comma);
|
170 |
+
textarea.val(terms);
|
171 |
+
}
|
172 |
+
|
173 |
+
textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_inline_edit_vars.comma + ' ' } );
|
174 |
+
});
|
175 |
+
|
176 |
+
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
|
177 |
+
$('.ptitle', editRow).focus();
|
178 |
+
|
179 |
+
return false;
|
180 |
+
},
|
181 |
+
|
182 |
+
save : function(id) {
|
183 |
+
var params, fields, page = $('.post_status_page').val() || '';
|
184 |
+
|
185 |
+
if ( typeof(id) == 'object' )
|
186 |
+
id = this.getId(id);
|
187 |
+
|
188 |
+
$('table.widefat .inline-edit-save .waiting').show();
|
189 |
+
|
190 |
+
params = {
|
191 |
+
action: mla_inline_edit_vars.ajax_action,
|
192 |
+
nonce: mla_inline_edit_vars.ajax_nonce,
|
193 |
+
post_type: typenow,
|
194 |
+
post_ID: id,
|
195 |
+
edit_date: 'true',
|
196 |
+
post_status: page
|
197 |
+
};
|
198 |
+
|
199 |
+
fields = $('#edit-'+id+' :input').serialize();
|
200 |
+
params = fields + '&' + $.param(params);
|
201 |
+
|
202 |
+
// make ajax request
|
203 |
+
$.post( ajaxurl, params,
|
204 |
+
function(r) {
|
205 |
+
$('table.widefat .inline-edit-save .waiting').hide();
|
206 |
+
|
207 |
+
if (r) {
|
208 |
+
if ( -1 != r.indexOf('<tr') ) {
|
209 |
+
$(inlineEditAttachment.what+id).remove();
|
210 |
+
$('#edit-'+id).before(r).remove();
|
211 |
+
$(inlineEditAttachment.what+id).hide().fadeIn();
|
212 |
+
} else {
|
213 |
+
r = r.replace( /<.[^<>]*?>/g, '' );
|
214 |
+
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
215 |
+
}
|
216 |
+
} else {
|
217 |
+
$('#edit-'+id+' .inline-edit-save .error').html(mla_inline_edit_vars.error).show();
|
218 |
+
}
|
219 |
+
}
|
220 |
+
, 'html');
|
221 |
+
return false;
|
222 |
+
},
|
223 |
+
|
224 |
+
revert : function(){
|
225 |
+
var id = $('table.widefat tr.inline-editor').attr('id');
|
226 |
+
|
227 |
+
if ( id ) {
|
228 |
+
$('table.widefat .inline-edit-save .waiting').hide();
|
229 |
+
|
230 |
+
if ( 'bulk-edit' == id ) {
|
231 |
+
$('table.widefat #bulk-edit').removeClass('inline-editor').hide();
|
232 |
+
$('#bulk-titles').html('');
|
233 |
+
$('#inlineedit').append( $('#bulk-edit') );
|
234 |
+
} else {
|
235 |
+
$('#'+id).remove();
|
236 |
+
id = id.substr( id.lastIndexOf('-') + 1 );
|
237 |
+
$(this.what+id).show();
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
return false;
|
242 |
+
},
|
243 |
+
|
244 |
+
getId : function(o) {
|
245 |
+
var id = $(o).closest('tr').attr('id'),
|
246 |
+
parts = id.split('-');
|
247 |
+
return parts[parts.length - 1];
|
248 |
+
}
|
249 |
+
};
|
250 |
+
|
251 |
+
$(document).ready(function(){inlineEditAttachment.init();});
|
252 |
+
})(jQuery);
|
js/mla-inline-edit-scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){inlineEditAttachment={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type="attachment";c.what="#attachment-";d.keyup(function(f){if(f.which==27){return inlineEditAttachment.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditAttachment.revert()}});a("a.cancel",d).click(function(){return inlineEditAttachment.revert()});a("a.save",d).click(function(){return inlineEditAttachment.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditAttachment.save(this)}});a("a.cancel",b).click(function(){return inlineEditAttachment.revert()});a("a.editinline").live("click",function(){inlineEditAttachment.edit(this);return false});a("span.catshow").click(function(){a(this).hide().next().show().parent().next().addClass("cat-hover")});a("span.cathide").click(function(){a(this).hide().prev().show().parent().next().removeClass("cat-hover")});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").mousedown(function(f){c.revert();a('select[name^="action"]').val("-1")})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var b="",d=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(e){if(a(this).prop("checked")){d=false;var f=a(this).val(),c;c=a("#inline_"+f+" .post_title").text()||mla_inline_edit_vars.notitle;b+='<div id="ttle'+f+'"><a id="_'+f+'" class="ntdelbutton" title="'+mla_inline_edit_vars.ntdeltitle+'">X</a>'+c+"</div>"}});if(d){return this.revert()}a("#bulk-titles").html(b);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').prop("checked",false);a("#ttle"+c).remove()});a("textarea.mla_tags").each(function(){var c=a(this).attr("name").replace("]","").replace("tax_input[","");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+c,{delay:500,minchars:2,multiple:true,multipleSep:mla_inline_edit_vars.comma+" "})});a("html, body").animate({scrollTop:0},"fast")},edit:function(g){var d=this,b,c,e,f;d.revert();if(typeof(g)=="object"){g=d.getId(g)}b=mla_inline_edit_vars.fields;c=a("#inline-edit").clone(true);a("td",c).attr("colspan",a(".widefat:first thead th:visible").length);if(a(d.what+g).hasClass("alternate")){a(c).addClass("alternate")}a(d.what+g).hide().after(c);e=a("#inline_"+g);if(!a(':input[name="post_author"] option[value="'+a(".post_author",e).text()+'"]',c).val()){a(':input[name="post_author"]',c).prepend('<option value="'+a(".post_author",e).text()+'">'+a("#"+d.type+"-"+g+" .author").text()+"</option>")}if(a(':input[name="post_author"] option',c).length==1){a("label.inline-edit-author",c).hide()}for(f=0;f<b.length;f++){a(':input[name="'+b[f]+'"]',c).val(a("."+b[f],e).text())}if(a(".image_alt",e).length==0){a("label.inline-edit-image-alt",c).hide()}a(".mla_category",e).each(function(){var h=a(this).text();if(h){taxname=a(this).attr("id").replace("_"+g,"");a("ul."+taxname+"-checklist :checkbox",c).val(h.split(","))}});a(".mla_tags",e).each(function(){var j=a(this).text(),k=a(this).attr("id").replace("_"+g,""),i=a("textarea.tax_input_"+k,c),h=mla_inline_edit_vars.comma;if(j){if(","!==h){j=j.replace(/,/g,h)}i.val(j)}i.suggest(ajaxurl+"?action=ajax-tag-search&tax="+k,{delay:500,minchars:2,multiple:true,multipleSep:mla_inline_edit_vars.comma+" "})});a(c).attr("id","edit-"+g).addClass("inline-editor").show();a(".ptitle",c).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:mla_inline_edit_vars.ajax_action,nonce:mla_inline_edit_vars.ajax_nonce,post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("<tr")){a(inlineEditAttachment.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditAttachment.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save .error").html(f).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(mla_inline_edit_vars.error).show()}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditAttachment.init()})})(jQuery);
|
js/{mla-scripts.js → mla-single-edit-scripts.js}
RENAMED
@@ -1,8 +1,6 @@
|
|
1 |
-
|
2 |
|
3 |
-
var
|
4 |
-
comma: ','
|
5 |
-
}
|
6 |
|
7 |
// return an array with any duplicate, whitespace or values removed
|
8 |
function array_unique_noempty(a) {
|
@@ -17,20 +15,20 @@ function array_unique_noempty(a) {
|
|
17 |
|
18 |
(function($){
|
19 |
|
20 |
-
tagBox = {
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
|
31 |
parseTags : function(el) {
|
32 |
var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),
|
33 |
-
thetags = taxbox.find('.the-tags'), comma =
|
34 |
current_tags = thetags.val().split(comma), new_tags = [];
|
35 |
delete current_tags[num];
|
36 |
|
@@ -58,7 +56,7 @@ tagBox = {
|
|
58 |
|
59 |
disabled = thetags.prop('disabled');
|
60 |
|
61 |
-
current_tags = thetags.val().split(
|
62 |
tagchecklist.empty();
|
63 |
|
64 |
$.each( current_tags, function( key, val ) {
|
@@ -88,7 +86,7 @@ tagBox = {
|
|
88 |
a = a || false;
|
89 |
var tags = $('.the-tags', el),
|
90 |
newtag = $('input.newtag', el),
|
91 |
-
comma =
|
92 |
newtags, text;
|
93 |
|
94 |
text = a ? $(a).text() : newtag.val();
|
@@ -157,7 +155,7 @@ tagBox = {
|
|
157 |
}
|
158 |
}).each(function(){
|
159 |
var tax = $(this).closest('div.tagsdiv').attr('id');
|
160 |
-
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep:
|
161 |
});
|
162 |
|
163 |
// save tags on post save/publish
|
@@ -201,8 +199,8 @@ jQuery(document).ready( function($) {
|
|
201 |
taxonomyParts.shift();
|
202 |
taxonomy = taxonomyParts.join('-');
|
203 |
settingName = taxonomy + '_tab';
|
204 |
-
if ( taxonomy == 'category' )
|
205 |
-
settingName = 'cats';
|
206 |
|
207 |
// TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
|
208 |
$('a', '#' + taxonomy + '-tabs').click( function(){
|
1 |
+
// These functions are adapted from wp-admin/js/post.js
|
2 |
|
3 |
+
var tagBox;
|
|
|
|
|
4 |
|
5 |
// return an array with any duplicate, whitespace or values removed
|
6 |
function array_unique_noempty(a) {
|
15 |
|
16 |
(function($){
|
17 |
|
18 |
+
tagBox = {
|
19 |
+
clean : function(tags) {
|
20 |
+
var comma = mla_single_edit_vars.comma;
|
21 |
+
if ( ',' !== comma )
|
22 |
+
tags = tags.replace(new RegExp(comma, 'g'), ',');
|
23 |
+
tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
|
24 |
+
if ( ',' !== comma )
|
25 |
+
tags = tags.replace(/,/g, comma);
|
26 |
+
return tags;
|
27 |
+
},
|
28 |
|
29 |
parseTags : function(el) {
|
30 |
var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),
|
31 |
+
thetags = taxbox.find('.the-tags'), comma = mla_single_edit_vars.comma,
|
32 |
current_tags = thetags.val().split(comma), new_tags = [];
|
33 |
delete current_tags[num];
|
34 |
|
56 |
|
57 |
disabled = thetags.prop('disabled');
|
58 |
|
59 |
+
current_tags = thetags.val().split(mla_single_edit_vars.comma);
|
60 |
tagchecklist.empty();
|
61 |
|
62 |
$.each( current_tags, function( key, val ) {
|
86 |
a = a || false;
|
87 |
var tags = $('.the-tags', el),
|
88 |
newtag = $('input.newtag', el),
|
89 |
+
comma = mla_single_edit_vars.comma,
|
90 |
newtags, text;
|
91 |
|
92 |
text = a ? $(a).text() : newtag.val();
|
155 |
}
|
156 |
}).each(function(){
|
157 |
var tax = $(this).closest('div.tagsdiv').attr('id');
|
158 |
+
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: mla_single_edit_vars.comma + ' ' } );
|
159 |
});
|
160 |
|
161 |
// save tags on post save/publish
|
199 |
taxonomyParts.shift();
|
200 |
taxonomy = taxonomyParts.join('-');
|
201 |
settingName = taxonomy + '_tab';
|
202 |
+
// if ( taxonomy == 'category' )
|
203 |
+
// settingName = 'cats';
|
204 |
|
205 |
// TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
|
206 |
$('a', '#' + taxonomy + '-tabs').click( function(){
|
js/mla-single-edit-scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var tagBox;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(c){var b=mla_single_edit_vars.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(f){var i=f.id,c=i.split("-check-num-")[1],e=a(f).closest(".tagsdiv"),h=e.find(".the-tags"),b=mla_single_edit_vars.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.clean(g.join(b)));this.quickClicks(e);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(mla_single_edit_vars.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend(" ").prepend(h)}e.append(j)})},flushTags:function(g,c,h){c=c||false;var d=a(".the-tags",g),j=a("input.newtag",g),b=mla_single_edit_vars.comma,e,i;i=c?a(c).text():j.val();tagsval=d.val();e=tagsval?tagsval+b+i:i;e=this.clean(e);e=array_unique_noempty(e.split(b)).join(b);d.val(e);this.quickClicks(g);if(!c){j.val("")}if("undefined"==typeof(h)){j.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:mla_single_edit_vars.comma+" "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}}})(jQuery);jQuery(document).ready(function(a){a("#side-info-column").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}});a(".categorydiv").each(function(){var g=a(this).attr("id"),c=false,f,h,e,b,d;e=g.split("-");e.shift();b=e.join("-");d=b+"_tab";a("a","#"+b+"-tabs").click(function(){var i=a(this).attr("href");a(this).parent().addClass("tabs").siblings("li").removeClass("tabs");a("#"+b+"-tabs").siblings(".tabs-panel").hide();a(i).show();if("#"+b+"-all"==i){deleteUserSetting(d)}else{setUserSetting(d,"pop")}return false});if(getUserSetting(d)){a('a[href="#'+b+'-pop"]',"#"+b+"-tabs").click()}a("#new"+b).one("focus",function(){a(this).val("").removeClass("form-input-tip")});a("#"+b+"-add-submit").click(function(){a("#new"+b).focus()});f=function(){if(c){return}c=true;var i=jQuery(this),k=i.is(":checked"),j=i.val().toString();a("#in-"+b+"-"+j+", #in-"+b+"-category-"+j).prop("checked",k);c=false};catAddBefore=function(i){if(!a("#new"+b).val()){return false}i.data+="&"+a(":checked","#"+b+"checklist").serialize();a("#"+b+"-add-submit").prop("disabled",true);return i};h=function(l,k){var j,i=a("#new"+b+"_parent");a("#"+b+"-add-submit").prop("disabled",false);if("undefined"!=k.parsed.responses[0]&&(j=k.parsed.responses[0].supplemental.newcat_parent)){i.before(j);i.remove()}};a("#"+b+"checklist").wpList({alt:"",response:b+"-ajax-response",addBefore:catAddBefore,addAfter:h});a("#"+b+"-add-toggle").click(function(){a("#"+b+"-adder").toggleClass("wp-hidden-children");a('a[href="#'+b+'-all"]',"#"+b+"-tabs").click();a("#new"+b).focus();return false});a("#"+b+"checklist li.popular-category :checkbox, #"+b+"checklist-pop :checkbox").live("click",function(){var i=a(this),k=i.is(":checked"),j=i.val();if(j&&i.parents("#taxonomy-"+b).length){a("#in-"+b+"-"+j+", #in-popular-"+b+"-"+j).prop("checked",k)}})})});
|
phpDocs/classes.svg
CHANGED
@@ -4,62 +4,90 @@
|
|
4 |
<!-- Generated by graphviz version 2.28.0 (20110507.0327)
|
5 |
-->
|
6 |
<!-- Title: G Pages: 1 -->
|
7 |
-
<svg width="352pt" height="
|
8 |
-
viewBox="0.00 0.00 352.00
|
9 |
-
<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4
|
10 |
<title>G</title>
|
11 |
-
<polygon fill="white" stroke="white" points="-4,5 -4,-
|
12 |
<g id="graph2" class="cluster"><title>cluster_global</title>
|
13 |
<polyline fill="none" stroke="gray" points="220,-8 324,-8 "/>
|
14 |
<path fill="none" stroke="gray" d="M324,-8C330,-8 336,-14 336,-20"/>
|
15 |
-
<polyline fill="none" stroke="gray" points="336,-20 336,-
|
16 |
-
<path fill="none" stroke="gray" d="M336,-
|
17 |
-
<polyline fill="none" stroke="gray" points="324,-
|
18 |
-
<path fill="none" stroke="gray" d="M220,-
|
19 |
-
<polyline fill="none" stroke="gray" points="208,-
|
20 |
<path fill="none" stroke="gray" d="M208,-20C208,-14 214,-8 220,-8"/>
|
21 |
-
<text text-anchor="middle" x="272" y="-
|
22 |
</g>
|
23 |
<!-- \\MLAData -->
|
24 |
<g id="node2" class="node"><title>\\MLAData</title>
|
25 |
<a xlink:href="includes.class-mla-data.html" xlink:title="MLAData" target="_parent">
|
26 |
-
<polygon fill="none" stroke="black" points="304,-
|
27 |
-
<text text-anchor="middle" x="272" y="-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
</a>
|
29 |
</g>
|
30 |
<!-- \\MLA_List_Table -->
|
31 |
-
<g id="
|
32 |
<a xlink:href="includes.class-mla-list-table.html" xlink:title="MLA_List_Table" target="_parent">
|
33 |
-
<polygon fill="none" stroke="black" points="327.5,-
|
34 |
-
<text text-anchor="middle" x="272" y="-
|
35 |
</a>
|
36 |
</g>
|
37 |
<!-- \\WP_List_Table -->
|
38 |
-
<g id="
|
39 |
-
<ellipse fill="none" stroke="black" cx="72" cy="-
|
40 |
-
<text text-anchor="middle" x="72" y="-
|
41 |
</g>
|
42 |
<!-- \\MLA_List_Table->\\WP_List_Table -->
|
43 |
<g id="edge3" class="edge"><title>\\MLA_List_Table->\\WP_List_Table</title>
|
44 |
-
<path fill="none" stroke="black" d="M216.371,-
|
45 |
-
<polygon fill="none" stroke="black" points="153.788,-
|
46 |
</g>
|
47 |
<!-- \\MLA -->
|
48 |
-
<g id="
|
49 |
<a xlink:href="includes.class-mla-main.html" xlink:title="MLA" target="_parent">
|
50 |
-
<polygon fill="none" stroke="black" points="299,-
|
51 |
-
<text text-anchor="middle" x="272" y="-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
</a>
|
53 |
</g>
|
54 |
<!-- \\MLASettings -->
|
55 |
-
<g id="
|
56 |
<a xlink:href="includes.class-mla-settings.html" xlink:title="MLASettings" target="_parent">
|
57 |
-
<polygon fill="none" stroke="black" points="317.5,-
|
58 |
-
<text text-anchor="middle" x="272" y="-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
</a>
|
60 |
</g>
|
61 |
<!-- \\MLATest -->
|
62 |
-
<g id="
|
63 |
<a xlink:href="tests.class-mla-tests.html" xlink:title="MLATest" target="_parent">
|
64 |
<polygon fill="none" stroke="black" points="304,-52 240,-52 240,-16 304,-16 304,-52"/>
|
65 |
<text text-anchor="middle" x="272" y="-31.2" font-family="Courier,monospace" font-size="11.00">MLATest</text>
|
4 |
<!-- Generated by graphviz version 2.28.0 (20110507.0327)
|
5 |
-->
|
6 |
<!-- Title: G Pages: 1 -->
|
7 |
+
<svg width="352pt" height="528pt"
|
8 |
+
viewBox="0.00 0.00 352.00 528.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
9 |
+
<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 524)">
|
10 |
<title>G</title>
|
11 |
+
<polygon fill="white" stroke="white" points="-4,5 -4,-524 349,-524 349,5 -4,5"/>
|
12 |
<g id="graph2" class="cluster"><title>cluster_global</title>
|
13 |
<polyline fill="none" stroke="gray" points="220,-8 324,-8 "/>
|
14 |
<path fill="none" stroke="gray" d="M324,-8C330,-8 336,-14 336,-20"/>
|
15 |
+
<polyline fill="none" stroke="gray" points="336,-20 336,-500 "/>
|
16 |
+
<path fill="none" stroke="gray" d="M336,-500C336,-506 330,-512 324,-512"/>
|
17 |
+
<polyline fill="none" stroke="gray" points="324,-512 220,-512 "/>
|
18 |
+
<path fill="none" stroke="gray" d="M220,-512C214,-512 208,-506 208,-500"/>
|
19 |
+
<polyline fill="none" stroke="gray" points="208,-500 208,-20 "/>
|
20 |
<path fill="none" stroke="gray" d="M208,-20C208,-14 214,-8 220,-8"/>
|
21 |
+
<text text-anchor="middle" x="272" y="-499.2" font-family="Times New Roman,serif" font-size="11.00" fill="gray">global</text>
|
22 |
</g>
|
23 |
<!-- \\MLAData -->
|
24 |
<g id="node2" class="node"><title>\\MLAData</title>
|
25 |
<a xlink:href="includes.class-mla-data.html" xlink:title="MLAData" target="_parent">
|
26 |
+
<polygon fill="none" stroke="black" points="304,-484 240,-484 240,-448 304,-448 304,-484"/>
|
27 |
+
<text text-anchor="middle" x="272" y="-463.2" font-family="Courier,monospace" font-size="11.00">MLAData</text>
|
28 |
+
</a>
|
29 |
+
</g>
|
30 |
+
<!-- \\MLAEdit -->
|
31 |
+
<g id="node3" class="node"><title>\\MLAEdit</title>
|
32 |
+
<a xlink:href="includes.class-mla-edit-media.html" xlink:title="MLAEdit" target="_parent">
|
33 |
+
<polygon fill="none" stroke="black" points="304,-430 240,-430 240,-394 304,-394 304,-430"/>
|
34 |
+
<text text-anchor="middle" x="272" y="-409.2" font-family="Courier,monospace" font-size="11.00">MLAEdit</text>
|
35 |
</a>
|
36 |
</g>
|
37 |
<!-- \\MLA_List_Table -->
|
38 |
+
<g id="node4" class="node"><title>\\MLA_List_Table</title>
|
39 |
<a xlink:href="includes.class-mla-list-table.html" xlink:title="MLA_List_Table" target="_parent">
|
40 |
+
<polygon fill="none" stroke="black" points="327.5,-376 216.5,-376 216.5,-340 327.5,-340 327.5,-376"/>
|
41 |
+
<text text-anchor="middle" x="272" y="-355.2" font-family="Courier,monospace" font-size="11.00">MLA_List_Table</text>
|
42 |
</a>
|
43 |
</g>
|
44 |
<!-- \\WP_List_Table -->
|
45 |
+
<g id="node12" class="node"><title>\\WP_List_Table</title>
|
46 |
+
<ellipse fill="none" stroke="black" cx="72" cy="-358" rx="71.4873" ry="18"/>
|
47 |
+
<text text-anchor="middle" x="72" y="-354.3" font-family="Times New Roman,serif" font-size="14.00" fill="gray">\WP_List_Table</text>
|
48 |
</g>
|
49 |
<!-- \\MLA_List_Table->\\WP_List_Table -->
|
50 |
<g id="edge3" class="edge"><title>\\MLA_List_Table->\\WP_List_Table</title>
|
51 |
+
<path fill="none" stroke="black" d="M216.371,-358C197.091,-358 174.98,-358 153.987,-358"/>
|
52 |
+
<polygon fill="none" stroke="black" points="153.788,-354.5 143.788,-358 153.788,-361.5 153.788,-354.5"/>
|
53 |
</g>
|
54 |
<!-- \\MLA -->
|
55 |
+
<g id="node5" class="node"><title>\\MLA</title>
|
56 |
<a xlink:href="includes.class-mla-main.html" xlink:title="MLA" target="_parent">
|
57 |
+
<polygon fill="none" stroke="black" points="299,-322 245,-322 245,-286 299,-286 299,-322"/>
|
58 |
+
<text text-anchor="middle" x="272" y="-301.2" font-family="Courier,monospace" font-size="11.00">MLA</text>
|
59 |
+
</a>
|
60 |
+
</g>
|
61 |
+
<!-- \\MLAObjects -->
|
62 |
+
<g id="node6" class="node"><title>\\MLAObjects</title>
|
63 |
+
<a xlink:href="includes.class-mla-objects.html" xlink:title="MLAObjects" target="_parent">
|
64 |
+
<polygon fill="none" stroke="black" points="314,-268 230,-268 230,-232 314,-232 314,-268"/>
|
65 |
+
<text text-anchor="middle" x="272" y="-247.2" font-family="Courier,monospace" font-size="11.00">MLAObjects</text>
|
66 |
+
</a>
|
67 |
+
</g>
|
68 |
+
<!-- \\MLAOptions -->
|
69 |
+
<g id="node7" class="node"><title>\\MLAOptions</title>
|
70 |
+
<a xlink:href="includes.class-mla-options.html" xlink:title="MLAOptions" target="_parent">
|
71 |
+
<polygon fill="none" stroke="black" points="314,-214 230,-214 230,-178 314,-178 314,-214"/>
|
72 |
+
<text text-anchor="middle" x="272" y="-193.2" font-family="Courier,monospace" font-size="11.00">MLAOptions</text>
|
73 |
</a>
|
74 |
</g>
|
75 |
<!-- \\MLASettings -->
|
76 |
+
<g id="node8" class="node"><title>\\MLASettings</title>
|
77 |
<a xlink:href="includes.class-mla-settings.html" xlink:title="MLASettings" target="_parent">
|
78 |
+
<polygon fill="none" stroke="black" points="317.5,-160 226.5,-160 226.5,-124 317.5,-124 317.5,-160"/>
|
79 |
+
<text text-anchor="middle" x="272" y="-139.2" font-family="Courier,monospace" font-size="11.00">MLASettings</text>
|
80 |
+
</a>
|
81 |
+
</g>
|
82 |
+
<!-- \\MLAShortcodes -->
|
83 |
+
<g id="node9" class="node"><title>\\MLAShortcodes</title>
|
84 |
+
<a xlink:href="includes.class-mla-shortcodes.html" xlink:title="MLAShortcodes" target="_parent">
|
85 |
+
<polygon fill="none" stroke="black" points="324,-106 220,-106 220,-70 324,-70 324,-106"/>
|
86 |
+
<text text-anchor="middle" x="272" y="-85.2" font-family="Courier,monospace" font-size="11.00">MLAShortcodes</text>
|
87 |
</a>
|
88 |
</g>
|
89 |
<!-- \\MLATest -->
|
90 |
+
<g id="node10" class="node"><title>\\MLATest</title>
|
91 |
<a xlink:href="tests.class-mla-tests.html" xlink:title="MLATest" target="_parent">
|
92 |
<polygon fill="none" stroke="black" points="304,-52 240,-52 240,-16 304,-16 304,-52"/>
|
93 |
<text text-anchor="middle" x="272" y="-31.2" font-family="Courier,monospace" font-size="11.00">MLATest</text>
|
phpDocs/classes/MLA.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -59,23 +56,24 @@
|
|
59 |
<li class="method public "><a href="#mla_add_help_tab" title="mla_add_help_tab :: Add contextual help tabs to all the MLA pages"><span class="description">Add contextual help tabs to all the MLA pages</span><pre>mla_add_help_tab()</pre></a></li>
|
60 |
<li class="method public "><a href="#mla_add_menu_options" title='mla_add_menu_options :: Add the "XX Entries per page" filter to the Screen Options tab'><span class="description">Add the "XX Entries per page" filter to the Screen Options tab</span><pre>mla_add_menu_options()</pre></a></li>
|
61 |
<li class="method public "><a href="#mla_admin_enqueue_scripts_action" title="mla_admin_enqueue_scripts_action :: Load the plugin's Style Sheet and Javascript files"><span class="description">Load the plugin's Style Sheet and Javascript files</span><pre>mla_admin_enqueue_scripts_action()</pre></a></li>
|
|
|
62 |
<li class="method public "><a href="#mla_admin_menu_action" title="mla_admin_menu_action :: Add the submenu pages"><span class="description">Add the submenu pages</span><pre>mla_admin_menu_action()</pre></a></li>
|
63 |
-
<li class="method public "><a href="#
|
64 |
-
<li class="method public "><a href="#
|
|
|
65 |
<li class="method public "><a href="#mla_render_admin_page" title='mla_render_admin_page :: Render the "Assistant" subpage in the Media section, using the list_table package'><span class="description">Render the "Assistant" subpage in the Media section, using the list_table package</span><pre>mla_render_admin_page()</pre></a></li>
|
66 |
<li class="method public "><a href="#mla_screen_options_show_screen_filter" title="mla_screen_options_show_screen_filter :: Only show screen options on the table-list screen"><span class="description">Only show screen options on the table-list screen</span><pre>mla_screen_options_show_screen_filter()</pre></a></li>
|
67 |
<li class="method public "><a href="#mla_set_screen_option_filter" title='mla_set_screen_option_filter :: Save the "Entries per page" option set by this user'><span class="description">Save the "Entries per page" option set by this user</span><pre>mla_set_screen_option_filter()</pre></a></li>
|
68 |
<li class="nav-header private">» Private</li>
|
69 |
-
<li class="method private "><a href="#
|
70 |
-
<li class="method private "><a href="#
|
|
|
|
|
71 |
<li class="method private "><a href="#_display_single_item" title="_display_single_item :: Display a single item sub page; prepare the form to
|
72 |
change the meta data for a single attachment."><span class="description">Display a single item sub page; prepare the form to
|
73 |
change the meta data for a single attachment.</span><pre>_display_single_item()</pre></a></li>
|
74 |
<li class="method private "><a href="#_restore_single_item" title="_restore_single_item :: Restore a single item from the Trash"><span class="description">Restore a single item from the Trash</span><pre>_restore_single_item()</pre></a></li>
|
75 |
<li class="method private "><a href="#_trash_single_item" title="_trash_single_item :: Move a single item to Trash"><span class="description">Move a single item to Trash</span><pre>_trash_single_item()</pre></a></li>
|
76 |
-
<li class="method private "><a href="#_update_single_item" title="_update_single_item :: Update a single item; change the meta data
|
77 |
-
for a single attachment."><span class="description">Update a single item; change the meta data
|
78 |
-
for a single attachment.</span><pre>_update_single_item()</pre></a></li>
|
79 |
<li class="nav-header">
|
80 |
<i class="icon-custom icon-property"></i> Properties</li>
|
81 |
<li class="nav-header private">» Private</li>
|
@@ -84,13 +82,16 @@ for a single attachment.</span><pre>_update_single_item()</pre></a></li>
|
|
84 |
<i class="icon-custom icon-constant"></i> Constants</li>
|
85 |
<li class="constant "><a href="#ADMIN_PAGE_SLUG" title="ADMIN_PAGE_SLUG :: Slug for adding plugin submenu"><span class="description">Slug for adding plugin submenu</span><pre>ADMIN_PAGE_SLUG</pre></a></li>
|
86 |
<li class="constant "><a href="#CURRENT_MLA_VERSION" title="CURRENT_MLA_VERSION :: Current version number"><span class="description">Current version number</span><pre>CURRENT_MLA_VERSION</pre></a></li>
|
87 |
-
<li class="constant "><a href="#
|
88 |
-
<li class="constant "><a href="#
|
89 |
-
<li class="constant "><a href="#
|
|
|
90 |
<li class="constant "><a href="#MLA_ADMIN_NONCE" title="MLA_ADMIN_NONCE :: Action name; uniquely identifies the nonce"><span class="description">Action name; uniquely identifies the nonce</span><pre>MLA_ADMIN_NONCE</pre></a></li>
|
|
|
91 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_DELETE" title="MLA_ADMIN_SINGLE_DELETE :: mla_admin_action value for permanently deleting a single item"><span class="description">mla_admin_action value for permanently deleting a single item</span><pre>MLA_ADMIN_SINGLE_DELETE</pre></a></li>
|
92 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_EDIT_DISPLAY" title="MLA_ADMIN_SINGLE_EDIT_DISPLAY :: mla_admin_action value for displaying a single item"><span class="description">mla_admin_action value for displaying a single item</span><pre>MLA_ADMIN_SINGLE_EDIT_DISPLAY</pre></a></li>
|
93 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_EDIT_UPDATE" title="MLA_ADMIN_SINGLE_EDIT_UPDATE :: mla_admin_action value for updating a single item"><span class="description">mla_admin_action value for updating a single item</span><pre>MLA_ADMIN_SINGLE_EDIT_UPDATE</pre></a></li>
|
|
|
94 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_RESTORE" title="MLA_ADMIN_SINGLE_RESTORE :: mla_admin_action value for restoring a single item from the trash"><span class="description">mla_admin_action value for restoring a single item from the trash</span><pre>MLA_ADMIN_SINGLE_RESTORE</pre></a></li>
|
95 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_TRASH" title="MLA_ADMIN_SINGLE_TRASH :: mla_admin_action value for moving a single item to the trash"><span class="description">mla_admin_action value for moving a single item to the trash</span><pre>MLA_ADMIN_SINGLE_TRASH</pre></a></li>
|
96 |
<li class="constant "><a href="#PLUGIN_NAME" title="PLUGIN_NAME :: Display name for this plugin"><span class="description">Display name for this plugin</span><pre>PLUGIN_NAME</pre></a></li>
|
@@ -126,10 +127,12 @@ of images and files held in the WordPress Media Library.</p>
|
|
126 |
<i class="icon-custom icon-method"></i> Methods</h3>
|
127 |
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
128 |
<h2>Initialization function, similar to __construct()</h2>
|
129 |
-
<pre>initialize() </pre>
|
130 |
<div class="labels"></div>
|
131 |
<div class="row collapse"><div class="detail-description">
|
132 |
-
<p class="long_description"
|
|
|
|
|
133 |
<table class="table table-bordered"><tr>
|
134 |
<th>since</th>
|
135 |
<td>0.1</td>
|
@@ -138,7 +141,7 @@ of images and files held in the WordPress Media Library.</p>
|
|
138 |
</div>
|
139 |
<a name="mla_add_help_tab" id="mla_add_help_tab"></a><div class="element clickable method public mla_add_help_tab" data-toggle="collapse" data-target=".mla_add_help_tab .collapse">
|
140 |
<h2>Add contextual help tabs to all the MLA pages</h2>
|
141 |
-
<pre>mla_add_help_tab() </pre>
|
142 |
<div class="labels"></div>
|
143 |
<div class="row collapse"><div class="detail-description">
|
144 |
<p class="long_description"></p>
|
@@ -150,7 +153,7 @@ of images and files held in the WordPress Media Library.</p>
|
|
150 |
</div>
|
151 |
<a name="mla_add_menu_options" id="mla_add_menu_options"></a><div class="element clickable method public mla_add_menu_options" data-toggle="collapse" data-target=".mla_add_menu_options .collapse">
|
152 |
<h2>Add the "XX Entries per page" filter to the Screen Options tab</h2>
|
153 |
-
<pre>mla_add_menu_options() </pre>
|
154 |
<div class="labels"></div>
|
155 |
<div class="row collapse"><div class="detail-description">
|
156 |
<p class="long_description"></p>
|
@@ -162,7 +165,7 @@ of images and files held in the WordPress Media Library.</p>
|
|
162 |
</div>
|
163 |
<a name="mla_admin_enqueue_scripts_action" id="mla_admin_enqueue_scripts_action"></a><div class="element clickable method public mla_admin_enqueue_scripts_action" data-toggle="collapse" data-target=".mla_admin_enqueue_scripts_action .collapse">
|
164 |
<h2>Load the plugin's Style Sheet and Javascript files</h2>
|
165 |
-
<pre>mla_admin_enqueue_scripts_action(string $page_hook) :
|
166 |
<div class="labels"></div>
|
167 |
<div class="row collapse"><div class="detail-description">
|
168 |
<p class="long_description"></p>
|
@@ -174,47 +177,75 @@ of images and files held in the WordPress Media Library.</p>
|
|
174 |
<div class="subelement argument">
|
175 |
<h4>$page_hook</h4>
|
176 |
<code>string</code><p>Name of the page being loaded</p></div>
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
</div></div>
|
180 |
</div>
|
181 |
<a name="mla_admin_menu_action" id="mla_admin_menu_action"></a><div class="element clickable method public mla_admin_menu_action" data-toggle="collapse" data-target=".mla_admin_menu_action .collapse">
|
182 |
<h2>Add the submenu pages</h2>
|
183 |
-
<pre>mla_admin_menu_action() </pre>
|
184 |
<div class="labels"></div>
|
185 |
<div class="row collapse"><div class="detail-description">
|
186 |
<p class="long_description"><p>Add a submenu page in the "Media" section,
|
|
|
|
|
|
|
|
|
187 |
add submenu page(s) for attachment taxonomies,
|
188 |
-
add filter to clean up taxonomy submenu labels
|
189 |
-
add settings page in the "Settings" section,
|
190 |
-
add settings link in the Plugins section entry for MLA.</p></p>
|
191 |
<table class="table table-bordered"><tr>
|
192 |
<th>since</th>
|
193 |
<td>0.1</td>
|
194 |
</tr></table>
|
195 |
</div></div>
|
196 |
</div>
|
197 |
-
<a name="
|
198 |
<h2>Redirect to the Edit Tags/Categories page</h2>
|
199 |
-
<pre>
|
200 |
<div class="labels"></div>
|
201 |
<div class="row collapse"><div class="detail-description">
|
202 |
<p class="long_description"><p>The custom taxonomy add/edit submenu entries go to "upload.php" by default.
|
203 |
-
This filter is the only way to redirect them to the correct WordPress page
|
|
|
204 |
<table class="table table-bordered"><tr>
|
205 |
<th>since</th>
|
206 |
<td>0.1</td>
|
207 |
</tr></table>
|
208 |
</div></div>
|
209 |
</div>
|
210 |
-
<a name="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
<h2>Cleanup menus for Edit Tags/Categories page</h2>
|
212 |
-
<pre>
|
213 |
<div class="labels"></div>
|
214 |
<div class="row collapse"><div class="detail-description">
|
215 |
-
<p class="long_description"><p>
|
216 |
-
|
217 |
-
|
|
|
|
|
|
|
218 |
<table class="table table-bordered"><tr>
|
219 |
<th>since</th>
|
220 |
<td>0.1</td>
|
@@ -231,7 +262,7 @@ to the right WordPress page for editing/adding taxonomy terms.</p></p>
|
|
231 |
</div>
|
232 |
<a name="mla_render_admin_page" id="mla_render_admin_page"></a><div class="element clickable method public mla_render_admin_page" data-toggle="collapse" data-target=".mla_render_admin_page .collapse">
|
233 |
<h2>Render the "Assistant" subpage in the Media section, using the list_table package</h2>
|
234 |
-
<pre>mla_render_admin_page() </pre>
|
235 |
<div class="labels"></div>
|
236 |
<div class="row collapse"><div class="detail-description">
|
237 |
<p class="long_description"></p>
|
@@ -266,7 +297,7 @@ to the right WordPress page for editing/adding taxonomy terms.</p></p>
|
|
266 |
</div>
|
267 |
<a name="mla_set_screen_option_filter" id="mla_set_screen_option_filter"></a><div class="element clickable method public mla_set_screen_option_filter" data-toggle="collapse" data-target=".mla_set_screen_option_filter .collapse">
|
268 |
<h2>Save the "Entries per page" option set by this user</h2>
|
269 |
-
<pre>mla_set_screen_option_filter(boolean $status, string $option, string $value) : string</pre>
|
270 |
<div class="labels"></div>
|
271 |
<div class="row collapse"><div class="detail-description">
|
272 |
<p class="long_description"></p>
|
@@ -287,12 +318,58 @@ to the right WordPress page for editing/adding taxonomy terms.</p></p>
|
|
287 |
<code>string</code><p>New value of the option</p></div>
|
288 |
<h3>Returns</h3>
|
289 |
<div class="subelement response">
|
290 |
-
<code>string</code>New value if this is our option, otherwise nothing</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
</div></div>
|
292 |
</div>
|
293 |
<a name="_current_bulk_action" id="_current_bulk_action"></a><div class="element clickable method private _current_bulk_action" data-toggle="collapse" data-target="._current_bulk_action .collapse">
|
294 |
-
<h2>Get the current action selected from the bulk actions dropdown
|
295 |
-
<pre>_current_bulk_action() : string |
|
296 |
<div class="labels"></div>
|
297 |
<div class="row collapse"><div class="detail-description">
|
298 |
<p class="long_description"></p>
|
@@ -302,11 +379,11 @@ to the right WordPress page for editing/adding taxonomy terms.</p></p>
|
|
302 |
</tr></table>
|
303 |
<h3>Returns</h3>
|
304 |
<div class="subelement response">
|
305 |
-
<code>string</code><code>
|
306 |
</div></div>
|
307 |
</div>
|
308 |
<a name="_delete_single_item" id="_delete_single_item"></a><div class="element clickable method private _delete_single_item" data-toggle="collapse" data-target="._delete_single_item .collapse">
|
309 |
-
<h2>Delete a single item permanently
|
310 |
<pre>_delete_single_item(array $post_id) : array</pre>
|
311 |
<div class="labels"></div>
|
312 |
<div class="row collapse"><div class="detail-description">
|
@@ -318,10 +395,10 @@ to the right WordPress page for editing/adding taxonomy terms.</p></p>
|
|
318 |
<h3>Parameters</h3>
|
319 |
<div class="subelement argument">
|
320 |
<h4>$post_id</h4>
|
321 |
-
<code>array</code><p>The form POST data
|
322 |
<h3>Returns</h3>
|
323 |
<div class="subelement response">
|
324 |
-
<code>array</code>success/failure message and
|
325 |
</div></div>
|
326 |
</div>
|
327 |
<a name="_display_single_item" id="_display_single_item"></a><div class="element clickable method private _display_single_item" data-toggle="collapse" data-target="._display_single_item .collapse">
|
@@ -341,7 +418,7 @@ change the meta data for a single attachment.</h2>
|
|
341 |
<code>int</code><p>The WordPress Post ID of the attachment item</p></div>
|
342 |
<h3>Returns</h3>
|
343 |
<div class="subelement response">
|
344 |
-
<code>array</code>message and/or HTML content
|
345 |
</div></div>
|
346 |
</div>
|
347 |
<a name="_restore_single_item" id="_restore_single_item"></a><div class="element clickable method private _restore_single_item" data-toggle="collapse" data-target="._restore_single_item .collapse">
|
@@ -360,7 +437,7 @@ change the meta data for a single attachment.</h2>
|
|
360 |
<code>array</code><p>The form POST data</p></div>
|
361 |
<h3>Returns</h3>
|
362 |
<div class="subelement response">
|
363 |
-
<code>array</code>success/failure message and
|
364 |
</div></div>
|
365 |
</div>
|
366 |
<a name="_trash_single_item" id="_trash_single_item"></a><div class="element clickable method private _trash_single_item" data-toggle="collapse" data-target="._trash_single_item .collapse">
|
@@ -379,34 +456,7 @@ change the meta data for a single attachment.</h2>
|
|
379 |
<code>array</code><p>The form POST data</p></div>
|
380 |
<h3>Returns</h3>
|
381 |
<div class="subelement response">
|
382 |
-
<code>array</code>success/failure message and
|
383 |
-
</div></div>
|
384 |
-
</div>
|
385 |
-
<a name="_update_single_item" id="_update_single_item"></a><div class="element clickable method private _update_single_item" data-toggle="collapse" data-target="._update_single_item .collapse">
|
386 |
-
<h2>Update a single item; change the meta data
|
387 |
-
for a single attachment.</h2>
|
388 |
-
<pre>_update_single_item(int $post_id, array $new_data, array $tax_input) : array</pre>
|
389 |
-
<div class="labels"></div>
|
390 |
-
<div class="row collapse"><div class="detail-description">
|
391 |
-
<p class="long_description"></p>
|
392 |
-
<table class="table table-bordered"><tr>
|
393 |
-
<th>since</th>
|
394 |
-
<td>0.1</td>
|
395 |
-
</tr></table>
|
396 |
-
<h3>Parameters</h3>
|
397 |
-
<div class="subelement argument">
|
398 |
-
<h4>$post_id</h4>
|
399 |
-
<code>int</code><p>The ID of the attachment to be updated</p></div>
|
400 |
-
<div class="subelement argument">
|
401 |
-
<h4>$new_data</h4>
|
402 |
-
<code>array</code><p>Field name => value pairs</p>
|
403 |
-
</div>
|
404 |
-
<div class="subelement argument">
|
405 |
-
<h4>$tax_input</h4>
|
406 |
-
<code>array</code><p>Attachment Category and Tag values</p></div>
|
407 |
-
<h3>Returns</h3>
|
408 |
-
<div class="subelement response">
|
409 |
-
<code>array</code>success/failure message and null content</div>
|
410 |
</div></div>
|
411 |
</div>
|
412 |
<h3>
|
@@ -449,21 +499,33 @@ for a single attachment.</h2>
|
|
449 |
</tr></table>
|
450 |
</div></div>
|
451 |
</div>
|
452 |
-
<a name="
|
453 |
-
<h2>
|
454 |
-
<pre>
|
455 |
<div class="labels"></div>
|
456 |
<div class="row collapse"><div class="detail-description">
|
457 |
<p class="long_description"></p>
|
458 |
<table class="table table-bordered"><tr>
|
459 |
<th>since</th>
|
460 |
-
<td>0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
</tr></table>
|
462 |
</div></div>
|
463 |
</div>
|
464 |
-
<a name="
|
465 |
-
<h2>
|
466 |
-
<pre>
|
467 |
<div class="labels"></div>
|
468 |
<div class="row collapse"><div class="detail-description">
|
469 |
<p class="long_description"></p>
|
@@ -473,9 +535,9 @@ for a single attachment.</h2>
|
|
473 |
</tr></table>
|
474 |
</div></div>
|
475 |
</div>
|
476 |
-
<a name="
|
477 |
-
<h2>
|
478 |
-
<pre>
|
479 |
<div class="labels"></div>
|
480 |
<div class="row collapse"><div class="detail-description">
|
481 |
<p class="long_description"></p>
|
@@ -497,6 +559,18 @@ for a single attachment.</h2>
|
|
497 |
</tr></table>
|
498 |
</div></div>
|
499 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
<a name="MLA_ADMIN_SINGLE_DELETE" id="MLA_ADMIN_SINGLE_DELETE"> </a><div class="element clickable constant MLA_ADMIN_SINGLE_DELETE" data-toggle="collapse" data-target=".MLA_ADMIN_SINGLE_DELETE .collapse">
|
501 |
<h2>mla_admin_action value for permanently deleting a single item</h2>
|
502 |
<pre>MLA_ADMIN_SINGLE_DELETE : string</pre>
|
@@ -533,6 +607,18 @@ for a single attachment.</h2>
|
|
533 |
</tr></table>
|
534 |
</div></div>
|
535 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
536 |
<a name="MLA_ADMIN_SINGLE_RESTORE" id="MLA_ADMIN_SINGLE_RESTORE"> </a><div class="element clickable constant MLA_ADMIN_SINGLE_RESTORE" data-toggle="collapse" data-target=".MLA_ADMIN_SINGLE_RESTORE .collapse">
|
537 |
<h2>mla_admin_action value for restoring a single item from the trash</h2>
|
538 |
<pre>MLA_ADMIN_SINGLE_RESTORE : string</pre>
|
@@ -588,7 +674,7 @@ for a single attachment.</h2>
|
|
588 |
<div class="row"><footer class="span12">
|
589 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
590 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
591 |
-
generated on
|
592 |
</div>
|
593 |
</body>
|
594 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLA</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
56 |
<li class="method public "><a href="#mla_add_help_tab" title="mla_add_help_tab :: Add contextual help tabs to all the MLA pages"><span class="description">Add contextual help tabs to all the MLA pages</span><pre>mla_add_help_tab()</pre></a></li>
|
57 |
<li class="method public "><a href="#mla_add_menu_options" title='mla_add_menu_options :: Add the "XX Entries per page" filter to the Screen Options tab'><span class="description">Add the "XX Entries per page" filter to the Screen Options tab</span><pre>mla_add_menu_options()</pre></a></li>
|
58 |
<li class="method public "><a href="#mla_admin_enqueue_scripts_action" title="mla_admin_enqueue_scripts_action :: Load the plugin's Style Sheet and Javascript files"><span class="description">Load the plugin's Style Sheet and Javascript files</span><pre>mla_admin_enqueue_scripts_action()</pre></a></li>
|
59 |
+
<li class="method public "><a href="#mla_admin_init_action" title="mla_admin_init_action :: Load the plugin's Ajax handler or process Edit Media update actions"><span class="description">Load the plugin's Ajax handler or process Edit Media update actions</span><pre>mla_admin_init_action()</pre></a></li>
|
60 |
<li class="method public "><a href="#mla_admin_menu_action" title="mla_admin_menu_action :: Add the submenu pages"><span class="description">Add the submenu pages</span><pre>mla_admin_menu_action()</pre></a></li>
|
61 |
+
<li class="method public "><a href="#mla_edit_tax_redirect" title="mla_edit_tax_redirect :: Redirect to the Edit Tags/Categories page"><span class="description">Redirect to the Edit Tags/Categories page</span><pre>mla_edit_tax_redirect()</pre></a></li>
|
62 |
+
<li class="method public "><a href="#mla_inline_edit_action" title="mla_inline_edit_action :: Ajax handler for inline editing (quick and bulk edit)"><span class="description">Ajax handler for inline editing (quick and bulk edit)</span><pre>mla_inline_edit_action()</pre></a></li>
|
63 |
+
<li class="method public "><a href="#mla_parent_file_filter" title="mla_parent_file_filter :: Cleanup menus for Edit Tags/Categories page"><span class="description">Cleanup menus for Edit Tags/Categories page</span><pre>mla_parent_file_filter()</pre></a></li>
|
64 |
<li class="method public "><a href="#mla_render_admin_page" title='mla_render_admin_page :: Render the "Assistant" subpage in the Media section, using the list_table package'><span class="description">Render the "Assistant" subpage in the Media section, using the list_table package</span><pre>mla_render_admin_page()</pre></a></li>
|
65 |
<li class="method public "><a href="#mla_screen_options_show_screen_filter" title="mla_screen_options_show_screen_filter :: Only show screen options on the table-list screen"><span class="description">Only show screen options on the table-list screen</span><pre>mla_screen_options_show_screen_filter()</pre></a></li>
|
66 |
<li class="method public "><a href="#mla_set_screen_option_filter" title='mla_set_screen_option_filter :: Save the "Entries per page" option set by this user'><span class="description">Save the "Entries per page" option set by this user</span><pre>mla_set_screen_option_filter()</pre></a></li>
|
67 |
<li class="nav-header private">» Private</li>
|
68 |
+
<li class="method private "><a href="#_authors_dropdown" title="_authors_dropdown :: Get the edit Authors dropdown box, if user has suitable permissions"><span class="description">Get the edit Authors dropdown box, if user has suitable permissions</span><pre>_authors_dropdown()</pre></a></li>
|
69 |
+
<li class="method private "><a href="#_build_inline_edit_form" title="_build_inline_edit_form :: Build the hidden row templates for inline editing (quick and bulk edit)"><span class="description">Build the hidden row templates for inline editing (quick and bulk edit)</span><pre>_build_inline_edit_form()</pre></a></li>
|
70 |
+
<li class="method private "><a href="#_current_bulk_action" title="_current_bulk_action :: Get the current action selected from the bulk actions dropdown"><span class="description">Get the current action selected from the bulk actions dropdown</span><pre>_current_bulk_action()</pre></a></li>
|
71 |
+
<li class="method private "><a href="#_delete_single_item" title="_delete_single_item :: Delete a single item permanently"><span class="description">Delete a single item permanently</span><pre>_delete_single_item()</pre></a></li>
|
72 |
<li class="method private "><a href="#_display_single_item" title="_display_single_item :: Display a single item sub page; prepare the form to
|
73 |
change the meta data for a single attachment."><span class="description">Display a single item sub page; prepare the form to
|
74 |
change the meta data for a single attachment.</span><pre>_display_single_item()</pre></a></li>
|
75 |
<li class="method private "><a href="#_restore_single_item" title="_restore_single_item :: Restore a single item from the Trash"><span class="description">Restore a single item from the Trash</span><pre>_restore_single_item()</pre></a></li>
|
76 |
<li class="method private "><a href="#_trash_single_item" title="_trash_single_item :: Move a single item to Trash"><span class="description">Move a single item to Trash</span><pre>_trash_single_item()</pre></a></li>
|
|
|
|
|
|
|
77 |
<li class="nav-header">
|
78 |
<i class="icon-custom icon-property"></i> Properties</li>
|
79 |
<li class="nav-header private">» Private</li>
|
82 |
<i class="icon-custom icon-constant"></i> Constants</li>
|
83 |
<li class="constant "><a href="#ADMIN_PAGE_SLUG" title="ADMIN_PAGE_SLUG :: Slug for adding plugin submenu"><span class="description">Slug for adding plugin submenu</span><pre>ADMIN_PAGE_SLUG</pre></a></li>
|
84 |
<li class="constant "><a href="#CURRENT_MLA_VERSION" title="CURRENT_MLA_VERSION :: Current version number"><span class="description">Current version number</span><pre>CURRENT_MLA_VERSION</pre></a></li>
|
85 |
+
<li class="constant "><a href="#JAVASCRIPT_INLINE_EDIT_OBJECT" title="JAVASCRIPT_INLINE_EDIT_OBJECT :: Object name for localizing JavaScript - MLA List Table"><span class="description">Object name for localizing JavaScript - MLA List Table</span><pre>JAVASCRIPT_INLINE_EDIT_OBJECT</pre></a></li>
|
86 |
+
<li class="constant "><a href="#JAVASCRIPT_INLINE_EDIT_SLUG" title="JAVASCRIPT_INLINE_EDIT_SLUG :: Slug for localizing and enqueueing JavaScript - MLA List Table"><span class="description">Slug for localizing and enqueueing JavaScript - MLA List Table</span><pre>JAVASCRIPT_INLINE_EDIT_SLUG</pre></a></li>
|
87 |
+
<li class="constant "><a href="#JAVASCRIPT_SINGLE_EDIT_OBJECT" title="JAVASCRIPT_SINGLE_EDIT_OBJECT :: Object name for localizing JavaScript - edit single item page"><span class="description">Object name for localizing JavaScript - edit single item page</span><pre>JAVASCRIPT_SINGLE_EDIT_OBJECT</pre></a></li>
|
88 |
+
<li class="constant "><a href="#JAVASCRIPT_SINGLE_EDIT_SLUG" title="JAVASCRIPT_SINGLE_EDIT_SLUG :: Slug for localizing and enqueueing JavaScript - edit single item page"><span class="description">Slug for localizing and enqueueing JavaScript - edit single item page</span><pre>JAVASCRIPT_SINGLE_EDIT_SLUG</pre></a></li>
|
89 |
<li class="constant "><a href="#MLA_ADMIN_NONCE" title="MLA_ADMIN_NONCE :: Action name; uniquely identifies the nonce"><span class="description">Action name; uniquely identifies the nonce</span><pre>MLA_ADMIN_NONCE</pre></a></li>
|
90 |
+
<li class="constant "><a href="#MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP" title="MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP :: mla_admin_action value for mapping Custom Field metadata"><span class="description">mla_admin_action value for mapping Custom Field metadata</span><pre>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP</pre></a></li>
|
91 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_DELETE" title="MLA_ADMIN_SINGLE_DELETE :: mla_admin_action value for permanently deleting a single item"><span class="description">mla_admin_action value for permanently deleting a single item</span><pre>MLA_ADMIN_SINGLE_DELETE</pre></a></li>
|
92 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_EDIT_DISPLAY" title="MLA_ADMIN_SINGLE_EDIT_DISPLAY :: mla_admin_action value for displaying a single item"><span class="description">mla_admin_action value for displaying a single item</span><pre>MLA_ADMIN_SINGLE_EDIT_DISPLAY</pre></a></li>
|
93 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_EDIT_UPDATE" title="MLA_ADMIN_SINGLE_EDIT_UPDATE :: mla_admin_action value for updating a single item"><span class="description">mla_admin_action value for updating a single item</span><pre>MLA_ADMIN_SINGLE_EDIT_UPDATE</pre></a></li>
|
94 |
+
<li class="constant "><a href="#MLA_ADMIN_SINGLE_MAP" title="MLA_ADMIN_SINGLE_MAP :: mla_admin_action value for mapping IPTC/EXIF metadata"><span class="description">mla_admin_action value for mapping IPTC/EXIF metadata</span><pre>MLA_ADMIN_SINGLE_MAP</pre></a></li>
|
95 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_RESTORE" title="MLA_ADMIN_SINGLE_RESTORE :: mla_admin_action value for restoring a single item from the trash"><span class="description">mla_admin_action value for restoring a single item from the trash</span><pre>MLA_ADMIN_SINGLE_RESTORE</pre></a></li>
|
96 |
<li class="constant "><a href="#MLA_ADMIN_SINGLE_TRASH" title="MLA_ADMIN_SINGLE_TRASH :: mla_admin_action value for moving a single item to the trash"><span class="description">mla_admin_action value for moving a single item to the trash</span><pre>MLA_ADMIN_SINGLE_TRASH</pre></a></li>
|
97 |
<li class="constant "><a href="#PLUGIN_NAME" title="PLUGIN_NAME :: Display name for this plugin"><span class="description">Display name for this plugin</span><pre>PLUGIN_NAME</pre></a></li>
|
127 |
<i class="icon-custom icon-method"></i> Methods</h3>
|
128 |
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
129 |
<h2>Initialization function, similar to __construct()</h2>
|
130 |
+
<pre>initialize() : void</pre>
|
131 |
<div class="labels"></div>
|
132 |
<div class="row collapse"><div class="detail-description">
|
133 |
+
<p class="long_description"><p>This function contains add_action and add_filter calls
|
134 |
+
to set up the Ajax handlers, enqueue JavaScript and CSS files, and
|
135 |
+
set up the Assistant submenu.</p></p>
|
136 |
<table class="table table-bordered"><tr>
|
137 |
<th>since</th>
|
138 |
<td>0.1</td>
|
141 |
</div>
|
142 |
<a name="mla_add_help_tab" id="mla_add_help_tab"></a><div class="element clickable method public mla_add_help_tab" data-toggle="collapse" data-target=".mla_add_help_tab .collapse">
|
143 |
<h2>Add contextual help tabs to all the MLA pages</h2>
|
144 |
+
<pre>mla_add_help_tab() : void</pre>
|
145 |
<div class="labels"></div>
|
146 |
<div class="row collapse"><div class="detail-description">
|
147 |
<p class="long_description"></p>
|
153 |
</div>
|
154 |
<a name="mla_add_menu_options" id="mla_add_menu_options"></a><div class="element clickable method public mla_add_menu_options" data-toggle="collapse" data-target=".mla_add_menu_options .collapse">
|
155 |
<h2>Add the "XX Entries per page" filter to the Screen Options tab</h2>
|
156 |
+
<pre>mla_add_menu_options() : void</pre>
|
157 |
<div class="labels"></div>
|
158 |
<div class="row collapse"><div class="detail-description">
|
159 |
<p class="long_description"></p>
|
165 |
</div>
|
166 |
<a name="mla_admin_enqueue_scripts_action" id="mla_admin_enqueue_scripts_action"></a><div class="element clickable method public mla_admin_enqueue_scripts_action" data-toggle="collapse" data-target=".mla_admin_enqueue_scripts_action .collapse">
|
167 |
<h2>Load the plugin's Style Sheet and Javascript files</h2>
|
168 |
+
<pre>mla_admin_enqueue_scripts_action(string $page_hook) : void</pre>
|
169 |
<div class="labels"></div>
|
170 |
<div class="row collapse"><div class="detail-description">
|
171 |
<p class="long_description"></p>
|
177 |
<div class="subelement argument">
|
178 |
<h4>$page_hook</h4>
|
179 |
<code>string</code><p>Name of the page being loaded</p></div>
|
180 |
+
</div></div>
|
181 |
+
</div>
|
182 |
+
<a name="mla_admin_init_action" id="mla_admin_init_action"></a><div class="element clickable method public mla_admin_init_action" data-toggle="collapse" data-target=".mla_admin_init_action .collapse">
|
183 |
+
<h2>Load the plugin's Ajax handler or process Edit Media update actions</h2>
|
184 |
+
<pre>mla_admin_init_action() : void</pre>
|
185 |
+
<div class="labels"></div>
|
186 |
+
<div class="row collapse"><div class="detail-description">
|
187 |
+
<p class="long_description"></p>
|
188 |
+
<table class="table table-bordered"><tr>
|
189 |
+
<th>since</th>
|
190 |
+
<td>0.20</td>
|
191 |
+
</tr></table>
|
192 |
</div></div>
|
193 |
</div>
|
194 |
<a name="mla_admin_menu_action" id="mla_admin_menu_action"></a><div class="element clickable method public mla_admin_menu_action" data-toggle="collapse" data-target=".mla_admin_menu_action .collapse">
|
195 |
<h2>Add the submenu pages</h2>
|
196 |
+
<pre>mla_admin_menu_action() : void</pre>
|
197 |
<div class="labels"></div>
|
198 |
<div class="row collapse"><div class="detail-description">
|
199 |
<p class="long_description"><p>Add a submenu page in the "Media" section,
|
200 |
+
add settings page in the "Settings" section.
|
201 |
+
add settings link in the Plugins section entry for MLA.</p>
|
202 |
+
|
203 |
+
<p>For WordPress versions before 3.5,
|
204 |
add submenu page(s) for attachment taxonomies,
|
205 |
+
add filter to clean up taxonomy submenu labels.</p></p>
|
|
|
|
|
206 |
<table class="table table-bordered"><tr>
|
207 |
<th>since</th>
|
208 |
<td>0.1</td>
|
209 |
</tr></table>
|
210 |
</div></div>
|
211 |
</div>
|
212 |
+
<a name="mla_edit_tax_redirect" id="mla_edit_tax_redirect"></a><div class="element clickable method public mla_edit_tax_redirect" data-toggle="collapse" data-target=".mla_edit_tax_redirect .collapse">
|
213 |
<h2>Redirect to the Edit Tags/Categories page</h2>
|
214 |
+
<pre>mla_edit_tax_redirect() : void</pre>
|
215 |
<div class="labels"></div>
|
216 |
<div class="row collapse"><div class="detail-description">
|
217 |
<p class="long_description"><p>The custom taxonomy add/edit submenu entries go to "upload.php" by default.
|
218 |
+
This filter is the only way to redirect them to the correct WordPress page.
|
219 |
+
The filter is not required for WordPress 3.5 and later.</p></p>
|
220 |
<table class="table table-bordered"><tr>
|
221 |
<th>since</th>
|
222 |
<td>0.1</td>
|
223 |
</tr></table>
|
224 |
</div></div>
|
225 |
</div>
|
226 |
+
<a name="mla_inline_edit_action" id="mla_inline_edit_action"></a><div class="element clickable method public mla_inline_edit_action" data-toggle="collapse" data-target=".mla_inline_edit_action .collapse">
|
227 |
+
<h2>Ajax handler for inline editing (quick and bulk edit)</h2>
|
228 |
+
<pre>mla_inline_edit_action() : void</pre>
|
229 |
+
<div class="labels"></div>
|
230 |
+
<div class="row collapse"><div class="detail-description">
|
231 |
+
<p class="long_description"><p>Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php</p></p>
|
232 |
+
<table class="table table-bordered"><tr>
|
233 |
+
<th>since</th>
|
234 |
+
<td>0.20</td>
|
235 |
+
</tr></table>
|
236 |
+
</div></div>
|
237 |
+
</div>
|
238 |
+
<a name="mla_parent_file_filter" id="mla_parent_file_filter"></a><div class="element clickable method public mla_parent_file_filter" data-toggle="collapse" data-target=".mla_parent_file_filter .collapse">
|
239 |
<h2>Cleanup menus for Edit Tags/Categories page</h2>
|
240 |
+
<pre>mla_parent_file_filter(array $parent_file) : string</pre>
|
241 |
<div class="labels"></div>
|
242 |
<div class="row collapse"><div class="detail-description">
|
243 |
+
<p class="long_description"><p>For WordPress before 3.5, the submenu entries for custom taxonomies
|
244 |
+
under the "Media" menu are not set up correctly by WordPress, so this
|
245 |
+
function cleans them up, redirecting the request to the right WordPress
|
246 |
+
page for editing/adding taxonomy terms.
|
247 |
+
For WordPress 3.5 and later, the function fixes the submenu bolding when
|
248 |
+
going to the Edit Media screen.</p></p>
|
249 |
<table class="table table-bordered"><tr>
|
250 |
<th>since</th>
|
251 |
<td>0.1</td>
|
262 |
</div>
|
263 |
<a name="mla_render_admin_page" id="mla_render_admin_page"></a><div class="element clickable method public mla_render_admin_page" data-toggle="collapse" data-target=".mla_render_admin_page .collapse">
|
264 |
<h2>Render the "Assistant" subpage in the Media section, using the list_table package</h2>
|
265 |
+
<pre>mla_render_admin_page() : void</pre>
|
266 |
<div class="labels"></div>
|
267 |
<div class="row collapse"><div class="detail-description">
|
268 |
<p class="long_description"></p>
|
297 |
</div>
|
298 |
<a name="mla_set_screen_option_filter" id="mla_set_screen_option_filter"></a><div class="element clickable method public mla_set_screen_option_filter" data-toggle="collapse" data-target=".mla_set_screen_option_filter .collapse">
|
299 |
<h2>Save the "Entries per page" option set by this user</h2>
|
300 |
+
<pre>mla_set_screen_option_filter(boolean $status, string $option, string $value) : string | void</pre>
|
301 |
<div class="labels"></div>
|
302 |
<div class="row collapse"><div class="detail-description">
|
303 |
<p class="long_description"></p>
|
318 |
<code>string</code><p>New value of the option</p></div>
|
319 |
<h3>Returns</h3>
|
320 |
<div class="subelement response">
|
321 |
+
<code>string</code><code>void</code>New value if this is our option, otherwise nothing</div>
|
322 |
+
</div></div>
|
323 |
+
</div>
|
324 |
+
<a name="_authors_dropdown" id="_authors_dropdown"></a><div class="element clickable method private _authors_dropdown" data-toggle="collapse" data-target="._authors_dropdown .collapse">
|
325 |
+
<h2>Get the edit Authors dropdown box, if user has suitable permissions</h2>
|
326 |
+
<pre>_authors_dropdown(integer $author, string $name, string $class) : string | false</pre>
|
327 |
+
<div class="labels"></div>
|
328 |
+
<div class="row collapse"><div class="detail-description">
|
329 |
+
<p class="long_description"></p>
|
330 |
+
<table class="table table-bordered"><tr>
|
331 |
+
<th>since</th>
|
332 |
+
<td>0.20</td>
|
333 |
+
</tr></table>
|
334 |
+
<h3>Parameters</h3>
|
335 |
+
<div class="subelement argument">
|
336 |
+
<h4>$author</h4>
|
337 |
+
<code>integer</code><p>Optional User ID of the current author, default 0</p></div>
|
338 |
+
<div class="subelement argument">
|
339 |
+
<h4>$name</h4>
|
340 |
+
<code>string</code><p>Optional HTML name attribute, default 'post_author'</p>
|
341 |
+
</div>
|
342 |
+
<div class="subelement argument">
|
343 |
+
<h4>$class</h4>
|
344 |
+
<code>string</code><p>Optional HTML class attribute, default 'authors'</p>
|
345 |
+
</div>
|
346 |
+
<h3>Returns</h3>
|
347 |
+
<div class="subelement response">
|
348 |
+
<code>string</code><code>false</code>HTML markup for the dropdown field or False</div>
|
349 |
+
</div></div>
|
350 |
+
</div>
|
351 |
+
<a name="_build_inline_edit_form" id="_build_inline_edit_form"></a><div class="element clickable method private _build_inline_edit_form" data-toggle="collapse" data-target="._build_inline_edit_form .collapse">
|
352 |
+
<h2>Build the hidden row templates for inline editing (quick and bulk edit)</h2>
|
353 |
+
<pre>_build_inline_edit_form(object $MLAListTable) : string</pre>
|
354 |
+
<div class="labels"></div>
|
355 |
+
<div class="row collapse"><div class="detail-description">
|
356 |
+
<p class="long_description"><p>inspired by inline_edit() in wp-admin\includes\class-wp-posts-list-table.php.</p></p>
|
357 |
+
<table class="table table-bordered"><tr>
|
358 |
+
<th>since</th>
|
359 |
+
<td>0.20</td>
|
360 |
+
</tr></table>
|
361 |
+
<h3>Parameters</h3>
|
362 |
+
<div class="subelement argument">
|
363 |
+
<h4>$MLAListTable</h4>
|
364 |
+
<code>object</code><p>MLA List Table object</p></div>
|
365 |
+
<h3>Returns</h3>
|
366 |
+
<div class="subelement response">
|
367 |
+
<code>string</code>HTML <form> markup for hidden rows</div>
|
368 |
</div></div>
|
369 |
</div>
|
370 |
<a name="_current_bulk_action" id="_current_bulk_action"></a><div class="element clickable method private _current_bulk_action" data-toggle="collapse" data-target="._current_bulk_action .collapse">
|
371 |
+
<h2>Get the current action selected from the bulk actions dropdown</h2>
|
372 |
+
<pre>_current_bulk_action() : string | false</pre>
|
373 |
<div class="labels"></div>
|
374 |
<div class="row collapse"><div class="detail-description">
|
375 |
<p class="long_description"></p>
|
379 |
</tr></table>
|
380 |
<h3>Returns</h3>
|
381 |
<div class="subelement response">
|
382 |
+
<code>string</code><code>false</code>The action name or False if no action was selected</div>
|
383 |
</div></div>
|
384 |
</div>
|
385 |
<a name="_delete_single_item" id="_delete_single_item"></a><div class="element clickable method private _delete_single_item" data-toggle="collapse" data-target="._delete_single_item .collapse">
|
386 |
+
<h2>Delete a single item permanently</h2>
|
387 |
<pre>_delete_single_item(array $post_id) : array</pre>
|
388 |
<div class="labels"></div>
|
389 |
<div class="row collapse"><div class="detail-description">
|
395 |
<h3>Parameters</h3>
|
396 |
<div class="subelement argument">
|
397 |
<h4>$post_id</h4>
|
398 |
+
<code>array</code><p>The form POST data</p></div>
|
399 |
<h3>Returns</h3>
|
400 |
<div class="subelement response">
|
401 |
+
<code>array</code>success/failure message and NULL content</div>
|
402 |
</div></div>
|
403 |
</div>
|
404 |
<a name="_display_single_item" id="_display_single_item"></a><div class="element clickable method private _display_single_item" data-toggle="collapse" data-target="._display_single_item .collapse">
|
418 |
<code>int</code><p>The WordPress Post ID of the attachment item</p></div>
|
419 |
<h3>Returns</h3>
|
420 |
<div class="subelement response">
|
421 |
+
<code>array</code>message and/or HTML content</div>
|
422 |
</div></div>
|
423 |
</div>
|
424 |
<a name="_restore_single_item" id="_restore_single_item"></a><div class="element clickable method private _restore_single_item" data-toggle="collapse" data-target="._restore_single_item .collapse">
|
437 |
<code>array</code><p>The form POST data</p></div>
|
438 |
<h3>Returns</h3>
|
439 |
<div class="subelement response">
|
440 |
+
<code>array</code>success/failure message and NULL content</div>
|
441 |
</div></div>
|
442 |
</div>
|
443 |
<a name="_trash_single_item" id="_trash_single_item"></a><div class="element clickable method private _trash_single_item" data-toggle="collapse" data-target="._trash_single_item .collapse">
|
456 |
<code>array</code><p>The form POST data</p></div>
|
457 |
<h3>Returns</h3>
|
458 |
<div class="subelement response">
|
459 |
+
<code>array</code>success/failure message and NULL content</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
</div></div>
|
461 |
</div>
|
462 |
<h3>
|
499 |
</tr></table>
|
500 |
</div></div>
|
501 |
</div>
|
502 |
+
<a name="JAVASCRIPT_INLINE_EDIT_OBJECT" id="JAVASCRIPT_INLINE_EDIT_OBJECT"> </a><div class="element clickable constant JAVASCRIPT_INLINE_EDIT_OBJECT" data-toggle="collapse" data-target=".JAVASCRIPT_INLINE_EDIT_OBJECT .collapse">
|
503 |
+
<h2>Object name for localizing JavaScript - MLA List Table</h2>
|
504 |
+
<pre>JAVASCRIPT_INLINE_EDIT_OBJECT : string</pre>
|
505 |
<div class="labels"></div>
|
506 |
<div class="row collapse"><div class="detail-description">
|
507 |
<p class="long_description"></p>
|
508 |
<table class="table table-bordered"><tr>
|
509 |
<th>since</th>
|
510 |
+
<td>0.20</td>
|
511 |
+
</tr></table>
|
512 |
+
</div></div>
|
513 |
+
</div>
|
514 |
+
<a name="JAVASCRIPT_INLINE_EDIT_SLUG" id="JAVASCRIPT_INLINE_EDIT_SLUG"> </a><div class="element clickable constant JAVASCRIPT_INLINE_EDIT_SLUG" data-toggle="collapse" data-target=".JAVASCRIPT_INLINE_EDIT_SLUG .collapse">
|
515 |
+
<h2>Slug for localizing and enqueueing JavaScript - MLA List Table</h2>
|
516 |
+
<pre>JAVASCRIPT_INLINE_EDIT_SLUG : string</pre>
|
517 |
+
<div class="labels"></div>
|
518 |
+
<div class="row collapse"><div class="detail-description">
|
519 |
+
<p class="long_description"></p>
|
520 |
+
<table class="table table-bordered"><tr>
|
521 |
+
<th>since</th>
|
522 |
+
<td>0.20</td>
|
523 |
</tr></table>
|
524 |
</div></div>
|
525 |
</div>
|
526 |
+
<a name="JAVASCRIPT_SINGLE_EDIT_OBJECT" id="JAVASCRIPT_SINGLE_EDIT_OBJECT"> </a><div class="element clickable constant JAVASCRIPT_SINGLE_EDIT_OBJECT" data-toggle="collapse" data-target=".JAVASCRIPT_SINGLE_EDIT_OBJECT .collapse">
|
527 |
+
<h2>Object name for localizing JavaScript - edit single item page</h2>
|
528 |
+
<pre>JAVASCRIPT_SINGLE_EDIT_OBJECT : string</pre>
|
529 |
<div class="labels"></div>
|
530 |
<div class="row collapse"><div class="detail-description">
|
531 |
<p class="long_description"></p>
|
535 |
</tr></table>
|
536 |
</div></div>
|
537 |
</div>
|
538 |
+
<a name="JAVASCRIPT_SINGLE_EDIT_SLUG" id="JAVASCRIPT_SINGLE_EDIT_SLUG"> </a><div class="element clickable constant JAVASCRIPT_SINGLE_EDIT_SLUG" data-toggle="collapse" data-target=".JAVASCRIPT_SINGLE_EDIT_SLUG .collapse">
|
539 |
+
<h2>Slug for localizing and enqueueing JavaScript - edit single item page</h2>
|
540 |
+
<pre>JAVASCRIPT_SINGLE_EDIT_SLUG : string</pre>
|
541 |
<div class="labels"></div>
|
542 |
<div class="row collapse"><div class="detail-description">
|
543 |
<p class="long_description"></p>
|
559 |
</tr></table>
|
560 |
</div></div>
|
561 |
</div>
|
562 |
+
<a name="MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP" id="MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP"> </a><div class="element clickable constant MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP" data-toggle="collapse" data-target=".MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP .collapse">
|
563 |
+
<h2>mla_admin_action value for mapping Custom Field metadata</h2>
|
564 |
+
<pre>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP : string</pre>
|
565 |
+
<div class="labels"></div>
|
566 |
+
<div class="row collapse"><div class="detail-description">
|
567 |
+
<p class="long_description"></p>
|
568 |
+
<table class="table table-bordered"><tr>
|
569 |
+
<th>since</th>
|
570 |
+
<td>1.10</td>
|
571 |
+
</tr></table>
|
572 |
+
</div></div>
|
573 |
+
</div>
|
574 |
<a name="MLA_ADMIN_SINGLE_DELETE" id="MLA_ADMIN_SINGLE_DELETE"> </a><div class="element clickable constant MLA_ADMIN_SINGLE_DELETE" data-toggle="collapse" data-target=".MLA_ADMIN_SINGLE_DELETE .collapse">
|
575 |
<h2>mla_admin_action value for permanently deleting a single item</h2>
|
576 |
<pre>MLA_ADMIN_SINGLE_DELETE : string</pre>
|
607 |
</tr></table>
|
608 |
</div></div>
|
609 |
</div>
|
610 |
+
<a name="MLA_ADMIN_SINGLE_MAP" id="MLA_ADMIN_SINGLE_MAP"> </a><div class="element clickable constant MLA_ADMIN_SINGLE_MAP" data-toggle="collapse" data-target=".MLA_ADMIN_SINGLE_MAP .collapse">
|
611 |
+
<h2>mla_admin_action value for mapping IPTC/EXIF metadata</h2>
|
612 |
+
<pre>MLA_ADMIN_SINGLE_MAP : string</pre>
|
613 |
+
<div class="labels"></div>
|
614 |
+
<div class="row collapse"><div class="detail-description">
|
615 |
+
<p class="long_description"></p>
|
616 |
+
<table class="table table-bordered"><tr>
|
617 |
+
<th>since</th>
|
618 |
+
<td>1.00</td>
|
619 |
+
</tr></table>
|
620 |
+
</div></div>
|
621 |
+
</div>
|
622 |
<a name="MLA_ADMIN_SINGLE_RESTORE" id="MLA_ADMIN_SINGLE_RESTORE"> </a><div class="element clickable constant MLA_ADMIN_SINGLE_RESTORE" data-toggle="collapse" data-target=".MLA_ADMIN_SINGLE_RESTORE .collapse">
|
623 |
<h2>mla_admin_action value for restoring a single item from the trash</h2>
|
624 |
<pre>MLA_ADMIN_SINGLE_RESTORE : string</pre>
|
674 |
<div class="row"><footer class="span12">
|
675 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
676 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
677 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
678 |
</div>
|
679 |
</body>
|
680 |
</html>
|
phpDocs/classes/MLAData.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -56,16 +53,43 @@
|
|
56 |
<li class="nav-header">
|
57 |
<i class="icon-custom icon-method"></i> Methods</li>
|
58 |
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
59 |
-
<li class="method public "><a href="#
|
60 |
-
<li class="method public "><a href="#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<li class="method public "><a href="#mla_load_template" title="mla_load_template :: Load an HTML template from a file"><span class="description">Load an HTML template from a file</span><pre>mla_load_template()</pre></a></li>
|
62 |
-
<li class="method public "><a href="#mla_parse_template" title="mla_parse_template :: Expand a template, replacing place holders with their values
|
63 |
-
<li class="method public "><a href="#
|
64 |
-
<li class="method public "><a href="#
|
65 |
-
<li class="method public "><a href="#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
<li class="nav-header private">» Private</li>
|
67 |
-
<li class="
|
68 |
-
<li class="
|
|
|
|
|
|
|
|
|
|
|
69 |
</ul>
|
70 |
</div>
|
71 |
<div class="span8">
|
@@ -79,7 +103,7 @@
|
|
79 |
</li>
|
80 |
</ul>
|
81 |
<div href="../classes/MLAData.html" class="element class">
|
82 |
-
<p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
83 |
<div class="details">
|
84 |
<p class="long_description"><p>The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials."
|
85 |
Templates separate HTML markup from PHP code for easier maintenance and localization.</p></p>
|
@@ -107,8 +131,116 @@ Templates separate HTML markup from PHP code for easier maintenance and localiza
|
|
107 |
</tr></table>
|
108 |
</div></div>
|
109 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
<a name="mla_fetch_attachment_references" id="mla_fetch_attachment_references"></a><div class="element clickable method public mla_fetch_attachment_references" data-toggle="collapse" data-target=".mla_fetch_attachment_references .collapse">
|
111 |
-
<h2>Find Featured Image and inserted image/link references to an attachment
|
112 |
<pre>mla_fetch_attachment_references(int $ID, int $parent) : array</pre>
|
113 |
<div class="labels"></div>
|
114 |
<div class="row collapse"><div class="detail-description">
|
@@ -131,29 +263,72 @@ as a Featured Image or inserted in the post as an image or link.</p></p>
|
|
131 |
<code>array</code>Reference information; see $references array comments</div>
|
132 |
</div></div>
|
133 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
<a name="mla_get_attachment_by_id" id="mla_get_attachment_by_id"></a><div class="element clickable method public mla_get_attachment_by_id" data-toggle="collapse" data-target=".mla_get_attachment_by_id .collapse">
|
135 |
-
<h2>Retrieve an Attachment array given a $post_id
|
136 |
-
<pre>mla_get_attachment_by_id(int $post_id) :
|
137 |
<div class="labels"></div>
|
138 |
<div class="row collapse"><div class="detail-description">
|
139 |
<p class="long_description"><p>The (associative) array will contain every field that can be found in
|
140 |
the posts and postmeta tables, and all references to the attachment.</p></p>
|
141 |
-
<table class="table table-bordered"
|
|
|
142 |
<th>since</th>
|
143 |
<td>0.1</td>
|
144 |
-
</tr
|
|
|
|
|
|
|
|
|
|
|
145 |
<h3>Parameters</h3>
|
146 |
<div class="subelement argument">
|
147 |
<h4>$post_id</h4>
|
148 |
-
<code>int</code><p>The ID of the attachment post
|
149 |
<h3>Returns</h3>
|
150 |
<div class="subelement response">
|
151 |
-
<code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
</div></div>
|
153 |
</div>
|
154 |
<a name="mla_load_template" id="mla_load_template"></a><div class="element clickable method public mla_load_template" data-toggle="collapse" data-target=".mla_load_template .collapse">
|
155 |
<h2>Load an HTML template from a file</h2>
|
156 |
-
<pre>mla_load_template(string $
|
157 |
<div class="labels"></div>
|
158 |
<div class="row collapse"><div class="detail-description">
|
159 |
<p class="long_description"><p>Loads a template to a string or a multi-part template to an array.
|
@@ -165,15 +340,19 @@ where "key" becomes the key part of the array.</p></p>
|
|
165 |
</tr></table>
|
166 |
<h3>Parameters</h3>
|
167 |
<div class="subelement argument">
|
168 |
-
<h4>$
|
169 |
-
<code>string</code><p>Complete path and name of the template file</p></div>
|
|
|
|
|
|
|
|
|
170 |
<h3>Returns</h3>
|
171 |
<div class="subelement response">
|
172 |
-
<code>string</code>
|
173 |
</div></div>
|
174 |
</div>
|
175 |
<a name="mla_parse_template" id="mla_parse_template"></a><div class="element clickable method public mla_parse_template" data-toggle="collapse" data-target=".mla_parse_template .collapse">
|
176 |
-
<h2>Expand a template, replacing place holders with their values
|
177 |
<pre>mla_parse_template(string $tpl, array $hash) : string</pre>
|
178 |
<div class="labels"></div>
|
179 |
<div class="row collapse"><div class="detail-description">
|
@@ -189,21 +368,20 @@ where "key" becomes the key part of the array.</p></p>
|
|
189 |
</div>
|
190 |
<div class="subelement argument">
|
191 |
<h4>$hash</h4>
|
192 |
-
<code>array</code><p>An associative array containing keys and values e.g. array('key' => 'value')
|
193 |
</div>
|
194 |
<h3>Returns</h3>
|
195 |
<div class="subelement response">
|
196 |
-
<code>string</code>Placeholders corresponding to the keys of the hash will be replaced with their values
|
197 |
</div></div>
|
198 |
</div>
|
199 |
-
<a name="
|
200 |
-
<h2>
|
201 |
-
<pre>
|
202 |
<div class="labels"></div>
|
203 |
<div class="row collapse"><div class="detail-description">
|
204 |
-
<p class="long_description"><p>
|
205 |
-
Modeled after wp_edit_attachments_query in wp-admin/post.php
|
206 |
-
NOTE: The caller must remove the 'posts_where' filter, if required.</p></p>
|
207 |
<table class="table table-bordered"><tr>
|
208 |
<th>since</th>
|
209 |
<td>0.1</td>
|
@@ -213,72 +391,122 @@ NOTE: The caller must remove the 'posts_where' filter, if required.</p></p>
|
|
213 |
<h4>$request</h4>
|
214 |
<code>array</code><p>query parameters from web page, usually found in $_REQUEST</p>
|
215 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
<h3>Returns</h3>
|
217 |
<div class="subelement response">
|
218 |
-
<code>array</code>
|
219 |
</div></div>
|
220 |
</div>
|
221 |
-
<a name="
|
222 |
-
<h2>
|
223 |
-
<pre>
|
224 |
<div class="labels"></div>
|
225 |
<div class="row collapse"><div class="detail-description">
|
226 |
-
<p class="long_description"><p>
|
227 |
-
Modeled after wp_edit_attachments_query in wp-admin/post.php</p></p>
|
228 |
<table class="table table-bordered"><tr>
|
229 |
<th>since</th>
|
230 |
-
<td>0.
|
231 |
</tr></table>
|
232 |
<h3>Parameters</h3>
|
233 |
<div class="subelement argument">
|
234 |
-
<h4>$
|
235 |
-
<code>
|
|
|
|
|
|
|
|
|
236 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
<div class="subelement argument">
|
238 |
-
<h4>$
|
239 |
-
<code>string</code><p>
|
240 |
-
<
|
241 |
-
<
|
242 |
-
<code>string</code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
<div class="subelement argument">
|
244 |
-
<h4>$
|
245 |
-
<code>
|
246 |
<div class="subelement argument">
|
247 |
-
<h4>$
|
248 |
-
<code>
|
249 |
<h3>Returns</h3>
|
250 |
<div class="subelement response">
|
251 |
-
<code>
|
252 |
</div></div>
|
253 |
</div>
|
254 |
-
<a name="
|
255 |
<h2>Adds a WHERE clause for detached items</h2>
|
256 |
-
<pre>
|
257 |
<div class="labels"></div>
|
258 |
<div class="row collapse"><div class="detail-description">
|
259 |
-
<p class="long_description"><p>Modeled after _edit_attachments_query_helper in wp-admin/post.php
|
260 |
-
Defined as public
|
261 |
<table class="table table-bordered"><tr>
|
262 |
<th>since</th>
|
263 |
<td>0.1</td>
|
264 |
</tr></table>
|
265 |
<h3>Parameters</h3>
|
266 |
<div class="subelement argument">
|
267 |
-
<h4>$
|
268 |
<code>string</code><p>query clause before modification</p></div>
|
269 |
<h3>Returns</h3>
|
270 |
<div class="subelement response">
|
271 |
<code>string</code>query clause after "detached" item modification</div>
|
272 |
</div></div>
|
273 |
</div>
|
274 |
-
<a name="
|
275 |
-
<h2>
|
276 |
-
<pre>
|
277 |
<div class="labels"></div>
|
278 |
<div class="row collapse"><div class="detail-description">
|
279 |
-
<p class="long_description"
|
280 |
-
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
<table class="table table-bordered"><tr>
|
283 |
<th>since</th>
|
284 |
<td>0.1</td>
|
@@ -286,30 +514,252 @@ a string containing the first array element.</p></p>
|
|
286 |
<h3>Parameters</h3>
|
287 |
<div class="subelement argument">
|
288 |
<h4>$post_id</h4>
|
289 |
-
<code>int</code><p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
<h3>Returns</h3>
|
291 |
<div class="subelement response">
|
292 |
-
<code>array</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
</div></div>
|
294 |
</div>
|
295 |
-
<a name="
|
296 |
-
<h2>
|
297 |
-
<pre>
|
298 |
<div class="labels"></div>
|
299 |
<div class="row collapse"><div class="detail-description">
|
300 |
<p class="long_description"></p>
|
301 |
<table class="table table-bordered"><tr>
|
302 |
<th>since</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
<td>0.1</td>
|
304 |
</tr></table>
|
305 |
<h3>Parameters</h3>
|
306 |
<div class="subelement argument">
|
307 |
-
<h4>$
|
308 |
-
<code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
</div>
|
310 |
<h3>Returns</h3>
|
311 |
<div class="subelement response">
|
312 |
-
<code>array</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
</div></div>
|
314 |
</div>
|
315 |
</div>
|
@@ -319,7 +769,7 @@ a string containing the first array element.</p></p>
|
|
319 |
<div class="row"><footer class="span12">
|
320 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
321 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
322 |
-
generated on
|
323 |
</div>
|
324 |
</body>
|
325 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLAData</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
53 |
<li class="nav-header">
|
54 |
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
+
<li class="method public "><a href="#mla_count_list_table_items" title="mla_count_list_table_items :: Get the total number of attachment posts"><span class="description">Get the total number of attachment posts</span><pre>mla_count_list_table_items()</pre></a></li>
|
57 |
+
<li class="method public "><a href="#mla_exif_metadata_value" title="mla_exif_metadata_value :: Parse one EXIF metadata field"><span class="description">Parse one EXIF metadata field</span><pre>mla_exif_metadata_value()</pre></a></li>
|
58 |
+
<li class="method public "><a href="#mla_fetch_attachment_image_metadata" title="mla_fetch_attachment_image_metadata :: Fetch and filter IPTC and EXIF meta data for an image attachment"><span class="description">Fetch and filter IPTC and EXIF meta data for an image attachment</span><pre>mla_fetch_attachment_image_metadata()</pre></a></li>
|
59 |
+
<li class="method public "><a href="#mla_fetch_attachment_metadata" title="mla_fetch_attachment_metadata :: Fetch and filter meta data for an attachment"><span class="description">Fetch and filter meta data for an attachment</span><pre>mla_fetch_attachment_metadata()</pre></a></li>
|
60 |
+
<li class="method public "><a href="#mla_fetch_attachment_parent_data" title="mla_fetch_attachment_parent_data :: Returns information about an attachment's parent, if found"><span class="description">Returns information about an attachment's parent, if found</span><pre>mla_fetch_attachment_parent_data()</pre></a></li>
|
61 |
+
<li class="method public "><a href="#mla_fetch_attachment_references" title="mla_fetch_attachment_references :: Find Featured Image and inserted image/link references to an attachment"><span class="description">Find Featured Image and inserted image/link references to an attachment</span><pre>mla_fetch_attachment_references()</pre></a></li>
|
62 |
+
<li class="method public "><a href="#mla_flush_mla_galleries" title="mla_flush_mla_galleries :: Invalidates the $mla_galleries or $galleries array and cached values"><span class="description">Invalidates the $mla_galleries or $galleries array and cached values</span><pre>mla_flush_mla_galleries()</pre></a></li>
|
63 |
+
<li class="method public "><a href="#mla_get_attachment_by_id" title="mla_get_attachment_by_id :: Retrieve an Attachment array given a $post_id"><span class="description">Retrieve an Attachment array given a $post_id</span><pre>mla_get_attachment_by_id()</pre></a></li>
|
64 |
+
<li class="method public "><a href="#mla_get_template_placeholders" title="mla_get_template_placeholders :: Analyze a template, returning an array of the place holders it contains"><span class="description">Analyze a template, returning an array of the place holders it contains</span><pre>mla_get_template_placeholders()</pre></a></li>
|
65 |
<li class="method public "><a href="#mla_load_template" title="mla_load_template :: Load an HTML template from a file"><span class="description">Load an HTML template from a file</span><pre>mla_load_template()</pre></a></li>
|
66 |
+
<li class="method public "><a href="#mla_parse_template" title="mla_parse_template :: Expand a template, replacing place holders with their values"><span class="description">Expand a template, replacing place holders with their values</span><pre>mla_parse_template()</pre></a></li>
|
67 |
+
<li class="method public "><a href="#mla_query_list_table_items" title="mla_query_list_table_items :: Retrieve attachment objects for list table display"><span class="description">Retrieve attachment objects for list table display</span><pre>mla_query_list_table_items()</pre></a></li>
|
68 |
+
<li class="method public "><a href="#mla_query_posts_join_filter" title="mla_query_posts_join_filter :: Adds a JOIN clause, if required, to handle sorting/searching on ALT Text"><span class="description">Adds a JOIN clause, if required, to handle sorting/searching on ALT Text</span><pre>mla_query_posts_join_filter()</pre></a></li>
|
69 |
+
<li class="method public "><a href="#mla_query_posts_orderby_filter" title="mla_query_posts_orderby_filter :: Adds a ORDERBY clause, if required"><span class="description">Adds a ORDERBY clause, if required</span><pre>mla_query_posts_orderby_filter()</pre></a></li>
|
70 |
+
<li class="method public "><a href="#mla_query_posts_search_filter" title="mla_query_posts_search_filter :: Adds a keyword search to the WHERE clause, if required"><span class="description">Adds a keyword search to the WHERE clause, if required</span><pre>mla_query_posts_search_filter()</pre></a></li>
|
71 |
+
<li class="method public "><a href="#mla_query_posts_where_filter" title="mla_query_posts_where_filter :: Adds a WHERE clause for detached items"><span class="description">Adds a WHERE clause for detached items</span><pre>mla_query_posts_where_filter()</pre></a></li>
|
72 |
+
<li class="method public "><a href="#mla_save_post_action" title="mla_save_post_action :: Invalidates $mla_galleries and $galleries arrays and cached values after post, page or attachment updates"><span class="description">Invalidates $mla_galleries and $galleries arrays and cached values after post, page or attachment updates</span><pre>mla_save_post_action()</pre></a></li>
|
73 |
+
<li class="method public "><a href="#mla_update_single_item" title="mla_update_single_item :: Update a single item; change the meta data
|
74 |
+
for a single attachment."><span class="description">Update a single item; change the meta data
|
75 |
+
for a single attachment.</span><pre>mla_update_single_item()</pre></a></li>
|
76 |
+
<li class="nav-header private">» Private</li>
|
77 |
+
<li class="method private "><a href="#_build_mla_galleries" title="_build_mla_galleries :: Builds the $mla_galleries or $galleries array"><span class="description">Builds the $mla_galleries or $galleries array</span><pre>_build_mla_galleries()</pre></a></li>
|
78 |
+
<li class="method private "><a href="#_execute_list_table_query" title="_execute_list_table_query :: Add filters, run query, remove filters"><span class="description">Add filters, run query, remove filters</span><pre>_execute_list_table_query()</pre></a></li>
|
79 |
+
<li class="method private "><a href="#_hex_dump" title="_hex_dump :: Format printable version of binary data"><span class="description">Format printable version of binary data</span><pre>_hex_dump()</pre></a></li>
|
80 |
+
<li class="method private "><a href="#_prepare_list_table_query" title="_prepare_list_table_query :: Sanitize and expand query arguments from request variables"><span class="description">Sanitize and expand query arguments from request variables</span><pre>_prepare_list_table_query()</pre></a></li>
|
81 |
+
<li class="method private "><a href="#_remove_tags" title="_remove_tags :: Remove tags from a term ids list"><span class="description">Remove tags from a term ids list</span><pre>_remove_tags()</pre></a></li>
|
82 |
+
<li class="method private "><a href="#_search_mla_galleries" title="_search_mla_galleries :: Search the $mla_galleries or $galleries array"><span class="description">Search the $mla_galleries or $galleries array</span><pre>_search_mla_galleries()</pre></a></li>
|
83 |
+
<li class="nav-header">
|
84 |
+
<i class="icon-custom icon-property"></i> Properties</li>
|
85 |
<li class="nav-header private">» Private</li>
|
86 |
+
<li class="property private "><a href="#%24galleries" title="$galleries :: Objects containing [gallery] shortcodes"><span class="description">Objects containing [gallery] shortcodes</span><pre>$galleries</pre></a></li>
|
87 |
+
<li class="property private "><a href="#%24mla_alt_text_view" title="$mla_alt_text_view :: Provides a unique name for the ALT Text SQL VIEW"><span class="description">Provides a unique name for the ALT Text SQL VIEW</span><pre>$mla_alt_text_view</pre></a></li>
|
88 |
+
<li class="property private "><a href="#%24mla_galleries" title="$mla_galleries :: Objects containing [mla_gallery] shortcodes"><span class="description">Objects containing [mla_gallery] shortcodes</span><pre>$mla_galleries</pre></a></li>
|
89 |
+
<li class="property private "><a href="#%24query_parameters" title='$query_parameters :: WP_Query filter "parameters"'><span class="description">WP_Query filter "parameters"</span><pre>$query_parameters</pre></a></li>
|
90 |
+
<li class="nav-header">
|
91 |
+
<i class="icon-custom icon-constant"></i> Constants</li>
|
92 |
+
<li class="constant "><a href="#MLA_ALT_TEXT_VIEW_SUFFIX" title="MLA_ALT_TEXT_VIEW_SUFFIX :: Provides a unique suffix for the ALT Text SQL VIEW"><span class="description">Provides a unique suffix for the ALT Text SQL VIEW</span><pre>MLA_ALT_TEXT_VIEW_SUFFIX</pre></a></li>
|
93 |
</ul>
|
94 |
</div>
|
95 |
<div class="span8">
|
103 |
</li>
|
104 |
</ul>
|
105 |
<div href="../classes/MLAData.html" class="element class">
|
106 |
+
<p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs</p>
|
107 |
<div class="details">
|
108 |
<p class="long_description"><p>The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials."
|
109 |
Templates separate HTML markup from PHP code for easier maintenance and localization.</p></p>
|
131 |
</tr></table>
|
132 |
</div></div>
|
133 |
</div>
|
134 |
+
<a name="mla_count_list_table_items" id="mla_count_list_table_items"></a><div class="element clickable method public mla_count_list_table_items" data-toggle="collapse" data-target=".mla_count_list_table_items .collapse">
|
135 |
+
<h2>Get the total number of attachment posts</h2>
|
136 |
+
<pre>mla_count_list_table_items(array $request) : integer</pre>
|
137 |
+
<div class="labels"></div>
|
138 |
+
<div class="row collapse"><div class="detail-description">
|
139 |
+
<p class="long_description"></p>
|
140 |
+
<table class="table table-bordered"><tr>
|
141 |
+
<th>since</th>
|
142 |
+
<td>0.30</td>
|
143 |
+
</tr></table>
|
144 |
+
<h3>Parameters</h3>
|
145 |
+
<div class="subelement argument">
|
146 |
+
<h4>$request</h4>
|
147 |
+
<code>array</code><p>Query variables, e.g., from $_REQUEST</p>
|
148 |
+
</div>
|
149 |
+
<h3>Returns</h3>
|
150 |
+
<div class="subelement response">
|
151 |
+
<code>integer</code>Number of attachment posts</div>
|
152 |
+
</div></div>
|
153 |
+
</div>
|
154 |
+
<a name="mla_exif_metadata_value" id="mla_exif_metadata_value"></a><div class="element clickable method public mla_exif_metadata_value" data-toggle="collapse" data-target=".mla_exif_metadata_value .collapse">
|
155 |
+
<h2>Parse one EXIF metadata field</h2>
|
156 |
+
<pre>mla_exif_metadata_value(string $key, string $image_metadata) : string</pre>
|
157 |
+
<div class="labels"></div>
|
158 |
+
<div class="row collapse"><div class="detail-description">
|
159 |
+
<p class="long_description"><p>Returns a string value, converting array data to a string as necessary.
|
160 |
+
Also handles the special pseudo-values 'ALL_EXIF' and 'ALL_IPTC'.</p></p>
|
161 |
+
<table class="table table-bordered"><tr>
|
162 |
+
<th>since</th>
|
163 |
+
<td>1.13</td>
|
164 |
+
</tr></table>
|
165 |
+
<h3>Parameters</h3>
|
166 |
+
<div class="subelement argument">
|
167 |
+
<h4>$key</h4>
|
168 |
+
<code>string</code><p>field name</p></div>
|
169 |
+
<div class="subelement argument">
|
170 |
+
<h4>$image_metadata</h4>
|
171 |
+
<code>string</code><p>metadata array containing 'mla_exif_metadata' and 'mla_iptc_metadata' arrays</p>
|
172 |
+
</div>
|
173 |
+
<h3>Returns</h3>
|
174 |
+
<div class="subelement response">
|
175 |
+
<code>string</code>string representation of metadata value or an empty string</div>
|
176 |
+
</div></div>
|
177 |
+
</div>
|
178 |
+
<a name="mla_fetch_attachment_image_metadata" id="mla_fetch_attachment_image_metadata"></a><div class="element clickable method public mla_fetch_attachment_image_metadata" data-toggle="collapse" data-target=".mla_fetch_attachment_image_metadata .collapse">
|
179 |
+
<h2>Fetch and filter IPTC and EXIF meta data for an image attachment</h2>
|
180 |
+
<pre>mla_fetch_attachment_image_metadata(int $post_id, string $path) : array</pre>
|
181 |
+
<div class="labels"></div>
|
182 |
+
<div class="row collapse"><div class="detail-description">
|
183 |
+
<p class="long_description"><p>Returns</p></p>
|
184 |
+
<table class="table table-bordered"><tr>
|
185 |
+
<th>since</th>
|
186 |
+
<td>0.90</td>
|
187 |
+
</tr></table>
|
188 |
+
<h3>Parameters</h3>
|
189 |
+
<div class="subelement argument">
|
190 |
+
<h4>$post_id</h4>
|
191 |
+
<code>int</code><p>post ID of attachment</p></div>
|
192 |
+
<div class="subelement argument">
|
193 |
+
<h4>$path</h4>
|
194 |
+
<code>string</code><p>optional; if $post_id is zero, path to the image file.</p>
|
195 |
+
</div>
|
196 |
+
<h3>Returns</h3>
|
197 |
+
<div class="subelement response">
|
198 |
+
<code>array</code>Meta data variables</div>
|
199 |
+
</div></div>
|
200 |
+
</div>
|
201 |
+
<a name="mla_fetch_attachment_metadata" id="mla_fetch_attachment_metadata"></a><div class="element clickable method public mla_fetch_attachment_metadata" data-toggle="collapse" data-target=".mla_fetch_attachment_metadata .collapse">
|
202 |
+
<h2>Fetch and filter meta data for an attachment</h2>
|
203 |
+
<pre>mla_fetch_attachment_metadata(int $post_id) : array</pre>
|
204 |
+
<div class="labels"></div>
|
205 |
+
<div class="row collapse"><div class="detail-description">
|
206 |
+
<p class="long_description"><p>Returns a filtered array of a post's meta data. Internal values beginning with '<em>'
|
207 |
+
are stripped out or converted to an 'mla</em>' equivalent. Array data is replaced with
|
208 |
+
a string containing the first array element.</p></p>
|
209 |
+
<table class="table table-bordered"><tr>
|
210 |
+
<th>since</th>
|
211 |
+
<td>0.1</td>
|
212 |
+
</tr></table>
|
213 |
+
<h3>Parameters</h3>
|
214 |
+
<div class="subelement argument">
|
215 |
+
<h4>$post_id</h4>
|
216 |
+
<code>int</code><p>post ID of attachment</p></div>
|
217 |
+
<h3>Returns</h3>
|
218 |
+
<div class="subelement response">
|
219 |
+
<code>array</code>Meta data variables</div>
|
220 |
+
</div></div>
|
221 |
+
</div>
|
222 |
+
<a name="mla_fetch_attachment_parent_data" id="mla_fetch_attachment_parent_data"></a><div class="element clickable method public mla_fetch_attachment_parent_data" data-toggle="collapse" data-target=".mla_fetch_attachment_parent_data .collapse">
|
223 |
+
<h2>Returns information about an attachment's parent, if found</h2>
|
224 |
+
<pre>mla_fetch_attachment_parent_data(int $parent_id) : array</pre>
|
225 |
+
<div class="labels"></div>
|
226 |
+
<div class="row collapse"><div class="detail-description">
|
227 |
+
<p class="long_description"></p>
|
228 |
+
<table class="table table-bordered"><tr>
|
229 |
+
<th>since</th>
|
230 |
+
<td>0.1</td>
|
231 |
+
</tr></table>
|
232 |
+
<h3>Parameters</h3>
|
233 |
+
<div class="subelement argument">
|
234 |
+
<h4>$parent_id</h4>
|
235 |
+
<code>int</code><p>post ID of attachment's parent, if any</p>
|
236 |
+
</div>
|
237 |
+
<h3>Returns</h3>
|
238 |
+
<div class="subelement response">
|
239 |
+
<code>array</code>Parent information; post_date, post_title and post_type</div>
|
240 |
+
</div></div>
|
241 |
+
</div>
|
242 |
<a name="mla_fetch_attachment_references" id="mla_fetch_attachment_references"></a><div class="element clickable method public mla_fetch_attachment_references" data-toggle="collapse" data-target=".mla_fetch_attachment_references .collapse">
|
243 |
+
<h2>Find Featured Image and inserted image/link references to an attachment</h2>
|
244 |
<pre>mla_fetch_attachment_references(int $ID, int $parent) : array</pre>
|
245 |
<div class="labels"></div>
|
246 |
<div class="row collapse"><div class="detail-description">
|
263 |
<code>array</code>Reference information; see $references array comments</div>
|
264 |
</div></div>
|
265 |
</div>
|
266 |
+
<a name="mla_flush_mla_galleries" id="mla_flush_mla_galleries"></a><div class="element clickable method public mla_flush_mla_galleries" data-toggle="collapse" data-target=".mla_flush_mla_galleries .collapse">
|
267 |
+
<h2>Invalidates the $mla_galleries or $galleries array and cached values</h2>
|
268 |
+
<pre>mla_flush_mla_galleries(string $option_name) : void</pre>
|
269 |
+
<div class="labels"></div>
|
270 |
+
<div class="row collapse"><div class="detail-description">
|
271 |
+
<p class="long_description"></p>
|
272 |
+
<table class="table table-bordered"><tr>
|
273 |
+
<th>since</th>
|
274 |
+
<td>1.00</td>
|
275 |
+
</tr></table>
|
276 |
+
<h3>Parameters</h3>
|
277 |
+
<div class="subelement argument">
|
278 |
+
<h4>$option_name</h4>
|
279 |
+
<code>string</code><p>name of the gallery's cache/option variable</p>
|
280 |
+
</div>
|
281 |
+
</div></div>
|
282 |
+
</div>
|
283 |
<a name="mla_get_attachment_by_id" id="mla_get_attachment_by_id"></a><div class="element clickable method public mla_get_attachment_by_id" data-toggle="collapse" data-target=".mla_get_attachment_by_id .collapse">
|
284 |
+
<h2>Retrieve an Attachment array given a $post_id</h2>
|
285 |
+
<pre>mla_get_attachment_by_id(int $post_id) : NULL | array</pre>
|
286 |
<div class="labels"></div>
|
287 |
<div class="row collapse"><div class="detail-description">
|
288 |
<p class="long_description"><p>The (associative) array will contain every field that can be found in
|
289 |
the posts and postmeta tables, and all references to the attachment.</p></p>
|
290 |
+
<table class="table table-bordered">
|
291 |
+
<tr>
|
292 |
<th>since</th>
|
293 |
<td>0.1</td>
|
294 |
+
</tr>
|
295 |
+
<tr>
|
296 |
+
<th>uses</th>
|
297 |
+
<td>\global\$post</td>
|
298 |
+
</tr>
|
299 |
+
</table>
|
300 |
<h3>Parameters</h3>
|
301 |
<div class="subelement argument">
|
302 |
<h4>$post_id</h4>
|
303 |
+
<code>int</code><p>The ID of the attachment post</p></div>
|
304 |
<h3>Returns</h3>
|
305 |
<div class="subelement response">
|
306 |
+
<code>NULL</code><code>array</code>NULL on failure else associative array</div>
|
307 |
+
</div></div>
|
308 |
+
</div>
|
309 |
+
<a name="mla_get_template_placeholders" id="mla_get_template_placeholders"></a><div class="element clickable method public mla_get_template_placeholders" data-toggle="collapse" data-target=".mla_get_template_placeholders .collapse">
|
310 |
+
<h2>Analyze a template, returning an array of the place holders it contains</h2>
|
311 |
+
<pre>mla_get_template_placeholders(string $tpl) : array</pre>
|
312 |
+
<div class="labels"></div>
|
313 |
+
<div class="row collapse"><div class="detail-description">
|
314 |
+
<p class="long_description"></p>
|
315 |
+
<table class="table table-bordered"><tr>
|
316 |
+
<th>since</th>
|
317 |
+
<td>0.90</td>
|
318 |
+
</tr></table>
|
319 |
+
<h3>Parameters</h3>
|
320 |
+
<div class="subelement argument">
|
321 |
+
<h4>$tpl</h4>
|
322 |
+
<code>string</code><p>A formatting string containing [+placeholders+]</p>
|
323 |
+
</div>
|
324 |
+
<h3>Returns</h3>
|
325 |
+
<div class="subelement response">
|
326 |
+
<code>array</code>Placeholder information: each entry is an array with ['prefix'] => string, ['value'] => string, ['single'] => boolean</div>
|
327 |
</div></div>
|
328 |
</div>
|
329 |
<a name="mla_load_template" id="mla_load_template"></a><div class="element clickable method public mla_load_template" data-toggle="collapse" data-target=".mla_load_template .collapse">
|
330 |
<h2>Load an HTML template from a file</h2>
|
331 |
+
<pre>mla_load_template(string $source, string $type) : string | array | false | NULL</pre>
|
332 |
<div class="labels"></div>
|
333 |
<div class="row collapse"><div class="detail-description">
|
334 |
<p class="long_description"><p>Loads a template to a string or a multi-part template to an array.
|
340 |
</tr></table>
|
341 |
<h3>Parameters</h3>
|
342 |
<div class="subelement argument">
|
343 |
+
<h4>$source</h4>
|
344 |
+
<code>string</code><p>Complete path and name of the template file, option name or the raw template</p></div>
|
345 |
+
<div class="subelement argument">
|
346 |
+
<h4>$type</h4>
|
347 |
+
<code>string</code><p>Optional type of template source; 'file' (default), 'option', 'string'</p>
|
348 |
+
</div>
|
349 |
<h3>Returns</h3>
|
350 |
<div class="subelement response">
|
351 |
+
<code>string</code><code>array</code><code>false</code><code>NULL</code>string for files that do not contain template divider comments, array for files containing template divider comments, false if file or option does not exist, NULL if file could not be loaded.</div>
|
352 |
</div></div>
|
353 |
</div>
|
354 |
<a name="mla_parse_template" id="mla_parse_template"></a><div class="element clickable method public mla_parse_template" data-toggle="collapse" data-target=".mla_parse_template .collapse">
|
355 |
+
<h2>Expand a template, replacing place holders with their values</h2>
|
356 |
<pre>mla_parse_template(string $tpl, array $hash) : string</pre>
|
357 |
<div class="labels"></div>
|
358 |
<div class="row collapse"><div class="detail-description">
|
368 |
</div>
|
369 |
<div class="subelement argument">
|
370 |
<h4>$hash</h4>
|
371 |
+
<code>array</code><p>An associative array containing keys and values e.g. array('key' => 'value')</p>
|
372 |
</div>
|
373 |
<h3>Returns</h3>
|
374 |
<div class="subelement response">
|
375 |
+
<code>string</code>Placeholders corresponding to the keys of the hash will be replaced with their values</div>
|
376 |
</div></div>
|
377 |
</div>
|
378 |
+
<a name="mla_query_list_table_items" id="mla_query_list_table_items"></a><div class="element clickable method public mla_query_list_table_items" data-toggle="collapse" data-target=".mla_query_list_table_items .collapse">
|
379 |
+
<h2>Retrieve attachment objects for list table display</h2>
|
380 |
+
<pre>mla_query_list_table_items(array $request, int $offset, int $count) : array</pre>
|
381 |
<div class="labels"></div>
|
382 |
<div class="row collapse"><div class="detail-description">
|
383 |
+
<p class="long_description"><p>Supports prepare_items in class-mla-list-table.php.
|
384 |
+
Modeled after wp_edit_attachments_query in wp-admin/post.php</p></p>
|
|
|
385 |
<table class="table table-bordered"><tr>
|
386 |
<th>since</th>
|
387 |
<td>0.1</td>
|
391 |
<h4>$request</h4>
|
392 |
<code>array</code><p>query parameters from web page, usually found in $_REQUEST</p>
|
393 |
</div>
|
394 |
+
<div class="subelement argument">
|
395 |
+
<h4>$offset</h4>
|
396 |
+
<code>int</code><p>number of rows to skip over to reach desired page</p></div>
|
397 |
+
<div class="subelement argument">
|
398 |
+
<h4>$count</h4>
|
399 |
+
<code>int</code><p>number of rows on each page</p></div>
|
400 |
<h3>Returns</h3>
|
401 |
<div class="subelement response">
|
402 |
+
<code>array</code>attachment objects (posts) including parent data, meta data and references</div>
|
403 |
</div></div>
|
404 |
</div>
|
405 |
+
<a name="mla_query_posts_join_filter" id="mla_query_posts_join_filter"></a><div class="element clickable method public mla_query_posts_join_filter" data-toggle="collapse" data-target=".mla_query_posts_join_filter .collapse">
|
406 |
+
<h2>Adds a JOIN clause, if required, to handle sorting/searching on ALT Text</h2>
|
407 |
+
<pre>mla_query_posts_join_filter(string $join_clause) : string</pre>
|
408 |
<div class="labels"></div>
|
409 |
<div class="row collapse"><div class="detail-description">
|
410 |
+
<p class="long_description"><p>Defined as public because it's a filter.</p></p>
|
|
|
411 |
<table class="table table-bordered"><tr>
|
412 |
<th>since</th>
|
413 |
+
<td>0.30</td>
|
414 |
</tr></table>
|
415 |
<h3>Parameters</h3>
|
416 |
<div class="subelement argument">
|
417 |
+
<h4>$join_clause</h4>
|
418 |
+
<code>string</code><p>query clause before modification</p></div>
|
419 |
+
<h3>Returns</h3>
|
420 |
+
<div class="subelement response">
|
421 |
+
<code>string</code>query clause after "LEFT JOIN view ON post_id" item modification</div>
|
422 |
+
</div></div>
|
423 |
</div>
|
424 |
+
<a name="mla_query_posts_orderby_filter" id="mla_query_posts_orderby_filter"></a><div class="element clickable method public mla_query_posts_orderby_filter" data-toggle="collapse" data-target=".mla_query_posts_orderby_filter .collapse">
|
425 |
+
<h2>Adds a ORDERBY clause, if required</h2>
|
426 |
+
<pre>mla_query_posts_orderby_filter(string $orderby_clause) : string</pre>
|
427 |
+
<div class="labels"></div>
|
428 |
+
<div class="row collapse"><div class="detail-description">
|
429 |
+
<p class="long_description"><p>Expands the range of sort options because the logic in WP_Query is limited.
|
430 |
+
Defined as public because it's a filter.</p></p>
|
431 |
+
<table class="table table-bordered"><tr>
|
432 |
+
<th>since</th>
|
433 |
+
<td>0.30</td>
|
434 |
+
</tr></table>
|
435 |
+
<h3>Parameters</h3>
|
436 |
<div class="subelement argument">
|
437 |
+
<h4>$orderby_clause</h4>
|
438 |
+
<code>string</code><p>query clause before modification</p></div>
|
439 |
+
<h3>Returns</h3>
|
440 |
+
<div class="subelement response">
|
441 |
+
<code>string</code>updated query clause</div>
|
442 |
+
</div></div>
|
443 |
+
</div>
|
444 |
+
<a name="mla_query_posts_search_filter" id="mla_query_posts_search_filter"></a><div class="element clickable method public mla_query_posts_search_filter" data-toggle="collapse" data-target=".mla_query_posts_search_filter .collapse">
|
445 |
+
<h2>Adds a keyword search to the WHERE clause, if required</h2>
|
446 |
+
<pre>mla_query_posts_search_filter(string $search_string, object $query_object) : string</pre>
|
447 |
+
<div class="labels"></div>
|
448 |
+
<div class="row collapse"><div class="detail-description">
|
449 |
+
<p class="long_description"><p>Defined as public because it's a filter.</p></p>
|
450 |
+
<table class="table table-bordered"><tr>
|
451 |
+
<th>since</th>
|
452 |
+
<td>0.60</td>
|
453 |
+
</tr></table>
|
454 |
+
<h3>Parameters</h3>
|
455 |
<div class="subelement argument">
|
456 |
+
<h4>$search_string</h4>
|
457 |
+
<code>string</code><p>query clause before modification</p></div>
|
458 |
<div class="subelement argument">
|
459 |
+
<h4>$query_object</h4>
|
460 |
+
<code>object</code><p>WP_Query object</p></div>
|
461 |
<h3>Returns</h3>
|
462 |
<div class="subelement response">
|
463 |
+
<code>string</code>query clause after keyword search addition</div>
|
464 |
</div></div>
|
465 |
</div>
|
466 |
+
<a name="mla_query_posts_where_filter" id="mla_query_posts_where_filter"></a><div class="element clickable method public mla_query_posts_where_filter" data-toggle="collapse" data-target=".mla_query_posts_where_filter .collapse">
|
467 |
<h2>Adds a WHERE clause for detached items</h2>
|
468 |
+
<pre>mla_query_posts_where_filter(string $where_clause) : string</pre>
|
469 |
<div class="labels"></div>
|
470 |
<div class="row collapse"><div class="detail-description">
|
471 |
+
<p class="long_description"><p>Modeled after _edit_attachments_query_helper in wp-admin/post.php.
|
472 |
+
Defined as public because it's a filter.</p></p>
|
473 |
<table class="table table-bordered"><tr>
|
474 |
<th>since</th>
|
475 |
<td>0.1</td>
|
476 |
</tr></table>
|
477 |
<h3>Parameters</h3>
|
478 |
<div class="subelement argument">
|
479 |
+
<h4>$where_clause</h4>
|
480 |
<code>string</code><p>query clause before modification</p></div>
|
481 |
<h3>Returns</h3>
|
482 |
<div class="subelement response">
|
483 |
<code>string</code>query clause after "detached" item modification</div>
|
484 |
</div></div>
|
485 |
</div>
|
486 |
+
<a name="mla_save_post_action" id="mla_save_post_action"></a><div class="element clickable method public mla_save_post_action" data-toggle="collapse" data-target=".mla_save_post_action .collapse">
|
487 |
+
<h2>Invalidates $mla_galleries and $galleries arrays and cached values after post, page or attachment updates</h2>
|
488 |
+
<pre>mla_save_post_action(integer $post_id) : void</pre>
|
489 |
<div class="labels"></div>
|
490 |
<div class="row collapse"><div class="detail-description">
|
491 |
+
<p class="long_description"></p>
|
492 |
+
<table class="table table-bordered"><tr>
|
493 |
+
<th>since</th>
|
494 |
+
<td>1.00</td>
|
495 |
+
</tr></table>
|
496 |
+
<h3>Parameters</h3>
|
497 |
+
<div class="subelement argument">
|
498 |
+
<h4>$post_id</h4>
|
499 |
+
<code>integer</code><p>ID of post/page/attachment; not used at this time</p>
|
500 |
+
</div>
|
501 |
+
</div></div>
|
502 |
+
</div>
|
503 |
+
<a name="mla_update_single_item" id="mla_update_single_item"></a><div class="element clickable method public mla_update_single_item" data-toggle="collapse" data-target=".mla_update_single_item .collapse">
|
504 |
+
<h2>Update a single item; change the meta data
|
505 |
+
for a single attachment.</h2>
|
506 |
+
<pre>mla_update_single_item(int $post_id, array $new_data, array $tax_input, array $tax_actions) : array</pre>
|
507 |
+
<div class="labels"></div>
|
508 |
+
<div class="row collapse"><div class="detail-description">
|
509 |
+
<p class="long_description"></p>
|
510 |
<table class="table table-bordered"><tr>
|
511 |
<th>since</th>
|
512 |
<td>0.1</td>
|
514 |
<h3>Parameters</h3>
|
515 |
<div class="subelement argument">
|
516 |
<h4>$post_id</h4>
|
517 |
+
<code>int</code><p>The ID of the attachment to be updated</p></div>
|
518 |
+
<div class="subelement argument">
|
519 |
+
<h4>$new_data</h4>
|
520 |
+
<code>array</code><p>Field name => value pairs</p>
|
521 |
+
</div>
|
522 |
+
<div class="subelement argument">
|
523 |
+
<h4>$tax_input</h4>
|
524 |
+
<code>array</code><p>Optional taxonomy term values, default null</p></div>
|
525 |
+
<div class="subelement argument">
|
526 |
+
<h4>$tax_actions</h4>
|
527 |
+
<code>array</code><p>Optional taxonomy actions (add, remove, replace), default null</p>
|
528 |
+
</div>
|
529 |
<h3>Returns</h3>
|
530 |
<div class="subelement response">
|
531 |
+
<code>array</code>success/failure message and NULL content</div>
|
532 |
+
</div></div>
|
533 |
+
</div>
|
534 |
+
<a name="_build_mla_galleries" id="_build_mla_galleries"></a><div class="element clickable method private _build_mla_galleries" data-toggle="collapse" data-target="._build_mla_galleries .collapse">
|
535 |
+
<h2>Builds the $mla_galleries or $galleries array</h2>
|
536 |
+
<pre>_build_mla_galleries(string $option_name, array $galleries_array, string $shortcode, boolean $exclude_revisions) : boolean</pre>
|
537 |
+
<div class="labels"></div>
|
538 |
+
<div class="row collapse"><div class="detail-description">
|
539 |
+
<p class="long_description"></p>
|
540 |
+
<table class="table table-bordered"><tr>
|
541 |
+
<th>since</th>
|
542 |
+
<td>0.70</td>
|
543 |
+
</tr></table>
|
544 |
+
<h3>Parameters</h3>
|
545 |
+
<div class="subelement argument">
|
546 |
+
<h4>$option_name</h4>
|
547 |
+
<code>string</code><p>name of the gallery's cache/option variable</p>
|
548 |
+
</div>
|
549 |
+
<div class="subelement argument">
|
550 |
+
<h4>$galleries_array</h4>
|
551 |
+
<code>array</code><p>by reference to the private static galleries array variable</p></div>
|
552 |
+
<div class="subelement argument">
|
553 |
+
<h4>$shortcode</h4>
|
554 |
+
<code>string</code><p>the shortcode to be searched for and processed</p></div>
|
555 |
+
<div class="subelement argument">
|
556 |
+
<h4>$exclude_revisions</h4>
|
557 |
+
<code>boolean</code><p>true to exclude revisions from the search</p></div>
|
558 |
+
<h3>Returns</h3>
|
559 |
+
<div class="subelement response">
|
560 |
+
<code>boolean</code>true if the galleries array is not empty</div>
|
561 |
</div></div>
|
562 |
</div>
|
563 |
+
<a name="_execute_list_table_query" id="_execute_list_table_query"></a><div class="element clickable method private _execute_list_table_query" data-toggle="collapse" data-target="._execute_list_table_query .collapse">
|
564 |
+
<h2>Add filters, run query, remove filters</h2>
|
565 |
+
<pre>_execute_list_table_query(array $request) : object</pre>
|
566 |
<div class="labels"></div>
|
567 |
<div class="row collapse"><div class="detail-description">
|
568 |
<p class="long_description"></p>
|
569 |
<table class="table table-bordered"><tr>
|
570 |
<th>since</th>
|
571 |
+
<td>0.30</td>
|
572 |
+
</tr></table>
|
573 |
+
<h3>Parameters</h3>
|
574 |
+
<div class="subelement argument">
|
575 |
+
<h4>$request</h4>
|
576 |
+
<code>array</code><p>query parameters from web page, usually found in $_REQUEST</p>
|
577 |
+
</div>
|
578 |
+
<h3>Returns</h3>
|
579 |
+
<div class="subelement response">
|
580 |
+
<code>object</code>WP_Query object with query results</div>
|
581 |
+
</div></div>
|
582 |
+
</div>
|
583 |
+
<a name="_hex_dump" id="_hex_dump"></a><div class="element clickable method private _hex_dump" data-toggle="collapse" data-target="._hex_dump .collapse">
|
584 |
+
<h2>Format printable version of binary data</h2>
|
585 |
+
<pre>_hex_dump(string $data, integer $limit, \intger $bytes_per_row) : string</pre>
|
586 |
+
<div class="labels"></div>
|
587 |
+
<div class="row collapse"><div class="detail-description">
|
588 |
+
<p class="long_description"></p>
|
589 |
+
<table class="table table-bordered"><tr>
|
590 |
+
<th>since</th>
|
591 |
+
<td>0.90</td>
|
592 |
+
</tr></table>
|
593 |
+
<h3>Parameters</h3>
|
594 |
+
<div class="subelement argument">
|
595 |
+
<h4>$data</h4>
|
596 |
+
<code>string</code><p>Binary data</p></div>
|
597 |
+
<div class="subelement argument">
|
598 |
+
<h4>$limit</h4>
|
599 |
+
<code>integer</code><p>Bytes to format, default = 0 (all bytes)</p>
|
600 |
+
</div>
|
601 |
+
<div class="subelement argument">
|
602 |
+
<h4>$bytes_per_row</h4>
|
603 |
+
<code>\intger</code><p>Bytes to format on each line</p></div>
|
604 |
+
<h3>Returns</h3>
|
605 |
+
<div class="subelement response">
|
606 |
+
<code>string</code>Printable representation of $data</div>
|
607 |
+
</div></div>
|
608 |
+
</div>
|
609 |
+
<a name="_prepare_list_table_query" id="_prepare_list_table_query"></a><div class="element clickable method private _prepare_list_table_query" data-toggle="collapse" data-target="._prepare_list_table_query .collapse">
|
610 |
+
<h2>Sanitize and expand query arguments from request variables</h2>
|
611 |
+
<pre>_prepare_list_table_query(array $raw_request, int $offset, int $count) : array</pre>
|
612 |
+
<div class="labels"></div>
|
613 |
+
<div class="row collapse"><div class="detail-description">
|
614 |
+
<p class="long_description"><p>Prepare the arguments for WP_Query.
|
615 |
+
Modeled after wp_edit_attachments_query in wp-admin/post.php</p></p>
|
616 |
+
<table class="table table-bordered"><tr>
|
617 |
+
<th>since</th>
|
618 |
<td>0.1</td>
|
619 |
</tr></table>
|
620 |
<h3>Parameters</h3>
|
621 |
<div class="subelement argument">
|
622 |
+
<h4>$raw_request</h4>
|
623 |
+
<code>array</code><p>query parameters from web page, usually found in $_REQUEST</p>
|
624 |
+
</div>
|
625 |
+
<div class="subelement argument">
|
626 |
+
<h4>$offset</h4>
|
627 |
+
<code>int</code><p>Optional number of rows (default 0) to skip over to reach desired page</p>
|
628 |
+
</div>
|
629 |
+
<div class="subelement argument">
|
630 |
+
<h4>$count</h4>
|
631 |
+
<code>int</code><p>Optional number of rows on each page (0 = all rows, default)</p>
|
632 |
</div>
|
633 |
<h3>Returns</h3>
|
634 |
<div class="subelement response">
|
635 |
+
<code>array</code>revised arguments suitable for WP_Query</div>
|
636 |
+
</div></div>
|
637 |
+
</div>
|
638 |
+
<a name="_remove_tags" id="_remove_tags"></a><div class="element clickable method private _remove_tags" data-toggle="collapse" data-target="._remove_tags .collapse">
|
639 |
+
<h2>Remove tags from a term ids list</h2>
|
640 |
+
<pre>_remove_tags(array $terms_before, array $tags, object $taxonomy_obj) : array</pre>
|
641 |
+
<div class="labels"></div>
|
642 |
+
<div class="row collapse"><div class="detail-description">
|
643 |
+
<p class="long_description"></p>
|
644 |
+
<table class="table table-bordered"><tr>
|
645 |
+
<th>since</th>
|
646 |
+
<td>0.40</td>
|
647 |
+
</tr></table>
|
648 |
+
<h3>Parameters</h3>
|
649 |
+
<div class="subelement argument">
|
650 |
+
<h4>$terms_before</h4>
|
651 |
+
<code>array</code><p>The term ids currently assigned</p></div>
|
652 |
+
<div class="subelement argument">
|
653 |
+
<h4>$tags</h4>
|
654 |
+
<code>array</code><p>| string The term ids (array) or names (string) to remove</p>
|
655 |
+
</div>
|
656 |
+
<div class="subelement argument">
|
657 |
+
<h4>$taxonomy_obj</h4>
|
658 |
+
<code>object</code><p>The taxonomy object</p></div>
|
659 |
+
<h3>Returns</h3>
|
660 |
+
<div class="subelement response">
|
661 |
+
<code>array</code>Term ids of the surviving tags</div>
|
662 |
+
</div></div>
|
663 |
+
</div>
|
664 |
+
<a name="_search_mla_galleries" id="_search_mla_galleries"></a><div class="element clickable method private _search_mla_galleries" data-toggle="collapse" data-target="._search_mla_galleries .collapse">
|
665 |
+
<h2>Search the $mla_galleries or $galleries array</h2>
|
666 |
+
<pre>_search_mla_galleries(array $galleries_array, int $attachment_id) : array</pre>
|
667 |
+
<div class="labels"></div>
|
668 |
+
<div class="row collapse"><div class="detail-description">
|
669 |
+
<p class="long_description"></p>
|
670 |
+
<table class="table table-bordered"><tr>
|
671 |
+
<th>since</th>
|
672 |
+
<td>0.70</td>
|
673 |
+
</tr></table>
|
674 |
+
<h3>Parameters</h3>
|
675 |
+
<div class="subelement argument">
|
676 |
+
<h4>$galleries_array</h4>
|
677 |
+
<code>array</code><p>by reference to the private static galleries array variable</p></div>
|
678 |
+
<div class="subelement argument">
|
679 |
+
<h4>$attachment_id</h4>
|
680 |
+
<code>int</code><p>the attachment ID to be searched for and processed</p></div>
|
681 |
+
<h3>Returns</h3>
|
682 |
+
<div class="subelement response">
|
683 |
+
<code>array</code>All posts/pages with one or more galleries that include the attachment. The array key is the parent_post ID; each entry contains post_title and post_type.</div>
|
684 |
+
</div></div>
|
685 |
+
</div>
|
686 |
+
<h3>
|
687 |
+
<i class="icon-custom icon-property"></i> Properties</h3>
|
688 |
+
<a name="%24galleries" id="$galleries"> </a><div class="element clickable property private $galleries" data-toggle="collapse" data-target=".$galleries .collapse">
|
689 |
+
<h2>Objects containing [gallery] shortcodes</h2>
|
690 |
+
<pre>$galleries : array</pre>
|
691 |
+
<div class="labels"></div>
|
692 |
+
<div class="row collapse"><div class="detail-description">
|
693 |
+
<p class="long_description"><p>This array contains all of the objects containing one or more [gallery] shortcodes
|
694 |
+
and array(s) of which attachments each [gallery] contains. The arrays are built once
|
695 |
+
each page load and cached for subsequent calls.</p>
|
696 |
+
|
697 |
+
<p>The outer array is keyed by post_id. It contains an array of [gallery] entries numbered from one (1).
|
698 |
+
Each inner array has these elements:
|
699 |
+
['parent_title'] post_title of the gallery parent,
|
700 |
+
['parent_type'] 'post' or 'page' or the custom post_type of the gallery parent,
|
701 |
+
['query'] contains a string with the arguments of the [gallery],
|
702 |
+
['results'] contains an array of post_ids for the objects in the gallery.</p></p>
|
703 |
+
<table class="table table-bordered"><tr>
|
704 |
+
<th>since</th>
|
705 |
+
<td>0.70</td>
|
706 |
+
</tr></table>
|
707 |
+
</div></div>
|
708 |
+
</div>
|
709 |
+
<a name="%24mla_alt_text_view" id="$mla_alt_text_view"> </a><div class="element clickable property private $mla_alt_text_view" data-toggle="collapse" data-target=".$mla_alt_text_view .collapse">
|
710 |
+
<h2>Provides a unique name for the ALT Text SQL VIEW</h2>
|
711 |
+
<pre>$mla_alt_text_view : array</pre>
|
712 |
+
<div class="labels"></div>
|
713 |
+
<div class="row collapse"><div class="detail-description">
|
714 |
+
<p class="long_description"></p>
|
715 |
+
<table class="table table-bordered"><tr>
|
716 |
+
<th>since</th>
|
717 |
+
<td>0.40</td>
|
718 |
+
</tr></table>
|
719 |
+
</div></div>
|
720 |
+
</div>
|
721 |
+
<a name="%24mla_galleries" id="$mla_galleries"> </a><div class="element clickable property private $mla_galleries" data-toggle="collapse" data-target=".$mla_galleries .collapse">
|
722 |
+
<h2>Objects containing [mla_gallery] shortcodes</h2>
|
723 |
+
<pre>$mla_galleries : array</pre>
|
724 |
+
<div class="labels"></div>
|
725 |
+
<div class="row collapse"><div class="detail-description">
|
726 |
+
<p class="long_description"><p>This array contains all of the objects containing one or more [mla_gallery] shortcodes
|
727 |
+
and array(s) of which attachments each [mla_gallery] contains. The arrays are built once
|
728 |
+
each page load and cached for subsequent calls.</p></p>
|
729 |
+
<table class="table table-bordered"><tr>
|
730 |
+
<th>since</th>
|
731 |
+
<td>0.70</td>
|
732 |
+
</tr></table>
|
733 |
+
</div></div>
|
734 |
+
</div>
|
735 |
+
<a name="%24query_parameters" id="$query_parameters"> </a><div class="element clickable property private $query_parameters" data-toggle="collapse" data-target=".$query_parameters .collapse">
|
736 |
+
<h2>WP_Query filter "parameters"</h2>
|
737 |
+
<pre>$query_parameters : array</pre>
|
738 |
+
<div class="labels"></div>
|
739 |
+
<div class="row collapse"><div class="detail-description">
|
740 |
+
<p class="long_description"><p>This array defines parameters for the query's join, where and orderby filters.
|
741 |
+
The parameters are set up in the _prepare_list_table_query function, and
|
742 |
+
any further logic required to translate those values is contained in the filters.</p>
|
743 |
+
|
744 |
+
<p>Array index values are: use_postmeta_view, postmeta_key, detached, orderby, order, s, mla-search-connector, mla-search-fields, sentence, exact</p></p>
|
745 |
+
<table class="table table-bordered"><tr>
|
746 |
+
<th>since</th>
|
747 |
+
<td>0.30</td>
|
748 |
+
</tr></table>
|
749 |
+
</div></div>
|
750 |
+
</div>
|
751 |
+
<h3>
|
752 |
+
<i class="icon-custom icon-constant"></i> Constants</h3>
|
753 |
+
<a name="MLA_ALT_TEXT_VIEW_SUFFIX" id="MLA_ALT_TEXT_VIEW_SUFFIX"> </a><div class="element clickable constant MLA_ALT_TEXT_VIEW_SUFFIX" data-toggle="collapse" data-target=".MLA_ALT_TEXT_VIEW_SUFFIX .collapse">
|
754 |
+
<h2>Provides a unique suffix for the ALT Text SQL VIEW</h2>
|
755 |
+
<pre>MLA_ALT_TEXT_VIEW_SUFFIX </pre>
|
756 |
+
<div class="labels"></div>
|
757 |
+
<div class="row collapse"><div class="detail-description">
|
758 |
+
<p class="long_description"></p>
|
759 |
+
<table class="table table-bordered"><tr>
|
760 |
+
<th>since</th>
|
761 |
+
<td>0.40</td>
|
762 |
+
</tr></table>
|
763 |
</div></div>
|
764 |
</div>
|
765 |
</div>
|
769 |
<div class="row"><footer class="span12">
|
770 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
771 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
772 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
773 |
</div>
|
774 |
</body>
|
775 |
</html>
|
phpDocs/classes/MLAEdit.html
ADDED
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
|
2 |
+
<head>
|
3 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
+
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLAEdit</title>
|
7 |
+
<meta name="author" content="Mike van Riel">
|
8 |
+
<meta name="description" content="">
|
9 |
+
<link href="../css/template.css" rel="stylesheet" media="all">
|
10 |
+
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
|
11 |
+
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
|
12 |
+
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
|
13 |
+
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
|
14 |
+
</head>
|
15 |
+
<body>
|
16 |
+
<div class="navbar navbar-fixed-top">
|
17 |
+
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
+
<li class="dropdown">
|
20 |
+
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
22 |
+
</li>
|
23 |
+
<li class="dropdown" id="charts-menu">
|
24 |
+
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
25 |
+
Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
|
26 |
+
</li>
|
27 |
+
<li class="dropdown" id="reports-menu">
|
28 |
+
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
|
29 |
+
Reports <b class="caret"></b></a><ul class="dropdown-menu">
|
30 |
+
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors
|
31 |
+
<span class="label label-info">0</span></a></li>
|
32 |
+
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers
|
33 |
+
<ul></ul></a></li>
|
34 |
+
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements
|
35 |
+
<span class="label label-info">0</span></a></li>
|
36 |
+
</ul>
|
37 |
+
</li>
|
38 |
+
</ul></div>
|
39 |
+
</div></div>
|
40 |
+
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top <i class="icon-upload icon-white"></i></a></div>
|
41 |
+
</div>
|
42 |
+
<div id="___" class="container">
|
43 |
+
<noscript><div class="alert alert-warning">
|
44 |
+
Javascript is disabled; several features are only available
|
45 |
+
if Javascript is enabled.
|
46 |
+
</div></noscript>
|
47 |
+
<div class="row">
|
48 |
+
<div class="span4">
|
49 |
+
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
|
50 |
+
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
|
51 |
+
</div>
|
52 |
+
<ul class="side-nav nav nav-list">
|
53 |
+
<li class="nav-header">
|
54 |
+
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
+
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
+
<li class="method public "><a href="#mla_add_meta_boxes_action" title="mla_add_meta_boxes_action :: Registers meta boxes for the Edit Media screen."><span class="description">Registers meta boxes for the Edit Media screen.</span><pre>mla_add_meta_boxes_action()</pre></a></li>
|
57 |
+
<li class="method public "><a href="#mla_attachment_submitbox_action" title="mla_attachment_submitbox_action :: Adds Last Modified date to the Submit box on the Edit Media screen."><span class="description">Adds Last Modified date to the Submit box on the Edit Media screen.</span><pre>mla_attachment_submitbox_action()</pre></a></li>
|
58 |
+
<li class="method public "><a href="#mla_custom_field_support_action" title="mla_custom_field_support_action :: Adds Custom Field support to the Edit Media screen."><span class="description">Adds Custom Field support to the Edit Media screen.</span><pre>mla_custom_field_support_action()</pre></a></li>
|
59 |
+
<li class="method public "><a href="#mla_edit_add_help_tab" title="mla_edit_add_help_tab :: Add contextual help tabs to the WordPress Edit Media page"><span class="description">Add contextual help tabs to the WordPress Edit Media page</span><pre>mla_edit_add_help_tab()</pre></a></li>
|
60 |
+
<li class="method public "><a href="#mla_edit_attachment_action" title="mla_edit_attachment_action :: Saves updates from the Edit Media screen."><span class="description">Saves updates from the Edit Media screen.</span><pre>mla_edit_attachment_action()</pre></a></li>
|
61 |
+
<li class="method public "><a href="#mla_featured_in_handler" title="mla_featured_in_handler :: Renders the Featured in meta box on the Edit Media page."><span class="description">Renders the Featured in meta box on the Edit Media page.</span><pre>mla_featured_in_handler()</pre></a></li>
|
62 |
+
<li class="method public "><a href="#mla_gallery_in_handler" title="mla_gallery_in_handler :: Renders the Gallery in meta box on the Edit Media page."><span class="description">Renders the Gallery in meta box on the Edit Media page.</span><pre>mla_gallery_in_handler()</pre></a></li>
|
63 |
+
<li class="method public "><a href="#mla_image_metadata_handler" title="mla_image_metadata_handler :: Renders the Image Metadata meta box on the Edit Media page."><span class="description">Renders the Image Metadata meta box on the Edit Media page.</span><pre>mla_image_metadata_handler()</pre></a></li>
|
64 |
+
<li class="method public "><a href="#mla_inserted_in_handler" title="mla_inserted_in_handler :: Renders the Inserted in meta box on the Edit Media page."><span class="description">Renders the Inserted in meta box on the Edit Media page.</span><pre>mla_inserted_in_handler()</pre></a></li>
|
65 |
+
<li class="method public "><a href="#mla_menu_order_handler" title="mla_menu_order_handler :: Renders the Menu Order meta box on the Edit Media page."><span class="description">Renders the Menu Order meta box on the Edit Media page.</span><pre>mla_menu_order_handler()</pre></a></li>
|
66 |
+
<li class="method public "><a href="#mla_mla_gallery_in_handler" title="mla_mla_gallery_in_handler :: Renders the Gallery in meta box on the Edit Media page."><span class="description">Renders the Gallery in meta box on the Edit Media page.</span><pre>mla_mla_gallery_in_handler()</pre></a></li>
|
67 |
+
<li class="method public "><a href="#mla_parent_info_handler" title="mla_parent_info_handler :: Renders the Parent Info meta box on the Edit Media page."><span class="description">Renders the Parent Info meta box on the Edit Media page.</span><pre>mla_parent_info_handler()</pre></a></li>
|
68 |
+
<li class="method public "><a href="#mla_post_updated_messages_filter" title="mla_post_updated_messages_filter :: Adds mapping update messages for display at the top of the Edit Media screen."><span class="description">Adds mapping update messages for display at the top of the Edit Media screen.</span><pre>mla_post_updated_messages_filter()</pre></a></li>
|
69 |
+
<li class="nav-header">
|
70 |
+
<i class="icon-custom icon-property"></i> Properties</li>
|
71 |
+
<li class="nav-header private">» Private</li>
|
72 |
+
<li class="property private "><a href="#%24mla_references" title="$mla_references :: Where-used values for the current item"><span class="description">Where-used values for the current item</span><pre>$mla_references</pre></a></li>
|
73 |
+
</ul>
|
74 |
+
</div>
|
75 |
+
<div class="span8">
|
76 |
+
<a name="%5CMLAEdit" id="\MLAEdit"></a><ul class="breadcrumb">
|
77 |
+
<li>
|
78 |
+
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
|
79 |
+
</li>
|
80 |
+
<li><a href="../namespaces/global.html">global</a></li>
|
81 |
+
<li class="active">
|
82 |
+
<span class="divider">\</span><a href="../classes/MLAEdit.html">MLAEdit</a>
|
83 |
+
</li>
|
84 |
+
</ul>
|
85 |
+
<div href="../classes/MLAEdit.html" class="element class">
|
86 |
+
<p class="short_description">Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen</p>
|
87 |
+
<div class="details">
|
88 |
+
<p class="long_description"></p>
|
89 |
+
<table class="table table-bordered">
|
90 |
+
<tr>
|
91 |
+
<th>package</th>
|
92 |
+
<td><a href="../packages/Media%20Library%20Assistant.html">Media Library Assistant</a></td>
|
93 |
+
</tr>
|
94 |
+
<tr>
|
95 |
+
<th>since</th>
|
96 |
+
<td>0.80</td>
|
97 |
+
</tr>
|
98 |
+
</table>
|
99 |
+
<h3>
|
100 |
+
<i class="icon-custom icon-method"></i> Methods</h3>
|
101 |
+
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
102 |
+
<h2>Initialization function, similar to __construct()</h2>
|
103 |
+
<pre>initialize() : void</pre>
|
104 |
+
<div class="labels"></div>
|
105 |
+
<div class="row collapse"><div class="detail-description">
|
106 |
+
<p class="long_description"></p>
|
107 |
+
<table class="table table-bordered"><tr>
|
108 |
+
<th>since</th>
|
109 |
+
<td>0.80</td>
|
110 |
+
</tr></table>
|
111 |
+
</div></div>
|
112 |
+
</div>
|
113 |
+
<a name="mla_add_meta_boxes_action" id="mla_add_meta_boxes_action"></a><div class="element clickable method public mla_add_meta_boxes_action" data-toggle="collapse" data-target=".mla_add_meta_boxes_action .collapse">
|
114 |
+
<h2>Registers meta boxes for the Edit Media screen.</h2>
|
115 |
+
<pre>mla_add_meta_boxes_action(string $post_type, object $post) : void</pre>
|
116 |
+
<div class="labels"></div>
|
117 |
+
<div class="row collapse"><div class="detail-description">
|
118 |
+
<p class="long_description"><p>Declared public because it is an action.</p></p>
|
119 |
+
<table class="table table-bordered"><tr>
|
120 |
+
<th>since</th>
|
121 |
+
<td>0.80</td>
|
122 |
+
</tr></table>
|
123 |
+
<h3>Parameters</h3>
|
124 |
+
<div class="subelement argument">
|
125 |
+
<h4>$post_type</h4>
|
126 |
+
<code>string</code><p>type of the current post, e.g., 'attachment'</p>
|
127 |
+
</div>
|
128 |
+
<div class="subelement argument">
|
129 |
+
<h4>$post</h4>
|
130 |
+
<code>object</code><p>current post</p></div>
|
131 |
+
</div></div>
|
132 |
+
</div>
|
133 |
+
<a name="mla_attachment_submitbox_action" id="mla_attachment_submitbox_action"></a><div class="element clickable method public mla_attachment_submitbox_action" data-toggle="collapse" data-target=".mla_attachment_submitbox_action .collapse">
|
134 |
+
<h2>Adds Last Modified date to the Submit box on the Edit Media screen.</h2>
|
135 |
+
<pre>mla_attachment_submitbox_action() : void</pre>
|
136 |
+
<div class="labels"></div>
|
137 |
+
<div class="row collapse"><div class="detail-description">
|
138 |
+
<p class="long_description"><p>Declared public because it is an action.</p></p>
|
139 |
+
<table class="table table-bordered"><tr>
|
140 |
+
<th>since</th>
|
141 |
+
<td>0.80</td>
|
142 |
+
</tr></table>
|
143 |
+
</div></div>
|
144 |
+
</div>
|
145 |
+
<a name="mla_custom_field_support_action" id="mla_custom_field_support_action"></a><div class="element clickable method public mla_custom_field_support_action" data-toggle="collapse" data-target=".mla_custom_field_support_action .collapse">
|
146 |
+
<h2>Adds Custom Field support to the Edit Media screen.</h2>
|
147 |
+
<pre>mla_custom_field_support_action() : void</pre>
|
148 |
+
<div class="labels"></div>
|
149 |
+
<div class="row collapse"><div class="detail-description">
|
150 |
+
<p class="long_description"><p>Declared public because it is an action.</p></p>
|
151 |
+
<table class="table table-bordered"><tr>
|
152 |
+
<th>since</th>
|
153 |
+
<td>0.80</td>
|
154 |
+
</tr></table>
|
155 |
+
</div></div>
|
156 |
+
</div>
|
157 |
+
<a name="mla_edit_add_help_tab" id="mla_edit_add_help_tab"></a><div class="element clickable method public mla_edit_add_help_tab" data-toggle="collapse" data-target=".mla_edit_add_help_tab .collapse">
|
158 |
+
<h2>Add contextual help tabs to the WordPress Edit Media page</h2>
|
159 |
+
<pre>mla_edit_add_help_tab(string $admin_title, string $title) : void</pre>
|
160 |
+
<div class="labels"></div>
|
161 |
+
<div class="row collapse"><div class="detail-description">
|
162 |
+
<p class="long_description"></p>
|
163 |
+
<table class="table table-bordered"><tr>
|
164 |
+
<th>since</th>
|
165 |
+
<td>0.90</td>
|
166 |
+
</tr></table>
|
167 |
+
<h3>Parameters</h3>
|
168 |
+
<div class="subelement argument">
|
169 |
+
<h4>$admin_title</h4>
|
170 |
+
<code>string</code><p>title as shown on the screen</p></div>
|
171 |
+
<div class="subelement argument">
|
172 |
+
<h4>$title</h4>
|
173 |
+
<code>string</code><p>title as shown in the HTML header</p></div>
|
174 |
+
</div></div>
|
175 |
+
</div>
|
176 |
+
<a name="mla_edit_attachment_action" id="mla_edit_attachment_action"></a><div class="element clickable method public mla_edit_attachment_action" data-toggle="collapse" data-target=".mla_edit_attachment_action .collapse">
|
177 |
+
<h2>Saves updates from the Edit Media screen.</h2>
|
178 |
+
<pre>mla_edit_attachment_action(integer $post_ID) : void</pre>
|
179 |
+
<div class="labels"></div>
|
180 |
+
<div class="row collapse"><div class="detail-description">
|
181 |
+
<p class="long_description"><p>Declared public because it is an action.</p></p>
|
182 |
+
<table class="table table-bordered"><tr>
|
183 |
+
<th>since</th>
|
184 |
+
<td>0.80</td>
|
185 |
+
</tr></table>
|
186 |
+
<h3>Parameters</h3>
|
187 |
+
<div class="subelement argument">
|
188 |
+
<h4>$post_ID</h4>
|
189 |
+
<code>integer</code><p>ID of the current post</p></div>
|
190 |
+
</div></div>
|
191 |
+
</div>
|
192 |
+
<a name="mla_featured_in_handler" id="mla_featured_in_handler"></a><div class="element clickable method public mla_featured_in_handler" data-toggle="collapse" data-target=".mla_featured_in_handler .collapse">
|
193 |
+
<h2>Renders the Featured in meta box on the Edit Media page.</h2>
|
194 |
+
<pre>mla_featured_in_handler(object $post) : void</pre>
|
195 |
+
<div class="labels"></div>
|
196 |
+
<div class="row collapse"><div class="detail-description">
|
197 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
198 |
+
<table class="table table-bordered"><tr>
|
199 |
+
<th>since</th>
|
200 |
+
<td>0.80</td>
|
201 |
+
</tr></table>
|
202 |
+
<h3>Parameters</h3>
|
203 |
+
<div class="subelement argument">
|
204 |
+
<h4>$post</h4>
|
205 |
+
<code>object</code><p>current post</p></div>
|
206 |
+
</div></div>
|
207 |
+
</div>
|
208 |
+
<a name="mla_gallery_in_handler" id="mla_gallery_in_handler"></a><div class="element clickable method public mla_gallery_in_handler" data-toggle="collapse" data-target=".mla_gallery_in_handler .collapse">
|
209 |
+
<h2>Renders the Gallery in meta box on the Edit Media page.</h2>
|
210 |
+
<pre>mla_gallery_in_handler(object $post) : void</pre>
|
211 |
+
<div class="labels"></div>
|
212 |
+
<div class="row collapse"><div class="detail-description">
|
213 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
214 |
+
<table class="table table-bordered"><tr>
|
215 |
+
<th>since</th>
|
216 |
+
<td>0.80</td>
|
217 |
+
</tr></table>
|
218 |
+
<h3>Parameters</h3>
|
219 |
+
<div class="subelement argument">
|
220 |
+
<h4>$post</h4>
|
221 |
+
<code>object</code><p>current post</p></div>
|
222 |
+
</div></div>
|
223 |
+
</div>
|
224 |
+
<a name="mla_image_metadata_handler" id="mla_image_metadata_handler"></a><div class="element clickable method public mla_image_metadata_handler" data-toggle="collapse" data-target=".mla_image_metadata_handler .collapse">
|
225 |
+
<h2>Renders the Image Metadata meta box on the Edit Media page.</h2>
|
226 |
+
<pre>mla_image_metadata_handler(object $post) : void</pre>
|
227 |
+
<div class="labels"></div>
|
228 |
+
<div class="row collapse"><div class="detail-description">
|
229 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
230 |
+
<table class="table table-bordered"><tr>
|
231 |
+
<th>since</th>
|
232 |
+
<td>0.80</td>
|
233 |
+
</tr></table>
|
234 |
+
<h3>Parameters</h3>
|
235 |
+
<div class="subelement argument">
|
236 |
+
<h4>$post</h4>
|
237 |
+
<code>object</code><p>current post</p></div>
|
238 |
+
</div></div>
|
239 |
+
</div>
|
240 |
+
<a name="mla_inserted_in_handler" id="mla_inserted_in_handler"></a><div class="element clickable method public mla_inserted_in_handler" data-toggle="collapse" data-target=".mla_inserted_in_handler .collapse">
|
241 |
+
<h2>Renders the Inserted in meta box on the Edit Media page.</h2>
|
242 |
+
<pre>mla_inserted_in_handler(object $post) : void</pre>
|
243 |
+
<div class="labels"></div>
|
244 |
+
<div class="row collapse"><div class="detail-description">
|
245 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
246 |
+
<table class="table table-bordered"><tr>
|
247 |
+
<th>since</th>
|
248 |
+
<td>0.80</td>
|
249 |
+
</tr></table>
|
250 |
+
<h3>Parameters</h3>
|
251 |
+
<div class="subelement argument">
|
252 |
+
<h4>$post</h4>
|
253 |
+
<code>object</code><p>current post</p></div>
|
254 |
+
</div></div>
|
255 |
+
</div>
|
256 |
+
<a name="mla_menu_order_handler" id="mla_menu_order_handler"></a><div class="element clickable method public mla_menu_order_handler" data-toggle="collapse" data-target=".mla_menu_order_handler .collapse">
|
257 |
+
<h2>Renders the Menu Order meta box on the Edit Media page.</h2>
|
258 |
+
<pre>mla_menu_order_handler(object $post) : void</pre>
|
259 |
+
<div class="labels"></div>
|
260 |
+
<div class="row collapse"><div class="detail-description">
|
261 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
262 |
+
<table class="table table-bordered"><tr>
|
263 |
+
<th>since</th>
|
264 |
+
<td>0.80</td>
|
265 |
+
</tr></table>
|
266 |
+
<h3>Parameters</h3>
|
267 |
+
<div class="subelement argument">
|
268 |
+
<h4>$post</h4>
|
269 |
+
<code>object</code><p>current post</p></div>
|
270 |
+
</div></div>
|
271 |
+
</div>
|
272 |
+
<a name="mla_mla_gallery_in_handler" id="mla_mla_gallery_in_handler"></a><div class="element clickable method public mla_mla_gallery_in_handler" data-toggle="collapse" data-target=".mla_mla_gallery_in_handler .collapse">
|
273 |
+
<h2>Renders the Gallery in meta box on the Edit Media page.</h2>
|
274 |
+
<pre>mla_mla_gallery_in_handler(object $post) : void</pre>
|
275 |
+
<div class="labels"></div>
|
276 |
+
<div class="row collapse"><div class="detail-description">
|
277 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
278 |
+
<table class="table table-bordered"><tr>
|
279 |
+
<th>since</th>
|
280 |
+
<td>0.80</td>
|
281 |
+
</tr></table>
|
282 |
+
<h3>Parameters</h3>
|
283 |
+
<div class="subelement argument">
|
284 |
+
<h4>$post</h4>
|
285 |
+
<code>object</code><p>current post</p></div>
|
286 |
+
</div></div>
|
287 |
+
</div>
|
288 |
+
<a name="mla_parent_info_handler" id="mla_parent_info_handler"></a><div class="element clickable method public mla_parent_info_handler" data-toggle="collapse" data-target=".mla_parent_info_handler .collapse">
|
289 |
+
<h2>Renders the Parent Info meta box on the Edit Media page.</h2>
|
290 |
+
<pre>mla_parent_info_handler(object $post) : void</pre>
|
291 |
+
<div class="labels"></div>
|
292 |
+
<div class="row collapse"><div class="detail-description">
|
293 |
+
<p class="long_description"><p>Declared public because it is a callback function.</p></p>
|
294 |
+
<table class="table table-bordered"><tr>
|
295 |
+
<th>since</th>
|
296 |
+
<td>0.80</td>
|
297 |
+
</tr></table>
|
298 |
+
<h3>Parameters</h3>
|
299 |
+
<div class="subelement argument">
|
300 |
+
<h4>$post</h4>
|
301 |
+
<code>object</code><p>current post</p></div>
|
302 |
+
</div></div>
|
303 |
+
</div>
|
304 |
+
<a name="mla_post_updated_messages_filter" id="mla_post_updated_messages_filter"></a><div class="element clickable method public mla_post_updated_messages_filter" data-toggle="collapse" data-target=".mla_post_updated_messages_filter .collapse">
|
305 |
+
<h2>Adds mapping update messages for display at the top of the Edit Media screen.</h2>
|
306 |
+
<pre>mla_post_updated_messages_filter(array $messages) : array</pre>
|
307 |
+
<div class="labels"></div>
|
308 |
+
<div class="row collapse"><div class="detail-description">
|
309 |
+
<p class="long_description"><p>Declared public because it is a filter.</p></p>
|
310 |
+
<table class="table table-bordered"><tr>
|
311 |
+
<th>since</th>
|
312 |
+
<td>1.10</td>
|
313 |
+
</tr></table>
|
314 |
+
<h3>Parameters</h3>
|
315 |
+
<div class="subelement argument">
|
316 |
+
<h4>$messages</h4>
|
317 |
+
<code>array</code><p>messages for the Edit screen</p></div>
|
318 |
+
<h3>Returns</h3>
|
319 |
+
<div class="subelement response">
|
320 |
+
<code>array</code>updated messages</div>
|
321 |
+
</div></div>
|
322 |
+
</div>
|
323 |
+
<h3>
|
324 |
+
<i class="icon-custom icon-property"></i> Properties</h3>
|
325 |
+
<a name="%24mla_references" id="$mla_references"> </a><div class="element clickable property private $mla_references" data-toggle="collapse" data-target=".$mla_references .collapse">
|
326 |
+
<h2>Where-used values for the current item</h2>
|
327 |
+
<pre>$mla_references : array</pre>
|
328 |
+
<div class="labels"></div>
|
329 |
+
<div class="row collapse"><div class="detail-description">
|
330 |
+
<p class="long_description"><p>This array contains the Featured/Inserted/Gallery/MLA Gallery references for the item.
|
331 |
+
The array is built once each page load and cached for subsequent calls.</p></p>
|
332 |
+
<table class="table table-bordered"><tr>
|
333 |
+
<th>since</th>
|
334 |
+
<td>0.80</td>
|
335 |
+
</tr></table>
|
336 |
+
</div></div>
|
337 |
+
</div>
|
338 |
+
</div>
|
339 |
+
</div>
|
340 |
+
</div>
|
341 |
+
</div>
|
342 |
+
<div class="row"><footer class="span12">
|
343 |
+
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
344 |
+
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
345 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
346 |
+
</div>
|
347 |
+
</body>
|
348 |
+
</html>
|
phpDocs/classes/MLAObjects.html
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
|
2 |
+
<head>
|
3 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
+
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLAObjects</title>
|
7 |
+
<meta name="author" content="Mike van Riel">
|
8 |
+
<meta name="description" content="">
|
9 |
+
<link href="../css/template.css" rel="stylesheet" media="all">
|
10 |
+
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
|
11 |
+
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
|
12 |
+
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
|
13 |
+
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
|
14 |
+
</head>
|
15 |
+
<body>
|
16 |
+
<div class="navbar navbar-fixed-top">
|
17 |
+
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
+
<li class="dropdown">
|
20 |
+
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
22 |
+
</li>
|
23 |
+
<li class="dropdown" id="charts-menu">
|
24 |
+
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
25 |
+
Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
|
26 |
+
</li>
|
27 |
+
<li class="dropdown" id="reports-menu">
|
28 |
+
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
|
29 |
+
Reports <b class="caret"></b></a><ul class="dropdown-menu">
|
30 |
+
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors
|
31 |
+
<span class="label label-info">0</span></a></li>
|
32 |
+
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers
|
33 |
+
<ul></ul></a></li>
|
34 |
+
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements
|
35 |
+
<span class="label label-info">0</span></a></li>
|
36 |
+
</ul>
|
37 |
+
</li>
|
38 |
+
</ul></div>
|
39 |
+
</div></div>
|
40 |
+
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top <i class="icon-upload icon-white"></i></a></div>
|
41 |
+
</div>
|
42 |
+
<div id="___" class="container">
|
43 |
+
<noscript><div class="alert alert-warning">
|
44 |
+
Javascript is disabled; several features are only available
|
45 |
+
if Javascript is enabled.
|
46 |
+
</div></noscript>
|
47 |
+
<div class="row">
|
48 |
+
<div class="span4">
|
49 |
+
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
|
50 |
+
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
|
51 |
+
</div>
|
52 |
+
<ul class="side-nav nav nav-list">
|
53 |
+
<li class="nav-header">
|
54 |
+
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
+
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
+
<li class="method public "><a href="#mla_taxonomy_column_filter" title='mla_taxonomy_column_filter :: WordPress Filter for edit taxonomy "Attachments" column,
|
57 |
+
which returns a count of the attachments assigned a given term'><span class="description">WordPress Filter for edit taxonomy "Attachments" column,
|
58 |
+
which returns a count of the attachments assigned a given term</span><pre>mla_taxonomy_column_filter()</pre></a></li>
|
59 |
+
<li class="method public "><a href="#mla_taxonomy_get_columns_filter" title='mla_taxonomy_get_columns_filter :: WordPress Filter for edit taxonomy "Attachments" column,
|
60 |
+
which replaces the "Posts" column with an equivalent "Attachments" column.'><span class="description">WordPress Filter for edit taxonomy "Attachments" column,
|
61 |
+
which replaces the "Posts" column with an equivalent "Attachments" column.</span><pre>mla_taxonomy_get_columns_filter()</pre></a></li>
|
62 |
+
<li class="nav-header private">» Private</li>
|
63 |
+
<li class="method private "><a href="#_build_taxonomies" title="_build_taxonomies :: Registers Attachment Categories and Attachment Tags custom taxonomies, adds taxonomy-related filters"><span class="description">Registers Attachment Categories and Attachment Tags custom taxonomies, adds taxonomy-related filters</span><pre>_build_taxonomies()</pre></a></li>
|
64 |
+
</ul>
|
65 |
+
</div>
|
66 |
+
<div class="span8">
|
67 |
+
<a name="%5CMLAObjects" id="\MLAObjects"></a><ul class="breadcrumb">
|
68 |
+
<li>
|
69 |
+
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
|
70 |
+
</li>
|
71 |
+
<li><a href="../namespaces/global.html">global</a></li>
|
72 |
+
<li class="active">
|
73 |
+
<span class="divider">\</span><a href="../classes/MLAObjects.html">MLAObjects</a>
|
74 |
+
</li>
|
75 |
+
</ul>
|
76 |
+
<div href="../classes/MLAObjects.html" class="element class">
|
77 |
+
<p class="short_description">Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags</p>
|
78 |
+
<div class="details">
|
79 |
+
<p class="long_description"></p>
|
80 |
+
<table class="table table-bordered">
|
81 |
+
<tr>
|
82 |
+
<th>package</th>
|
83 |
+
<td><a href="../packages/Media%20Library%20Assistant.html">Media Library Assistant</a></td>
|
84 |
+
</tr>
|
85 |
+
<tr>
|
86 |
+
<th>since</th>
|
87 |
+
<td>0.20</td>
|
88 |
+
</tr>
|
89 |
+
</table>
|
90 |
+
<h3>
|
91 |
+
<i class="icon-custom icon-method"></i> Methods</h3>
|
92 |
+
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
93 |
+
<h2>Initialization function, similar to __construct()</h2>
|
94 |
+
<pre>initialize() : void</pre>
|
95 |
+
<div class="labels"></div>
|
96 |
+
<div class="row collapse"><div class="detail-description">
|
97 |
+
<p class="long_description"></p>
|
98 |
+
<table class="table table-bordered"><tr>
|
99 |
+
<th>since</th>
|
100 |
+
<td>0.20</td>
|
101 |
+
</tr></table>
|
102 |
+
</div></div>
|
103 |
+
</div>
|
104 |
+
<a name="mla_taxonomy_column_filter" id="mla_taxonomy_column_filter"></a><div class="element clickable method public mla_taxonomy_column_filter" data-toggle="collapse" data-target=".mla_taxonomy_column_filter .collapse">
|
105 |
+
<h2>WordPress Filter for edit taxonomy "Attachments" column,
|
106 |
+
which returns a count of the attachments assigned a given term</h2>
|
107 |
+
<pre>mla_taxonomy_column_filter(string $place_holder, array $column_name, array $term_id) : array</pre>
|
108 |
+
<div class="labels"></div>
|
109 |
+
<div class="row collapse"><div class="detail-description">
|
110 |
+
<p class="long_description"></p>
|
111 |
+
<table class="table table-bordered"><tr>
|
112 |
+
<th>since</th>
|
113 |
+
<td>0.30</td>
|
114 |
+
</tr></table>
|
115 |
+
<h3>Parameters</h3>
|
116 |
+
<div class="subelement argument">
|
117 |
+
<h4>$place_holder</h4>
|
118 |
+
<code>string</code><p>current column value; always ''</p>
|
119 |
+
</div>
|
120 |
+
<div class="subelement argument">
|
121 |
+
<h4>$column_name</h4>
|
122 |
+
<code>array</code><p>name of the column</p></div>
|
123 |
+
<div class="subelement argument">
|
124 |
+
<h4>$term_id</h4>
|
125 |
+
<code>array</code><p>ID of the term for which the count is desired</p></div>
|
126 |
+
<h3>Returns</h3>
|
127 |
+
<div class="subelement response">
|
128 |
+
<code>array</code>HTML markup for the column content; number of attachments in the category and alink to retrieve a list of them</div>
|
129 |
+
</div></div>
|
130 |
+
</div>
|
131 |
+
<a name="mla_taxonomy_get_columns_filter" id="mla_taxonomy_get_columns_filter"></a><div class="element clickable method public mla_taxonomy_get_columns_filter" data-toggle="collapse" data-target=".mla_taxonomy_get_columns_filter .collapse">
|
132 |
+
<h2>WordPress Filter for edit taxonomy "Attachments" column,
|
133 |
+
which replaces the "Posts" column with an equivalent "Attachments" column.</h2>
|
134 |
+
<pre>mla_taxonomy_get_columns_filter(array $columns) : array</pre>
|
135 |
+
<div class="labels"></div>
|
136 |
+
<div class="row collapse"><div class="detail-description">
|
137 |
+
<p class="long_description"></p>
|
138 |
+
<table class="table table-bordered"><tr>
|
139 |
+
<th>since</th>
|
140 |
+
<td>0.30</td>
|
141 |
+
</tr></table>
|
142 |
+
<h3>Parameters</h3>
|
143 |
+
<div class="subelement argument">
|
144 |
+
<h4>$columns</h4>
|
145 |
+
<code>array</code><p>column definitions for the edit taxonomy list table</p></div>
|
146 |
+
<h3>Returns</h3>
|
147 |
+
<div class="subelement response">
|
148 |
+
<code>array</code>updated column definitions for the edit taxonomy list table</div>
|
149 |
+
</div></div>
|
150 |
+
</div>
|
151 |
+
<a name="_build_taxonomies" id="_build_taxonomies"></a><div class="element clickable method private _build_taxonomies" data-toggle="collapse" data-target="._build_taxonomies .collapse">
|
152 |
+
<h2>Registers Attachment Categories and Attachment Tags custom taxonomies, adds taxonomy-related filters</h2>
|
153 |
+
<pre>_build_taxonomies() : void</pre>
|
154 |
+
<div class="labels"></div>
|
155 |
+
<div class="row collapse"><div class="detail-description">
|
156 |
+
<p class="long_description"></p>
|
157 |
+
<table class="table table-bordered"><tr>
|
158 |
+
<th>since</th>
|
159 |
+
<td>0.1</td>
|
160 |
+
</tr></table>
|
161 |
+
</div></div>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
</div>
|
167 |
+
<div class="row"><footer class="span12">
|
168 |
+
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
169 |
+
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
170 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
171 |
+
</div>
|
172 |
+
</body>
|
173 |
+
</html>
|
phpDocs/classes/MLAOptions.html
ADDED
@@ -0,0 +1,1013 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
|
2 |
+
<head>
|
3 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
+
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLAOptions</title>
|
7 |
+
<meta name="author" content="Mike van Riel">
|
8 |
+
<meta name="description" content="">
|
9 |
+
<link href="../css/template.css" rel="stylesheet" media="all">
|
10 |
+
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
|
11 |
+
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
|
12 |
+
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
|
13 |
+
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
|
14 |
+
</head>
|
15 |
+
<body>
|
16 |
+
<div class="navbar navbar-fixed-top">
|
17 |
+
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
+
<li class="dropdown">
|
20 |
+
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
22 |
+
</li>
|
23 |
+
<li class="dropdown" id="charts-menu">
|
24 |
+
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
25 |
+
Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
|
26 |
+
</li>
|
27 |
+
<li class="dropdown" id="reports-menu">
|
28 |
+
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
|
29 |
+
Reports <b class="caret"></b></a><ul class="dropdown-menu">
|
30 |
+
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors
|
31 |
+
<span class="label label-info">0</span></a></li>
|
32 |
+
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers
|
33 |
+
<ul></ul></a></li>
|
34 |
+
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements
|
35 |
+
<span class="label label-info">0</span></a></li>
|
36 |
+
</ul>
|
37 |
+
</li>
|
38 |
+
</ul></div>
|
39 |
+
</div></div>
|
40 |
+
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top <i class="icon-upload icon-white"></i></a></div>
|
41 |
+
</div>
|
42 |
+
<div id="___" class="container">
|
43 |
+
<noscript><div class="alert alert-warning">
|
44 |
+
Javascript is disabled; several features are only available
|
45 |
+
if Javascript is enabled.
|
46 |
+
</div></noscript>
|
47 |
+
<div class="row">
|
48 |
+
<div class="span4">
|
49 |
+
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
|
50 |
+
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
|
51 |
+
</div>
|
52 |
+
<ul class="side-nav nav nav-list">
|
53 |
+
<li class="nav-header">
|
54 |
+
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
+
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
+
<li class="method public "><a href="#mla_add_attachment_action" title="mla_add_attachment_action :: Perform ITC/EXIF mapping on just-inserted attachment"><span class="description">Perform ITC/EXIF mapping on just-inserted attachment</span><pre>mla_add_attachment_action()</pre></a></li>
|
57 |
+
<li class="method public "><a href="#mla_custom_field_option_handler" title="mla_custom_field_option_handler :: Render and manage custom field mapping options"><span class="description">Render and manage custom field mapping options</span><pre>mla_custom_field_option_handler()</pre></a></li>
|
58 |
+
<li class="method public "><a href="#mla_custom_field_option_value" title="mla_custom_field_option_value :: Fetch custom field option value given a slug"><span class="description">Fetch custom field option value given a slug</span><pre>mla_custom_field_option_value()</pre></a></li>
|
59 |
+
<li class="method public "><a href="#mla_custom_field_support" title="mla_custom_field_support :: Evaluate file information for custom field mapping"><span class="description">Evaluate file information for custom field mapping</span><pre>mla_custom_field_support()</pre></a></li>
|
60 |
+
<li class="method public "><a href="#mla_delete_option" title="mla_delete_option :: Delete the stored value of a defined MLA option"><span class="description">Delete the stored value of a defined MLA option</span><pre>mla_delete_option()</pre></a></li>
|
61 |
+
<li class="method public "><a href="#mla_evaluate_custom_field_mapping" title="mla_evaluate_custom_field_mapping :: Evaluate custom field mapping updates for a post"><span class="description">Evaluate custom field mapping updates for a post</span><pre>mla_evaluate_custom_field_mapping()</pre></a></li>
|
62 |
+
<li class="method public "><a href="#mla_evaluate_iptc_exif_mapping" title="mla_evaluate_iptc_exif_mapping :: Evaluate IPTC/EXIF mapping updates for a post"><span class="description">Evaluate IPTC/EXIF mapping updates for a post</span><pre>mla_evaluate_iptc_exif_mapping()</pre></a></li>
|
63 |
+
<li class="method public "><a href="#mla_fetch_gallery_template" title="mla_fetch_gallery_template :: Fetch style or markup template from $mla_templates"><span class="description">Fetch style or markup template from $mla_templates</span><pre>mla_fetch_gallery_template()</pre></a></li>
|
64 |
+
<li class="method public "><a href="#mla_get_markup_templates" title="mla_get_markup_templates :: Get ALL markup templates from $mla_templates, including 'default'"><span class="description">Get ALL markup templates from $mla_templates, including 'default'</span><pre>mla_get_markup_templates()</pre></a></li>
|
65 |
+
<li class="method public "><a href="#mla_get_option" title="mla_get_option :: Return the stored value or default value of a defined MLA option"><span class="description">Return the stored value or default value of a defined MLA option</span><pre>mla_get_option()</pre></a></li>
|
66 |
+
<li class="method public "><a href="#mla_get_style_templates" title="mla_get_style_templates :: Get ALL style templates from $mla_templates, including 'default'"><span class="description">Get ALL style templates from $mla_templates, including 'default'</span><pre>mla_get_style_templates()</pre></a></li>
|
67 |
+
<li class="method public "><a href="#mla_iptc_exif_option_handler" title="mla_iptc_exif_option_handler :: Render and manage iptc/exif support options"><span class="description">Render and manage iptc/exif support options</span><pre>mla_iptc_exif_option_handler()</pre></a></li>
|
68 |
+
<li class="method public "><a href="#mla_put_markup_templates" title="mla_put_markup_templates :: Put user-defined markup templates to $mla_templates and database"><span class="description">Put user-defined markup templates to $mla_templates and database</span><pre>mla_put_markup_templates()</pre></a></li>
|
69 |
+
<li class="method public "><a href="#mla_put_style_templates" title="mla_put_style_templates :: Put user-defined style templates to $mla_templates and database"><span class="description">Put user-defined style templates to $mla_templates and database</span><pre>mla_put_style_templates()</pre></a></li>
|
70 |
+
<li class="method public "><a href="#mla_taxonomy_option_handler" title="mla_taxonomy_option_handler :: Render and manage taxonomy support options, e.g., Categories and Post Tags"><span class="description">Render and manage taxonomy support options, e.g., Categories and Post Tags</span><pre>mla_taxonomy_option_handler()</pre></a></li>
|
71 |
+
<li class="method public "><a href="#mla_taxonomy_support" title="mla_taxonomy_support :: Determine MLA support for a taxonomy, handling the special case where the
|
72 |
+
settings are being updated or reset."><span class="description">Determine MLA support for a taxonomy, handling the special case where the
|
73 |
+
settings are being updated or reset.</span><pre>mla_taxonomy_support()</pre></a></li>
|
74 |
+
<li class="method public "><a href="#mla_update_attachment_metadata_filter" title="mla_update_attachment_metadata_filter :: Perform Custom Field mapping on just-inserted or updated attachment"><span class="description">Perform Custom Field mapping on just-inserted or updated attachment</span><pre>mla_update_attachment_metadata_filter()</pre></a></li>
|
75 |
+
<li class="method public "><a href="#mla_update_option" title="mla_update_option :: Add or update the stored value of a defined MLA option"><span class="description">Add or update the stored value of a defined MLA option</span><pre>mla_update_option()</pre></a></li>
|
76 |
+
<li class="nav-header private">» Private</li>
|
77 |
+
<li class="method private "><a href="#_compose_custom_field_option_list" title="_compose_custom_field_option_list :: Compose a Custom Field Options list with current selection"><span class="description">Compose a Custom Field Options list with current selection</span><pre>_compose_custom_field_option_list()</pre></a></li>
|
78 |
+
<li class="method private "><a href="#_compose_data_source_option_list" title="_compose_data_source_option_list :: Compose a (Custom Field) Data Source Options list with current selection"><span class="description">Compose a (Custom Field) Data Source Options list with current selection</span><pre>_compose_data_source_option_list()</pre></a></li>
|
79 |
+
<li class="method private "><a href="#_compose_iptc_option_list" title="_compose_iptc_option_list :: Compose an IPTC Options list with current selection"><span class="description">Compose an IPTC Options list with current selection</span><pre>_compose_iptc_option_list()</pre></a></li>
|
80 |
+
<li class="method private "><a href="#_compose_parent_option_list" title="_compose_parent_option_list :: Compose an hierarchical taxonomy Parent options list with current selection"><span class="description">Compose an hierarchical taxonomy Parent options list with current selection</span><pre>_compose_parent_option_list()</pre></a></li>
|
81 |
+
<li class="method private "><a href="#_evaluate_data_source" title="_evaluate_data_source :: Evaluate custom field mapping data source"><span class="description">Evaluate custom field mapping data source</span><pre>_evaluate_data_source()</pre></a></li>
|
82 |
+
<li class="method private "><a href="#_evaluate_file_information" title="_evaluate_file_information :: Evaluate file information for custom field mapping"><span class="description">Evaluate file information for custom field mapping</span><pre>_evaluate_file_information()</pre></a></li>
|
83 |
+
<li class="method private "><a href="#_get_custom_field_names" title="_get_custom_field_names :: Generate a list of all (post) Custom Field names"><span class="description">Generate a list of all (post) Custom Field names</span><pre>_get_custom_field_names()</pre></a></li>
|
84 |
+
<li class="method private "><a href="#_load_option_templates" title="_load_option_templates :: Load style and markup templates to $mla_templates"><span class="description">Load style and markup templates to $mla_templates</span><pre>_load_option_templates()</pre></a></li>
|
85 |
+
<li class="method private "><a href="#_update_custom_field_mapping" title="_update_custom_field_mapping :: Update custom field mappings"><span class="description">Update custom field mappings</span><pre>_update_custom_field_mapping()</pre></a></li>
|
86 |
+
<li class="method private "><a href="#_update_iptc_exif_custom_mapping" title="_update_iptc_exif_custom_mapping :: Update Custom field portion of IPTC/EXIF mappings"><span class="description">Update Custom field portion of IPTC/EXIF mappings</span><pre>_update_iptc_exif_custom_mapping()</pre></a></li>
|
87 |
+
<li class="method private "><a href="#_update_iptc_exif_standard_mapping" title="_update_iptc_exif_standard_mapping :: Update Standard field portion of IPTC/EXIF mappings"><span class="description">Update Standard field portion of IPTC/EXIF mappings</span><pre>_update_iptc_exif_standard_mapping()</pre></a></li>
|
88 |
+
<li class="method private "><a href="#_update_iptc_exif_taxonomy_mapping" title="_update_iptc_exif_taxonomy_mapping :: Update Taxonomy term portion of IPTC/EXIF mappings"><span class="description">Update Taxonomy term portion of IPTC/EXIF mappings</span><pre>_update_iptc_exif_taxonomy_mapping()</pre></a></li>
|
89 |
+
<li class="nav-header">
|
90 |
+
<i class="icon-custom icon-property"></i> Properties</li>
|
91 |
+
<li class="property public "><a href="#%24mla_option_definitions" title="$mla_option_definitions :: $mla_option_definitions defines the database options and admin page areas for setting/updating them."><span class="description">$mla_option_definitions defines the database options and admin page areas for setting/updating them.</span><pre>$mla_option_definitions</pre></a></li>
|
92 |
+
<li class="property public "><a href="#%24process_featured_in" title='$process_featured_in :: Option setting for "Featured in" reporting'><span class="description">Option setting for "Featured in" reporting</span><pre>$process_featured_in</pre></a></li>
|
93 |
+
<li class="property public "><a href="#%24process_gallery_in" title='$process_gallery_in :: Option setting for "Gallery in" reporting'><span class="description">Option setting for "Gallery in" reporting</span><pre>$process_gallery_in</pre></a></li>
|
94 |
+
<li class="property public "><a href="#%24process_inserted_in" title='$process_inserted_in :: Option setting for "Inserted in" reporting'><span class="description">Option setting for "Inserted in" reporting</span><pre>$process_inserted_in</pre></a></li>
|
95 |
+
<li class="property public "><a href="#%24process_mla_gallery_in" title='$process_mla_gallery_in :: Option setting for "MLA Gallery in" reporting'><span class="description">Option setting for "MLA Gallery in" reporting</span><pre>$process_mla_gallery_in</pre></a></li>
|
96 |
+
<li class="nav-header private">» Private</li>
|
97 |
+
<li class="property private "><a href="#%24custom_field_data_sources" title="$custom_field_data_sources :: Array of Data Source names for custom field mapping"><span class="description">Array of Data Source names for custom field mapping</span><pre>$custom_field_data_sources</pre></a></li>
|
98 |
+
<li class="property private "><a href="#%24mla_option_templates" title="$mla_option_templates :: Style and Markup templates"><span class="description">Style and Markup templates</span><pre>$mla_option_templates</pre></a></li>
|
99 |
+
<li class="nav-header">
|
100 |
+
<i class="icon-custom icon-constant"></i> Constants</li>
|
101 |
+
<li class="constant "><a href="#MLA_FEATURED_IN_TUNING" title="MLA_FEATURED_IN_TUNING :: Provides a unique name for a database tuning option"><span class="description">Provides a unique name for a database tuning option</span><pre>MLA_FEATURED_IN_TUNING</pre></a></li>
|
102 |
+
<li class="constant "><a href="#MLA_GALLERY_IN_TUNING" title="MLA_GALLERY_IN_TUNING :: Provides a unique name for a database tuning option"><span class="description">Provides a unique name for a database tuning option</span><pre>MLA_GALLERY_IN_TUNING</pre></a></li>
|
103 |
+
<li class="constant "><a href="#MLA_INSERTED_IN_TUNING" title="MLA_INSERTED_IN_TUNING :: Provides a unique name for a database tuning option"><span class="description">Provides a unique name for a database tuning option</span><pre>MLA_INSERTED_IN_TUNING</pre></a></li>
|
104 |
+
<li class="constant "><a href="#MLA_MLA_GALLERY_IN_TUNING" title="MLA_MLA_GALLERY_IN_TUNING :: Provides a unique name for a database tuning option"><span class="description">Provides a unique name for a database tuning option</span><pre>MLA_MLA_GALLERY_IN_TUNING</pre></a></li>
|
105 |
+
<li class="constant "><a href="#MLA_NEW_CUSTOM_FIELD" title='MLA_NEW_CUSTOM_FIELD :: Provides a unique name for the Custom Field "new field" key'><span class="description">Provides a unique name for the Custom Field "new field" key</span><pre>MLA_NEW_CUSTOM_FIELD</pre></a></li>
|
106 |
+
<li class="constant "><a href="#MLA_NEW_CUSTOM_RULE" title='MLA_NEW_CUSTOM_RULE :: Provides a unique name for the Custom Field "new rule" key'><span class="description">Provides a unique name for the Custom Field "new rule" key</span><pre>MLA_NEW_CUSTOM_RULE</pre></a></li>
|
107 |
+
<li class="constant "><a href="#MLA_VERSION_OPTION" title="MLA_VERSION_OPTION :: Provides a unique name for the current version option"><span class="description">Provides a unique name for the current version option</span><pre>MLA_VERSION_OPTION</pre></a></li>
|
108 |
+
</ul>
|
109 |
+
</div>
|
110 |
+
<div class="span8">
|
111 |
+
<a name="%5CMLAOptions" id="\MLAOptions"></a><ul class="breadcrumb">
|
112 |
+
<li>
|
113 |
+
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
|
114 |
+
</li>
|
115 |
+
<li><a href="../namespaces/global.html">global</a></li>
|
116 |
+
<li class="active">
|
117 |
+
<span class="divider">\</span><a href="../classes/MLAOptions.html">MLAOptions</a>
|
118 |
+
</li>
|
119 |
+
</ul>
|
120 |
+
<div href="../classes/MLAOptions.html" class="element class">
|
121 |
+
<p class="short_description">Class MLA (Media Library Assistant) Options manages the plugin option settings
|
122 |
+
and provides functions to get and put them from/to WordPress option variables</p>
|
123 |
+
<div class="details">
|
124 |
+
<p class="long_description"><p>Separated from class MLASettings in version 1.00</p></p>
|
125 |
+
<table class="table table-bordered">
|
126 |
+
<tr>
|
127 |
+
<th>package</th>
|
128 |
+
<td><a href="../packages/Media%20Library%20Assistant.html">Media Library Assistant</a></td>
|
129 |
+
</tr>
|
130 |
+
<tr>
|
131 |
+
<th>since</th>
|
132 |
+
<td>1.00</td>
|
133 |
+
</tr>
|
134 |
+
</table>
|
135 |
+
<h3>
|
136 |
+
<i class="icon-custom icon-method"></i> Methods</h3>
|
137 |
+
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
138 |
+
<h2>Initialization function, similar to __construct()</h2>
|
139 |
+
<pre>initialize() : void</pre>
|
140 |
+
<div class="labels"></div>
|
141 |
+
<div class="row collapse"><div class="detail-description">
|
142 |
+
<p class="long_description"></p>
|
143 |
+
<table class="table table-bordered"><tr>
|
144 |
+
<th>since</th>
|
145 |
+
<td>1.00</td>
|
146 |
+
</tr></table>
|
147 |
+
</div></div>
|
148 |
+
</div>
|
149 |
+
<a name="mla_add_attachment_action" id="mla_add_attachment_action"></a><div class="element clickable method public mla_add_attachment_action" data-toggle="collapse" data-target=".mla_add_attachment_action .collapse">
|
150 |
+
<h2>Perform ITC/EXIF mapping on just-inserted attachment</h2>
|
151 |
+
<pre>mla_add_attachment_action(integer $post_id) : void</pre>
|
152 |
+
<div class="labels"></div>
|
153 |
+
<div class="row collapse"><div class="detail-description">
|
154 |
+
<p class="long_description"></p>
|
155 |
+
<table class="table table-bordered"><tr>
|
156 |
+
<th>since</th>
|
157 |
+
<td>1.00</td>
|
158 |
+
</tr></table>
|
159 |
+
<h3>Parameters</h3>
|
160 |
+
<div class="subelement argument">
|
161 |
+
<h4>$post_id</h4>
|
162 |
+
<code>integer</code><p>ID of just-inserted attachment</p>
|
163 |
+
</div>
|
164 |
+
</div></div>
|
165 |
+
</div>
|
166 |
+
<a name="mla_custom_field_option_handler" id="mla_custom_field_option_handler"></a><div class="element clickable method public mla_custom_field_option_handler" data-toggle="collapse" data-target=".mla_custom_field_option_handler .collapse">
|
167 |
+
<h2>Render and manage custom field mapping options</h2>
|
168 |
+
<pre>mla_custom_field_option_handler(string $action, string $key, array $value, array $args) : string</pre>
|
169 |
+
<div class="labels"></div>
|
170 |
+
<div class="row collapse"><div class="detail-description">
|
171 |
+
<p class="long_description"></p>
|
172 |
+
<table class="table table-bordered">
|
173 |
+
<tr>
|
174 |
+
<th>since</th>
|
175 |
+
<td>1.10</td>
|
176 |
+
</tr>
|
177 |
+
<tr>
|
178 |
+
<th>uses</th>
|
179 |
+
<td>\global\$mla_option_templates</td>
|
180 |
+
</tr>
|
181 |
+
</table>
|
182 |
+
<h3>Parameters</h3>
|
183 |
+
<div class="subelement argument">
|
184 |
+
<h4>$action</h4>
|
185 |
+
<code>string</code><p>'render', 'update', 'delete', or 'reset'</p>
|
186 |
+
</div>
|
187 |
+
<div class="subelement argument">
|
188 |
+
<h4>$key</h4>
|
189 |
+
<code>string</code><p>option name, e.g., 'custom_field_mapping'</p>
|
190 |
+
</div>
|
191 |
+
<div class="subelement argument">
|
192 |
+
<h4>$value</h4>
|
193 |
+
<code>array</code><p>option parameters</p></div>
|
194 |
+
<div class="subelement argument">
|
195 |
+
<h4>$args</h4>
|
196 |
+
<code>array</code><p>Optional. null (default) for 'render' else option data, e.g., $_REQUEST</p>
|
197 |
+
</div>
|
198 |
+
<h3>Returns</h3>
|
199 |
+
<div class="subelement response">
|
200 |
+
<code>string</code>HTML table row markup for 'render' else message(s) reflecting the results of the operation.</div>
|
201 |
+
</div></div>
|
202 |
+
</div>
|
203 |
+
<a name="mla_custom_field_option_value" id="mla_custom_field_option_value"></a><div class="element clickable method public mla_custom_field_option_value" data-toggle="collapse" data-target=".mla_custom_field_option_value .collapse">
|
204 |
+
<h2>Fetch custom field option value given a slug</h2>
|
205 |
+
<pre>mla_custom_field_option_value(string $slug) : array</pre>
|
206 |
+
<div class="labels"></div>
|
207 |
+
<div class="row collapse"><div class="detail-description">
|
208 |
+
<p class="long_description"></p>
|
209 |
+
<table class="table table-bordered"><tr>
|
210 |
+
<th>since</th>
|
211 |
+
<td>1.10</td>
|
212 |
+
</tr></table>
|
213 |
+
<h3>Parameters</h3>
|
214 |
+
<div class="subelement argument">
|
215 |
+
<h4>$slug</h4>
|
216 |
+
<code>string</code><p>slug, e.g., 'c_file-size' for the 'File Size' field</p>
|
217 |
+
</div>
|
218 |
+
<h3>Returns</h3>
|
219 |
+
<div class="subelement response">
|
220 |
+
<code>array</code>option value, e.g., array( 'name' => 'File Size', ... )</div>
|
221 |
+
</div></div>
|
222 |
+
</div>
|
223 |
+
<a name="mla_custom_field_support" id="mla_custom_field_support"></a><div class="element clickable method public mla_custom_field_support" data-toggle="collapse" data-target=".mla_custom_field_support .collapse">
|
224 |
+
<h2>Evaluate file information for custom field mapping</h2>
|
225 |
+
<pre>mla_custom_field_support(string $support_type) : array</pre>
|
226 |
+
<div class="labels"></div>
|
227 |
+
<div class="row collapse"><div class="detail-description">
|
228 |
+
<p class="long_description"></p>
|
229 |
+
<table class="table table-bordered"><tr>
|
230 |
+
<th>since</th>
|
231 |
+
<td>1.10</td>
|
232 |
+
</tr></table>
|
233 |
+
<h3>Parameters</h3>
|
234 |
+
<div class="subelement argument">
|
235 |
+
<h4>$support_type</h4>
|
236 |
+
<code>string</code><p>array format; 'default_columns' (default), 'default_hidden_columns', 'default_sortable_columns', 'quick_edit' or 'bulk_edit'</p>
|
237 |
+
</div>
|
238 |
+
<h3>Returns</h3>
|
239 |
+
<div class="subelement response">
|
240 |
+
<code>array</code>default, hidden, sortable quick_edit or bulk_edit colums in appropriate format</div>
|
241 |
+
</div></div>
|
242 |
+
</div>
|
243 |
+
<a name="mla_delete_option" id="mla_delete_option"></a><div class="element clickable method public mla_delete_option" data-toggle="collapse" data-target=".mla_delete_option .collapse">
|
244 |
+
<h2>Delete the stored value of a defined MLA option</h2>
|
245 |
+
<pre>mla_delete_option(string $option) : boolean</pre>
|
246 |
+
<div class="labels"></div>
|
247 |
+
<div class="row collapse"><div class="detail-description">
|
248 |
+
<p class="long_description"></p>
|
249 |
+
<table class="table table-bordered"><tr>
|
250 |
+
<th>since</th>
|
251 |
+
<td>0.1</td>
|
252 |
+
</tr></table>
|
253 |
+
<h3>Parameters</h3>
|
254 |
+
<div class="subelement argument">
|
255 |
+
<h4>$option</h4>
|
256 |
+
<code>string</code><p>Name of the desired option</p></div>
|
257 |
+
<h3>Returns</h3>
|
258 |
+
<div class="subelement response">
|
259 |
+
<code>boolean</code>True if the option was deleted, otherwise false</div>
|
260 |
+
</div></div>
|
261 |
+
</div>
|
262 |
+
<a name="mla_evaluate_custom_field_mapping" id="mla_evaluate_custom_field_mapping"></a><div class="element clickable method public mla_evaluate_custom_field_mapping" data-toggle="collapse" data-target=".mla_evaluate_custom_field_mapping .collapse">
|
263 |
+
<h2>Evaluate custom field mapping updates for a post</h2>
|
264 |
+
<pre>mla_evaluate_custom_field_mapping(integer $post_id, string $category, array $settings, array $attachment_metadata) : array</pre>
|
265 |
+
<div class="labels"></div>
|
266 |
+
<div class="row collapse"><div class="detail-description">
|
267 |
+
<p class="long_description"></p>
|
268 |
+
<table class="table table-bordered"><tr>
|
269 |
+
<th>since</th>
|
270 |
+
<td>1.10</td>
|
271 |
+
</tr></table>
|
272 |
+
<h3>Parameters</h3>
|
273 |
+
<div class="subelement argument">
|
274 |
+
<h4>$post_id</h4>
|
275 |
+
<code>integer</code><p>post ID to be evaluated</p></div>
|
276 |
+
<div class="subelement argument">
|
277 |
+
<h4>$category</h4>
|
278 |
+
<code>string</code><p>category/scope to evaluate against: custom_field_mapping or single_attachment_mapping</p>
|
279 |
+
</div>
|
280 |
+
<div class="subelement argument">
|
281 |
+
<h4>$settings</h4>
|
282 |
+
<code>array</code><p>(optional) custom_field_mapping values, default NULL (use current option value)</p>
|
283 |
+
</div>
|
284 |
+
<div class="subelement argument">
|
285 |
+
<h4>$attachment_metadata</h4>
|
286 |
+
<code>array</code><p>(optional) attachment_metadata, default NULL (use current postmeta database value)</p>
|
287 |
+
</div>
|
288 |
+
<h3>Returns</h3>
|
289 |
+
<div class="subelement response">
|
290 |
+
<code>array</code>Updates suitable for MLAData::mla_update_single_item, if any</div>
|
291 |
+
</div></div>
|
292 |
+
</div>
|
293 |
+
<a name="mla_evaluate_iptc_exif_mapping" id="mla_evaluate_iptc_exif_mapping"></a><div class="element clickable method public mla_evaluate_iptc_exif_mapping" data-toggle="collapse" data-target=".mla_evaluate_iptc_exif_mapping .collapse">
|
294 |
+
<h2>Evaluate IPTC/EXIF mapping updates for a post</h2>
|
295 |
+
<pre>mla_evaluate_iptc_exif_mapping(object $post, string $category, array $settings) : array</pre>
|
296 |
+
<div class="labels"></div>
|
297 |
+
<div class="row collapse"><div class="detail-description">
|
298 |
+
<p class="long_description"></p>
|
299 |
+
<table class="table table-bordered"><tr>
|
300 |
+
<th>since</th>
|
301 |
+
<td>1.00</td>
|
302 |
+
</tr></table>
|
303 |
+
<h3>Parameters</h3>
|
304 |
+
<div class="subelement argument">
|
305 |
+
<h4>$post</h4>
|
306 |
+
<code>object</code><p>post object with current values</p></div>
|
307 |
+
<div class="subelement argument">
|
308 |
+
<h4>$category</h4>
|
309 |
+
<code>string</code><p>category to evaluate against, e.g., iptc_exif_standard_mapping or iptc_exif_mapping</p></div>
|
310 |
+
<div class="subelement argument">
|
311 |
+
<h4>$settings</h4>
|
312 |
+
<code>array</code><p>(optional) iptc_exif_mapping values, default - current option value</p>
|
313 |
+
</div>
|
314 |
+
<h3>Returns</h3>
|
315 |
+
<div class="subelement response">
|
316 |
+
<code>array</code>Updates suitable for MLAData::mla_update_single_item, if any</div>
|
317 |
+
</div></div>
|
318 |
+
</div>
|
319 |
+
<a name="mla_fetch_gallery_template" id="mla_fetch_gallery_template"></a><div class="element clickable method public mla_fetch_gallery_template" data-toggle="collapse" data-target=".mla_fetch_gallery_template .collapse">
|
320 |
+
<h2>Fetch style or markup template from $mla_templates</h2>
|
321 |
+
<pre>mla_fetch_gallery_template(string $key, string $type) : string | boolean | null</pre>
|
322 |
+
<div class="labels"></div>
|
323 |
+
<div class="row collapse"><div class="detail-description">
|
324 |
+
<p class="long_description"></p>
|
325 |
+
<table class="table table-bordered"><tr>
|
326 |
+
<th>since</th>
|
327 |
+
<td>0.80</td>
|
328 |
+
</tr></table>
|
329 |
+
<h3>Parameters</h3>
|
330 |
+
<div class="subelement argument">
|
331 |
+
<h4>$key</h4>
|
332 |
+
<code>string</code><p>Template name</p></div>
|
333 |
+
<div class="subelement argument">
|
334 |
+
<h4>$type</h4>
|
335 |
+
<code>string</code><p>Template type; 'style' (default) or 'markup'</p>
|
336 |
+
</div>
|
337 |
+
<h3>Returns</h3>
|
338 |
+
<div class="subelement response">
|
339 |
+
<code>string</code><code>boolean</code><code>null</code>requested template, false if not found or null if no templates</div>
|
340 |
+
</div></div>
|
341 |
+
</div>
|
342 |
+
<a name="mla_get_markup_templates" id="mla_get_markup_templates"></a><div class="element clickable method public mla_get_markup_templates" data-toggle="collapse" data-target=".mla_get_markup_templates .collapse">
|
343 |
+
<h2>Get ALL markup templates from $mla_templates, including 'default'</h2>
|
344 |
+
<pre>mla_get_markup_templates() : array | null</pre>
|
345 |
+
<div class="labels"></div>
|
346 |
+
<div class="row collapse"><div class="detail-description">
|
347 |
+
<p class="long_description"></p>
|
348 |
+
<table class="table table-bordered"><tr>
|
349 |
+
<th>since</th>
|
350 |
+
<td>0.80</td>
|
351 |
+
</tr></table>
|
352 |
+
<h3>Returns</h3>
|
353 |
+
<div class="subelement response">
|
354 |
+
<code>array</code><code>null</code>name => value for all markup templates or null if no templates</div>
|
355 |
+
</div></div>
|
356 |
+
</div>
|
357 |
+
<a name="mla_get_option" id="mla_get_option"></a><div class="element clickable method public mla_get_option" data-toggle="collapse" data-target=".mla_get_option .collapse">
|
358 |
+
<h2>Return the stored value or default value of a defined MLA option</h2>
|
359 |
+
<pre>mla_get_option(string $option) : mixed</pre>
|
360 |
+
<div class="labels"></div>
|
361 |
+
<div class="row collapse"><div class="detail-description">
|
362 |
+
<p class="long_description"></p>
|
363 |
+
<table class="table table-bordered"><tr>
|
364 |
+
<th>since</th>
|
365 |
+
<td>0.1</td>
|
366 |
+
</tr></table>
|
367 |
+
<h3>Parameters</h3>
|
368 |
+
<div class="subelement argument">
|
369 |
+
<h4>$option</h4>
|
370 |
+
<code>string</code><p>Name of the desired option</p></div>
|
371 |
+
<h3>Returns</h3>
|
372 |
+
<div class="subelement response">
|
373 |
+
<code>mixed</code>Value(s) for the option or false if the option is not a defined MLA option</div>
|
374 |
+
</div></div>
|
375 |
+
</div>
|
376 |
+
<a name="mla_get_style_templates" id="mla_get_style_templates"></a><div class="element clickable method public mla_get_style_templates" data-toggle="collapse" data-target=".mla_get_style_templates .collapse">
|
377 |
+
<h2>Get ALL style templates from $mla_templates, including 'default'</h2>
|
378 |
+
<pre>mla_get_style_templates() : array | null</pre>
|
379 |
+
<div class="labels"></div>
|
380 |
+
<div class="row collapse"><div class="detail-description">
|
381 |
+
<p class="long_description"></p>
|
382 |
+
<table class="table table-bordered"><tr>
|
383 |
+
<th>since</th>
|
384 |
+
<td>0.80</td>
|
385 |
+
</tr></table>
|
386 |
+
<h3>Returns</h3>
|
387 |
+
<div class="subelement response">
|
388 |
+
<code>array</code><code>null</code>name => value for all style templates or null if no templates</div>
|
389 |
+
</div></div>
|
390 |
+
</div>
|
391 |
+
<a name="mla_iptc_exif_option_handler" id="mla_iptc_exif_option_handler"></a><div class="element clickable method public mla_iptc_exif_option_handler" data-toggle="collapse" data-target=".mla_iptc_exif_option_handler .collapse">
|
392 |
+
<h2>Render and manage iptc/exif support options</h2>
|
393 |
+
<pre>mla_iptc_exif_option_handler(string $action, string $key, array $value, array $args) : string</pre>
|
394 |
+
<div class="labels"></div>
|
395 |
+
<div class="row collapse"><div class="detail-description">
|
396 |
+
<p class="long_description"></p>
|
397 |
+
<table class="table table-bordered">
|
398 |
+
<tr>
|
399 |
+
<th>since</th>
|
400 |
+
<td>1.00</td>
|
401 |
+
</tr>
|
402 |
+
<tr>
|
403 |
+
<th>uses</th>
|
404 |
+
<td>\global\$mla_option_templates</td>
|
405 |
+
</tr>
|
406 |
+
</table>
|
407 |
+
<h3>Parameters</h3>
|
408 |
+
<div class="subelement argument">
|
409 |
+
<h4>$action</h4>
|
410 |
+
<code>string</code><p>'render', 'update', 'delete', or 'reset'</p>
|
411 |
+
</div>
|
412 |
+
<div class="subelement argument">
|
413 |
+
<h4>$key</h4>
|
414 |
+
<code>string</code><p>option name, e.g., 'iptc_exif_mapping'</p>
|
415 |
+
</div>
|
416 |
+
<div class="subelement argument">
|
417 |
+
<h4>$value</h4>
|
418 |
+
<code>array</code><p>option parameters</p></div>
|
419 |
+
<div class="subelement argument">
|
420 |
+
<h4>$args</h4>
|
421 |
+
<code>array</code><p>Optional. null (default) for 'render' else option data, e.g., $_REQUEST</p>
|
422 |
+
</div>
|
423 |
+
<h3>Returns</h3>
|
424 |
+
<div class="subelement response">
|
425 |
+
<code>string</code>HTML table row markup for 'render' else message(s) reflecting the results of the operation.</div>
|
426 |
+
</div></div>
|
427 |
+
</div>
|
428 |
+
<a name="mla_put_markup_templates" id="mla_put_markup_templates"></a><div class="element clickable method public mla_put_markup_templates" data-toggle="collapse" data-target=".mla_put_markup_templates .collapse">
|
429 |
+
<h2>Put user-defined markup templates to $mla_templates and database</h2>
|
430 |
+
<pre>mla_put_markup_templates(array $templates) : boolean</pre>
|
431 |
+
<div class="labels"></div>
|
432 |
+
<div class="row collapse"><div class="detail-description">
|
433 |
+
<p class="long_description"></p>
|
434 |
+
<table class="table table-bordered"><tr>
|
435 |
+
<th>since</th>
|
436 |
+
<td>0.80</td>
|
437 |
+
</tr></table>
|
438 |
+
<h3>Parameters</h3>
|
439 |
+
<div class="subelement argument">
|
440 |
+
<h4>$templates</h4>
|
441 |
+
<code>array</code><p>name => value for all user-defined markup templates</p>
|
442 |
+
</div>
|
443 |
+
<h3>Returns</h3>
|
444 |
+
<div class="subelement response">
|
445 |
+
<code>boolean</code>true if success, false if failure</div>
|
446 |
+
</div></div>
|
447 |
+
</div>
|
448 |
+
<a name="mla_put_style_templates" id="mla_put_style_templates"></a><div class="element clickable method public mla_put_style_templates" data-toggle="collapse" data-target=".mla_put_style_templates .collapse">
|
449 |
+
<h2>Put user-defined style templates to $mla_templates and database</h2>
|
450 |
+
<pre>mla_put_style_templates(array $templates) : boolean</pre>
|
451 |
+
<div class="labels"></div>
|
452 |
+
<div class="row collapse"><div class="detail-description">
|
453 |
+
<p class="long_description"></p>
|
454 |
+
<table class="table table-bordered"><tr>
|
455 |
+
<th>since</th>
|
456 |
+
<td>0.80</td>
|
457 |
+
</tr></table>
|
458 |
+
<h3>Parameters</h3>
|
459 |
+
<div class="subelement argument">
|
460 |
+
<h4>$templates</h4>
|
461 |
+
<code>array</code><p>name => value for all user-defined style templates</p>
|
462 |
+
</div>
|
463 |
+
<h3>Returns</h3>
|
464 |
+
<div class="subelement response">
|
465 |
+
<code>boolean</code>true if success, false if failure</div>
|
466 |
+
</div></div>
|
467 |
+
</div>
|
468 |
+
<a name="mla_taxonomy_option_handler" id="mla_taxonomy_option_handler"></a><div class="element clickable method public mla_taxonomy_option_handler" data-toggle="collapse" data-target=".mla_taxonomy_option_handler .collapse">
|
469 |
+
<h2>Render and manage taxonomy support options, e.g., Categories and Post Tags</h2>
|
470 |
+
<pre>mla_taxonomy_option_handler(string $action, string $key, array $value, array $args) : string</pre>
|
471 |
+
<div class="labels"></div>
|
472 |
+
<div class="row collapse"><div class="detail-description">
|
473 |
+
<p class="long_description"></p>
|
474 |
+
<table class="table table-bordered">
|
475 |
+
<tr>
|
476 |
+
<th>since</th>
|
477 |
+
<td>0.30</td>
|
478 |
+
</tr>
|
479 |
+
<tr>
|
480 |
+
<th>uses</th>
|
481 |
+
<td>\global\$mla_option_templates</td>
|
482 |
+
</tr>
|
483 |
+
</table>
|
484 |
+
<h3>Parameters</h3>
|
485 |
+
<div class="subelement argument">
|
486 |
+
<h4>$action</h4>
|
487 |
+
<code>string</code><p>'render', 'update', 'delete', or 'reset'</p>
|
488 |
+
</div>
|
489 |
+
<div class="subelement argument">
|
490 |
+
<h4>$key</h4>
|
491 |
+
<code>string</code><p>option name, e.g., 'taxonomy_support'</p>
|
492 |
+
</div>
|
493 |
+
<div class="subelement argument">
|
494 |
+
<h4>$value</h4>
|
495 |
+
<code>array</code><p>option parameters</p></div>
|
496 |
+
<div class="subelement argument">
|
497 |
+
<h4>$args</h4>
|
498 |
+
<code>array</code><p>Optional. null (default) for 'render' else option data, e.g., $_REQUEST</p>
|
499 |
+
</div>
|
500 |
+
<h3>Returns</h3>
|
501 |
+
<div class="subelement response">
|
502 |
+
<code>string</code>HTML table row markup for 'render' else message(s) reflecting the results of the operation.</div>
|
503 |
+
</div></div>
|
504 |
+
</div>
|
505 |
+
<a name="mla_taxonomy_support" id="mla_taxonomy_support"></a><div class="element clickable method public mla_taxonomy_support" data-toggle="collapse" data-target=".mla_taxonomy_support .collapse">
|
506 |
+
<h2>Determine MLA support for a taxonomy, handling the special case where the
|
507 |
+
settings are being updated or reset.</h2>
|
508 |
+
<pre>mla_taxonomy_support(string $tax_name, string $support_type) : boolean | string</pre>
|
509 |
+
<div class="labels"></div>
|
510 |
+
<div class="row collapse"><div class="detail-description">
|
511 |
+
<p class="long_description"></p>
|
512 |
+
<table class="table table-bordered"><tr>
|
513 |
+
<th>since</th>
|
514 |
+
<td>0.30</td>
|
515 |
+
</tr></table>
|
516 |
+
<h3>Parameters</h3>
|
517 |
+
<div class="subelement argument">
|
518 |
+
<h4>$tax_name</h4>
|
519 |
+
<code>string</code><p>Taxonomy name, e.g., attachment_category</p></div>
|
520 |
+
<div class="subelement argument">
|
521 |
+
<h4>$support_type</h4>
|
522 |
+
<code>string</code><p>Optional. 'support' (default), 'quick-edit' or 'filter'</p>
|
523 |
+
</div>
|
524 |
+
<h3>Returns</h3>
|
525 |
+
<div class="subelement response">
|
526 |
+
<code>boolean</code><code>string</code>true if the taxonomy is supported in this way else false string if $tax_name is '' and $support_type is 'filter', returns the taxonomy to filter by</div>
|
527 |
+
</div></div>
|
528 |
+
</div>
|
529 |
+
<a name="mla_update_attachment_metadata_filter" id="mla_update_attachment_metadata_filter"></a><div class="element clickable method public mla_update_attachment_metadata_filter" data-toggle="collapse" data-target=".mla_update_attachment_metadata_filter .collapse">
|
530 |
+
<h2>Perform Custom Field mapping on just-inserted or updated attachment</h2>
|
531 |
+
<pre>mla_update_attachment_metadata_filter(array $data, integer $post_id) : void</pre>
|
532 |
+
<div class="labels"></div>
|
533 |
+
<div class="row collapse"><div class="detail-description">
|
534 |
+
<p class="long_description"></p>
|
535 |
+
<table class="table table-bordered"><tr>
|
536 |
+
<th>since</th>
|
537 |
+
<td>1.10</td>
|
538 |
+
</tr></table>
|
539 |
+
<h3>Parameters</h3>
|
540 |
+
<div class="subelement argument">
|
541 |
+
<h4>$data</h4>
|
542 |
+
<code>array</code><p>Attachment metadata for just-inserted attachment</p>
|
543 |
+
</div>
|
544 |
+
<div class="subelement argument">
|
545 |
+
<h4>$post_id</h4>
|
546 |
+
<code>integer</code><p>ID of just-inserted attachment</p>
|
547 |
+
</div>
|
548 |
+
</div></div>
|
549 |
+
</div>
|
550 |
+
<a name="mla_update_option" id="mla_update_option"></a><div class="element clickable method public mla_update_option" data-toggle="collapse" data-target=".mla_update_option .collapse">
|
551 |
+
<h2>Add or update the stored value of a defined MLA option</h2>
|
552 |
+
<pre>mla_update_option(string $option, mixed $newvalue) : boolean</pre>
|
553 |
+
<div class="labels"></div>
|
554 |
+
<div class="row collapse"><div class="detail-description">
|
555 |
+
<p class="long_description"></p>
|
556 |
+
<table class="table table-bordered"><tr>
|
557 |
+
<th>since</th>
|
558 |
+
<td>0.1</td>
|
559 |
+
</tr></table>
|
560 |
+
<h3>Parameters</h3>
|
561 |
+
<div class="subelement argument">
|
562 |
+
<h4>$option</h4>
|
563 |
+
<code>string</code><p>Name of the desired option</p></div>
|
564 |
+
<div class="subelement argument">
|
565 |
+
<h4>$newvalue</h4>
|
566 |
+
<code>mixed</code><p>New value for the desired option</p></div>
|
567 |
+
<h3>Returns</h3>
|
568 |
+
<div class="subelement response">
|
569 |
+
<code>boolean</code>True if the value was changed or false if the update failed</div>
|
570 |
+
</div></div>
|
571 |
+
</div>
|
572 |
+
<a name="_compose_custom_field_option_list" id="_compose_custom_field_option_list"></a><div class="element clickable method private _compose_custom_field_option_list" data-toggle="collapse" data-target="._compose_custom_field_option_list .collapse">
|
573 |
+
<h2>Compose a Custom Field Options list with current selection</h2>
|
574 |
+
<pre>_compose_custom_field_option_list(string $selection) : string</pre>
|
575 |
+
<div class="labels"></div>
|
576 |
+
<div class="row collapse"><div class="detail-description">
|
577 |
+
<p class="long_description"></p>
|
578 |
+
<table class="table table-bordered">
|
579 |
+
<tr>
|
580 |
+
<th>since</th>
|
581 |
+
<td>1.10</td>
|
582 |
+
</tr>
|
583 |
+
<tr>
|
584 |
+
<th>uses</th>
|
585 |
+
<td>\global\$mla_option_templates</td>
|
586 |
+
</tr>
|
587 |
+
</table>
|
588 |
+
<h3>Parameters</h3>
|
589 |
+
<div class="subelement argument">
|
590 |
+
<h4>$selection</h4>
|
591 |
+
<code>string</code><p>current selection or 'none' (default)</p>
|
592 |
+
</div>
|
593 |
+
<h3>Returns</h3>
|
594 |
+
<div class="subelement response">
|
595 |
+
<code>string</code>HTML markup with select field options</div>
|
596 |
+
</div></div>
|
597 |
+
</div>
|
598 |
+
<a name="_compose_data_source_option_list" id="_compose_data_source_option_list"></a><div class="element clickable method private _compose_data_source_option_list" data-toggle="collapse" data-target="._compose_data_source_option_list .collapse">
|
599 |
+
<h2>Compose a (Custom Field) Data Source Options list with current selection</h2>
|
600 |
+
<pre>_compose_data_source_option_list(string $selection) : string</pre>
|
601 |
+
<div class="labels"></div>
|
602 |
+
<div class="row collapse"><div class="detail-description">
|
603 |
+
<p class="long_description"></p>
|
604 |
+
<table class="table table-bordered">
|
605 |
+
<tr>
|
606 |
+
<th>since</th>
|
607 |
+
<td>1.10</td>
|
608 |
+
</tr>
|
609 |
+
<tr>
|
610 |
+
<th>uses</th>
|
611 |
+
<td>\global\$mla_option_templates</td>
|
612 |
+
</tr>
|
613 |
+
</table>
|
614 |
+
<h3>Parameters</h3>
|
615 |
+
<div class="subelement argument">
|
616 |
+
<h4>$selection</h4>
|
617 |
+
<code>string</code><p>current selection or 'none' (default)</p>
|
618 |
+
</div>
|
619 |
+
<h3>Returns</h3>
|
620 |
+
<div class="subelement response">
|
621 |
+
<code>string</code>HTML markup with select field options</div>
|
622 |
+
</div></div>
|
623 |
+
</div>
|
624 |
+
<a name="_compose_iptc_option_list" id="_compose_iptc_option_list"></a><div class="element clickable method private _compose_iptc_option_list" data-toggle="collapse" data-target="._compose_iptc_option_list .collapse">
|
625 |
+
<h2>Compose an IPTC Options list with current selection</h2>
|
626 |
+
<pre>_compose_iptc_option_list(string $selection) : string</pre>
|
627 |
+
<div class="labels"></div>
|
628 |
+
<div class="row collapse"><div class="detail-description">
|
629 |
+
<p class="long_description"></p>
|
630 |
+
<table class="table table-bordered">
|
631 |
+
<tr>
|
632 |
+
<th>since</th>
|
633 |
+
<td>1.00</td>
|
634 |
+
</tr>
|
635 |
+
<tr>
|
636 |
+
<th>uses</th>
|
637 |
+
<td>\global\$mla_option_templates</td>
|
638 |
+
</tr>
|
639 |
+
</table>
|
640 |
+
<h3>Parameters</h3>
|
641 |
+
<div class="subelement argument">
|
642 |
+
<h4>$selection</h4>
|
643 |
+
<code>string</code><p>current selection or 'none' (default)</p>
|
644 |
+
</div>
|
645 |
+
<h3>Returns</h3>
|
646 |
+
<div class="subelement response">
|
647 |
+
<code>string</code>HTML markup with select field options</div>
|
648 |
+
</div></div>
|
649 |
+
</div>
|
650 |
+
<a name="_compose_parent_option_list" id="_compose_parent_option_list"></a><div class="element clickable method private _compose_parent_option_list" data-toggle="collapse" data-target="._compose_parent_option_list .collapse">
|
651 |
+
<h2>Compose an hierarchical taxonomy Parent options list with current selection</h2>
|
652 |
+
<pre>_compose_parent_option_list(string $taxonomy, integer $selection) : string</pre>
|
653 |
+
<div class="labels"></div>
|
654 |
+
<div class="row collapse"><div class="detail-description">
|
655 |
+
<p class="long_description"></p>
|
656 |
+
<table class="table table-bordered">
|
657 |
+
<tr>
|
658 |
+
<th>since</th>
|
659 |
+
<td>1.00</td>
|
660 |
+
</tr>
|
661 |
+
<tr>
|
662 |
+
<th>uses</th>
|
663 |
+
<td>\global\$mla_option_templates</td>
|
664 |
+
</tr>
|
665 |
+
</table>
|
666 |
+
<h3>Parameters</h3>
|
667 |
+
<div class="subelement argument">
|
668 |
+
<h4>$taxonomy</h4>
|
669 |
+
<code>string</code><p>taxonomy slug</p></div>
|
670 |
+
<div class="subelement argument">
|
671 |
+
<h4>$selection</h4>
|
672 |
+
<code>integer</code><p>current selection or 0 (zero, default)</p>
|
673 |
+
</div>
|
674 |
+
<h3>Returns</h3>
|
675 |
+
<div class="subelement response">
|
676 |
+
<code>string</code>HTML markup with select field options</div>
|
677 |
+
</div></div>
|
678 |
+
</div>
|
679 |
+
<a name="_evaluate_data_source" id="_evaluate_data_source"></a><div class="element clickable method private _evaluate_data_source" data-toggle="collapse" data-target="._evaluate_data_source .collapse">
|
680 |
+
<h2>Evaluate custom field mapping data source</h2>
|
681 |
+
<pre>_evaluate_data_source(integer $post_id, string $category, string $data_source, string $format, array $attachment_metadata) : string</pre>
|
682 |
+
<div class="labels"></div>
|
683 |
+
<div class="row collapse"><div class="detail-description">
|
684 |
+
<p class="long_description"></p>
|
685 |
+
<table class="table table-bordered"><tr>
|
686 |
+
<th>since</th>
|
687 |
+
<td>1.10</td>
|
688 |
+
</tr></table>
|
689 |
+
<h3>Parameters</h3>
|
690 |
+
<div class="subelement argument">
|
691 |
+
<h4>$post_id</h4>
|
692 |
+
<code>integer</code><p>post->ID of attachment</p>
|
693 |
+
</div>
|
694 |
+
<div class="subelement argument">
|
695 |
+
<h4>$category</h4>
|
696 |
+
<code>string</code><p>category/scope to evaluate against: custom_field_mapping or single_attachment_mapping</p>
|
697 |
+
</div>
|
698 |
+
<div class="subelement argument">
|
699 |
+
<h4>$data_source</h4>
|
700 |
+
<code>string</code><p>data source name</p></div>
|
701 |
+
<div class="subelement argument">
|
702 |
+
<h4>$format</h4>
|
703 |
+
<code>string</code><p>desired results format, default 'native'</p>
|
704 |
+
</div>
|
705 |
+
<div class="subelement argument">
|
706 |
+
<h4>$attachment_metadata</h4>
|
707 |
+
<code>array</code><p>(optional) attachment_metadata, default NULL (use current postmeta database value)</p>
|
708 |
+
</div>
|
709 |
+
<h3>Returns</h3>
|
710 |
+
<div class="subelement response">
|
711 |
+
<code>string</code>data source value</div>
|
712 |
+
</div></div>
|
713 |
+
</div>
|
714 |
+
<a name="_evaluate_file_information" id="_evaluate_file_information"></a><div class="element clickable method private _evaluate_file_information" data-toggle="collapse" data-target="._evaluate_file_information .collapse">
|
715 |
+
<h2>Evaluate file information for custom field mapping</h2>
|
716 |
+
<pre>_evaluate_file_information(string $upload_dir, array $wp_attached_files, array $wp_attachment_metadata, integer $post_id) : array</pre>
|
717 |
+
<div class="labels"></div>
|
718 |
+
<div class="row collapse"><div class="detail-description">
|
719 |
+
<p class="long_description"></p>
|
720 |
+
<table class="table table-bordered"><tr>
|
721 |
+
<th>since</th>
|
722 |
+
<td>1.10</td>
|
723 |
+
</tr></table>
|
724 |
+
<h3>Parameters</h3>
|
725 |
+
<div class="subelement argument">
|
726 |
+
<h4>$upload_dir</h4>
|
727 |
+
<code>string</code><p>absolute path the the uploads base directory</p></div>
|
728 |
+
<div class="subelement argument">
|
729 |
+
<h4>$wp_attached_files</h4>
|
730 |
+
<code>array</code><p>_wp_attached_file meta_value array, indexed by post_id</p></div>
|
731 |
+
<div class="subelement argument">
|
732 |
+
<h4>$wp_attachment_metadata</h4>
|
733 |
+
<code>array</code><p>_wp_attachment_metadata meta_value array, indexed by post_id</p></div>
|
734 |
+
<div class="subelement argument">
|
735 |
+
<h4>$post_id</h4>
|
736 |
+
<code>integer</code><p>post->ID of attachment</p>
|
737 |
+
</div>
|
738 |
+
<h3>Returns</h3>
|
739 |
+
<div class="subelement response">
|
740 |
+
<code>array</code>absolute_path, base_file, path, file_name, extension, dimensions, width, height, hwstring_small, array of intermediate sizes</div>
|
741 |
+
</div></div>
|
742 |
+
</div>
|
743 |
+
<a name="_get_custom_field_names" id="_get_custom_field_names"></a><div class="element clickable method private _get_custom_field_names" data-toggle="collapse" data-target="._get_custom_field_names .collapse">
|
744 |
+
<h2>Generate a list of all (post) Custom Field names</h2>
|
745 |
+
<pre>_get_custom_field_names() : array</pre>
|
746 |
+
<div class="labels"></div>
|
747 |
+
<div class="row collapse"><div class="detail-description">
|
748 |
+
<p class="long_description"></p>
|
749 |
+
<table class="table table-bordered"><tr>
|
750 |
+
<th>since</th>
|
751 |
+
<td>1.00</td>
|
752 |
+
</tr></table>
|
753 |
+
<h3>Returns</h3>
|
754 |
+
<div class="subelement response">
|
755 |
+
<code>array</code>Custom field names from the postmeta table</div>
|
756 |
+
</div></div>
|
757 |
+
</div>
|
758 |
+
<a name="_load_option_templates" id="_load_option_templates"></a><div class="element clickable method private _load_option_templates" data-toggle="collapse" data-target="._load_option_templates .collapse">
|
759 |
+
<h2>Load style and markup templates to $mla_templates</h2>
|
760 |
+
<pre>_load_option_templates() : void</pre>
|
761 |
+
<div class="labels"></div>
|
762 |
+
<div class="row collapse"><div class="detail-description">
|
763 |
+
<p class="long_description"></p>
|
764 |
+
<table class="table table-bordered"><tr>
|
765 |
+
<th>since</th>
|
766 |
+
<td>0.80</td>
|
767 |
+
</tr></table>
|
768 |
+
</div></div>
|
769 |
+
</div>
|
770 |
+
<a name="_update_custom_field_mapping" id="_update_custom_field_mapping"></a><div class="element clickable method private _update_custom_field_mapping" data-toggle="collapse" data-target="._update_custom_field_mapping .collapse">
|
771 |
+
<h2>Update custom field mappings</h2>
|
772 |
+
<pre>_update_custom_field_mapping(array $current_values, array $new_values) : array</pre>
|
773 |
+
<div class="labels"></div>
|
774 |
+
<div class="row collapse"><div class="detail-description">
|
775 |
+
<p class="long_description"></p>
|
776 |
+
<table class="table table-bordered"><tr>
|
777 |
+
<th>since</th>
|
778 |
+
<td>1.10</td>
|
779 |
+
</tr></table>
|
780 |
+
<h3>Parameters</h3>
|
781 |
+
<div class="subelement argument">
|
782 |
+
<h4>$current_values</h4>
|
783 |
+
<code>array</code><p>current custom_field_mapping values</p></div>
|
784 |
+
<div class="subelement argument">
|
785 |
+
<h4>$new_values</h4>
|
786 |
+
<code>array</code><p>new values</p></div>
|
787 |
+
<h3>Returns</h3>
|
788 |
+
<div class="subelement response">
|
789 |
+
<code>array</code>( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )</div>
|
790 |
+
</div></div>
|
791 |
+
</div>
|
792 |
+
<a name="_update_iptc_exif_custom_mapping" id="_update_iptc_exif_custom_mapping"></a><div class="element clickable method private _update_iptc_exif_custom_mapping" data-toggle="collapse" data-target="._update_iptc_exif_custom_mapping .collapse">
|
793 |
+
<h2>Update Custom field portion of IPTC/EXIF mappings</h2>
|
794 |
+
<pre>_update_iptc_exif_custom_mapping(array $current_values, array $new_values) : array</pre>
|
795 |
+
<div class="labels"></div>
|
796 |
+
<div class="row collapse"><div class="detail-description">
|
797 |
+
<p class="long_description"></p>
|
798 |
+
<table class="table table-bordered"><tr>
|
799 |
+
<th>since</th>
|
800 |
+
<td>1.00</td>
|
801 |
+
</tr></table>
|
802 |
+
<h3>Parameters</h3>
|
803 |
+
<div class="subelement argument">
|
804 |
+
<h4>$current_values</h4>
|
805 |
+
<code>array</code><p>current iptc_exif_mapping values</p></div>
|
806 |
+
<div class="subelement argument">
|
807 |
+
<h4>$new_values</h4>
|
808 |
+
<code>array</code><p>new values</p></div>
|
809 |
+
<h3>Returns</h3>
|
810 |
+
<div class="subelement response">
|
811 |
+
<code>array</code>( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )</div>
|
812 |
+
</div></div>
|
813 |
+
</div>
|
814 |
+
<a name="_update_iptc_exif_standard_mapping" id="_update_iptc_exif_standard_mapping"></a><div class="element clickable method private _update_iptc_exif_standard_mapping" data-toggle="collapse" data-target="._update_iptc_exif_standard_mapping .collapse">
|
815 |
+
<h2>Update Standard field portion of IPTC/EXIF mappings</h2>
|
816 |
+
<pre>_update_iptc_exif_standard_mapping(array $current_values, array $new_values) : array</pre>
|
817 |
+
<div class="labels"></div>
|
818 |
+
<div class="row collapse"><div class="detail-description">
|
819 |
+
<p class="long_description"></p>
|
820 |
+
<table class="table table-bordered"><tr>
|
821 |
+
<th>since</th>
|
822 |
+
<td>1.00</td>
|
823 |
+
</tr></table>
|
824 |
+
<h3>Parameters</h3>
|
825 |
+
<div class="subelement argument">
|
826 |
+
<h4>$current_values</h4>
|
827 |
+
<code>array</code><p>current iptc_exif_mapping values</p></div>
|
828 |
+
<div class="subelement argument">
|
829 |
+
<h4>$new_values</h4>
|
830 |
+
<code>array</code><p>new values</p></div>
|
831 |
+
<h3>Returns</h3>
|
832 |
+
<div class="subelement response">
|
833 |
+
<code>array</code>( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )</div>
|
834 |
+
</div></div>
|
835 |
+
</div>
|
836 |
+
<a name="_update_iptc_exif_taxonomy_mapping" id="_update_iptc_exif_taxonomy_mapping"></a><div class="element clickable method private _update_iptc_exif_taxonomy_mapping" data-toggle="collapse" data-target="._update_iptc_exif_taxonomy_mapping .collapse">
|
837 |
+
<h2>Update Taxonomy term portion of IPTC/EXIF mappings</h2>
|
838 |
+
<pre>_update_iptc_exif_taxonomy_mapping(array $current_values, array $new_values) : array</pre>
|
839 |
+
<div class="labels"></div>
|
840 |
+
<div class="row collapse"><div class="detail-description">
|
841 |
+
<p class="long_description"></p>
|
842 |
+
<table class="table table-bordered"><tr>
|
843 |
+
<th>since</th>
|
844 |
+
<td>1.00</td>
|
845 |
+
</tr></table>
|
846 |
+
<h3>Parameters</h3>
|
847 |
+
<div class="subelement argument">
|
848 |
+
<h4>$current_values</h4>
|
849 |
+
<code>array</code><p>current iptc_exif_mapping values</p></div>
|
850 |
+
<div class="subelement argument">
|
851 |
+
<h4>$new_values</h4>
|
852 |
+
<code>array</code><p>new values</p></div>
|
853 |
+
<h3>Returns</h3>
|
854 |
+
<div class="subelement response">
|
855 |
+
<code>array</code>( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )</div>
|
856 |
+
</div></div>
|
857 |
+
</div>
|
858 |
+
<h3>
|
859 |
+
<i class="icon-custom icon-property"></i> Properties</h3>
|
860 |
+
<a name="%24mla_option_definitions" id="$mla_option_definitions"> </a><div class="element clickable property public $mla_option_definitions" data-toggle="collapse" data-target=".$mla_option_definitions .collapse">
|
861 |
+
<h2>$mla_option_definitions defines the database options and admin page areas for setting/updating them.</h2>
|
862 |
+
<pre>$mla_option_definitions </pre>
|
863 |
+
<div class="labels"></div>
|
864 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"><p>Each option is defined by an array with the following elements:</p>
|
865 |
+
|
866 |
+
<p>array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
|
867 |
+
|
868 |
+
<p>tab => Settings page tab id for the option
|
869 |
+
name => admin page label or heading text
|
870 |
+
type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea', 'custom', 'hidden'
|
871 |
+
std => default value
|
872 |
+
help => help text
|
873 |
+
size => text size, default 40
|
874 |
+
cols => textbox columns, default 90
|
875 |
+
rows => textbox rows, default 5
|
876 |
+
options => array of radio or select option values
|
877 |
+
texts => array of radio or select option display texts
|
878 |
+
render => rendering function for 'custom' options. Usage:
|
879 |
+
$options_list .= ['render']( 'render', $key, $value );
|
880 |
+
update => update function for 'custom' options; returns nothing. Usage:
|
881 |
+
$message = ['update']( 'update', $key, $value, $_REQUEST );
|
882 |
+
delete => delete function for 'custom' options; returns nothing. Usage:
|
883 |
+
$message = ['delete']( 'delete', $key, $value, $_REQUEST );
|
884 |
+
reset => reset function for 'custom' options; returns nothing. Usage:
|
885 |
+
$message = ['reset']( 'reset', $key, $value, $_REQUEST );</p></p></div></div>
|
886 |
+
</div>
|
887 |
+
<a name="%24process_featured_in" id="$process_featured_in"> </a><div class="element clickable property public $process_featured_in" data-toggle="collapse" data-target=".$process_featured_in .collapse">
|
888 |
+
<h2>Option setting for "Featured in" reporting</h2>
|
889 |
+
<pre>$process_featured_in : boolean</pre>
|
890 |
+
<div class="labels"></div>
|
891 |
+
<div class="row collapse"><div class="detail-description">
|
892 |
+
<p class="long_description"><p>This setting is false if the "Featured in" database access setting is "disabled", else true.</p></p>
|
893 |
+
<table class="table table-bordered"><tr>
|
894 |
+
<th>since</th>
|
895 |
+
<td>1.00</td>
|
896 |
+
</tr></table>
|
897 |
+
</div></div>
|
898 |
+
</div>
|
899 |
+
<a name="%24process_gallery_in" id="$process_gallery_in"> </a><div class="element clickable property public $process_gallery_in" data-toggle="collapse" data-target=".$process_gallery_in .collapse">
|
900 |
+
<h2>Option setting for "Gallery in" reporting</h2>
|
901 |
+
<pre>$process_gallery_in : boolean</pre>
|
902 |
+
<div class="labels"></div>
|
903 |
+
<div class="row collapse"><div class="detail-description">
|
904 |
+
<p class="long_description"><p>This setting is false if the "Gallery in" database access setting is "disabled", else true.</p></p>
|
905 |
+
<table class="table table-bordered"><tr>
|
906 |
+
<th>since</th>
|
907 |
+
<td>1.00</td>
|
908 |
+
</tr></table>
|
909 |
+
</div></div>
|
910 |
+
</div>
|
911 |
+
<a name="%24process_inserted_in" id="$process_inserted_in"> </a><div class="element clickable property public $process_inserted_in" data-toggle="collapse" data-target=".$process_inserted_in .collapse">
|
912 |
+
<h2>Option setting for "Inserted in" reporting</h2>
|
913 |
+
<pre>$process_inserted_in : boolean</pre>
|
914 |
+
<div class="labels"></div>
|
915 |
+
<div class="row collapse"><div class="detail-description">
|
916 |
+
<p class="long_description"><p>This setting is false if the "Inserted in" database access setting is "disabled", else true.</p></p>
|
917 |
+
<table class="table table-bordered"><tr>
|
918 |
+
<th>since</th>
|
919 |
+
<td>1.00</td>
|
920 |
+
</tr></table>
|
921 |
+
</div></div>
|
922 |
+
</div>
|
923 |
+
<a name="%24process_mla_gallery_in" id="$process_mla_gallery_in"> </a><div class="element clickable property public $process_mla_gallery_in" data-toggle="collapse" data-target=".$process_mla_gallery_in .collapse">
|
924 |
+
<h2>Option setting for "MLA Gallery in" reporting</h2>
|
925 |
+
<pre>$process_mla_gallery_in : boolean</pre>
|
926 |
+
<div class="labels"></div>
|
927 |
+
<div class="row collapse"><div class="detail-description">
|
928 |
+
<p class="long_description"><p>This setting is false if the "MLA Gallery in" database access setting is "disabled", else true.</p></p>
|
929 |
+
<table class="table table-bordered"><tr>
|
930 |
+
<th>since</th>
|
931 |
+
<td>1.00</td>
|
932 |
+
</tr></table>
|
933 |
+
</div></div>
|
934 |
+
</div>
|
935 |
+
<a name="%24custom_field_data_sources" id="$custom_field_data_sources"> </a><div class="element clickable property private $custom_field_data_sources" data-toggle="collapse" data-target=".$custom_field_data_sources .collapse">
|
936 |
+
<h2>Array of Data Source names for custom field mapping</h2>
|
937 |
+
<pre>$custom_field_data_sources : array</pre>
|
938 |
+
<div class="labels"></div>
|
939 |
+
<div class="row collapse"><div class="detail-description">
|
940 |
+
<p class="long_description"></p>
|
941 |
+
<table class="table table-bordered"><tr>
|
942 |
+
<th>since</th>
|
943 |
+
<td>1.10</td>
|
944 |
+
</tr></table>
|
945 |
+
</div></div>
|
946 |
+
</div>
|
947 |
+
<a name="%24mla_option_templates" id="$mla_option_templates"> </a><div class="element clickable property private $mla_option_templates" data-toggle="collapse" data-target=".$mla_option_templates .collapse">
|
948 |
+
<h2>Style and Markup templates</h2>
|
949 |
+
<pre>$mla_option_templates : array</pre>
|
950 |
+
<div class="labels"></div>
|
951 |
+
<div class="row collapse"><div class="detail-description">
|
952 |
+
<p class="long_description"></p>
|
953 |
+
<table class="table table-bordered"><tr>
|
954 |
+
<th>since</th>
|
955 |
+
<td>0.80</td>
|
956 |
+
</tr></table>
|
957 |
+
</div></div>
|
958 |
+
</div>
|
959 |
+
<h3>
|
960 |
+
<i class="icon-custom icon-constant"></i> Constants</h3>
|
961 |
+
<a name="MLA_FEATURED_IN_TUNING" id="MLA_FEATURED_IN_TUNING"> </a><div class="element clickable constant MLA_FEATURED_IN_TUNING" data-toggle="collapse" data-target=".MLA_FEATURED_IN_TUNING .collapse">
|
962 |
+
<h2>Provides a unique name for a database tuning option</h2>
|
963 |
+
<pre>MLA_FEATURED_IN_TUNING </pre>
|
964 |
+
<div class="labels"></div>
|
965 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
966 |
+
</div>
|
967 |
+
<a name="MLA_GALLERY_IN_TUNING" id="MLA_GALLERY_IN_TUNING"> </a><div class="element clickable constant MLA_GALLERY_IN_TUNING" data-toggle="collapse" data-target=".MLA_GALLERY_IN_TUNING .collapse">
|
968 |
+
<h2>Provides a unique name for a database tuning option</h2>
|
969 |
+
<pre>MLA_GALLERY_IN_TUNING </pre>
|
970 |
+
<div class="labels"></div>
|
971 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
972 |
+
</div>
|
973 |
+
<a name="MLA_INSERTED_IN_TUNING" id="MLA_INSERTED_IN_TUNING"> </a><div class="element clickable constant MLA_INSERTED_IN_TUNING" data-toggle="collapse" data-target=".MLA_INSERTED_IN_TUNING .collapse">
|
974 |
+
<h2>Provides a unique name for a database tuning option</h2>
|
975 |
+
<pre>MLA_INSERTED_IN_TUNING </pre>
|
976 |
+
<div class="labels"></div>
|
977 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
978 |
+
</div>
|
979 |
+
<a name="MLA_MLA_GALLERY_IN_TUNING" id="MLA_MLA_GALLERY_IN_TUNING"> </a><div class="element clickable constant MLA_MLA_GALLERY_IN_TUNING" data-toggle="collapse" data-target=".MLA_MLA_GALLERY_IN_TUNING .collapse">
|
980 |
+
<h2>Provides a unique name for a database tuning option</h2>
|
981 |
+
<pre>MLA_MLA_GALLERY_IN_TUNING </pre>
|
982 |
+
<div class="labels"></div>
|
983 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
984 |
+
</div>
|
985 |
+
<a name="MLA_NEW_CUSTOM_FIELD" id="MLA_NEW_CUSTOM_FIELD"> </a><div class="element clickable constant MLA_NEW_CUSTOM_FIELD" data-toggle="collapse" data-target=".MLA_NEW_CUSTOM_FIELD .collapse">
|
986 |
+
<h2>Provides a unique name for the Custom Field "new field" key</h2>
|
987 |
+
<pre>MLA_NEW_CUSTOM_FIELD </pre>
|
988 |
+
<div class="labels"></div>
|
989 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
990 |
+
</div>
|
991 |
+
<a name="MLA_NEW_CUSTOM_RULE" id="MLA_NEW_CUSTOM_RULE"> </a><div class="element clickable constant MLA_NEW_CUSTOM_RULE" data-toggle="collapse" data-target=".MLA_NEW_CUSTOM_RULE .collapse">
|
992 |
+
<h2>Provides a unique name for the Custom Field "new rule" key</h2>
|
993 |
+
<pre>MLA_NEW_CUSTOM_RULE </pre>
|
994 |
+
<div class="labels"></div>
|
995 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
996 |
+
</div>
|
997 |
+
<a name="MLA_VERSION_OPTION" id="MLA_VERSION_OPTION"> </a><div class="element clickable constant MLA_VERSION_OPTION" data-toggle="collapse" data-target=".MLA_VERSION_OPTION .collapse">
|
998 |
+
<h2>Provides a unique name for the current version option</h2>
|
999 |
+
<pre>MLA_VERSION_OPTION </pre>
|
1000 |
+
<div class="labels"></div>
|
1001 |
+
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
1002 |
+
</div>
|
1003 |
+
</div>
|
1004 |
+
</div>
|
1005 |
+
</div>
|
1006 |
+
</div>
|
1007 |
+
<div class="row"><footer class="span12">
|
1008 |
+
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
1009 |
+
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
1010 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
1011 |
+
</div>
|
1012 |
+
</body>
|
1013 |
+
</html>
|
phpDocs/classes/MLASettings.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -56,24 +53,51 @@
|
|
56 |
<li class="nav-header">
|
57 |
<i class="icon-custom icon-method"></i> Methods</li>
|
58 |
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
|
|
59 |
<li class="method public "><a href="#mla_add_plugin_settings_link" title='mla_add_plugin_settings_link :: Add the "Settings" link to the MLA entry in the Plugins section'><span class="description">Add the "Settings" link to the MLA entry in the Plugins section</span><pre>mla_add_plugin_settings_link()</pre></a></li>
|
60 |
<li class="method public "><a href="#mla_admin_menu_action" title='mla_admin_menu_action :: Add settings page in the "Settings" section,
|
61 |
add settings link in the Plugins section entry for MLA.'><span class="description">Add settings page in the "Settings" section,
|
62 |
add settings link in the Plugins section entry for MLA.</span><pre>mla_admin_menu_action()</pre></a></li>
|
63 |
-
<li class="method public "><a href="#
|
64 |
-
<li class="method public "><a href="#
|
65 |
-
<li class="method public "><a href="#mla_render_settings_page" title='mla_render_settings_page :: Render the "Media Library Assistant" subpage in the Settings section'><span class="description">Render the "Media Library Assistant" subpage in the Settings section</span><pre>mla_render_settings_page()</pre></a></li>
|
66 |
-
<li class="method public "><a href="#mla_update_option" title="mla_update_option :: Add or update the stored value of a defined MLA option"><span class="description">Add or update the stored value of a defined MLA option</span><pre>mla_update_option()</pre></a></li>
|
67 |
<li class="nav-header private">» Private</li>
|
68 |
-
<li class="method private "><a href="#
|
69 |
-
<li class="method private "><a href="#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
<li class="nav-header">
|
71 |
<i class="icon-custom icon-property"></i> Properties</li>
|
72 |
<li class="nav-header private">» Private</li>
|
73 |
-
<li class="property private "><a href="#%
|
|
|
|
|
|
|
74 |
<li class="nav-header">
|
75 |
<i class="icon-custom icon-constant"></i> Constants</li>
|
76 |
-
<li class="constant "><a href="#MLA_SETTINGS_SLUG" title="MLA_SETTINGS_SLUG :: Provides a unique name for the settings page
|
77 |
</ul>
|
78 |
</div>
|
79 |
<div class="span8">
|
@@ -87,8 +111,7 @@ add settings link in the Plugins section entry for MLA.</span><pre>mla_admin_men
|
|
87 |
</li>
|
88 |
</ul>
|
89 |
<div href="../classes/MLASettings.html" class="element class">
|
90 |
-
<p class="short_description">Class MLA (Media Library Assistant) Settings
|
91 |
-
and provides the settings page to edit them.</p>
|
92 |
<div class="details">
|
93 |
<p class="long_description"></p>
|
94 |
<table class="table table-bordered">
|
@@ -105,7 +128,7 @@ and provides the settings page to edit them.</p>
|
|
105 |
<i class="icon-custom icon-method"></i> Methods</h3>
|
106 |
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
107 |
<h2>Initialization function, similar to __construct()</h2>
|
108 |
-
<pre>initialize() </pre>
|
109 |
<div class="labels"></div>
|
110 |
<div class="row collapse"><div class="detail-description">
|
111 |
<p class="long_description"></p>
|
@@ -115,6 +138,18 @@ and provides the settings page to edit them.</p>
|
|
115 |
</tr></table>
|
116 |
</div></div>
|
117 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
<a name="mla_add_plugin_settings_link" id="mla_add_plugin_settings_link"></a><div class="element clickable method public mla_add_plugin_settings_link" data-toggle="collapse" data-target=".mla_add_plugin_settings_link .collapse">
|
119 |
<h2>Add the "Settings" link to the MLA entry in the Plugins section</h2>
|
120 |
<pre>mla_add_plugin_settings_link(array $links, string $file) : array</pre>
|
@@ -141,7 +176,7 @@ and provides the settings page to edit them.</p>
|
|
141 |
<a name="mla_admin_menu_action" id="mla_admin_menu_action"></a><div class="element clickable method public mla_admin_menu_action" data-toggle="collapse" data-target=".mla_admin_menu_action .collapse">
|
142 |
<h2>Add settings page in the "Settings" section,
|
143 |
add settings link in the Plugins section entry for MLA.</h2>
|
144 |
-
<pre>mla_admin_menu_action() </pre>
|
145 |
<div class="labels"></div>
|
146 |
<div class="row collapse"><div class="detail-description">
|
147 |
<p class="long_description"></p>
|
@@ -151,9 +186,21 @@ add settings link in the Plugins section entry for MLA.</h2>
|
|
151 |
</tr></table>
|
152 |
</div></div>
|
153 |
</div>
|
154 |
-
<a name="
|
155 |
-
<h2>
|
156 |
-
<pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
<div class="labels"></div>
|
158 |
<div class="row collapse"><div class="detail-description">
|
159 |
<p class="long_description"></p>
|
@@ -161,74 +208,283 @@ add settings link in the Plugins section entry for MLA.</h2>
|
|
161 |
<th>since</th>
|
162 |
<td>0.1</td>
|
163 |
</tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
<h3>Parameters</h3>
|
165 |
<div class="subelement argument">
|
166 |
-
<h4>$
|
167 |
-
<code>string</code><p>
|
|
|
|
|
|
|
|
|
|
|
168 |
<h3>Returns</h3>
|
169 |
<div class="subelement response">
|
170 |
-
<code>
|
171 |
</div></div>
|
172 |
</div>
|
173 |
-
<a name="
|
174 |
-
<h2>
|
175 |
-
<pre>
|
176 |
<div class="labels"></div>
|
177 |
<div class="row collapse"><div class="detail-description">
|
178 |
<p class="long_description"></p>
|
179 |
-
<table class="table table-bordered"
|
|
|
180 |
<th>since</th>
|
181 |
-
<td>0.
|
182 |
-
</tr
|
|
|
|
|
|
|
|
|
|
|
183 |
<h3>Parameters</h3>
|
184 |
<div class="subelement argument">
|
185 |
-
<h4>$
|
186 |
-
<code>string</code><p>
|
|
|
187 |
<h3>Returns</h3>
|
188 |
<div class="subelement response">
|
189 |
-
<code>
|
190 |
</div></div>
|
191 |
</div>
|
192 |
-
<a name="
|
193 |
-
<h2>
|
194 |
-
<pre>
|
195 |
<div class="labels"></div>
|
196 |
<div class="row collapse"><div class="detail-description">
|
197 |
<p class="long_description"></p>
|
198 |
<table class="table table-bordered"><tr>
|
199 |
<th>since</th>
|
200 |
-
<td>
|
201 |
</tr></table>
|
|
|
|
|
|
|
|
|
202 |
<h3>Returns</h3>
|
203 |
<div class="subelement response">
|
204 |
-
<code
|
205 |
</div></div>
|
206 |
</div>
|
207 |
-
<a name="
|
208 |
-
<h2>
|
209 |
-
|
|
|
210 |
<div class="labels"></div>
|
211 |
<div class="row collapse"><div class="detail-description">
|
212 |
<p class="long_description"></p>
|
213 |
-
<table class="table table-bordered"
|
|
|
214 |
<th>since</th>
|
215 |
-
<td>
|
216 |
-
</tr
|
|
|
|
|
|
|
|
|
|
|
217 |
<h3>Parameters</h3>
|
218 |
<div class="subelement argument">
|
219 |
-
<h4>$
|
220 |
-
<code>
|
221 |
-
<div class="subelement argument">
|
222 |
-
<h4>$newvalue</h4>
|
223 |
-
<code>mixed</code><p>New value for the desired option</p></div>
|
224 |
<h3>Returns</h3>
|
225 |
<div class="subelement response">
|
226 |
-
<code>
|
227 |
</div></div>
|
228 |
</div>
|
229 |
-
<a name="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
<h2>Delete saved settings, restoring default values</h2>
|
231 |
-
<pre>
|
232 |
<div class="labels"></div>
|
233 |
<div class="row collapse"><div class="detail-description">
|
234 |
<p class="long_description"></p>
|
@@ -236,59 +492,177 @@ add settings link in the Plugins section entry for MLA.</h2>
|
|
236 |
<th>since</th>
|
237 |
<td>0.1</td>
|
238 |
</tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
<h3>Parameters</h3>
|
240 |
<div class="subelement argument">
|
241 |
-
<h4>$
|
242 |
-
<code>array</code><p
|
|
|
|
|
|
|
|
|
243 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
<h3>Returns</h3>
|
245 |
<div class="subelement response">
|
246 |
-
<code>array</code>Message(s) reflecting the results of the operation
|
247 |
</div></div>
|
248 |
</div>
|
249 |
-
<a name="
|
250 |
-
<h2>Save settings to the options table</h2>
|
251 |
-
<pre>
|
252 |
<div class="labels"></div>
|
253 |
<div class="row collapse"><div class="detail-description">
|
254 |
<p class="long_description"></p>
|
255 |
-
<table class="table table-bordered"
|
|
|
256 |
<th>since</th>
|
257 |
<td>0.1</td>
|
258 |
-
</tr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
<h3>Parameters</h3>
|
260 |
<div class="subelement argument">
|
261 |
-
<h4>$
|
262 |
-
<code>
|
|
|
|
|
|
|
|
|
263 |
</div>
|
264 |
<h3>Returns</h3>
|
265 |
<div class="subelement response">
|
266 |
-
<code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
</div></div>
|
268 |
</div>
|
269 |
<h3>
|
270 |
<i class="icon-custom icon-property"></i> Properties</h3>
|
271 |
-
<a name="%
|
272 |
-
<h2
|
273 |
-
|
|
|
274 |
<div class="labels"></div>
|
275 |
-
<div class="row collapse"><div class="detail-description"
|
276 |
-
|
277 |
-
<p>array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
|
278 |
|
279 |
-
<p>
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
</div>
|
288 |
<h3>
|
289 |
<i class="icon-custom icon-constant"></i> Constants</h3>
|
290 |
<a name="MLA_SETTINGS_SLUG" id="MLA_SETTINGS_SLUG"> </a><div class="element clickable constant MLA_SETTINGS_SLUG" data-toggle="collapse" data-target=".MLA_SETTINGS_SLUG .collapse">
|
291 |
-
<h2>Provides a unique name for the settings page
|
292 |
<pre>MLA_SETTINGS_SLUG </pre>
|
293 |
<div class="labels"></div>
|
294 |
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
@@ -300,7 +674,7 @@ options => array of radio or select option values</p></p></div></div>
|
|
300 |
<div class="row"><footer class="span12">
|
301 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
302 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
303 |
-
generated on
|
304 |
</div>
|
305 |
</body>
|
306 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLASettings</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
53 |
<li class="nav-header">
|
54 |
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
+
<li class="method public "><a href="#mla_activation_hook" title="mla_activation_hook :: Perform one-time actions on plugin activation"><span class="description">Perform one-time actions on plugin activation</span><pre>mla_activation_hook()</pre></a></li>
|
57 |
<li class="method public "><a href="#mla_add_plugin_settings_link" title='mla_add_plugin_settings_link :: Add the "Settings" link to the MLA entry in the Plugins section'><span class="description">Add the "Settings" link to the MLA entry in the Plugins section</span><pre>mla_add_plugin_settings_link()</pre></a></li>
|
58 |
<li class="method public "><a href="#mla_admin_menu_action" title='mla_admin_menu_action :: Add settings page in the "Settings" section,
|
59 |
add settings link in the Plugins section entry for MLA.'><span class="description">Add settings page in the "Settings" section,
|
60 |
add settings link in the Plugins section entry for MLA.</span><pre>mla_admin_menu_action()</pre></a></li>
|
61 |
+
<li class="method public "><a href="#mla_deactivation_hook" title="mla_deactivation_hook :: Perform one-time actions on plugin deactivation"><span class="description">Perform one-time actions on plugin deactivation</span><pre>mla_deactivation_hook()</pre></a></li>
|
62 |
+
<li class="method public "><a href="#mla_render_settings_page" title='mla_render_settings_page :: Render (echo) the "Media Library Assistant" subpage in the Settings section'><span class="description">Render (echo) the "Media Library Assistant" subpage in the Settings section</span><pre>mla_render_settings_page()</pre></a></li>
|
|
|
|
|
63 |
<li class="nav-header private">» Private</li>
|
64 |
+
<li class="method private "><a href="#_compose_custom_field_tab" title="_compose_custom_field_tab :: Compose the Custom Field tab content for the Settings subpage"><span class="description">Compose the Custom Field tab content for the Settings subpage</span><pre>_compose_custom_field_tab()</pre></a></li>
|
65 |
+
<li class="method private "><a href="#_compose_documentation_tab" title="_compose_documentation_tab :: Compose the Documentation tab content for the Settings subpage"><span class="description">Compose the Documentation tab content for the Settings subpage</span><pre>_compose_documentation_tab()</pre></a></li>
|
66 |
+
<li class="method private "><a href="#_compose_general_tab" title="_compose_general_tab :: Compose the General tab content for the Settings subpage"><span class="description">Compose the General tab content for the Settings subpage</span><pre>_compose_general_tab()</pre></a></li>
|
67 |
+
<li class="method private "><a href="#_compose_iptc_exif_tab" title="_compose_iptc_exif_tab :: Compose the IPTC/EXIF tab content for the Settings subpage"><span class="description">Compose the IPTC/EXIF tab content for the Settings subpage</span><pre>_compose_iptc_exif_tab()</pre></a></li>
|
68 |
+
<li class="method private "><a href="#_compose_mla_gallery_tab" title="_compose_mla_gallery_tab :: Compose the MLA Gallery tab content for the Settings subpage"><span class="description">Compose the MLA Gallery tab content for the Settings subpage</span><pre>_compose_mla_gallery_tab()</pre></a></li>
|
69 |
+
<li class="method private "><a href="#_compose_option_row" title="_compose_option_row :: Compose the table row for a single MLA option"><span class="description">Compose the table row for a single MLA option</span><pre>_compose_option_row()</pre></a></li>
|
70 |
+
<li class="method private "><a href="#_compose_settings_tabs" title="_compose_settings_tabs :: Compose the navigation tabs for the Settings subpage"><span class="description">Compose the navigation tabs for the Settings subpage</span><pre>_compose_settings_tabs()</pre></a></li>
|
71 |
+
<li class="method private "><a href="#_delete_custom_field" title="_delete_custom_field :: Delete a custom field from the wp_postmeta table"><span class="description">Delete a custom field from the wp_postmeta table</span><pre>_delete_custom_field()</pre></a></li>
|
72 |
+
<li class="method private "><a href="#_process_custom_field_mapping" title="_process_custom_field_mapping :: Process custom field settings against all image attachments
|
73 |
+
without saving the settings to the mla_option"><span class="description">Process custom field settings against all image attachments
|
74 |
+
without saving the settings to the mla_option</span><pre>_process_custom_field_mapping()</pre></a></li>
|
75 |
+
<li class="method private "><a href="#_process_iptc_exif_custom" title="_process_iptc_exif_custom :: Process IPTC/EXIF custom field settings against all image attachments
|
76 |
+
without saving the settings to the mla_option"><span class="description">Process IPTC/EXIF custom field settings against all image attachments
|
77 |
+
without saving the settings to the mla_option</span><pre>_process_iptc_exif_custom()</pre></a></li>
|
78 |
+
<li class="method private "><a href="#_process_iptc_exif_standard" title="_process_iptc_exif_standard :: Process IPTC/EXIF standard field settings against all image attachments
|
79 |
+
without saving the settings to the mla_option"><span class="description">Process IPTC/EXIF standard field settings against all image attachments
|
80 |
+
without saving the settings to the mla_option</span><pre>_process_iptc_exif_standard()</pre></a></li>
|
81 |
+
<li class="method private "><a href="#_process_iptc_exif_taxonomy" title="_process_iptc_exif_taxonomy :: Process IPTC/EXIF taxonomy term settings against all image attachments
|
82 |
+
without saving the settings to the mla_option"><span class="description">Process IPTC/EXIF taxonomy term settings against all image attachments
|
83 |
+
without saving the settings to the mla_option</span><pre>_process_iptc_exif_taxonomy()</pre></a></li>
|
84 |
+
<li class="method private "><a href="#_reset_general_settings" title="_reset_general_settings :: Delete saved settings, restoring default values"><span class="description">Delete saved settings, restoring default values</span><pre>_reset_general_settings()</pre></a></li>
|
85 |
+
<li class="method private "><a href="#_save_custom_field_settings" title="_save_custom_field_settings :: Save custom field settings to the options table"><span class="description">Save custom field settings to the options table</span><pre>_save_custom_field_settings()</pre></a></li>
|
86 |
+
<li class="method private "><a href="#_save_gallery_settings" title="_save_gallery_settings :: Save MLA Gallery settings to the options table"><span class="description">Save MLA Gallery settings to the options table</span><pre>_save_gallery_settings()</pre></a></li>
|
87 |
+
<li class="method private "><a href="#_save_general_settings" title="_save_general_settings :: Save General settings to the options table"><span class="description">Save General settings to the options table</span><pre>_save_general_settings()</pre></a></li>
|
88 |
+
<li class="method private "><a href="#_save_iptc_exif_settings" title="_save_iptc_exif_settings :: Save IPTC/EXIF settings to the options table"><span class="description">Save IPTC/EXIF settings to the options table</span><pre>_save_iptc_exif_settings()</pre></a></li>
|
89 |
+
<li class="method private "><a href="#_update_option_row" title="_update_option_row :: Update or delete a single MLA option value"><span class="description">Update or delete a single MLA option value</span><pre>_update_option_row()</pre></a></li>
|
90 |
+
<li class="method private "><a href="#_version_upgrade" title="_version_upgrade :: Database and option update check, for installing new versions"><span class="description">Database and option update check, for installing new versions</span><pre>_version_upgrade()</pre></a></li>
|
91 |
<li class="nav-header">
|
92 |
<i class="icon-custom icon-property"></i> Properties</li>
|
93 |
<li class="nav-header private">» Private</li>
|
94 |
+
<li class="property private "><a href="#%24mla_tablist" title="$mla_tablist :: Definitions for Settings page tab ids, titles and handlers
|
95 |
+
Each tab is defined by an array with the following elements:"><span class="description">Definitions for Settings page tab ids, titles and handlers
|
96 |
+
Each tab is defined by an array with the following elements:</span><pre>$mla_tablist</pre></a></li>
|
97 |
+
<li class="property private "><a href="#%24page_template_array" title="$page_template_array :: Template file for the Settings page(s) and parts"><span class="description">Template file for the Settings page(s) and parts</span><pre>$page_template_array</pre></a></li>
|
98 |
<li class="nav-header">
|
99 |
<i class="icon-custom icon-constant"></i> Constants</li>
|
100 |
+
<li class="constant "><a href="#MLA_SETTINGS_SLUG" title="MLA_SETTINGS_SLUG :: Provides a unique name for the settings page"><span class="description">Provides a unique name for the settings page</span><pre>MLA_SETTINGS_SLUG</pre></a></li>
|
101 |
</ul>
|
102 |
</div>
|
103 |
<div class="span8">
|
111 |
</li>
|
112 |
</ul>
|
113 |
<div href="../classes/MLASettings.html" class="element class">
|
114 |
+
<p class="short_description">Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings</p>
|
|
|
115 |
<div class="details">
|
116 |
<p class="long_description"></p>
|
117 |
<table class="table table-bordered">
|
128 |
<i class="icon-custom icon-method"></i> Methods</h3>
|
129 |
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
130 |
<h2>Initialization function, similar to __construct()</h2>
|
131 |
+
<pre>initialize() : void</pre>
|
132 |
<div class="labels"></div>
|
133 |
<div class="row collapse"><div class="detail-description">
|
134 |
<p class="long_description"></p>
|
138 |
</tr></table>
|
139 |
</div></div>
|
140 |
</div>
|
141 |
+
<a name="mla_activation_hook" id="mla_activation_hook"></a><div class="element clickable method public mla_activation_hook" data-toggle="collapse" data-target=".mla_activation_hook .collapse">
|
142 |
+
<h2>Perform one-time actions on plugin activation</h2>
|
143 |
+
<pre>mla_activation_hook() : void</pre>
|
144 |
+
<div class="labels"></div>
|
145 |
+
<div class="row collapse"><div class="detail-description">
|
146 |
+
<p class="long_description"><p>Adds a view to the database to support sorting the listing on 'ALT Text'.</p></p>
|
147 |
+
<table class="table table-bordered"><tr>
|
148 |
+
<th>since</th>
|
149 |
+
<td>0.40</td>
|
150 |
+
</tr></table>
|
151 |
+
</div></div>
|
152 |
+
</div>
|
153 |
<a name="mla_add_plugin_settings_link" id="mla_add_plugin_settings_link"></a><div class="element clickable method public mla_add_plugin_settings_link" data-toggle="collapse" data-target=".mla_add_plugin_settings_link .collapse">
|
154 |
<h2>Add the "Settings" link to the MLA entry in the Plugins section</h2>
|
155 |
<pre>mla_add_plugin_settings_link(array $links, string $file) : array</pre>
|
176 |
<a name="mla_admin_menu_action" id="mla_admin_menu_action"></a><div class="element clickable method public mla_admin_menu_action" data-toggle="collapse" data-target=".mla_admin_menu_action .collapse">
|
177 |
<h2>Add settings page in the "Settings" section,
|
178 |
add settings link in the Plugins section entry for MLA.</h2>
|
179 |
+
<pre>mla_admin_menu_action() : void</pre>
|
180 |
<div class="labels"></div>
|
181 |
<div class="row collapse"><div class="detail-description">
|
182 |
<p class="long_description"></p>
|
186 |
</tr></table>
|
187 |
</div></div>
|
188 |
</div>
|
189 |
+
<a name="mla_deactivation_hook" id="mla_deactivation_hook"></a><div class="element clickable method public mla_deactivation_hook" data-toggle="collapse" data-target=".mla_deactivation_hook .collapse">
|
190 |
+
<h2>Perform one-time actions on plugin deactivation</h2>
|
191 |
+
<pre>mla_deactivation_hook() : void</pre>
|
192 |
+
<div class="labels"></div>
|
193 |
+
<div class="row collapse"><div class="detail-description">
|
194 |
+
<p class="long_description"><p>Removes (if present) a view from the database that supports sorting the listing on 'ALT Text'.</p></p>
|
195 |
+
<table class="table table-bordered"><tr>
|
196 |
+
<th>since</th>
|
197 |
+
<td>0.40</td>
|
198 |
+
</tr></table>
|
199 |
+
</div></div>
|
200 |
+
</div>
|
201 |
+
<a name="mla_render_settings_page" id="mla_render_settings_page"></a><div class="element clickable method public mla_render_settings_page" data-toggle="collapse" data-target=".mla_render_settings_page .collapse">
|
202 |
+
<h2>Render (echo) the "Media Library Assistant" subpage in the Settings section</h2>
|
203 |
+
<pre>mla_render_settings_page() : void</pre>
|
204 |
<div class="labels"></div>
|
205 |
<div class="row collapse"><div class="detail-description">
|
206 |
<p class="long_description"></p>
|
208 |
<th>since</th>
|
209 |
<td>0.1</td>
|
210 |
</tr></table>
|
211 |
+
</div></div>
|
212 |
+
</div>
|
213 |
+
<a name="_compose_custom_field_tab" id="_compose_custom_field_tab"></a><div class="element clickable method private _compose_custom_field_tab" data-toggle="collapse" data-target="._compose_custom_field_tab .collapse">
|
214 |
+
<h2>Compose the Custom Field tab content for the Settings subpage</h2>
|
215 |
+
<pre>_compose_custom_field_tab() : array</pre>
|
216 |
+
<div class="labels"></div>
|
217 |
+
<div class="row collapse"><div class="detail-description">
|
218 |
+
<p class="long_description"></p>
|
219 |
+
<table class="table table-bordered">
|
220 |
+
<tr>
|
221 |
+
<th>since</th>
|
222 |
+
<td>1.10</td>
|
223 |
+
</tr>
|
224 |
+
<tr>
|
225 |
+
<th>uses</th>
|
226 |
+
<td>\global\$page_template_array</td>
|
227 |
+
</tr>
|
228 |
+
</table>
|
229 |
+
<h3>Returns</h3>
|
230 |
+
<div class="subelement response">
|
231 |
+
<code>array</code>'message' => status/error messages, 'body' => tab content</div>
|
232 |
+
</div></div>
|
233 |
+
</div>
|
234 |
+
<a name="_compose_documentation_tab" id="_compose_documentation_tab"></a><div class="element clickable method private _compose_documentation_tab" data-toggle="collapse" data-target="._compose_documentation_tab .collapse">
|
235 |
+
<h2>Compose the Documentation tab content for the Settings subpage</h2>
|
236 |
+
<pre>_compose_documentation_tab() : array</pre>
|
237 |
+
<div class="labels"></div>
|
238 |
+
<div class="row collapse"><div class="detail-description">
|
239 |
+
<p class="long_description"></p>
|
240 |
+
<table class="table table-bordered">
|
241 |
+
<tr>
|
242 |
+
<th>since</th>
|
243 |
+
<td>0.80</td>
|
244 |
+
</tr>
|
245 |
+
<tr>
|
246 |
+
<th>uses</th>
|
247 |
+
<td>\global\$page_template_array</td>
|
248 |
+
</tr>
|
249 |
+
</table>
|
250 |
+
<h3>Returns</h3>
|
251 |
+
<div class="subelement response">
|
252 |
+
<code>array</code>'message' => status/error messages, 'body' => tab content</div>
|
253 |
+
</div></div>
|
254 |
+
</div>
|
255 |
+
<a name="_compose_general_tab" id="_compose_general_tab"></a><div class="element clickable method private _compose_general_tab" data-toggle="collapse" data-target="._compose_general_tab .collapse">
|
256 |
+
<h2>Compose the General tab content for the Settings subpage</h2>
|
257 |
+
<pre>_compose_general_tab() : array</pre>
|
258 |
+
<div class="labels"></div>
|
259 |
+
<div class="row collapse"><div class="detail-description">
|
260 |
+
<p class="long_description"></p>
|
261 |
+
<table class="table table-bordered">
|
262 |
+
<tr>
|
263 |
+
<th>since</th>
|
264 |
+
<td>0.80</td>
|
265 |
+
</tr>
|
266 |
+
<tr>
|
267 |
+
<th>uses</th>
|
268 |
+
<td>\global\$page_template_array</td>
|
269 |
+
</tr>
|
270 |
+
</table>
|
271 |
+
<h3>Returns</h3>
|
272 |
+
<div class="subelement response">
|
273 |
+
<code>array</code>'message' => status/error messages, 'body' => tab content</div>
|
274 |
+
</div></div>
|
275 |
+
</div>
|
276 |
+
<a name="_compose_iptc_exif_tab" id="_compose_iptc_exif_tab"></a><div class="element clickable method private _compose_iptc_exif_tab" data-toggle="collapse" data-target="._compose_iptc_exif_tab .collapse">
|
277 |
+
<h2>Compose the IPTC/EXIF tab content for the Settings subpage</h2>
|
278 |
+
<pre>_compose_iptc_exif_tab() : array</pre>
|
279 |
+
<div class="labels"></div>
|
280 |
+
<div class="row collapse"><div class="detail-description">
|
281 |
+
<p class="long_description"></p>
|
282 |
+
<table class="table table-bordered">
|
283 |
+
<tr>
|
284 |
+
<th>since</th>
|
285 |
+
<td>1.00</td>
|
286 |
+
</tr>
|
287 |
+
<tr>
|
288 |
+
<th>uses</th>
|
289 |
+
<td>\global\$page_template_array</td>
|
290 |
+
</tr>
|
291 |
+
</table>
|
292 |
+
<h3>Returns</h3>
|
293 |
+
<div class="subelement response">
|
294 |
+
<code>array</code>'message' => status/error messages, 'body' => tab content</div>
|
295 |
+
</div></div>
|
296 |
+
</div>
|
297 |
+
<a name="_compose_mla_gallery_tab" id="_compose_mla_gallery_tab"></a><div class="element clickable method private _compose_mla_gallery_tab" data-toggle="collapse" data-target="._compose_mla_gallery_tab .collapse">
|
298 |
+
<h2>Compose the MLA Gallery tab content for the Settings subpage</h2>
|
299 |
+
<pre>_compose_mla_gallery_tab() : array</pre>
|
300 |
+
<div class="labels"></div>
|
301 |
+
<div class="row collapse"><div class="detail-description">
|
302 |
+
<p class="long_description"></p>
|
303 |
+
<table class="table table-bordered">
|
304 |
+
<tr>
|
305 |
+
<th>since</th>
|
306 |
+
<td>0.80</td>
|
307 |
+
</tr>
|
308 |
+
<tr>
|
309 |
+
<th>uses</th>
|
310 |
+
<td>\global\$page_template_array</td>
|
311 |
+
</tr>
|
312 |
+
</table>
|
313 |
+
<h3>Returns</h3>
|
314 |
+
<div class="subelement response">
|
315 |
+
<code>array</code>'message' => status/error messages, 'body' => tab content</div>
|
316 |
+
</div></div>
|
317 |
+
</div>
|
318 |
+
<a name="_compose_option_row" id="_compose_option_row"></a><div class="element clickable method private _compose_option_row" data-toggle="collapse" data-target="._compose_option_row .collapse">
|
319 |
+
<h2>Compose the table row for a single MLA option</h2>
|
320 |
+
<pre>_compose_option_row(string $key, array $value) : string</pre>
|
321 |
+
<div class="labels"></div>
|
322 |
+
<div class="row collapse"><div class="detail-description">
|
323 |
+
<p class="long_description"></p>
|
324 |
+
<table class="table table-bordered">
|
325 |
+
<tr>
|
326 |
+
<th>since</th>
|
327 |
+
<td>0.80</td>
|
328 |
+
</tr>
|
329 |
+
<tr>
|
330 |
+
<th>uses</th>
|
331 |
+
<td>\global\$page_template_array</td>
|
332 |
+
</tr>
|
333 |
+
</table>
|
334 |
<h3>Parameters</h3>
|
335 |
<div class="subelement argument">
|
336 |
+
<h4>$key</h4>
|
337 |
+
<code>string</code><p>HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
|
338 |
+
</div>
|
339 |
+
<div class="subelement argument">
|
340 |
+
<h4>$value</h4>
|
341 |
+
<code>array</code><p>Option parameters, e.g., 'type', 'std'</p>
|
342 |
+
</div>
|
343 |
<h3>Returns</h3>
|
344 |
<div class="subelement response">
|
345 |
+
<code>string</code>HTML markup for the option's table row</div>
|
346 |
</div></div>
|
347 |
</div>
|
348 |
+
<a name="_compose_settings_tabs" id="_compose_settings_tabs"></a><div class="element clickable method private _compose_settings_tabs" data-toggle="collapse" data-target="._compose_settings_tabs .collapse">
|
349 |
+
<h2>Compose the navigation tabs for the Settings subpage</h2>
|
350 |
+
<pre>_compose_settings_tabs(string $active_tab) : string</pre>
|
351 |
<div class="labels"></div>
|
352 |
<div class="row collapse"><div class="detail-description">
|
353 |
<p class="long_description"></p>
|
354 |
+
<table class="table table-bordered">
|
355 |
+
<tr>
|
356 |
<th>since</th>
|
357 |
+
<td>0.80</td>
|
358 |
+
</tr>
|
359 |
+
<tr>
|
360 |
+
<th>uses</th>
|
361 |
+
<td>\global\$page_template_array</td>
|
362 |
+
</tr>
|
363 |
+
</table>
|
364 |
<h3>Parameters</h3>
|
365 |
<div class="subelement argument">
|
366 |
+
<h4>$active_tab</h4>
|
367 |
+
<code>string</code><p>Optional data-tab-id value for the active tab, default 'general'</p>
|
368 |
+
</div>
|
369 |
<h3>Returns</h3>
|
370 |
<div class="subelement response">
|
371 |
+
<code>string</code>HTML markup for the Settings subpage navigation tabs</div>
|
372 |
</div></div>
|
373 |
</div>
|
374 |
+
<a name="_delete_custom_field" id="_delete_custom_field"></a><div class="element clickable method private _delete_custom_field" data-toggle="collapse" data-target="._delete_custom_field .collapse">
|
375 |
+
<h2>Delete a custom field from the wp_postmeta table</h2>
|
376 |
+
<pre>_delete_custom_field(array $value) : array</pre>
|
377 |
<div class="labels"></div>
|
378 |
<div class="row collapse"><div class="detail-description">
|
379 |
<p class="long_description"></p>
|
380 |
<table class="table table-bordered"><tr>
|
381 |
<th>since</th>
|
382 |
+
<td>1.10</td>
|
383 |
</tr></table>
|
384 |
+
<h3>Parameters</h3>
|
385 |
+
<div class="subelement argument">
|
386 |
+
<h4>$value</h4>
|
387 |
+
<code>array</code><p>specific custom_field_mapping rule</p></div>
|
388 |
<h3>Returns</h3>
|
389 |
<div class="subelement response">
|
390 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
391 |
</div></div>
|
392 |
</div>
|
393 |
+
<a name="_process_custom_field_mapping" id="_process_custom_field_mapping"></a><div class="element clickable method private _process_custom_field_mapping" data-toggle="collapse" data-target="._process_custom_field_mapping .collapse">
|
394 |
+
<h2>Process custom field settings against all image attachments
|
395 |
+
without saving the settings to the mla_option</h2>
|
396 |
+
<pre>_process_custom_field_mapping(array $settings) : array</pre>
|
397 |
<div class="labels"></div>
|
398 |
<div class="row collapse"><div class="detail-description">
|
399 |
<p class="long_description"></p>
|
400 |
+
<table class="table table-bordered">
|
401 |
+
<tr>
|
402 |
<th>since</th>
|
403 |
+
<td>1.10</td>
|
404 |
+
</tr>
|
405 |
+
<tr>
|
406 |
+
<th>uses</th>
|
407 |
+
<td>\global\$_REQUEST</td>
|
408 |
+
</tr>
|
409 |
+
</table>
|
410 |
<h3>Parameters</h3>
|
411 |
<div class="subelement argument">
|
412 |
+
<h4>$settings</h4>
|
413 |
+
<code>array</code><p>| NULL specific custom_field_mapping values</p></div>
|
|
|
|
|
|
|
414 |
<h3>Returns</h3>
|
415 |
<div class="subelement response">
|
416 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
417 |
</div></div>
|
418 |
</div>
|
419 |
+
<a name="_process_iptc_exif_custom" id="_process_iptc_exif_custom"></a><div class="element clickable method private _process_iptc_exif_custom" data-toggle="collapse" data-target="._process_iptc_exif_custom .collapse">
|
420 |
+
<h2>Process IPTC/EXIF custom field settings against all image attachments
|
421 |
+
without saving the settings to the mla_option</h2>
|
422 |
+
<pre>_process_iptc_exif_custom() : array</pre>
|
423 |
+
<div class="labels"></div>
|
424 |
+
<div class="row collapse"><div class="detail-description">
|
425 |
+
<p class="long_description"></p>
|
426 |
+
<table class="table table-bordered">
|
427 |
+
<tr>
|
428 |
+
<th>since</th>
|
429 |
+
<td>1.00</td>
|
430 |
+
</tr>
|
431 |
+
<tr>
|
432 |
+
<th>uses</th>
|
433 |
+
<td>\global\$_REQUEST</td>
|
434 |
+
</tr>
|
435 |
+
</table>
|
436 |
+
<h3>Returns</h3>
|
437 |
+
<div class="subelement response">
|
438 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
439 |
+
</div></div>
|
440 |
+
</div>
|
441 |
+
<a name="_process_iptc_exif_standard" id="_process_iptc_exif_standard"></a><div class="element clickable method private _process_iptc_exif_standard" data-toggle="collapse" data-target="._process_iptc_exif_standard .collapse">
|
442 |
+
<h2>Process IPTC/EXIF standard field settings against all image attachments
|
443 |
+
without saving the settings to the mla_option</h2>
|
444 |
+
<pre>_process_iptc_exif_standard() : array</pre>
|
445 |
+
<div class="labels"></div>
|
446 |
+
<div class="row collapse"><div class="detail-description">
|
447 |
+
<p class="long_description"></p>
|
448 |
+
<table class="table table-bordered">
|
449 |
+
<tr>
|
450 |
+
<th>since</th>
|
451 |
+
<td>1.00</td>
|
452 |
+
</tr>
|
453 |
+
<tr>
|
454 |
+
<th>uses</th>
|
455 |
+
<td>\global\$_REQUEST</td>
|
456 |
+
</tr>
|
457 |
+
</table>
|
458 |
+
<h3>Returns</h3>
|
459 |
+
<div class="subelement response">
|
460 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
461 |
+
</div></div>
|
462 |
+
</div>
|
463 |
+
<a name="_process_iptc_exif_taxonomy" id="_process_iptc_exif_taxonomy"></a><div class="element clickable method private _process_iptc_exif_taxonomy" data-toggle="collapse" data-target="._process_iptc_exif_taxonomy .collapse">
|
464 |
+
<h2>Process IPTC/EXIF taxonomy term settings against all image attachments
|
465 |
+
without saving the settings to the mla_option</h2>
|
466 |
+
<pre>_process_iptc_exif_taxonomy() : array</pre>
|
467 |
+
<div class="labels"></div>
|
468 |
+
<div class="row collapse"><div class="detail-description">
|
469 |
+
<p class="long_description"></p>
|
470 |
+
<table class="table table-bordered">
|
471 |
+
<tr>
|
472 |
+
<th>since</th>
|
473 |
+
<td>1.00</td>
|
474 |
+
</tr>
|
475 |
+
<tr>
|
476 |
+
<th>uses</th>
|
477 |
+
<td>\global\$_REQUEST</td>
|
478 |
+
</tr>
|
479 |
+
</table>
|
480 |
+
<h3>Returns</h3>
|
481 |
+
<div class="subelement response">
|
482 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
483 |
+
</div></div>
|
484 |
+
</div>
|
485 |
+
<a name="_reset_general_settings" id="_reset_general_settings"></a><div class="element clickable method private _reset_general_settings" data-toggle="collapse" data-target="._reset_general_settings .collapse">
|
486 |
<h2>Delete saved settings, restoring default values</h2>
|
487 |
+
<pre>_reset_general_settings() : array</pre>
|
488 |
<div class="labels"></div>
|
489 |
<div class="row collapse"><div class="detail-description">
|
490 |
<p class="long_description"></p>
|
492 |
<th>since</th>
|
493 |
<td>0.1</td>
|
494 |
</tr></table>
|
495 |
+
<h3>Returns</h3>
|
496 |
+
<div class="subelement response">
|
497 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
498 |
+
</div></div>
|
499 |
+
</div>
|
500 |
+
<a name="_save_custom_field_settings" id="_save_custom_field_settings"></a><div class="element clickable method private _save_custom_field_settings" data-toggle="collapse" data-target="._save_custom_field_settings .collapse">
|
501 |
+
<h2>Save custom field settings to the options table</h2>
|
502 |
+
<pre>_save_custom_field_settings(array $new_values) : array</pre>
|
503 |
+
<div class="labels"></div>
|
504 |
+
<div class="row collapse"><div class="detail-description">
|
505 |
+
<p class="long_description"></p>
|
506 |
+
<table class="table table-bordered">
|
507 |
+
<tr>
|
508 |
+
<th>since</th>
|
509 |
+
<td>1.10</td>
|
510 |
+
</tr>
|
511 |
+
<tr>
|
512 |
+
<th>uses</th>
|
513 |
+
<td>\global\$_REQUEST</td>
|
514 |
+
</tr>
|
515 |
+
</table>
|
516 |
<h3>Parameters</h3>
|
517 |
<div class="subelement argument">
|
518 |
+
<h4>$new_values</h4>
|
519 |
+
<code>array</code><p>| NULL specific custom_field_mapping values</p></div>
|
520 |
+
<h3>Returns</h3>
|
521 |
+
<div class="subelement response">
|
522 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
523 |
+
</div></div>
|
524 |
</div>
|
525 |
+
<a name="_save_gallery_settings" id="_save_gallery_settings"></a><div class="element clickable method private _save_gallery_settings" data-toggle="collapse" data-target="._save_gallery_settings .collapse">
|
526 |
+
<h2>Save MLA Gallery settings to the options table</h2>
|
527 |
+
<pre>_save_gallery_settings() : array</pre>
|
528 |
+
<div class="labels"></div>
|
529 |
+
<div class="row collapse"><div class="detail-description">
|
530 |
+
<p class="long_description"></p>
|
531 |
+
<table class="table table-bordered">
|
532 |
+
<tr>
|
533 |
+
<th>since</th>
|
534 |
+
<td>0.80</td>
|
535 |
+
</tr>
|
536 |
+
<tr>
|
537 |
+
<th>uses</th>
|
538 |
+
<td>\global\$_REQUEST</td>
|
539 |
+
</tr>
|
540 |
+
</table>
|
541 |
<h3>Returns</h3>
|
542 |
<div class="subelement response">
|
543 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
544 |
</div></div>
|
545 |
</div>
|
546 |
+
<a name="_save_general_settings" id="_save_general_settings"></a><div class="element clickable method private _save_general_settings" data-toggle="collapse" data-target="._save_general_settings .collapse">
|
547 |
+
<h2>Save General settings to the options table</h2>
|
548 |
+
<pre>_save_general_settings() : array</pre>
|
549 |
<div class="labels"></div>
|
550 |
<div class="row collapse"><div class="detail-description">
|
551 |
<p class="long_description"></p>
|
552 |
+
<table class="table table-bordered">
|
553 |
+
<tr>
|
554 |
<th>since</th>
|
555 |
<td>0.1</td>
|
556 |
+
</tr>
|
557 |
+
<tr>
|
558 |
+
<th>uses</th>
|
559 |
+
<td>\global\$_REQUEST</td>
|
560 |
+
</tr>
|
561 |
+
</table>
|
562 |
+
<h3>Returns</h3>
|
563 |
+
<div class="subelement response">
|
564 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
565 |
+
</div></div>
|
566 |
+
</div>
|
567 |
+
<a name="_save_iptc_exif_settings" id="_save_iptc_exif_settings"></a><div class="element clickable method private _save_iptc_exif_settings" data-toggle="collapse" data-target="._save_iptc_exif_settings .collapse">
|
568 |
+
<h2>Save IPTC/EXIF settings to the options table</h2>
|
569 |
+
<pre>_save_iptc_exif_settings() : array</pre>
|
570 |
+
<div class="labels"></div>
|
571 |
+
<div class="row collapse"><div class="detail-description">
|
572 |
+
<p class="long_description"></p>
|
573 |
+
<table class="table table-bordered">
|
574 |
+
<tr>
|
575 |
+
<th>since</th>
|
576 |
+
<td>1.00</td>
|
577 |
+
</tr>
|
578 |
+
<tr>
|
579 |
+
<th>uses</th>
|
580 |
+
<td>\global\$_REQUEST</td>
|
581 |
+
</tr>
|
582 |
+
</table>
|
583 |
+
<h3>Returns</h3>
|
584 |
+
<div class="subelement response">
|
585 |
+
<code>array</code>Message(s) reflecting the results of the operation</div>
|
586 |
+
</div></div>
|
587 |
+
</div>
|
588 |
+
<a name="_update_option_row" id="_update_option_row"></a><div class="element clickable method private _update_option_row" data-toggle="collapse" data-target="._update_option_row .collapse">
|
589 |
+
<h2>Update or delete a single MLA option value</h2>
|
590 |
+
<pre>_update_option_row(string $key, array $value) : string</pre>
|
591 |
+
<div class="labels"></div>
|
592 |
+
<div class="row collapse"><div class="detail-description">
|
593 |
+
<p class="long_description"></p>
|
594 |
+
<table class="table table-bordered">
|
595 |
+
<tr>
|
596 |
+
<th>since</th>
|
597 |
+
<td>0.80</td>
|
598 |
+
</tr>
|
599 |
+
<tr>
|
600 |
+
<th>uses</th>
|
601 |
+
<td>\global\$_REQUEST</td>
|
602 |
+
</tr>
|
603 |
+
</table>
|
604 |
<h3>Parameters</h3>
|
605 |
<div class="subelement argument">
|
606 |
+
<h4>$key</h4>
|
607 |
+
<code>string</code><p>HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
|
608 |
+
</div>
|
609 |
+
<div class="subelement argument">
|
610 |
+
<h4>$value</h4>
|
611 |
+
<code>array</code><p>Option parameters, e.g., 'type', 'std'</p>
|
612 |
</div>
|
613 |
<h3>Returns</h3>
|
614 |
<div class="subelement response">
|
615 |
+
<code>string</code>HTML markup for the option's table row</div>
|
616 |
+
</div></div>
|
617 |
+
</div>
|
618 |
+
<a name="_version_upgrade" id="_version_upgrade"></a><div class="element clickable method private _version_upgrade" data-toggle="collapse" data-target="._version_upgrade .collapse">
|
619 |
+
<h2>Database and option update check, for installing new versions</h2>
|
620 |
+
<pre>_version_upgrade() : void</pre>
|
621 |
+
<div class="labels"></div>
|
622 |
+
<div class="row collapse"><div class="detail-description">
|
623 |
+
<p class="long_description"></p>
|
624 |
+
<table class="table table-bordered"><tr>
|
625 |
+
<th>since</th>
|
626 |
+
<td>0.30</td>
|
627 |
+
</tr></table>
|
628 |
</div></div>
|
629 |
</div>
|
630 |
<h3>
|
631 |
<i class="icon-custom icon-property"></i> Properties</h3>
|
632 |
+
<a name="%24mla_tablist" id="$mla_tablist"> </a><div class="element clickable property private $mla_tablist" data-toggle="collapse" data-target=".$mla_tablist .collapse">
|
633 |
+
<h2>Definitions for Settings page tab ids, titles and handlers
|
634 |
+
Each tab is defined by an array with the following elements:</h2>
|
635 |
+
<pre>$mla_tablist : array</pre>
|
636 |
<div class="labels"></div>
|
637 |
+
<div class="row collapse"><div class="detail-description">
|
638 |
+
<p class="long_description"><p>array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
|
|
|
639 |
|
640 |
+
<p>title => tab label / heading text
|
641 |
+
render => rendering function for tab messages and content. Usage:
|
642 |
+
$tab_content = <a href="">'render'</a>;</p></p>
|
643 |
+
<table class="table table-bordered"><tr>
|
644 |
+
<th>since</th>
|
645 |
+
<td>0.80</td>
|
646 |
+
</tr></table>
|
647 |
+
</div></div>
|
648 |
+
</div>
|
649 |
+
<a name="%24page_template_array" id="$page_template_array"> </a><div class="element clickable property private $page_template_array" data-toggle="collapse" data-target=".$page_template_array .collapse">
|
650 |
+
<h2>Template file for the Settings page(s) and parts</h2>
|
651 |
+
<pre>$page_template_array : array</pre>
|
652 |
+
<div class="labels"></div>
|
653 |
+
<div class="row collapse"><div class="detail-description">
|
654 |
+
<p class="long_description"><p>This array contains all of the template parts for the Settings page(s). The array is built once
|
655 |
+
each page load and cached for subsequent use.</p></p>
|
656 |
+
<table class="table table-bordered"><tr>
|
657 |
+
<th>since</th>
|
658 |
+
<td>0.80</td>
|
659 |
+
</tr></table>
|
660 |
+
</div></div>
|
661 |
</div>
|
662 |
<h3>
|
663 |
<i class="icon-custom icon-constant"></i> Constants</h3>
|
664 |
<a name="MLA_SETTINGS_SLUG" id="MLA_SETTINGS_SLUG"> </a><div class="element clickable constant MLA_SETTINGS_SLUG" data-toggle="collapse" data-target=".MLA_SETTINGS_SLUG .collapse">
|
665 |
+
<h2>Provides a unique name for the settings page</h2>
|
666 |
<pre>MLA_SETTINGS_SLUG </pre>
|
667 |
<div class="labels"></div>
|
668 |
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
|
674 |
<div class="row"><footer class="span12">
|
675 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
676 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
677 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
678 |
</div>
|
679 |
</body>
|
680 |
</html>
|
phpDocs/classes/MLAShortcodes.html
ADDED
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
|
2 |
+
<head>
|
3 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
+
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLAShortcodes</title>
|
7 |
+
<meta name="author" content="Mike van Riel">
|
8 |
+
<meta name="description" content="">
|
9 |
+
<link href="../css/template.css" rel="stylesheet" media="all">
|
10 |
+
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
|
11 |
+
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
|
12 |
+
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
|
13 |
+
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
|
14 |
+
</head>
|
15 |
+
<body>
|
16 |
+
<div class="navbar navbar-fixed-top">
|
17 |
+
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
+
<li class="dropdown">
|
20 |
+
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
22 |
+
</li>
|
23 |
+
<li class="dropdown" id="charts-menu">
|
24 |
+
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
25 |
+
Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
|
26 |
+
</li>
|
27 |
+
<li class="dropdown" id="reports-menu">
|
28 |
+
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
|
29 |
+
Reports <b class="caret"></b></a><ul class="dropdown-menu">
|
30 |
+
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors
|
31 |
+
<span class="label label-info">0</span></a></li>
|
32 |
+
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers
|
33 |
+
<ul></ul></a></li>
|
34 |
+
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements
|
35 |
+
<span class="label label-info">0</span></a></li>
|
36 |
+
</ul>
|
37 |
+
</li>
|
38 |
+
</ul></div>
|
39 |
+
</div></div>
|
40 |
+
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top <i class="icon-upload icon-white"></i></a></div>
|
41 |
+
</div>
|
42 |
+
<div id="___" class="container">
|
43 |
+
<noscript><div class="alert alert-warning">
|
44 |
+
Javascript is disabled; several features are only available
|
45 |
+
if Javascript is enabled.
|
46 |
+
</div></noscript>
|
47 |
+
<div class="row">
|
48 |
+
<div class="span4">
|
49 |
+
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
|
50 |
+
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
|
51 |
+
</div>
|
52 |
+
<ul class="side-nav nav nav-list">
|
53 |
+
<li class="nav-header">
|
54 |
+
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
+
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
+
<li class="method public "><a href="#mla_attachment_list_shortcode" title="mla_attachment_list_shortcode :: WordPress Shortcode; renders a complete list of all attachments and references to them"><span class="description">WordPress Shortcode; renders a complete list of all attachments and references to them</span><pre>mla_attachment_list_shortcode()</pre></a></li>
|
57 |
+
<li class="method public "><a href="#mla_gallery_shortcode" title="mla_gallery_shortcode :: The MLA Gallery shortcode."><span class="description">The MLA Gallery shortcode.</span><pre>mla_gallery_shortcode()</pre></a></li>
|
58 |
+
<li class="method public "><a href="#mla_get_shortcode_attachments" title="mla_get_shortcode_attachments :: Parses shortcode parameters and returns the gallery objects"><span class="description">Parses shortcode parameters and returns the gallery objects</span><pre>mla_get_shortcode_attachments()</pre></a></li>
|
59 |
+
<li class="method public "><a href="#mla_shortcode_query_posts_where_filter" title="mla_shortcode_query_posts_where_filter :: Filters the WHERE clause for shortcode queries"><span class="description">Filters the WHERE clause for shortcode queries</span><pre>mla_shortcode_query_posts_where_filter()</pre></a></li>
|
60 |
+
<li class="nav-header private">» Private</li>
|
61 |
+
<li class="method private "><a href="#_sanitize_query_specification" title="_sanitize_query_specification :: Cleans up damage caused by the Visual Editor to the tax_query and meta_query specifications"><span class="description">Cleans up damage caused by the Visual Editor to the tax_query and meta_query specifications</span><pre>_sanitize_query_specification()</pre></a></li>
|
62 |
+
<li class="nav-header">
|
63 |
+
<i class="icon-custom icon-property"></i> Properties</li>
|
64 |
+
<li class="property public "><a href="#%24mla_debug_messages" title="$mla_debug_messages :: Accumulates debug messages"><span class="description">Accumulates debug messages</span><pre>$mla_debug_messages</pre></a></li>
|
65 |
+
<li class="property public "><a href="#%24mla_iptc_keys" title="$mla_iptc_keys :: IPTC Dataset friendly name/slug and identifiers"><span class="description">IPTC Dataset friendly name/slug and identifiers</span><pre>$mla_iptc_keys</pre></a></li>
|
66 |
+
<li class="nav-header private">» Private</li>
|
67 |
+
<li class="property private "><a href="#%24mla_debug" title="$mla_debug :: Turn debug collection and display on or off"><span class="description">Turn debug collection and display on or off</span><pre>$mla_debug</pre></a></li>
|
68 |
+
<li class="property private "><a href="#%24mla_iptc_descriptions" title="$mla_iptc_descriptions :: IPTC Dataset descriptions"><span class="description">IPTC Dataset descriptions</span><pre>$mla_iptc_descriptions</pre></a></li>
|
69 |
+
<li class="property private "><a href="#%24mla_iptc_formats" title="$mla_iptc_formats :: IPTC file format identifiers and descriptions"><span class="description">IPTC file format identifiers and descriptions</span><pre>$mla_iptc_formats</pre></a></li>
|
70 |
+
<li class="property private "><a href="#%24mla_iptc_image_types" title="$mla_iptc_image_types :: IPTC image type identifiers and descriptions"><span class="description">IPTC image type identifiers and descriptions</span><pre>$mla_iptc_image_types</pre></a></li>
|
71 |
+
<li class="property private "><a href="#%24mla_iptc_records" title="$mla_iptc_records :: IPTC Dataset identifiers and names"><span class="description">IPTC Dataset identifiers and names</span><pre>$mla_iptc_records</pre></a></li>
|
72 |
+
<li class="property private "><a href="#%24query_parameters" title='$query_parameters :: WP_Query filter "parameters"'><span class="description">WP_Query filter "parameters"</span><pre>$query_parameters</pre></a></li>
|
73 |
+
</ul>
|
74 |
+
</div>
|
75 |
+
<div class="span8">
|
76 |
+
<a name="%5CMLAShortcodes" id="\MLAShortcodes"></a><ul class="breadcrumb">
|
77 |
+
<li>
|
78 |
+
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
|
79 |
+
</li>
|
80 |
+
<li><a href="../namespaces/global.html">global</a></li>
|
81 |
+
<li class="active">
|
82 |
+
<span class="divider">\</span><a href="../classes/MLAShortcodes.html">MLAShortcodes</a>
|
83 |
+
</li>
|
84 |
+
</ul>
|
85 |
+
<div href="../classes/MLAShortcodes.html" class="element class">
|
86 |
+
<p class="short_description">Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users</p>
|
87 |
+
<div class="details">
|
88 |
+
<p class="long_description"></p>
|
89 |
+
<table class="table table-bordered">
|
90 |
+
<tr>
|
91 |
+
<th>package</th>
|
92 |
+
<td><a href="../packages/Media%20Library%20Assistant.html">Media Library Assistant</a></td>
|
93 |
+
</tr>
|
94 |
+
<tr>
|
95 |
+
<th>since</th>
|
96 |
+
<td>0.20</td>
|
97 |
+
</tr>
|
98 |
+
</table>
|
99 |
+
<h3>
|
100 |
+
<i class="icon-custom icon-method"></i> Methods</h3>
|
101 |
+
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
102 |
+
<h2>Initialization function, similar to __construct()</h2>
|
103 |
+
<pre>initialize() : void</pre>
|
104 |
+
<div class="labels"></div>
|
105 |
+
<div class="row collapse"><div class="detail-description">
|
106 |
+
<p class="long_description"></p>
|
107 |
+
<table class="table table-bordered"><tr>
|
108 |
+
<th>since</th>
|
109 |
+
<td>0.20</td>
|
110 |
+
</tr></table>
|
111 |
+
</div></div>
|
112 |
+
</div>
|
113 |
+
<a name="mla_attachment_list_shortcode" id="mla_attachment_list_shortcode"></a><div class="element clickable method public mla_attachment_list_shortcode" data-toggle="collapse" data-target=".mla_attachment_list_shortcode .collapse">
|
114 |
+
<h2>WordPress Shortcode; renders a complete list of all attachments and references to them</h2>
|
115 |
+
<pre>mla_attachment_list_shortcode() : void</pre>
|
116 |
+
<div class="labels"></div>
|
117 |
+
<div class="row collapse"><div class="detail-description">
|
118 |
+
<p class="long_description"></p>
|
119 |
+
<table class="table table-bordered"><tr>
|
120 |
+
<th>since</th>
|
121 |
+
<td>0.1</td>
|
122 |
+
</tr></table>
|
123 |
+
</div></div>
|
124 |
+
</div>
|
125 |
+
<a name="mla_gallery_shortcode" id="mla_gallery_shortcode"></a><div class="element clickable method public mla_gallery_shortcode" data-toggle="collapse" data-target=".mla_gallery_shortcode .collapse">
|
126 |
+
<h2>The MLA Gallery shortcode.</h2>
|
127 |
+
<pre>mla_gallery_shortcode(array $attr) : string</pre>
|
128 |
+
<div class="labels"></div>
|
129 |
+
<div class="row collapse"><div class="detail-description">
|
130 |
+
<p class="long_description"><p>This is a superset of the WordPress Gallery shortcode for displaying images on a post,
|
131 |
+
page or custom post type. It is adapted from /wp-includes/media.php gallery_shortcode.
|
132 |
+
Enhancements include many additional selection parameters and full taxonomy support.</p></p>
|
133 |
+
<table class="table table-bordered"><tr>
|
134 |
+
<th>since</th>
|
135 |
+
<td>.50</td>
|
136 |
+
</tr></table>
|
137 |
+
<h3>Parameters</h3>
|
138 |
+
<div class="subelement argument">
|
139 |
+
<h4>$attr</h4>
|
140 |
+
<code>array</code><p>Attributes of the shortcode.</p></div>
|
141 |
+
<h3>Returns</h3>
|
142 |
+
<div class="subelement response">
|
143 |
+
<code>string</code>HTML content to display gallery.</div>
|
144 |
+
</div></div>
|
145 |
+
</div>
|
146 |
+
<a name="mla_get_shortcode_attachments" id="mla_get_shortcode_attachments"></a><div class="element clickable method public mla_get_shortcode_attachments" data-toggle="collapse" data-target=".mla_get_shortcode_attachments .collapse">
|
147 |
+
<h2>Parses shortcode parameters and returns the gallery objects</h2>
|
148 |
+
<pre>mla_get_shortcode_attachments(int $post_parent, array $attr) : array</pre>
|
149 |
+
<div class="labels"></div>
|
150 |
+
<div class="row collapse"><div class="detail-description">
|
151 |
+
<p class="long_description"></p>
|
152 |
+
<table class="table table-bordered"><tr>
|
153 |
+
<th>since</th>
|
154 |
+
<td>.50</td>
|
155 |
+
</tr></table>
|
156 |
+
<h3>Parameters</h3>
|
157 |
+
<div class="subelement argument">
|
158 |
+
<h4>$post_parent</h4>
|
159 |
+
<code>int</code><p>Post ID of the parent</p></div>
|
160 |
+
<div class="subelement argument">
|
161 |
+
<h4>$attr</h4>
|
162 |
+
<code>array</code><p>Attributes of the shortcode</p></div>
|
163 |
+
<h3>Returns</h3>
|
164 |
+
<div class="subelement response">
|
165 |
+
<code>array</code>List of attachments returned from WP_Query</div>
|
166 |
+
</div></div>
|
167 |
+
</div>
|
168 |
+
<a name="mla_shortcode_query_posts_where_filter" id="mla_shortcode_query_posts_where_filter"></a><div class="element clickable method public mla_shortcode_query_posts_where_filter" data-toggle="collapse" data-target=".mla_shortcode_query_posts_where_filter .collapse">
|
169 |
+
<h2>Filters the WHERE clause for shortcode queries</h2>
|
170 |
+
<pre>mla_shortcode_query_posts_where_filter(string $where_clause) : string</pre>
|
171 |
+
<div class="labels"></div>
|
172 |
+
<div class="row collapse"><div class="detail-description">
|
173 |
+
<p class="long_description"><p>Captures debug information. Adds whitespace to the post_type = 'attachment'
|
174 |
+
phrase to circumvent subsequent Role Scoper modification of the clause.
|
175 |
+
Handles post_parent "any" and "none" cases.
|
176 |
+
Defined as public because it's a filter.</p></p>
|
177 |
+
<table class="table table-bordered"><tr>
|
178 |
+
<th>since</th>
|
179 |
+
<td>0.70</td>
|
180 |
+
</tr></table>
|
181 |
+
<h3>Parameters</h3>
|
182 |
+
<div class="subelement argument">
|
183 |
+
<h4>$where_clause</h4>
|
184 |
+
<code>string</code><p>query clause before modification</p></div>
|
185 |
+
<h3>Returns</h3>
|
186 |
+
<div class="subelement response">
|
187 |
+
<code>string</code>query clause after modification</div>
|
188 |
+
</div></div>
|
189 |
+
</div>
|
190 |
+
<a name="_sanitize_query_specification" id="_sanitize_query_specification"></a><div class="element clickable method private _sanitize_query_specification" data-toggle="collapse" data-target="._sanitize_query_specification .collapse">
|
191 |
+
<h2>Cleans up damage caused by the Visual Editor to the tax_query and meta_query specifications</h2>
|
192 |
+
<pre>_sanitize_query_specification(string $specification) : string</pre>
|
193 |
+
<div class="labels"></div>
|
194 |
+
<div class="row collapse"><div class="detail-description">
|
195 |
+
<p class="long_description"></p>
|
196 |
+
<table class="table table-bordered"><tr>
|
197 |
+
<th>since</th>
|
198 |
+
<td>1.14</td>
|
199 |
+
</tr></table>
|
200 |
+
<h3>Parameters</h3>
|
201 |
+
<div class="subelement argument">
|
202 |
+
<h4>$specification</h4>
|
203 |
+
<code>string</code><p>query specification; PHP nested arrays</p></div>
|
204 |
+
<h3>Returns</h3>
|
205 |
+
<div class="subelement response">
|
206 |
+
<code>string</code>query specification with HTML escape sequences and line breaks removed</div>
|
207 |
+
</div></div>
|
208 |
+
</div>
|
209 |
+
<h3>
|
210 |
+
<i class="icon-custom icon-property"></i> Properties</h3>
|
211 |
+
<a name="%24mla_debug_messages" id="$mla_debug_messages"> </a><div class="element clickable property public $mla_debug_messages" data-toggle="collapse" data-target=".$mla_debug_messages .collapse">
|
212 |
+
<h2>Accumulates debug messages</h2>
|
213 |
+
<pre>$mla_debug_messages : string</pre>
|
214 |
+
<div class="labels"></div>
|
215 |
+
<div class="row collapse"><div class="detail-description">
|
216 |
+
<p class="long_description"></p>
|
217 |
+
<table class="table table-bordered"><tr>
|
218 |
+
<th>since</th>
|
219 |
+
<td>0.60</td>
|
220 |
+
</tr></table>
|
221 |
+
</div></div>
|
222 |
+
</div>
|
223 |
+
<a name="%24mla_iptc_keys" id="$mla_iptc_keys"> </a><div class="element clickable property public $mla_iptc_keys" data-toggle="collapse" data-target=".$mla_iptc_keys .collapse">
|
224 |
+
<h2>IPTC Dataset friendly name/slug and identifiers</h2>
|
225 |
+
<pre>$mla_iptc_keys : array</pre>
|
226 |
+
<div class="labels"></div>
|
227 |
+
<div class="row collapse"><div class="detail-description">
|
228 |
+
<p class="long_description"><p>This array contains the sanitized names and identifiers of Datasets defined in
|
229 |
+
the "IPTC-NAA Information Interchange Model Version No. 4.1".</p></p>
|
230 |
+
<table class="table table-bordered"><tr>
|
231 |
+
<th>since</th>
|
232 |
+
<td>0.90</td>
|
233 |
+
</tr></table>
|
234 |
+
</div></div>
|
235 |
+
</div>
|
236 |
+
<a name="%24mla_debug" id="$mla_debug"> </a><div class="element clickable property private $mla_debug" data-toggle="collapse" data-target=".$mla_debug .collapse">
|
237 |
+
<h2>Turn debug collection and display on or off</h2>
|
238 |
+
<pre>$mla_debug : boolean</pre>
|
239 |
+
<div class="labels"></div>
|
240 |
+
<div class="row collapse"><div class="detail-description">
|
241 |
+
<p class="long_description"></p>
|
242 |
+
<table class="table table-bordered"><tr>
|
243 |
+
<th>since</th>
|
244 |
+
<td>0.70</td>
|
245 |
+
</tr></table>
|
246 |
+
</div></div>
|
247 |
+
</div>
|
248 |
+
<a name="%24mla_iptc_descriptions" id="$mla_iptc_descriptions"> </a><div class="element clickable property private $mla_iptc_descriptions" data-toggle="collapse" data-target=".$mla_iptc_descriptions .collapse">
|
249 |
+
<h2>IPTC Dataset descriptions</h2>
|
250 |
+
<pre>$mla_iptc_descriptions : array</pre>
|
251 |
+
<div class="labels"></div>
|
252 |
+
<div class="row collapse"><div class="detail-description">
|
253 |
+
<p class="long_description"><p>This array contains the descriptions of Datasets defined in
|
254 |
+
the "IPTC-NAA Information Interchange Model Version No. 4.1".</p></p>
|
255 |
+
<table class="table table-bordered"><tr>
|
256 |
+
<th>since</th>
|
257 |
+
<td>0.90</td>
|
258 |
+
</tr></table>
|
259 |
+
</div></div>
|
260 |
+
</div>
|
261 |
+
<a name="%24mla_iptc_formats" id="$mla_iptc_formats"> </a><div class="element clickable property private $mla_iptc_formats" data-toggle="collapse" data-target=".$mla_iptc_formats .collapse">
|
262 |
+
<h2>IPTC file format identifiers and descriptions</h2>
|
263 |
+
<pre>$mla_iptc_formats : array</pre>
|
264 |
+
<div class="labels"></div>
|
265 |
+
<div class="row collapse"><div class="detail-description">
|
266 |
+
<p class="long_description"><p>This array contains the file format identifiers and descriptions defined in
|
267 |
+
the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 1#020.</p></p>
|
268 |
+
<table class="table table-bordered"><tr>
|
269 |
+
<th>since</th>
|
270 |
+
<td>0.90</td>
|
271 |
+
</tr></table>
|
272 |
+
</div></div>
|
273 |
+
</div>
|
274 |
+
<a name="%24mla_iptc_image_types" id="$mla_iptc_image_types"> </a><div class="element clickable property private $mla_iptc_image_types" data-toggle="collapse" data-target=".$mla_iptc_image_types .collapse">
|
275 |
+
<h2>IPTC image type identifiers and descriptions</h2>
|
276 |
+
<pre>$mla_iptc_image_types : array</pre>
|
277 |
+
<div class="labels"></div>
|
278 |
+
<div class="row collapse"><div class="detail-description">
|
279 |
+
<p class="long_description"><p>This array contains the image type identifiers and descriptions defined in
|
280 |
+
the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 2#130, octet 2.</p></p>
|
281 |
+
<table class="table table-bordered"><tr>
|
282 |
+
<th>since</th>
|
283 |
+
<td>0.90</td>
|
284 |
+
</tr></table>
|
285 |
+
</div></div>
|
286 |
+
</div>
|
287 |
+
<a name="%24mla_iptc_records" id="$mla_iptc_records"> </a><div class="element clickable property private $mla_iptc_records" data-toggle="collapse" data-target=".$mla_iptc_records .collapse">
|
288 |
+
<h2>IPTC Dataset identifiers and names</h2>
|
289 |
+
<pre>$mla_iptc_records : array</pre>
|
290 |
+
<div class="labels"></div>
|
291 |
+
<div class="row collapse"><div class="detail-description">
|
292 |
+
<p class="long_description"><p>This array contains the identifiers and names of Datasets defined in
|
293 |
+
the "IPTC-NAA Information Interchange Model Version No. 4.1".</p></p>
|
294 |
+
<table class="table table-bordered"><tr>
|
295 |
+
<th>since</th>
|
296 |
+
<td>0.90</td>
|
297 |
+
</tr></table>
|
298 |
+
</div></div>
|
299 |
+
</div>
|
300 |
+
<a name="%24query_parameters" id="$query_parameters"> </a><div class="element clickable property private $query_parameters" data-toggle="collapse" data-target=".$query_parameters .collapse">
|
301 |
+
<h2>WP_Query filter "parameters"</h2>
|
302 |
+
<pre>$query_parameters : array</pre>
|
303 |
+
<div class="labels"></div>
|
304 |
+
<div class="row collapse"><div class="detail-description">
|
305 |
+
<p class="long_description"><p>This array defines parameters for the query's where filter, mla_shortcode_query_posts_where_filter.
|
306 |
+
The parameters are set up in the mla_get_shortcode_attachments function, and
|
307 |
+
any further logic required to translate those values is contained in the filter.</p>
|
308 |
+
|
309 |
+
<p>Array index values are: post_parent</p></p>
|
310 |
+
<table class="table table-bordered"><tr>
|
311 |
+
<th>since</th>
|
312 |
+
<td>1.13</td>
|
313 |
+
</tr></table>
|
314 |
+
</div></div>
|
315 |
+
</div>
|
316 |
+
</div>
|
317 |
+
</div>
|
318 |
+
</div>
|
319 |
+
</div>
|
320 |
+
<div class="row"><footer class="span12">
|
321 |
+
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
322 |
+
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
323 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
324 |
+
</div>
|
325 |
+
</body>
|
326 |
+
</html>
|
phpDocs/classes/MLATest.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -55,8 +52,12 @@
|
|
55 |
<ul class="side-nav nav nav-list">
|
56 |
<li class="nav-header">
|
57 |
<i class="icon-custom icon-method"></i> Methods</li>
|
|
|
58 |
<li class="method public "><a href="#min_WordPress_version" title="min_WordPress_version :: Test that your WordPress version is at least that of the $min_version"><span class="description">Test that your WordPress version is at least that of the $min_version</span><pre>min_WordPress_version()</pre></a></li>
|
59 |
<li class="method public "><a href="#min_php_version" title="min_php_version :: Test that your PHP version is at least that of the $min_php_version"><span class="description">Test that your PHP version is at least that of the $min_php_version</span><pre>min_php_version()</pre></a></li>
|
|
|
|
|
|
|
60 |
</ul>
|
61 |
</div>
|
62 |
<div class="span8">
|
@@ -86,9 +87,21 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
86 |
</table>
|
87 |
<h3>
|
88 |
<i class="icon-custom icon-method"></i> Methods</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
<a name="min_WordPress_version" id="min_WordPress_version"></a><div class="element clickable method public min_WordPress_version" data-toggle="collapse" data-target=".min_WordPress_version .collapse">
|
90 |
<h2>Test that your WordPress version is at least that of the $min_version</h2>
|
91 |
-
<pre>min_WordPress_version(string $min_version
|
92 |
<div class="labels"></div>
|
93 |
<div class="row collapse"><div class="detail-description">
|
94 |
<p class="long_description"></p>
|
@@ -101,17 +114,14 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
101 |
<h4>$min_version</h4>
|
102 |
<code>string</code><p>representing the minimum required version of WordPress, e.g. '3.3.0'</p>
|
103 |
</div>
|
104 |
-
<div class="subelement argument">
|
105 |
-
<h4>$plugin_name</h4>
|
106 |
-
<code>string</code><p>Name of the plugin for messaging purposes</p></div>
|
107 |
<h3>Returns</h3>
|
108 |
<div class="subelement response">
|
109 |
-
<code
|
110 |
</div></div>
|
111 |
</div>
|
112 |
<a name="min_php_version" id="min_php_version"></a><div class="element clickable method public min_php_version" data-toggle="collapse" data-target=".min_php_version .collapse">
|
113 |
<h2>Test that your PHP version is at least that of the $min_php_version</h2>
|
114 |
-
<pre>min_php_version(string $min_version
|
115 |
<div class="labels"></div>
|
116 |
<div class="row collapse"><div class="detail-description">
|
117 |
<p class="long_description"></p>
|
@@ -124,12 +134,23 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
124 |
<h4>$min_version</h4>
|
125 |
<code>string</code><p>representing the minimum required version of PHP, e.g. '5.3.2'</p>
|
126 |
</div>
|
127 |
-
<div class="subelement argument">
|
128 |
-
<h4>$plugin_name</h4>
|
129 |
-
<code>string</code><p>Name of the plugin for messaging purposes</p></div>
|
130 |
<h3>Returns</h3>
|
131 |
<div class="subelement response">
|
132 |
-
<code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
</div></div>
|
134 |
</div>
|
135 |
</div>
|
@@ -139,7 +160,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
139 |
<div class="row"><footer class="span12">
|
140 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
141 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
142 |
-
generated on
|
143 |
</div>
|
144 |
</body>
|
145 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLATest</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
52 |
<ul class="side-nav nav nav-list">
|
53 |
<li class="nav-header">
|
54 |
<i class="icon-custom icon-method"></i> Methods</li>
|
55 |
+
<li class="method public "><a href="#initialize" title="initialize :: Initialization function, similar to __construct()"><span class="description">Initialization function, similar to __construct()</span><pre>initialize()</pre></a></li>
|
56 |
<li class="method public "><a href="#min_WordPress_version" title="min_WordPress_version :: Test that your WordPress version is at least that of the $min_version"><span class="description">Test that your WordPress version is at least that of the $min_version</span><pre>min_WordPress_version()</pre></a></li>
|
57 |
<li class="method public "><a href="#min_php_version" title="min_php_version :: Test that your PHP version is at least that of the $min_php_version"><span class="description">Test that your PHP version is at least that of the $min_php_version</span><pre>min_php_version()</pre></a></li>
|
58 |
+
<li class="nav-header">
|
59 |
+
<i class="icon-custom icon-property"></i> Properties</li>
|
60 |
+
<li class="property public "><a href="#%24wordpress_3point5_plus" title="$wordpress_3point5_plus :: True if WordPress version is 3.5 or newer"><span class="description">True if WordPress version is 3.5 or newer</span><pre>$wordpress_3point5_plus</pre></a></li>
|
61 |
</ul>
|
62 |
</div>
|
63 |
<div class="span8">
|
87 |
</table>
|
88 |
<h3>
|
89 |
<i class="icon-custom icon-method"></i> Methods</h3>
|
90 |
+
<a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
|
91 |
+
<h2>Initialization function, similar to __construct()</h2>
|
92 |
+
<pre>initialize() : void</pre>
|
93 |
+
<div class="labels"></div>
|
94 |
+
<div class="row collapse"><div class="detail-description">
|
95 |
+
<p class="long_description"></p>
|
96 |
+
<table class="table table-bordered"><tr>
|
97 |
+
<th>since</th>
|
98 |
+
<td>0.60</td>
|
99 |
+
</tr></table>
|
100 |
+
</div></div>
|
101 |
+
</div>
|
102 |
<a name="min_WordPress_version" id="min_WordPress_version"></a><div class="element clickable method public min_WordPress_version" data-toggle="collapse" data-target=".min_WordPress_version .collapse">
|
103 |
<h2>Test that your WordPress version is at least that of the $min_version</h2>
|
104 |
+
<pre>min_WordPress_version(string $min_version) : string</pre>
|
105 |
<div class="labels"></div>
|
106 |
<div class="row collapse"><div class="detail-description">
|
107 |
<p class="long_description"></p>
|
114 |
<h4>$min_version</h4>
|
115 |
<code>string</code><p>representing the minimum required version of WordPress, e.g. '3.3.0'</p>
|
116 |
</div>
|
|
|
|
|
|
|
117 |
<h3>Returns</h3>
|
118 |
<div class="subelement response">
|
119 |
+
<code>string</code>'' if pass else error message</div>
|
120 |
</div></div>
|
121 |
</div>
|
122 |
<a name="min_php_version" id="min_php_version"></a><div class="element clickable method public min_php_version" data-toggle="collapse" data-target=".min_php_version .collapse">
|
123 |
<h2>Test that your PHP version is at least that of the $min_php_version</h2>
|
124 |
+
<pre>min_php_version(string $min_version) : string</pre>
|
125 |
<div class="labels"></div>
|
126 |
<div class="row collapse"><div class="detail-description">
|
127 |
<p class="long_description"></p>
|
134 |
<h4>$min_version</h4>
|
135 |
<code>string</code><p>representing the minimum required version of PHP, e.g. '5.3.2'</p>
|
136 |
</div>
|
|
|
|
|
|
|
137 |
<h3>Returns</h3>
|
138 |
<div class="subelement response">
|
139 |
+
<code>string</code>'' if pass else error message</div>
|
140 |
+
</div></div>
|
141 |
+
</div>
|
142 |
+
<h3>
|
143 |
+
<i class="icon-custom icon-property"></i> Properties</h3>
|
144 |
+
<a name="%24wordpress_3point5_plus" id="$wordpress_3point5_plus"> </a><div class="element clickable property public $wordpress_3point5_plus" data-toggle="collapse" data-target=".$wordpress_3point5_plus .collapse">
|
145 |
+
<h2>True if WordPress version is 3.5 or newer</h2>
|
146 |
+
<pre>$wordpress_3point5_plus : boolean</pre>
|
147 |
+
<div class="labels"></div>
|
148 |
+
<div class="row collapse"><div class="detail-description">
|
149 |
+
<p class="long_description"></p>
|
150 |
+
<table class="table table-bordered"><tr>
|
151 |
+
<th>since</th>
|
152 |
+
<td>0.60</td>
|
153 |
+
</tr></table>
|
154 |
</div></div>
|
155 |
</div>
|
156 |
</div>
|
160 |
<div class="row"><footer class="span12">
|
161 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
162 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
163 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
164 |
</div>
|
165 |
</body>
|
166 |
</html>
|
phpDocs/classes/MLA_List_Table.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -64,26 +61,27 @@ calls the parent constructor to set some default configs.</span><pre>__construct
|
|
64 |
<li class="method public "><a href="#column_author" title="column_author :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_author()</pre></a></li>
|
65 |
<li class="method public "><a href="#column_base_file" title="column_base_file :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_base_file()</pre></a></li>
|
66 |
<li class="method public "><a href="#column_caption" title="column_caption :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_caption()</pre></a></li>
|
67 |
-
<li class="method public "><a href="#column_categories" title="column_categories :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_categories()</pre></a></li>
|
68 |
<li class="method public "><a href="#column_cb" title="column_cb :: Displays checkboxes for using bulk actions."><span class="description">Displays checkboxes for using bulk actions.</span><pre>column_cb()</pre></a></li>
|
69 |
<li class="method public "><a href="#column_date" title="column_date :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_date()</pre></a></li>
|
70 |
-
<li class="method public "><a href="#column_default" title="column_default ::
|
71 |
-
for a given column."><span class="description">Called when the parent class can't find a method specifically built
|
72 |
-
for a given column.</span><pre>column_default()</pre></a></li>
|
73 |
<li class="method public "><a href="#column_description" title="column_description :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_description()</pre></a></li>
|
74 |
<li class="method public "><a href="#column_featured" title="column_featured :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_featured()</pre></a></li>
|
|
|
75 |
<li class="method public "><a href="#column_icon" title="column_icon :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_icon()</pre></a></li>
|
76 |
<li class="method public "><a href="#column_inserted" title="column_inserted :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_inserted()</pre></a></li>
|
|
|
|
|
|
|
77 |
<li class="method public "><a href="#column_parent" title="column_parent :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_parent()</pre></a></li>
|
|
|
78 |
<li class="method public "><a href="#column_post_name" title="column_post_name :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_post_name()</pre></a></li>
|
79 |
<li class="method public "><a href="#column_post_title" title="column_post_title :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_post_title()</pre></a></li>
|
80 |
-
<li class="method public "><a href="#column_tags" title="column_tags :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_tags()</pre></a></li>
|
81 |
<li class="method public "><a href="#column_title_name" title="column_title_name :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_title_name()</pre></a></li>
|
82 |
-
<li class="method public "><a href="#extra_tablenav" title="extra_tablenav :: Extra controls to be displayed between bulk actions and pagination
|
83 |
<li class="method public "><a href="#get_bulk_actions" title="get_bulk_actions :: Get an associative array ( option_name => option_title ) with the list
|
84 |
of bulk actions available on this table."><span class="description">Get an associative array ( option_name => option_title ) with the list
|
85 |
of bulk actions available on this table.</span><pre>get_bulk_actions()</pre></a></li>
|
86 |
-
<li class="method public "><a href="#get_columns" title="get_columns :: This method dictates the table's columns and titles
|
87 |
<li class="method public "><a href="#get_hidden_columns" title="get_hidden_columns :: Returns the list of currently hidden columns from a user option or
|
88 |
from default values if the option is not set"><span class="description">Returns the list of currently hidden columns from a user option or
|
89 |
from default values if the option is not set</span><pre>get_hidden_columns()</pre></a></li>
|
@@ -91,23 +89,26 @@ from default values if the option is not set</span><pre>get_hidden_columns()</pr
|
|
91 |
and the value is db column to sort by."><span class="description">Returns an array where the key is the column that needs to be sortable
|
92 |
and the value is db column to sort by.</span><pre>get_sortable_columns()</pre></a></li>
|
93 |
<li class="method public "><a href="#get_views" title="get_views :: Returns an associative array listing all the views that can be used with this table."><span class="description">Returns an associative array listing all the views that can be used with this table.</span><pre>get_views()</pre></a></li>
|
94 |
-
<li class="method public "><a href="#
|
95 |
-
<li class="method public "><a href="#
|
96 |
-
<li class="method public "><a href="#
|
|
|
|
|
|
|
|
|
97 |
<li class="nav-header private">» Private</li>
|
98 |
-
<li class="method private "><a href="#_avail_mime_types" title="_avail_mime_types :: Get mime types with one or more attachments for view preparation
|
|
|
99 |
<li class="method private "><a href="#_build_rollover_actions" title="_build_rollover_actions :: Add rollover actions to exactly one of the following displayed columns:
|
100 |
'ID_parent', 'title_name', 'post_title', 'post_name'"><span class="description">Add rollover actions to exactly one of the following displayed columns:
|
101 |
'ID_parent', 'title_name', 'post_title', 'post_name'</span><pre>_build_rollover_actions()</pre></a></li>
|
102 |
-
<li class="method private "><a href="#_count_list_table_items" title="_count_list_table_items :: Get the total number of attachment posts"><span class="description">Get the total number of attachment posts</span><pre>_count_list_table_items()</pre></a></li>
|
103 |
<li class="method private "><a href="#_default_hidden_columns" title="_default_hidden_columns :: Access the default list of hidden columns"><span class="description">Access the default list of hidden columns</span><pre>_default_hidden_columns()</pre></a></li>
|
104 |
-
<li class="method private "><a href="#_mime_types" title="_mime_types :: Get possible mime types for view preparation."><span class="description">Get possible mime types for view preparation.</span><pre>_mime_types()</pre></a></li>
|
105 |
<li class="nav-header">
|
106 |
<i class="icon-custom icon-property"></i> Properties</li>
|
107 |
<li class="nav-header private">» Private</li>
|
108 |
<li class="property private "><a href="#%24currently_hidden" title="$currently_hidden :: Currently hidden columns"><span class="description">Currently hidden columns</span><pre>$currently_hidden</pre></a></li>
|
109 |
<li class="property private "><a href="#%24default_columns" title="$default_columns :: Table column definitions"><span class="description">Table column definitions</span><pre>$default_columns</pre></a></li>
|
110 |
-
<li class="property private "><a href="#%24default_hidden_columns" title="$default_hidden_columns :: Default values for
|
111 |
<li class="property private "><a href="#%24default_sortable_columns" title="$default_sortable_columns :: Sortable column definitions"><span class="description">Sortable column definitions</span><pre>$default_sortable_columns</pre></a></li>
|
112 |
<li class="property private "><a href="#%24rollover_id" title="$rollover_id :: Records assignment of row-level actions to a table row"><span class="description">Records assignment of row-level actions to a table row</span><pre>$rollover_id</pre></a></li>
|
113 |
</ul>
|
@@ -123,9 +124,9 @@ and the value is db column to sort by.</span><pre>get_sortable_columns()</pre></
|
|
123 |
</li>
|
124 |
</ul>
|
125 |
<div href="../classes/MLA_List_Table.html" class="element class">
|
126 |
-
<p class="short_description">Class MLA (Media Library Assistant) List Table
|
127 |
<div class="details">
|
128 |
-
<p class="long_description"></p>
|
129 |
<table class="table table-bordered">
|
130 |
<tr>
|
131 |
<th>package</th>
|
@@ -141,7 +142,7 @@ and the value is db column to sort by.</span><pre>get_sortable_columns()</pre></
|
|
141 |
<a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse">
|
142 |
<h2>Initializes some properties from $_REQUEST vairables, then
|
143 |
calls the parent constructor to set some default configs.</h2>
|
144 |
-
<pre>__construct() </pre>
|
145 |
<div class="labels"></div>
|
146 |
<div class="row collapse"><div class="detail-description">
|
147 |
<p class="long_description"></p>
|
@@ -219,7 +220,7 @@ calls the parent constructor to set some default configs.</h2>
|
|
219 |
<p class="long_description"></p>
|
220 |
<table class="table table-bordered"><tr>
|
221 |
<th>since</th>
|
222 |
-
<td>0.
|
223 |
</tr></table>
|
224 |
<h3>Parameters</h3>
|
225 |
<div class="subelement argument">
|
@@ -271,26 +272,6 @@ calls the parent constructor to set some default configs.</h2>
|
|
271 |
<code>string</code>HTML markup to be placed inside the column</div>
|
272 |
</div></div>
|
273 |
</div>
|
274 |
-
<a name="column_categories" id="column_categories"></a><div class="element clickable method public column_categories" data-toggle="collapse" data-target=".column_categories .collapse">
|
275 |
-
<h2>Supply the content for a custom column</h2>
|
276 |
-
<pre>column_categories(array $item) : string</pre>
|
277 |
-
<div class="labels"></div>
|
278 |
-
<div class="row collapse"><div class="detail-description">
|
279 |
-
<p class="long_description"></p>
|
280 |
-
<table class="table table-bordered"><tr>
|
281 |
-
<th>since</th>
|
282 |
-
<td>0.1</td>
|
283 |
-
</tr></table>
|
284 |
-
<h3>Parameters</h3>
|
285 |
-
<div class="subelement argument">
|
286 |
-
<h4>$item</h4>
|
287 |
-
<code>array</code><p>A singular attachment (post) object</p>
|
288 |
-
</div>
|
289 |
-
<h3>Returns</h3>
|
290 |
-
<div class="subelement response">
|
291 |
-
<code>string</code>HTML markup to be placed inside the column</div>
|
292 |
-
</div></div>
|
293 |
-
</div>
|
294 |
<a name="column_cb" id="column_cb"></a><div class="element clickable method public column_cb" data-toggle="collapse" data-target=".column_cb .collapse">
|
295 |
<h2>Displays checkboxes for using bulk actions.</h2>
|
296 |
<pre>column_cb(array $item) : string</pre>
|
@@ -333,13 +314,13 @@ is given special treatment when columns are processed.</p></p>
|
|
333 |
</div></div>
|
334 |
</div>
|
335 |
<a name="column_default" id="column_default"></a><div class="element clickable method public column_default" data-toggle="collapse" data-target=".column_default .collapse">
|
336 |
-
<h2>
|
337 |
-
for a given column.</h2>
|
338 |
<pre>column_default(array $item, array $column_name) : string</pre>
|
339 |
<div class="labels"></div>
|
340 |
<div class="row collapse"><div class="detail-description">
|
341 |
-
<p class="long_description"><p>
|
342 |
-
|
|
|
343 |
<table class="table table-bordered"><tr>
|
344 |
<th>since</th>
|
345 |
<td>0.1</td>
|
@@ -398,6 +379,26 @@ so this function returns a troubleshooting message.</p></p>
|
|
398 |
<code>string</code>HTML markup to be placed inside the column</div>
|
399 |
</div></div>
|
400 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
<a name="column_icon" id="column_icon"></a><div class="element clickable method public column_icon" data-toggle="collapse" data-target=".column_icon .collapse">
|
402 |
<h2>Supply the content for a custom column</h2>
|
403 |
<pre>column_icon(array $item) : string</pre>
|
@@ -438,6 +439,66 @@ so this function returns a troubleshooting message.</p></p>
|
|
438 |
<code>string</code>HTML markup to be placed inside the column</div>
|
439 |
</div></div>
|
440 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
<a name="column_parent" id="column_parent"></a><div class="element clickable method public column_parent" data-toggle="collapse" data-target=".column_parent .collapse">
|
442 |
<h2>Supply the content for a custom column</h2>
|
443 |
<pre>column_parent(array $item) : string</pre>
|
@@ -458,15 +519,15 @@ so this function returns a troubleshooting message.</p></p>
|
|
458 |
<code>string</code>HTML markup to be placed inside the column</div>
|
459 |
</div></div>
|
460 |
</div>
|
461 |
-
<a name="
|
462 |
<h2>Supply the content for a custom column</h2>
|
463 |
-
<pre>
|
464 |
<div class="labels"></div>
|
465 |
<div class="row collapse"><div class="detail-description">
|
466 |
<p class="long_description"></p>
|
467 |
<table class="table table-bordered"><tr>
|
468 |
<th>since</th>
|
469 |
-
<td>0.
|
470 |
</tr></table>
|
471 |
<h3>Parameters</h3>
|
472 |
<div class="subelement argument">
|
@@ -478,9 +539,9 @@ so this function returns a troubleshooting message.</p></p>
|
|
478 |
<code>string</code>HTML markup to be placed inside the column</div>
|
479 |
</div></div>
|
480 |
</div>
|
481 |
-
<a name="
|
482 |
<h2>Supply the content for a custom column</h2>
|
483 |
-
<pre>
|
484 |
<div class="labels"></div>
|
485 |
<div class="row collapse"><div class="detail-description">
|
486 |
<p class="long_description"></p>
|
@@ -498,9 +559,9 @@ so this function returns a troubleshooting message.</p></p>
|
|
498 |
<code>string</code>HTML markup to be placed inside the column</div>
|
499 |
</div></div>
|
500 |
</div>
|
501 |
-
<a name="
|
502 |
<h2>Supply the content for a custom column</h2>
|
503 |
-
<pre>
|
504 |
<div class="labels"></div>
|
505 |
<div class="row collapse"><div class="detail-description">
|
506 |
<p class="long_description"></p>
|
@@ -539,11 +600,11 @@ so this function returns a troubleshooting message.</p></p>
|
|
539 |
</div></div>
|
540 |
</div>
|
541 |
<a name="extra_tablenav" id="extra_tablenav"></a><div class="element clickable method public extra_tablenav" data-toggle="collapse" data-target=".extra_tablenav .collapse">
|
542 |
-
<h2>Extra controls to be displayed between bulk actions and pagination
|
543 |
<pre>extra_tablenav(string $which) : array</pre>
|
544 |
<div class="labels"></div>
|
545 |
<div class="row collapse"><div class="detail-description">
|
546 |
-
<p class="long_description"><p>Modeled after class-wp-posts-list-table.php in wp-admin/includes
|
547 |
<table class="table table-bordered"><tr>
|
548 |
<th>since</th>
|
549 |
<td>0.1</td>
|
@@ -575,7 +636,7 @@ of bulk actions available on this table.</h2>
|
|
575 |
</div></div>
|
576 |
</div>
|
577 |
<a name="get_columns" id="get_columns"></a><div class="element clickable method public get_columns" data-toggle="collapse" data-target=".get_columns .collapse">
|
578 |
-
<h2>This method dictates the table's columns and titles
|
579 |
<pre>get_columns() : array</pre>
|
580 |
<div class="labels"></div>
|
581 |
<div class="row collapse"><div class="detail-description">
|
@@ -619,7 +680,7 @@ if set.</p></p>
|
|
619 |
</tr></table>
|
620 |
<h3>Returns</h3>
|
621 |
<div class="subelement response">
|
622 |
-
<code>array</code>Sortable column information,e.g., 'slugs'=>array('data_values',
|
623 |
</div></div>
|
624 |
</div>
|
625 |
<a name="get_views" id="get_views"></a><div class="element clickable method public get_views" data-toggle="collapse" data-target=".get_views .collapse">
|
@@ -637,9 +698,53 @@ if set.</p></p>
|
|
637 |
<code>array</code>View information,e.g., array ( id => link )</div>
|
638 |
</div></div>
|
639 |
</div>
|
640 |
-
<a name="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
641 |
<h2>Handler for filter 'manage_media_page_mla-menu_columns'</h2>
|
642 |
-
<pre>
|
643 |
<div class="labels"></div>
|
644 |
<div class="row collapse"><div class="detail-description">
|
645 |
<p class="long_description"><p>This required filter dictates the table's columns and titles. Set when the
|
@@ -654,9 +759,9 @@ to affect the "screen options" setup.</p></p>
|
|
654 |
<code>array</code>list of table columns</div>
|
655 |
</div></div>
|
656 |
</div>
|
657 |
-
<a name="
|
658 |
<h2>Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'</h2>
|
659 |
-
<pre>
|
660 |
<div class="labels"></div>
|
661 |
<div class="row collapse"><div class="detail-description">
|
662 |
<p class="long_description"><p>Required because the screen.php get_hidden_columns function only uses
|
@@ -683,8 +788,8 @@ is not created in time for the call from screen.php.</p></p>
|
|
683 |
</div></div>
|
684 |
</div>
|
685 |
<a name="prepare_items" id="prepare_items"></a><div class="element clickable method public prepare_items" data-toggle="collapse" data-target=".prepare_items .collapse">
|
686 |
-
<h2>Prepares the list of items for displaying
|
687 |
-
<pre>prepare_items() </pre>
|
688 |
<div class="labels"></div>
|
689 |
<div class="row collapse"><div class="detail-description">
|
690 |
<p class="long_description"><p>This is where you prepare your data for display. This method will usually
|
@@ -697,8 +802,24 @@ $this->set_pagination_args().</p></p>
|
|
697 |
</tr></table>
|
698 |
</div></div>
|
699 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
700 |
<a name="_avail_mime_types" id="_avail_mime_types"></a><div class="element clickable method private _avail_mime_types" data-toggle="collapse" data-target="._avail_mime_types .collapse">
|
701 |
-
<h2>Get mime types with one or more attachments for view preparation
|
702 |
<pre>_avail_mime_types(array $num_posts) : array</pre>
|
703 |
<div class="labels"></div>
|
704 |
<div class="row collapse"><div class="detail-description">
|
@@ -717,33 +838,30 @@ with additional entries.</p></p>
|
|
717 |
<code>array</code>Mime type names</div>
|
718 |
</div></div>
|
719 |
</div>
|
720 |
-
<a name="
|
721 |
-
<h2>Add
|
722 |
-
|
723 |
-
<pre>_build_rollover_actions(array $item, string $column) : array</pre>
|
724 |
<div class="labels"></div>
|
725 |
<div class="row collapse"><div class="detail-description">
|
726 |
<p class="long_description"></p>
|
727 |
<table class="table table-bordered"><tr>
|
728 |
<th>since</th>
|
729 |
-
<td>0.
|
730 |
</tr></table>
|
731 |
<h3>Parameters</h3>
|
732 |
<div class="subelement argument">
|
733 |
<h4>$item</h4>
|
734 |
-
<code>
|
735 |
</div>
|
736 |
-
<div class="subelement argument">
|
737 |
-
<h4>$column</h4>
|
738 |
-
<code>string</code><p>Current column name</p></div>
|
739 |
<h3>Returns</h3>
|
740 |
<div class="subelement response">
|
741 |
-
<code>
|
742 |
</div></div>
|
743 |
</div>
|
744 |
-
<a name="
|
745 |
-
<h2>
|
746 |
-
|
|
|
747 |
<div class="labels"></div>
|
748 |
<div class="row collapse"><div class="detail-description">
|
749 |
<p class="long_description"></p>
|
@@ -753,12 +871,15 @@ with additional entries.</p></p>
|
|
753 |
</tr></table>
|
754 |
<h3>Parameters</h3>
|
755 |
<div class="subelement argument">
|
756 |
-
<h4>$
|
757 |
-
<code>
|
758 |
</div>
|
|
|
|
|
|
|
759 |
<h3>Returns</h3>
|
760 |
<div class="subelement response">
|
761 |
-
<code>
|
762 |
</div></div>
|
763 |
</div>
|
764 |
<a name="_default_hidden_columns" id="_default_hidden_columns"></a><div class="element clickable method private _default_hidden_columns" data-toggle="collapse" data-target="._default_hidden_columns .collapse">
|
@@ -776,22 +897,6 @@ with additional entries.</p></p>
|
|
776 |
<code>array</code>default list of hidden columns</div>
|
777 |
</div></div>
|
778 |
</div>
|
779 |
-
<a name="_mime_types" id="_mime_types"></a><div class="element clickable method private _mime_types" data-toggle="collapse" data-target="._mime_types .collapse">
|
780 |
-
<h2>Get possible mime types for view preparation.</h2>
|
781 |
-
<pre>_mime_types() : array</pre>
|
782 |
-
<div class="labels"></div>
|
783 |
-
<div class="row collapse"><div class="detail-description">
|
784 |
-
<p class="long_description"><p>Modeled after get_post_mime_types in wp-admin/includes/post.php,
|
785 |
-
with additional entries.</p></p>
|
786 |
-
<table class="table table-bordered"><tr>
|
787 |
-
<th>since</th>
|
788 |
-
<td>0.1</td>
|
789 |
-
</tr></table>
|
790 |
-
<h3>Returns</h3>
|
791 |
-
<div class="subelement response">
|
792 |
-
<code>array</code>Mime type names and HTML markup for views</div>
|
793 |
-
</div></div>
|
794 |
-
</div>
|
795 |
<h3>
|
796 |
<i class="icon-custom icon-property"></i> Properties</h3>
|
797 |
<a name="%24currently_hidden" id="$currently_hidden"> </a><div class="element clickable property private $currently_hidden" data-toggle="collapse" data-target=".$currently_hidden .collapse">
|
@@ -817,7 +922,10 @@ use the special slug "cb".</p>
|
|
817 |
|
818 |
<p>The 'cb' column is treated differently than the rest. If including a checkbox
|
819 |
column in your table you must create a column_cb() method. If you don't need
|
820 |
-
bulk actions or checkboxes, simply leave the 'cb' entry out of your array.</p
|
|
|
|
|
|
|
821 |
<table class="table table-bordered"><tr>
|
822 |
<th>since</th>
|
823 |
<td>0.1</td>
|
@@ -825,7 +933,7 @@ bulk actions or checkboxes, simply leave the 'cb' entry out of your array.</p></
|
|
825 |
</div></div>
|
826 |
</div>
|
827 |
<a name="%24default_hidden_columns" id="$default_hidden_columns"> </a><div class="element clickable property private $default_hidden_columns" data-toggle="collapse" data-target=".$default_hidden_columns .collapse">
|
828 |
-
<h2>Default values for
|
829 |
<pre>$default_hidden_columns : array</pre>
|
830 |
<div class="labels"></div>
|
831 |
<div class="row collapse"><div class="detail-description">
|
@@ -833,7 +941,10 @@ bulk actions or checkboxes, simply leave the 'cb' entry out of your array.</p></
|
|
833 |
the user has not altered the selection of hidden columns.</p>
|
834 |
|
835 |
<p>The value on the right-hand side must match the column slug, e.g.,
|
836 |
-
array(0 => 'ID_parent, 1 => 'title_name').</p
|
|
|
|
|
|
|
837 |
<table class="table table-bordered"><tr>
|
838 |
<th>since</th>
|
839 |
<td>0.1</td>
|
@@ -851,7 +962,10 @@ to sort by. Often, the key and value will be the same, but this is not always
|
|
851 |
the case (as the value is a column name from the database, not the list table).</p>
|
852 |
|
853 |
<p>The array value also contains a boolean which is 'true' if the data is currently
|
854 |
-
sorted by that column. This is computed each time the table is displayed.</p
|
|
|
|
|
|
|
855 |
<table class="table table-bordered"><tr>
|
856 |
<th>since</th>
|
857 |
<td>0.1</td>
|
@@ -877,7 +991,7 @@ sorted by that column. This is computed each time the table is displayed.</p></p
|
|
877 |
<div class="row"><footer class="span12">
|
878 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
879 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
880 |
-
generated on
|
881 |
</div>
|
882 |
</body>
|
883 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » \MLA_List_Table</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
61 |
<li class="method public "><a href="#column_author" title="column_author :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_author()</pre></a></li>
|
62 |
<li class="method public "><a href="#column_base_file" title="column_base_file :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_base_file()</pre></a></li>
|
63 |
<li class="method public "><a href="#column_caption" title="column_caption :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_caption()</pre></a></li>
|
|
|
64 |
<li class="method public "><a href="#column_cb" title="column_cb :: Displays checkboxes for using bulk actions."><span class="description">Displays checkboxes for using bulk actions.</span><pre>column_cb()</pre></a></li>
|
65 |
<li class="method public "><a href="#column_date" title="column_date :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_date()</pre></a></li>
|
66 |
+
<li class="method public "><a href="#column_default" title="column_default :: Supply a column value if no column-specific function has been defined"><span class="description">Supply a column value if no column-specific function has been defined</span><pre>column_default()</pre></a></li>
|
|
|
|
|
67 |
<li class="method public "><a href="#column_description" title="column_description :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_description()</pre></a></li>
|
68 |
<li class="method public "><a href="#column_featured" title="column_featured :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_featured()</pre></a></li>
|
69 |
+
<li class="method public "><a href="#column_galleries" title="column_galleries :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_galleries()</pre></a></li>
|
70 |
<li class="method public "><a href="#column_icon" title="column_icon :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_icon()</pre></a></li>
|
71 |
<li class="method public "><a href="#column_inserted" title="column_inserted :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_inserted()</pre></a></li>
|
72 |
+
<li class="method public "><a href="#column_menu_order" title="column_menu_order :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_menu_order()</pre></a></li>
|
73 |
+
<li class="method public "><a href="#column_mla_galleries" title="column_mla_galleries :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_mla_galleries()</pre></a></li>
|
74 |
+
<li class="method public "><a href="#column_modified" title="column_modified :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_modified()</pre></a></li>
|
75 |
<li class="method public "><a href="#column_parent" title="column_parent :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_parent()</pre></a></li>
|
76 |
+
<li class="method public "><a href="#column_post_mime_type" title="column_post_mime_type :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_post_mime_type()</pre></a></li>
|
77 |
<li class="method public "><a href="#column_post_name" title="column_post_name :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_post_name()</pre></a></li>
|
78 |
<li class="method public "><a href="#column_post_title" title="column_post_title :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_post_title()</pre></a></li>
|
|
|
79 |
<li class="method public "><a href="#column_title_name" title="column_title_name :: Supply the content for a custom column"><span class="description">Supply the content for a custom column</span><pre>column_title_name()</pre></a></li>
|
80 |
+
<li class="method public "><a href="#extra_tablenav" title="extra_tablenav :: Extra controls to be displayed between bulk actions and pagination"><span class="description">Extra controls to be displayed between bulk actions and pagination</span><pre>extra_tablenav()</pre></a></li>
|
81 |
<li class="method public "><a href="#get_bulk_actions" title="get_bulk_actions :: Get an associative array ( option_name => option_title ) with the list
|
82 |
of bulk actions available on this table."><span class="description">Get an associative array ( option_name => option_title ) with the list
|
83 |
of bulk actions available on this table.</span><pre>get_bulk_actions()</pre></a></li>
|
84 |
+
<li class="method public "><a href="#get_columns" title="get_columns :: This method dictates the table's columns and titles"><span class="description">This method dictates the table's columns and titles</span><pre>get_columns()</pre></a></li>
|
85 |
<li class="method public "><a href="#get_hidden_columns" title="get_hidden_columns :: Returns the list of currently hidden columns from a user option or
|
86 |
from default values if the option is not set"><span class="description">Returns the list of currently hidden columns from a user option or
|
87 |
from default values if the option is not set</span><pre>get_hidden_columns()</pre></a></li>
|
89 |
and the value is db column to sort by."><span class="description">Returns an array where the key is the column that needs to be sortable
|
90 |
and the value is db column to sort by.</span><pre>get_sortable_columns()</pre></a></li>
|
91 |
<li class="method public "><a href="#get_views" title="get_views :: Returns an associative array listing all the views that can be used with this table."><span class="description">Returns an associative array listing all the views that can be used with this table.</span><pre>get_views()</pre></a></li>
|
92 |
+
<li class="method public "><a href="#mla_admin_init_action" title="mla_admin_init_action :: Adds support for taxonomy columns"><span class="description">Adds support for taxonomy columns</span><pre>mla_admin_init_action()</pre></a></li>
|
93 |
+
<li class="method public "><a href="#mla_get_attachment_mime_types" title="mla_get_attachment_mime_types :: Get possible mime types for view preparation"><span class="description">Get possible mime types for view preparation</span><pre>mla_get_attachment_mime_types()</pre></a></li>
|
94 |
+
<li class="method public "><a href="#mla_get_sortable_columns" title="mla_get_sortable_columns :: Return the names and display values of the sortable columns"><span class="description">Return the names and display values of the sortable columns</span><pre>mla_get_sortable_columns()</pre></a></li>
|
95 |
+
<li class="method public "><a href="#mla_manage_columns_filter" title="mla_manage_columns_filter :: Handler for filter 'manage_media_page_mla-menu_columns'"><span class="description">Handler for filter 'manage_media_page_mla-menu_columns'</span><pre>mla_manage_columns_filter()</pre></a></li>
|
96 |
+
<li class="method public "><a href="#mla_manage_hidden_columns_filter" title="mla_manage_hidden_columns_filter :: Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'"><span class="description">Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'</span><pre>mla_manage_hidden_columns_filter()</pre></a></li>
|
97 |
+
<li class="method public "><a href="#prepare_items" title="prepare_items :: Prepares the list of items for displaying"><span class="description">Prepares the list of items for displaying</span><pre>prepare_items()</pre></a></li>
|
98 |
+
<li class="method public "><a href="#single_row" title="single_row :: Generates (echoes) content for a single row of the table"><span class="description">Generates (echoes) content for a single row of the table</span><pre>single_row()</pre></a></li>
|
99 |
<li class="nav-header private">» Private</li>
|
100 |
+
<li class="method private "><a href="#_avail_mime_types" title="_avail_mime_types :: Get mime types with one or more attachments for view preparation"><span class="description">Get mime types with one or more attachments for view preparation</span><pre>_avail_mime_types()</pre></a></li>
|
101 |
+
<li class="method private "><a href="#_build_inline_data" title="_build_inline_data :: Add hidden fields with the data for use in the inline editor"><span class="description">Add hidden fields with the data for use in the inline editor</span><pre>_build_inline_data()</pre></a></li>
|
102 |
<li class="method private "><a href="#_build_rollover_actions" title="_build_rollover_actions :: Add rollover actions to exactly one of the following displayed columns:
|
103 |
'ID_parent', 'title_name', 'post_title', 'post_name'"><span class="description">Add rollover actions to exactly one of the following displayed columns:
|
104 |
'ID_parent', 'title_name', 'post_title', 'post_name'</span><pre>_build_rollover_actions()</pre></a></li>
|
|
|
105 |
<li class="method private "><a href="#_default_hidden_columns" title="_default_hidden_columns :: Access the default list of hidden columns"><span class="description">Access the default list of hidden columns</span><pre>_default_hidden_columns()</pre></a></li>
|
|
|
106 |
<li class="nav-header">
|
107 |
<i class="icon-custom icon-property"></i> Properties</li>
|
108 |
<li class="nav-header private">» Private</li>
|
109 |
<li class="property private "><a href="#%24currently_hidden" title="$currently_hidden :: Currently hidden columns"><span class="description">Currently hidden columns</span><pre>$currently_hidden</pre></a></li>
|
110 |
<li class="property private "><a href="#%24default_columns" title="$default_columns :: Table column definitions"><span class="description">Table column definitions</span><pre>$default_columns</pre></a></li>
|
111 |
+
<li class="property private "><a href="#%24default_hidden_columns" title="$default_hidden_columns :: Default values for hidden columns"><span class="description">Default values for hidden columns</span><pre>$default_hidden_columns</pre></a></li>
|
112 |
<li class="property private "><a href="#%24default_sortable_columns" title="$default_sortable_columns :: Sortable column definitions"><span class="description">Sortable column definitions</span><pre>$default_sortable_columns</pre></a></li>
|
113 |
<li class="property private "><a href="#%24rollover_id" title="$rollover_id :: Records assignment of row-level actions to a table row"><span class="description">Records assignment of row-level actions to a table row</span><pre>$rollover_id</pre></a></li>
|
114 |
</ul>
|
124 |
</li>
|
125 |
</ul>
|
126 |
<div href="../classes/MLA_List_Table.html" class="element class">
|
127 |
+
<p class="short_description">Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu</p>
|
128 |
<div class="details">
|
129 |
+
<p class="long_description"><p>Extends the core WP_List_Table class.</p></p>
|
130 |
<table class="table table-bordered">
|
131 |
<tr>
|
132 |
<th>package</th>
|
142 |
<a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse">
|
143 |
<h2>Initializes some properties from $_REQUEST vairables, then
|
144 |
calls the parent constructor to set some default configs.</h2>
|
145 |
+
<pre>__construct() : void</pre>
|
146 |
<div class="labels"></div>
|
147 |
<div class="row collapse"><div class="detail-description">
|
148 |
<p class="long_description"></p>
|
220 |
<p class="long_description"></p>
|
221 |
<table class="table table-bordered"><tr>
|
222 |
<th>since</th>
|
223 |
+
<td>0.30</td>
|
224 |
</tr></table>
|
225 |
<h3>Parameters</h3>
|
226 |
<div class="subelement argument">
|
272 |
<code>string</code>HTML markup to be placed inside the column</div>
|
273 |
</div></div>
|
274 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
<a name="column_cb" id="column_cb"></a><div class="element clickable method public column_cb" data-toggle="collapse" data-target=".column_cb .collapse">
|
276 |
<h2>Displays checkboxes for using bulk actions.</h2>
|
277 |
<pre>column_cb(array $item) : string</pre>
|
314 |
</div></div>
|
315 |
</div>
|
316 |
<a name="column_default" id="column_default"></a><div class="element clickable method public column_default" data-toggle="collapse" data-target=".column_default .collapse">
|
317 |
+
<h2>Supply a column value if no column-specific function has been defined</h2>
|
|
|
318 |
<pre>column_default(array $item, array $column_name) : string</pre>
|
319 |
<div class="labels"></div>
|
320 |
<div class="row collapse"><div class="detail-description">
|
321 |
+
<p class="long_description"><p>Called when the parent class can't find a method specifically built for a
|
322 |
+
given column. The taxonomy columns are handled here. All other columns should
|
323 |
+
have a specific method, so this function returns a troubleshooting message.</p></p>
|
324 |
<table class="table table-bordered"><tr>
|
325 |
<th>since</th>
|
326 |
<td>0.1</td>
|
379 |
<code>string</code>HTML markup to be placed inside the column</div>
|
380 |
</div></div>
|
381 |
</div>
|
382 |
+
<a name="column_galleries" id="column_galleries"></a><div class="element clickable method public column_galleries" data-toggle="collapse" data-target=".column_galleries .collapse">
|
383 |
+
<h2>Supply the content for a custom column</h2>
|
384 |
+
<pre>column_galleries(array $item) : string</pre>
|
385 |
+
<div class="labels"></div>
|
386 |
+
<div class="row collapse"><div class="detail-description">
|
387 |
+
<p class="long_description"></p>
|
388 |
+
<table class="table table-bordered"><tr>
|
389 |
+
<th>since</th>
|
390 |
+
<td>0.70</td>
|
391 |
+
</tr></table>
|
392 |
+
<h3>Parameters</h3>
|
393 |
+
<div class="subelement argument">
|
394 |
+
<h4>$item</h4>
|
395 |
+
<code>array</code><p>A singular attachment (post) object</p>
|
396 |
+
</div>
|
397 |
+
<h3>Returns</h3>
|
398 |
+
<div class="subelement response">
|
399 |
+
<code>string</code>HTML markup to be placed inside the column</div>
|
400 |
+
</div></div>
|
401 |
+
</div>
|
402 |
<a name="column_icon" id="column_icon"></a><div class="element clickable method public column_icon" data-toggle="collapse" data-target=".column_icon .collapse">
|
403 |
<h2>Supply the content for a custom column</h2>
|
404 |
<pre>column_icon(array $item) : string</pre>
|
439 |
<code>string</code>HTML markup to be placed inside the column</div>
|
440 |
</div></div>
|
441 |
</div>
|
442 |
+
<a name="column_menu_order" id="column_menu_order"></a><div class="element clickable method public column_menu_order" data-toggle="collapse" data-target=".column_menu_order .collapse">
|
443 |
+
<h2>Supply the content for a custom column</h2>
|
444 |
+
<pre>column_menu_order(array $item) : string</pre>
|
445 |
+
<div class="labels"></div>
|
446 |
+
<div class="row collapse"><div class="detail-description">
|
447 |
+
<p class="long_description"></p>
|
448 |
+
<table class="table table-bordered"><tr>
|
449 |
+
<th>since</th>
|
450 |
+
<td>0.60</td>
|
451 |
+
</tr></table>
|
452 |
+
<h3>Parameters</h3>
|
453 |
+
<div class="subelement argument">
|
454 |
+
<h4>$item</h4>
|
455 |
+
<code>array</code><p>A singular attachment (post) object</p>
|
456 |
+
</div>
|
457 |
+
<h3>Returns</h3>
|
458 |
+
<div class="subelement response">
|
459 |
+
<code>string</code>HTML markup to be placed inside the column</div>
|
460 |
+
</div></div>
|
461 |
+
</div>
|
462 |
+
<a name="column_mla_galleries" id="column_mla_galleries"></a><div class="element clickable method public column_mla_galleries" data-toggle="collapse" data-target=".column_mla_galleries .collapse">
|
463 |
+
<h2>Supply the content for a custom column</h2>
|
464 |
+
<pre>column_mla_galleries(array $item) : string</pre>
|
465 |
+
<div class="labels"></div>
|
466 |
+
<div class="row collapse"><div class="detail-description">
|
467 |
+
<p class="long_description"></p>
|
468 |
+
<table class="table table-bordered"><tr>
|
469 |
+
<th>since</th>
|
470 |
+
<td>0.70</td>
|
471 |
+
</tr></table>
|
472 |
+
<h3>Parameters</h3>
|
473 |
+
<div class="subelement argument">
|
474 |
+
<h4>$item</h4>
|
475 |
+
<code>array</code><p>A singular attachment (post) object</p>
|
476 |
+
</div>
|
477 |
+
<h3>Returns</h3>
|
478 |
+
<div class="subelement response">
|
479 |
+
<code>string</code>HTML markup to be placed inside the column</div>
|
480 |
+
</div></div>
|
481 |
+
</div>
|
482 |
+
<a name="column_modified" id="column_modified"></a><div class="element clickable method public column_modified" data-toggle="collapse" data-target=".column_modified .collapse">
|
483 |
+
<h2>Supply the content for a custom column</h2>
|
484 |
+
<pre>column_modified(array $item) : string</pre>
|
485 |
+
<div class="labels"></div>
|
486 |
+
<div class="row collapse"><div class="detail-description">
|
487 |
+
<p class="long_description"></p>
|
488 |
+
<table class="table table-bordered"><tr>
|
489 |
+
<th>since</th>
|
490 |
+
<td>0.30</td>
|
491 |
+
</tr></table>
|
492 |
+
<h3>Parameters</h3>
|
493 |
+
<div class="subelement argument">
|
494 |
+
<h4>$item</h4>
|
495 |
+
<code>array</code><p>A singular attachment (post) object</p>
|
496 |
+
</div>
|
497 |
+
<h3>Returns</h3>
|
498 |
+
<div class="subelement response">
|
499 |
+
<code>string</code>HTML markup to be placed inside the column</div>
|
500 |
+
</div></div>
|
501 |
+
</div>
|
502 |
<a name="column_parent" id="column_parent"></a><div class="element clickable method public column_parent" data-toggle="collapse" data-target=".column_parent .collapse">
|
503 |
<h2>Supply the content for a custom column</h2>
|
504 |
<pre>column_parent(array $item) : string</pre>
|
519 |
<code>string</code>HTML markup to be placed inside the column</div>
|
520 |
</div></div>
|
521 |
</div>
|
522 |
+
<a name="column_post_mime_type" id="column_post_mime_type"></a><div class="element clickable method public column_post_mime_type" data-toggle="collapse" data-target=".column_post_mime_type .collapse">
|
523 |
<h2>Supply the content for a custom column</h2>
|
524 |
+
<pre>column_post_mime_type(array $item) : string</pre>
|
525 |
<div class="labels"></div>
|
526 |
<div class="row collapse"><div class="detail-description">
|
527 |
<p class="long_description"></p>
|
528 |
<table class="table table-bordered"><tr>
|
529 |
<th>since</th>
|
530 |
+
<td>0.30</td>
|
531 |
</tr></table>
|
532 |
<h3>Parameters</h3>
|
533 |
<div class="subelement argument">
|
539 |
<code>string</code>HTML markup to be placed inside the column</div>
|
540 |
</div></div>
|
541 |
</div>
|
542 |
+
<a name="column_post_name" id="column_post_name"></a><div class="element clickable method public column_post_name" data-toggle="collapse" data-target=".column_post_name .collapse">
|
543 |
<h2>Supply the content for a custom column</h2>
|
544 |
+
<pre>column_post_name(array $item) : string</pre>
|
545 |
<div class="labels"></div>
|
546 |
<div class="row collapse"><div class="detail-description">
|
547 |
<p class="long_description"></p>
|
559 |
<code>string</code>HTML markup to be placed inside the column</div>
|
560 |
</div></div>
|
561 |
</div>
|
562 |
+
<a name="column_post_title" id="column_post_title"></a><div class="element clickable method public column_post_title" data-toggle="collapse" data-target=".column_post_title .collapse">
|
563 |
<h2>Supply the content for a custom column</h2>
|
564 |
+
<pre>column_post_title(array $item) : string</pre>
|
565 |
<div class="labels"></div>
|
566 |
<div class="row collapse"><div class="detail-description">
|
567 |
<p class="long_description"></p>
|
600 |
</div></div>
|
601 |
</div>
|
602 |
<a name="extra_tablenav" id="extra_tablenav"></a><div class="element clickable method public extra_tablenav" data-toggle="collapse" data-target=".extra_tablenav .collapse">
|
603 |
+
<h2>Extra controls to be displayed between bulk actions and pagination</h2>
|
604 |
<pre>extra_tablenav(string $which) : array</pre>
|
605 |
<div class="labels"></div>
|
606 |
<div class="row collapse"><div class="detail-description">
|
607 |
+
<p class="long_description"><p>Modeled after class-wp-posts-list-table.php in wp-admin/includes.</p></p>
|
608 |
<table class="table table-bordered"><tr>
|
609 |
<th>since</th>
|
610 |
<td>0.1</td>
|
636 |
</div></div>
|
637 |
</div>
|
638 |
<a name="get_columns" id="get_columns"></a><div class="element clickable method public get_columns" data-toggle="collapse" data-target=".get_columns .collapse">
|
639 |
+
<h2>This method dictates the table's columns and titles</h2>
|
640 |
<pre>get_columns() : array</pre>
|
641 |
<div class="labels"></div>
|
642 |
<div class="row collapse"><div class="detail-description">
|
680 |
</tr></table>
|
681 |
<h3>Returns</h3>
|
682 |
<div class="subelement response">
|
683 |
+
<code>array</code>Sortable column information,e.g., 'slugs'=>array('data_values',boolean)</div>
|
684 |
</div></div>
|
685 |
</div>
|
686 |
<a name="get_views" id="get_views"></a><div class="element clickable method public get_views" data-toggle="collapse" data-target=".get_views .collapse">
|
698 |
<code>array</code>View information,e.g., array ( id => link )</div>
|
699 |
</div></div>
|
700 |
</div>
|
701 |
+
<a name="mla_admin_init_action" id="mla_admin_init_action"></a><div class="element clickable method public mla_admin_init_action" data-toggle="collapse" data-target=".mla_admin_init_action .collapse">
|
702 |
+
<h2>Adds support for taxonomy columns</h2>
|
703 |
+
<pre>mla_admin_init_action() : void</pre>
|
704 |
+
<div class="labels"></div>
|
705 |
+
<div class="row collapse"><div class="detail-description">
|
706 |
+
<p class="long_description"><p>Called in the admin_init action because the list_table object isn't
|
707 |
+
created in time to affect the "screen options" setup.</p></p>
|
708 |
+
<table class="table table-bordered"><tr>
|
709 |
+
<th>since</th>
|
710 |
+
<td>0.30</td>
|
711 |
+
</tr></table>
|
712 |
+
</div></div>
|
713 |
+
</div>
|
714 |
+
<a name="mla_get_attachment_mime_types" id="mla_get_attachment_mime_types"></a><div class="element clickable method public mla_get_attachment_mime_types" data-toggle="collapse" data-target=".mla_get_attachment_mime_types .collapse">
|
715 |
+
<h2>Get possible mime types for view preparation</h2>
|
716 |
+
<pre>mla_get_attachment_mime_types() : array</pre>
|
717 |
+
<div class="labels"></div>
|
718 |
+
<div class="row collapse"><div class="detail-description">
|
719 |
+
<p class="long_description"><p>Modeled after get_post_mime_types in wp-includes/post.php,
|
720 |
+
with additional entries.</p></p>
|
721 |
+
<table class="table table-bordered"><tr>
|
722 |
+
<th>since</th>
|
723 |
+
<td>0.1</td>
|
724 |
+
</tr></table>
|
725 |
+
<h3>Returns</h3>
|
726 |
+
<div class="subelement response">
|
727 |
+
<code>array</code>Mime type names and HTML markup for views</div>
|
728 |
+
</div></div>
|
729 |
+
</div>
|
730 |
+
<a name="mla_get_sortable_columns" id="mla_get_sortable_columns"></a><div class="element clickable method public mla_get_sortable_columns" data-toggle="collapse" data-target=".mla_get_sortable_columns .collapse">
|
731 |
+
<h2>Return the names and display values of the sortable columns</h2>
|
732 |
+
<pre>mla_get_sortable_columns() : array</pre>
|
733 |
+
<div class="labels"></div>
|
734 |
+
<div class="row collapse"><div class="detail-description">
|
735 |
+
<p class="long_description"></p>
|
736 |
+
<table class="table table-bordered"><tr>
|
737 |
+
<th>since</th>
|
738 |
+
<td>0.30</td>
|
739 |
+
</tr></table>
|
740 |
+
<h3>Returns</h3>
|
741 |
+
<div class="subelement response">
|
742 |
+
<code>array</code>name => array( orderby value, heading ) for sortable columns</div>
|
743 |
+
</div></div>
|
744 |
+
</div>
|
745 |
+
<a name="mla_manage_columns_filter" id="mla_manage_columns_filter"></a><div class="element clickable method public mla_manage_columns_filter" data-toggle="collapse" data-target=".mla_manage_columns_filter .collapse">
|
746 |
<h2>Handler for filter 'manage_media_page_mla-menu_columns'</h2>
|
747 |
+
<pre>mla_manage_columns_filter() : array</pre>
|
748 |
<div class="labels"></div>
|
749 |
<div class="row collapse"><div class="detail-description">
|
750 |
<p class="long_description"><p>This required filter dictates the table's columns and titles. Set when the
|
759 |
<code>array</code>list of table columns</div>
|
760 |
</div></div>
|
761 |
</div>
|
762 |
+
<a name="mla_manage_hidden_columns_filter" id="mla_manage_hidden_columns_filter"></a><div class="element clickable method public mla_manage_hidden_columns_filter" data-toggle="collapse" data-target=".mla_manage_hidden_columns_filter .collapse">
|
763 |
<h2>Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'</h2>
|
764 |
+
<pre>mla_manage_hidden_columns_filter(string $result, string $option, object $user_data) : array</pre>
|
765 |
<div class="labels"></div>
|
766 |
<div class="row collapse"><div class="detail-description">
|
767 |
<p class="long_description"><p>Required because the screen.php get_hidden_columns function only uses
|
788 |
</div></div>
|
789 |
</div>
|
790 |
<a name="prepare_items" id="prepare_items"></a><div class="element clickable method public prepare_items" data-toggle="collapse" data-target=".prepare_items .collapse">
|
791 |
+
<h2>Prepares the list of items for displaying</h2>
|
792 |
+
<pre>prepare_items() : void</pre>
|
793 |
<div class="labels"></div>
|
794 |
<div class="row collapse"><div class="detail-description">
|
795 |
<p class="long_description"><p>This is where you prepare your data for display. This method will usually
|
802 |
</tr></table>
|
803 |
</div></div>
|
804 |
</div>
|
805 |
+
<a name="single_row" id="single_row"></a><div class="element clickable method public single_row" data-toggle="collapse" data-target=".single_row .collapse">
|
806 |
+
<h2>Generates (echoes) content for a single row of the table</h2>
|
807 |
+
<pre>single_row(object $item) : void</pre>
|
808 |
+
<div class="labels"></div>
|
809 |
+
<div class="row collapse"><div class="detail-description">
|
810 |
+
<p class="long_description"></p>
|
811 |
+
<table class="table table-bordered"><tr>
|
812 |
+
<th>since</th>
|
813 |
+
<td>.20</td>
|
814 |
+
</tr></table>
|
815 |
+
<h3>Parameters</h3>
|
816 |
+
<div class="subelement argument">
|
817 |
+
<h4>$item</h4>
|
818 |
+
<code>object</code><p>the current item</p></div>
|
819 |
+
</div></div>
|
820 |
+
</div>
|
821 |
<a name="_avail_mime_types" id="_avail_mime_types"></a><div class="element clickable method private _avail_mime_types" data-toggle="collapse" data-target="._avail_mime_types .collapse">
|
822 |
+
<h2>Get mime types with one or more attachments for view preparation</h2>
|
823 |
<pre>_avail_mime_types(array $num_posts) : array</pre>
|
824 |
<div class="labels"></div>
|
825 |
<div class="row collapse"><div class="detail-description">
|
838 |
<code>array</code>Mime type names</div>
|
839 |
</div></div>
|
840 |
</div>
|
841 |
+
<a name="_build_inline_data" id="_build_inline_data"></a><div class="element clickable method private _build_inline_data" data-toggle="collapse" data-target="._build_inline_data .collapse">
|
842 |
+
<h2>Add hidden fields with the data for use in the inline editor</h2>
|
843 |
+
<pre>_build_inline_data(object $item) : string</pre>
|
|
|
844 |
<div class="labels"></div>
|
845 |
<div class="row collapse"><div class="detail-description">
|
846 |
<p class="long_description"></p>
|
847 |
<table class="table table-bordered"><tr>
|
848 |
<th>since</th>
|
849 |
+
<td>0.20</td>
|
850 |
</tr></table>
|
851 |
<h3>Parameters</h3>
|
852 |
<div class="subelement argument">
|
853 |
<h4>$item</h4>
|
854 |
+
<code>object</code><p>A singular attachment (post) object</p>
|
855 |
</div>
|
|
|
|
|
|
|
856 |
<h3>Returns</h3>
|
857 |
<div class="subelement response">
|
858 |
+
<code>string</code>HTML <div> with row data</div>
|
859 |
</div></div>
|
860 |
</div>
|
861 |
+
<a name="_build_rollover_actions" id="_build_rollover_actions"></a><div class="element clickable method private _build_rollover_actions" data-toggle="collapse" data-target="._build_rollover_actions .collapse">
|
862 |
+
<h2>Add rollover actions to exactly one of the following displayed columns:
|
863 |
+
'ID_parent', 'title_name', 'post_title', 'post_name'</h2>
|
864 |
+
<pre>_build_rollover_actions(object $item, string $column) : array</pre>
|
865 |
<div class="labels"></div>
|
866 |
<div class="row collapse"><div class="detail-description">
|
867 |
<p class="long_description"></p>
|
871 |
</tr></table>
|
872 |
<h3>Parameters</h3>
|
873 |
<div class="subelement argument">
|
874 |
+
<h4>$item</h4>
|
875 |
+
<code>object</code><p>A singular attachment (post) object</p>
|
876 |
</div>
|
877 |
+
<div class="subelement argument">
|
878 |
+
<h4>$column</h4>
|
879 |
+
<code>string</code><p>Current column name</p></div>
|
880 |
<h3>Returns</h3>
|
881 |
<div class="subelement response">
|
882 |
+
<code>array</code>Names and URLs of row-level actions</div>
|
883 |
</div></div>
|
884 |
</div>
|
885 |
<a name="_default_hidden_columns" id="_default_hidden_columns"></a><div class="element clickable method private _default_hidden_columns" data-toggle="collapse" data-target="._default_hidden_columns .collapse">
|
897 |
<code>array</code>default list of hidden columns</div>
|
898 |
</div></div>
|
899 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
900 |
<h3>
|
901 |
<i class="icon-custom icon-property"></i> Properties</h3>
|
902 |
<a name="%24currently_hidden" id="$currently_hidden"> </a><div class="element clickable property private $currently_hidden" data-toggle="collapse" data-target=".$currently_hidden .collapse">
|
922 |
|
923 |
<p>The 'cb' column is treated differently than the rest. If including a checkbox
|
924 |
column in your table you must create a column_cb() method. If you don't need
|
925 |
+
bulk actions or checkboxes, simply leave the 'cb' entry out of your array.</p>
|
926 |
+
|
927 |
+
<p>Taxonomy columns are added to this array by mla_admin_init_action.
|
928 |
+
Custom field columns are added to this array by mla_admin_init_action.</p></p>
|
929 |
<table class="table table-bordered"><tr>
|
930 |
<th>since</th>
|
931 |
<td>0.1</td>
|
933 |
</div></div>
|
934 |
</div>
|
935 |
<a name="%24default_hidden_columns" id="$default_hidden_columns"> </a><div class="element clickable property private $default_hidden_columns" data-toggle="collapse" data-target=".$default_hidden_columns .collapse">
|
936 |
+
<h2>Default values for hidden columns</h2>
|
937 |
<pre>$default_hidden_columns : array</pre>
|
938 |
<div class="labels"></div>
|
939 |
<div class="row collapse"><div class="detail-description">
|
941 |
the user has not altered the selection of hidden columns.</p>
|
942 |
|
943 |
<p>The value on the right-hand side must match the column slug, e.g.,
|
944 |
+
array(0 => 'ID_parent, 1 => 'title_name').</p>
|
945 |
+
|
946 |
+
<p>Taxonomy columns are added to this array by mla_admin_init_action.
|
947 |
+
Custom field columns are added to this array by mla_admin_init_action.</p></p>
|
948 |
<table class="table table-bordered"><tr>
|
949 |
<th>since</th>
|
950 |
<td>0.1</td>
|
962 |
the case (as the value is a column name from the database, not the list table).</p>
|
963 |
|
964 |
<p>The array value also contains a boolean which is 'true' if the data is currently
|
965 |
+
sorted by that column. This is computed each time the table is displayed.</p>
|
966 |
+
|
967 |
+
<p>Taxonomy columns, if any, are added to this array by mla_admin_init_action.
|
968 |
+
Custom field columns are added to this array by mla_admin_init_action.</p></p>
|
969 |
<table class="table table-bordered"><tr>
|
970 |
<th>since</th>
|
971 |
<td>0.1</td>
|
991 |
<div class="row"><footer class="span12">
|
992 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
993 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
994 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
995 |
</div>
|
996 |
</body>
|
997 |
</html>
|
phpDocs/deprecated.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -65,7 +62,7 @@
|
|
65 |
<div class="row"><footer class="span12">
|
66 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
67 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
68 |
-
generated on
|
69 |
</div>
|
70 |
</body>
|
71 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
62 |
<div class="row"><footer class="span12">
|
63 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
64 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
65 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
66 |
</div>
|
67 |
</body>
|
68 |
</html>
|
phpDocs/errors.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -71,12 +68,15 @@
|
|
71 |
<div class="package-contents"></div>
|
72 |
<div class="package-contents"></div>
|
73 |
<div class="package-contents"></div>
|
|
|
|
|
|
|
74 |
</div>
|
75 |
</div>
|
76 |
<div class="row"><footer class="span12">
|
77 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
78 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
79 |
-
generated on
|
80 |
</div>
|
81 |
</body>
|
82 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
68 |
<div class="package-contents"></div>
|
69 |
<div class="package-contents"></div>
|
70 |
<div class="package-contents"></div>
|
71 |
+
<div class="package-contents"></div>
|
72 |
+
<div class="package-contents"></div>
|
73 |
+
<div class="package-contents"></div>
|
74 |
</div>
|
75 |
</div>
|
76 |
<div class="row"><footer class="span12">
|
77 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
78 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
79 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
80 |
</div>
|
81 |
</body>
|
82 |
</html>
|
phpDocs/graph_class.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -62,7 +59,7 @@
|
|
62 |
</script><div class="row"><footer class="span12">
|
63 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
64 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
65 |
-
generated on
|
66 |
</div>
|
67 |
</body>
|
68 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
59 |
</script><div class="row"><footer class="span12">
|
60 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
61 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
62 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
63 |
</div>
|
64 |
</body>
|
65 |
</html>
|
phpDocs/index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -48,7 +45,7 @@
|
|
48 |
if Javascript is enabled.
|
49 |
</div></noscript>
|
50 |
<div class="hero-unit">
|
51 |
-
<h1>
|
52 |
<h2>Documentation</h2>
|
53 |
</div>
|
54 |
<div class="row">
|
@@ -82,7 +79,7 @@
|
|
82 |
<div class="row"><footer class="span12">
|
83 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
84 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
85 |
-
generated on
|
86 |
</div>
|
87 |
</body>
|
88 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
45 |
if Javascript is enabled.
|
46 |
</div></noscript>
|
47 |
<div class="hero-unit">
|
48 |
+
<h1>Media Library Assistant</h1>
|
49 |
<h2>Documentation</h2>
|
50 |
</div>
|
51 |
<div class="row">
|
79 |
<div class="row"><footer class="span12">
|
80 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
81 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
82 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
83 |
</div>
|
84 |
</body>
|
85 |
</html>
|
phpDocs/markers.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -67,7 +64,7 @@
|
|
67 |
<div class="row"><footer class="span12">
|
68 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
69 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
70 |
-
generated on
|
71 |
</div>
|
72 |
</body>
|
73 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
64 |
<div class="row"><footer class="span12">
|
65 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
66 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
67 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
68 |
</div>
|
69 |
</body>
|
70 |
</html>
|
phpDocs/namespaces/global.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -70,122 +67,27 @@
|
|
70 |
<div class="namespace-indent">
|
71 |
<h3>
|
72 |
<i class="icon-custom icon-function"></i> Functions</h3>
|
73 |
-
<a name="
|
74 |
-
<h2>
|
75 |
-
|
76 |
-
<pre>mla_attachment_category_column_filter(string $place_holder, array $column_name, array $term_id) : array</pre>
|
77 |
-
<div class="labels"></div>
|
78 |
-
<div class="row collapse"><div class="detail-description">
|
79 |
-
<p class="long_description"></p>
|
80 |
-
<table class="table table-bordered"><tr>
|
81 |
-
<th>since</th>
|
82 |
-
<td>0.1</td>
|
83 |
-
</tr></table>
|
84 |
-
<h3>Parameters</h3>
|
85 |
-
<div class="subelement argument">
|
86 |
-
<h4>$place_holder</h4>
|
87 |
-
<code>string</code><p>unknown, undocumented parameter.</p></div>
|
88 |
-
<div class="subelement argument">
|
89 |
-
<h4>$column_name</h4>
|
90 |
-
<code>array</code><p>name of the column.</p></div>
|
91 |
-
<div class="subelement argument">
|
92 |
-
<h4>$term_id</h4>
|
93 |
-
<code>array</code><p>ID of the term for which the count is desired.</p></div>
|
94 |
-
<h3>Returns</h3>
|
95 |
-
<div class="subelement response">
|
96 |
-
<code>array</code>HTML markup for the column content; number of attachments in the category and alink to retrieve a list of them.</div>
|
97 |
-
</div></div>
|
98 |
-
</div>
|
99 |
-
<a name="mla_attachment_category_get_columns_filter" id="mla_attachment_category_get_columns_filter"></a><div class="element clickable function mla_attachment_category_get_columns_filter" data-toggle="collapse" data-target=".mla_attachment_category_get_columns_filter .collapse">
|
100 |
-
<h2>WordPress Filter for Attachment Category "Attachments" column,
|
101 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.</h2>
|
102 |
-
<pre>mla_attachment_category_get_columns_filter(array $columns) : array</pre>
|
103 |
<div class="labels"></div>
|
104 |
<div class="row collapse"><div class="detail-description">
|
105 |
<p class="long_description"></p>
|
106 |
<table class="table table-bordered"><tr>
|
107 |
<th>since</th>
|
108 |
-
<td>0.
|
109 |
</tr></table>
|
110 |
-
<h3>Parameters</h3>
|
111 |
-
<div class="subelement argument">
|
112 |
-
<h4>$columns</h4>
|
113 |
-
<code>array</code><p>column definitions for the Attachment Category list table.</p></div>
|
114 |
-
<h3>Returns</h3>
|
115 |
-
<div class="subelement response">
|
116 |
-
<code>array</code>updated column definitions for the Attachment Category list table.</div>
|
117 |
</div></div>
|
118 |
</div>
|
119 |
-
<a name="
|
120 |
-
<h2>
|
121 |
-
<pre>
|
122 |
<div class="labels"></div>
|
123 |
<div class="row collapse"><div class="detail-description">
|
124 |
<p class="long_description"></p>
|
125 |
<table class="table table-bordered"><tr>
|
126 |
<th>since</th>
|
127 |
-
<td>
|
128 |
-
</tr></table>
|
129 |
-
<h3>Returns</h3>
|
130 |
-
<div class="subelement response">
|
131 |
-
<code>string</code>HTML markup for the attachment list</div>
|
132 |
-
</div></div>
|
133 |
-
</div>
|
134 |
-
<a name="mla_attachment_tag_column_filter" id="mla_attachment_tag_column_filter"></a><div class="element clickable function mla_attachment_tag_column_filter" data-toggle="collapse" data-target=".mla_attachment_tag_column_filter .collapse">
|
135 |
-
<h2>WordPress Filter for Attachment Tag "Attachments" column,
|
136 |
-
which returns a count of the attachments assigned a given tag</h2>
|
137 |
-
<pre>mla_attachment_tag_column_filter(string $place_holder, array $column_name, array $term_id) : array</pre>
|
138 |
-
<div class="labels"></div>
|
139 |
-
<div class="row collapse"><div class="detail-description">
|
140 |
-
<p class="long_description"></p>
|
141 |
-
<table class="table table-bordered"><tr>
|
142 |
-
<th>since</th>
|
143 |
-
<td>0.1</td>
|
144 |
-
</tr></table>
|
145 |
-
<h3>Parameters</h3>
|
146 |
-
<div class="subelement argument">
|
147 |
-
<h4>$place_holder</h4>
|
148 |
-
<code>string</code><p>unknown, undocumented parameter</p></div>
|
149 |
-
<div class="subelement argument">
|
150 |
-
<h4>$column_name</h4>
|
151 |
-
<code>array</code><p>name of the column</p></div>
|
152 |
-
<div class="subelement argument">
|
153 |
-
<h4>$term_id</h4>
|
154 |
-
<code>array</code><p>ID of the term for which the count is desired</p></div>
|
155 |
-
<h3>Returns</h3>
|
156 |
-
<div class="subelement response">
|
157 |
-
<code>array</code>HTML markup for the column content; number of attachments with the tag and alink to retrieve a list of them.</div>
|
158 |
-
</div></div>
|
159 |
-
</div>
|
160 |
-
<a name="mla_attachment_tag_get_columns_filter" id="mla_attachment_tag_get_columns_filter"></a><div class="element clickable function mla_attachment_tag_get_columns_filter" data-toggle="collapse" data-target=".mla_attachment_tag_get_columns_filter .collapse">
|
161 |
-
<h2>WordPress Filter for Attachment Tag "Attachments" column,
|
162 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.</h2>
|
163 |
-
<pre>mla_attachment_tag_get_columns_filter(array $columns) : array</pre>
|
164 |
-
<div class="labels"></div>
|
165 |
-
<div class="row collapse"><div class="detail-description">
|
166 |
-
<p class="long_description"></p>
|
167 |
-
<table class="table table-bordered"><tr>
|
168 |
-
<th>since</th>
|
169 |
-
<td>0.1</td>
|
170 |
-
</tr></table>
|
171 |
-
<h3>Parameters</h3>
|
172 |
-
<div class="subelement argument">
|
173 |
-
<h4>$columns</h4>
|
174 |
-
<code>array</code><p>column definitions for the Attachment Category list table.</p></div>
|
175 |
-
<h3>Returns</h3>
|
176 |
-
<div class="subelement response">
|
177 |
-
<code>array</code>updated column definitions for the Attachment Category list table.</div>
|
178 |
-
</div></div>
|
179 |
-
</div>
|
180 |
-
<a name="mla_build_taxonomies_action" id="mla_build_taxonomies_action"></a><div class="element clickable function mla_build_taxonomies_action" data-toggle="collapse" data-target=".mla_build_taxonomies_action .collapse">
|
181 |
-
<h2>WordPress Action; registers Attachment Categories and Attachment Tags custom taxonomies</h2>
|
182 |
-
<pre>mla_build_taxonomies_action() </pre>
|
183 |
-
<div class="labels"></div>
|
184 |
-
<div class="row collapse"><div class="detail-description">
|
185 |
-
<p class="long_description"></p>
|
186 |
-
<table class="table table-bordered"><tr>
|
187 |
-
<th>since</th>
|
188 |
-
<td>0.1</td>
|
189 |
</tr></table>
|
190 |
</div></div>
|
191 |
</div>
|
@@ -202,18 +104,46 @@ of images and files held in the WordPress Media Library.</p>
|
|
202 |
<a name="MLAData" id="MLAData"></a><div class="element ajax clickable class" href="../classes/MLAData.html">
|
203 |
<h1>MLAData<a href="../classes/MLAData.html">¶</a>
|
204 |
</h1>
|
205 |
-
<p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
206 |
<div class="details collapse"></div>
|
207 |
<a href="../classes/MLAData.html" class="more">« More »</a>
|
208 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
<a name="MLASettings" id="MLASettings"></a><div class="element ajax clickable class" href="../classes/MLASettings.html">
|
210 |
<h1>MLASettings<a href="../classes/MLASettings.html">¶</a>
|
211 |
</h1>
|
212 |
-
<p class="short_description">Class MLA (Media Library Assistant) Settings
|
213 |
-
and provides the settings page to edit them.</p>
|
214 |
<div class="details collapse"></div>
|
215 |
<a href="../classes/MLASettings.html" class="more">« More »</a>
|
216 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
<a name="MLATest" id="MLATest"></a><div class="element ajax clickable class" href="../classes/MLATest.html">
|
218 |
<h1>MLATest<a href="../classes/MLATest.html">¶</a>
|
219 |
</h1>
|
@@ -225,7 +155,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
225 |
<a name="MLA_List_Table" id="MLA_List_Table"></a><div class="element ajax clickable class" href="../classes/MLA_List_Table.html">
|
226 |
<h1>MLA_List_Table<a href="../classes/MLA_List_Table.html">¶</a>
|
227 |
</h1>
|
228 |
-
<p class="short_description">Class MLA (Media Library Assistant) List Table
|
229 |
<div class="details collapse"></div>
|
230 |
<a href="../classes/MLA_List_Table.html" class="more">« More »</a>
|
231 |
</div>
|
@@ -255,7 +185,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
255 |
<div class="row"><footer class="span12">
|
256 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
257 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
258 |
-
generated on
|
259 |
</div>
|
260 |
</body>
|
261 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » global</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
67 |
<div class="namespace-indent">
|
68 |
<h3>
|
69 |
<i class="icon-custom icon-function"></i> Functions</h3>
|
70 |
+
<a name="mla_name_conflict_reporting_action" id="mla_name_conflict_reporting_action"></a><div class="element clickable function mla_name_conflict_reporting_action" data-toggle="collapse" data-target=".mla_name_conflict_reporting_action .collapse">
|
71 |
+
<h2>Displays name conflict error messages at the top of the Dashboard</h2>
|
72 |
+
<pre>mla_name_conflict_reporting_action() </pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
<div class="labels"></div>
|
74 |
<div class="row collapse"><div class="detail-description">
|
75 |
<p class="long_description"></p>
|
76 |
<table class="table table-bordered"><tr>
|
77 |
<th>since</th>
|
78 |
+
<td>0.20</td>
|
79 |
</tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
</div></div>
|
81 |
</div>
|
82 |
+
<a name="mla_plugin_loader_reporting_action" id="mla_plugin_loader_reporting_action"></a><div class="element clickable function mla_plugin_loader_reporting_action" data-toggle="collapse" data-target=".mla_plugin_loader_reporting_action .collapse">
|
83 |
+
<h2>Displays version conflict error messages at the top of the Dashboard</h2>
|
84 |
+
<pre>mla_plugin_loader_reporting_action() </pre>
|
85 |
<div class="labels"></div>
|
86 |
<div class="row collapse"><div class="detail-description">
|
87 |
<p class="long_description"></p>
|
88 |
<table class="table table-bordered"><tr>
|
89 |
<th>since</th>
|
90 |
+
<td>1.14</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
</tr></table>
|
92 |
</div></div>
|
93 |
</div>
|
104 |
<a name="MLAData" id="MLAData"></a><div class="element ajax clickable class" href="../classes/MLAData.html">
|
105 |
<h1>MLAData<a href="../classes/MLAData.html">¶</a>
|
106 |
</h1>
|
107 |
+
<p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs</p>
|
108 |
<div class="details collapse"></div>
|
109 |
<a href="../classes/MLAData.html" class="more">« More »</a>
|
110 |
</div>
|
111 |
+
<a name="MLAEdit" id="MLAEdit"></a><div class="element ajax clickable class" href="../classes/MLAEdit.html">
|
112 |
+
<h1>MLAEdit<a href="../classes/MLAEdit.html">¶</a>
|
113 |
+
</h1>
|
114 |
+
<p class="short_description">Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen</p>
|
115 |
+
<div class="details collapse"></div>
|
116 |
+
<a href="../classes/MLAEdit.html" class="more">« More »</a>
|
117 |
+
</div>
|
118 |
+
<a name="MLAObjects" id="MLAObjects"></a><div class="element ajax clickable class" href="../classes/MLAObjects.html">
|
119 |
+
<h1>MLAObjects<a href="../classes/MLAObjects.html">¶</a>
|
120 |
+
</h1>
|
121 |
+
<p class="short_description">Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags</p>
|
122 |
+
<div class="details collapse"></div>
|
123 |
+
<a href="../classes/MLAObjects.html" class="more">« More »</a>
|
124 |
+
</div>
|
125 |
+
<a name="MLAOptions" id="MLAOptions"></a><div class="element ajax clickable class" href="../classes/MLAOptions.html">
|
126 |
+
<h1>MLAOptions<a href="../classes/MLAOptions.html">¶</a>
|
127 |
+
</h1>
|
128 |
+
<p class="short_description">Class MLA (Media Library Assistant) Options manages the plugin option settings
|
129 |
+
and provides functions to get and put them from/to WordPress option variables</p>
|
130 |
+
<div class="details collapse"></div>
|
131 |
+
<a href="../classes/MLAOptions.html" class="more">« More »</a>
|
132 |
+
</div>
|
133 |
<a name="MLASettings" id="MLASettings"></a><div class="element ajax clickable class" href="../classes/MLASettings.html">
|
134 |
<h1>MLASettings<a href="../classes/MLASettings.html">¶</a>
|
135 |
</h1>
|
136 |
+
<p class="short_description">Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings</p>
|
|
|
137 |
<div class="details collapse"></div>
|
138 |
<a href="../classes/MLASettings.html" class="more">« More »</a>
|
139 |
</div>
|
140 |
+
<a name="MLAShortcodes" id="MLAShortcodes"></a><div class="element ajax clickable class" href="../classes/MLAShortcodes.html">
|
141 |
+
<h1>MLAShortcodes<a href="../classes/MLAShortcodes.html">¶</a>
|
142 |
+
</h1>
|
143 |
+
<p class="short_description">Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users</p>
|
144 |
+
<div class="details collapse"></div>
|
145 |
+
<a href="../classes/MLAShortcodes.html" class="more">« More »</a>
|
146 |
+
</div>
|
147 |
<a name="MLATest" id="MLATest"></a><div class="element ajax clickable class" href="../classes/MLATest.html">
|
148 |
<h1>MLATest<a href="../classes/MLATest.html">¶</a>
|
149 |
</h1>
|
155 |
<a name="MLA_List_Table" id="MLA_List_Table"></a><div class="element ajax clickable class" href="../classes/MLA_List_Table.html">
|
156 |
<h1>MLA_List_Table<a href="../classes/MLA_List_Table.html">¶</a>
|
157 |
</h1>
|
158 |
+
<p class="short_description">Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu</p>
|
159 |
<div class="details collapse"></div>
|
160 |
<a href="../classes/MLA_List_Table.html" class="more">« More »</a>
|
161 |
</div>
|
185 |
<div class="row"><footer class="span12">
|
186 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
187 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
188 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
189 |
</div>
|
190 |
</body>
|
191 |
</html>
|
phpDocs/packages/Default.html
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
|
2 |
-
<head>
|
3 |
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
-
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<title>phpDocumentor » Default</title>
|
7 |
-
<meta name="author" content="Mike van Riel">
|
8 |
-
<meta name="description" content="">
|
9 |
-
<link href="../css/template.css" rel="stylesheet" media="all">
|
10 |
-
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
|
11 |
-
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
|
12 |
-
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
|
13 |
-
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
|
14 |
-
</head>
|
15 |
-
<body>
|
16 |
-
<div class="navbar navbar-fixed-top">
|
17 |
-
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">phpDocumentor</a><div class="nav-collapse"><ul class="nav">
|
19 |
-
<li class="dropdown">
|
20 |
-
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
-
</li>
|
26 |
-
<li class="dropdown" id="charts-menu">
|
27 |
-
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
28 |
-
Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
|
29 |
-
</li>
|
30 |
-
<li class="dropdown" id="reports-menu">
|
31 |
-
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
|
32 |
-
Reports <b class="caret"></b></a><ul class="dropdown-menu">
|
33 |
-
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors
|
34 |
-
<span class="label label-info">0</span></a></li>
|
35 |
-
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers
|
36 |
-
<ul></ul></a></li>
|
37 |
-
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements
|
38 |
-
<span class="label label-info">0</span></a></li>
|
39 |
-
</ul>
|
40 |
-
</li>
|
41 |
-
</ul></div>
|
42 |
-
</div></div>
|
43 |
-
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top <i class="icon-upload icon-white"></i></a></div>
|
44 |
-
</div>
|
45 |
-
<div id="___" class="container">
|
46 |
-
<noscript><div class="alert alert-warning">
|
47 |
-
Javascript is disabled; several features are only available
|
48 |
-
if Javascript is enabled.
|
49 |
-
</div></noscript>
|
50 |
-
<div class="row">
|
51 |
-
<div class="span4">
|
52 |
-
<div class="btn-group view pull-right" data-toggle="buttons-radio">
|
53 |
-
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
|
54 |
-
</div>
|
55 |
-
<ul class="side-nav nav nav-list">
|
56 |
-
<li class="nav-header">
|
57 |
-
<i class="icon-map-marker"></i> Packages</li>
|
58 |
-
<li>
|
59 |
-
<span class="empty-package"><i class="icon-folder-close"></i>Default</span><ul class="nav nav-list nav-packages"></ul>
|
60 |
-
</li>
|
61 |
-
</ul>
|
62 |
-
</div>
|
63 |
-
<div class="span8 package-contents"></div>
|
64 |
-
</div>
|
65 |
-
<div class="row"><footer class="span12">
|
66 |
-
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
67 |
-
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
68 |
-
generated on 2012-08-10T14:31:50-07:00.<br></footer></div>
|
69 |
-
</div>
|
70 |
-
</body>
|
71 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
phpDocs/packages/Media Library Assistant.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
-
<title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
@@ -15,13 +15,10 @@
|
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
-
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
-
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
|
22 |
-
<li><a>Packages</a></li>
|
23 |
-
<li><a href="../packages/Media%20Library%20Assistant.html"><i class="icon-folder-open"></i> Media Library Assistant</a></li>
|
24 |
-
</ul>
|
25 |
</li>
|
26 |
<li class="dropdown" id="charts-menu">
|
27 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
@@ -60,28 +57,20 @@
|
|
60 |
</li>
|
61 |
<li class="nav-header">
|
62 |
<i class="icon-custom icon-function"></i> Functions</li>
|
63 |
-
<li class="function "><a href="#
|
64 |
-
|
65 |
-
which returns a count of the attachments assigned a given category</span><pre>mla_attachment_category_column_filter</pre></a></li>
|
66 |
-
<li class="function "><a href="#mla_attachment_category_get_columns_filter" title='mla_attachment_category_get_columns_filter :: WordPress Filter for Attachment Category "Attachments" column,
|
67 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.'><span class="description">WordPress Filter for Attachment Category "Attachments" column,
|
68 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.</span><pre>mla_attachment_category_get_columns_filter</pre></a></li>
|
69 |
-
<li class="function "><a href="#mla_attachment_list_shortcode" title="mla_attachment_list_shortcode :: WordPress Shortcode; renders a complete list of all attachments and references to them"><span class="description">WordPress Shortcode; renders a complete list of all attachments and references to them</span><pre>mla_attachment_list_shortcode</pre></a></li>
|
70 |
-
<li class="function "><a href="#mla_attachment_tag_column_filter" title='mla_attachment_tag_column_filter :: WordPress Filter for Attachment Tag "Attachments" column,
|
71 |
-
which returns a count of the attachments assigned a given tag'><span class="description">WordPress Filter for Attachment Tag "Attachments" column,
|
72 |
-
which returns a count of the attachments assigned a given tag</span><pre>mla_attachment_tag_column_filter</pre></a></li>
|
73 |
-
<li class="function "><a href="#mla_attachment_tag_get_columns_filter" title='mla_attachment_tag_get_columns_filter :: WordPress Filter for Attachment Tag "Attachments" column,
|
74 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.'><span class="description">WordPress Filter for Attachment Tag "Attachments" column,
|
75 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.</span><pre>mla_attachment_tag_get_columns_filter</pre></a></li>
|
76 |
-
<li class="function "><a href="#mla_build_taxonomies_action" title="mla_build_taxonomies_action :: WordPress Action; registers Attachment Categories and Attachment Tags custom taxonomies"><span class="description">WordPress Action; registers Attachment Categories and Attachment Tags custom taxonomies</span><pre>mla_build_taxonomies_action</pre></a></li>
|
77 |
<li class="nav-header">
|
78 |
<i class="icon-custom icon-class"></i> Classes</li>
|
79 |
-
<li><a href="#MLAData" title="Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
80 |
-
<li><a href="#
|
|
|
81 |
<li><a href="#MLA" title="Class MLA (Media Library Assistant) provides several enhancements to the handling
|
82 |
of images and files held in the WordPress Media Library.">MLA</a></li>
|
83 |
-
<li><a href="#
|
84 |
-
|
|
|
|
|
|
|
85 |
<li><a href="#MLATest" title="Class MLA (Media Library Assistant) Test provides basic run-time tests
|
86 |
to ensure the plugin can run in the current WordPress envrionment.">MLATest</a></li>
|
87 |
<li class="nav-header">
|
@@ -101,122 +90,27 @@ to ensure the plugin can run in the current WordPress envrionment.">MLATest</a><
|
|
101 |
<div class="package-indent">
|
102 |
<h3>
|
103 |
<i class="icon-custom icon-function"></i> Functions</h3>
|
104 |
-
<a name="
|
105 |
-
<h2>
|
106 |
-
|
107 |
-
<pre>mla_attachment_category_column_filter(string $place_holder, array $column_name, array $term_id) : array</pre>
|
108 |
-
<div class="labels"></div>
|
109 |
-
<div class="row collapse"><div class="detail-description">
|
110 |
-
<p class="long_description"></p>
|
111 |
-
<table class="table table-bordered"><tr>
|
112 |
-
<th>since</th>
|
113 |
-
<td>0.1</td>
|
114 |
-
</tr></table>
|
115 |
-
<h3>Parameters</h3>
|
116 |
-
<div class="subelement argument">
|
117 |
-
<h4>$place_holder</h4>
|
118 |
-
<code>string</code><p>unknown, undocumented parameter.</p></div>
|
119 |
-
<div class="subelement argument">
|
120 |
-
<h4>$column_name</h4>
|
121 |
-
<code>array</code><p>name of the column.</p></div>
|
122 |
-
<div class="subelement argument">
|
123 |
-
<h4>$term_id</h4>
|
124 |
-
<code>array</code><p>ID of the term for which the count is desired.</p></div>
|
125 |
-
<h3>Returns</h3>
|
126 |
-
<div class="subelement response">
|
127 |
-
<code>array</code>HTML markup for the column content; number of attachments in the category and alink to retrieve a list of them.</div>
|
128 |
-
</div></div>
|
129 |
-
</div>
|
130 |
-
<a name="mla_attachment_category_get_columns_filter" id="mla_attachment_category_get_columns_filter"></a><div class="element clickable function mla_attachment_category_get_columns_filter" data-toggle="collapse" data-target=".mla_attachment_category_get_columns_filter .collapse">
|
131 |
-
<h2>WordPress Filter for Attachment Category "Attachments" column,
|
132 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.</h2>
|
133 |
-
<pre>mla_attachment_category_get_columns_filter(array $columns) : array</pre>
|
134 |
<div class="labels"></div>
|
135 |
<div class="row collapse"><div class="detail-description">
|
136 |
<p class="long_description"></p>
|
137 |
<table class="table table-bordered"><tr>
|
138 |
<th>since</th>
|
139 |
-
<td>0.
|
140 |
</tr></table>
|
141 |
-
<h3>Parameters</h3>
|
142 |
-
<div class="subelement argument">
|
143 |
-
<h4>$columns</h4>
|
144 |
-
<code>array</code><p>column definitions for the Attachment Category list table.</p></div>
|
145 |
-
<h3>Returns</h3>
|
146 |
-
<div class="subelement response">
|
147 |
-
<code>array</code>updated column definitions for the Attachment Category list table.</div>
|
148 |
</div></div>
|
149 |
</div>
|
150 |
-
<a name="
|
151 |
-
<h2>
|
152 |
-
<pre>
|
153 |
<div class="labels"></div>
|
154 |
<div class="row collapse"><div class="detail-description">
|
155 |
<p class="long_description"></p>
|
156 |
<table class="table table-bordered"><tr>
|
157 |
<th>since</th>
|
158 |
-
<td>
|
159 |
-
</tr></table>
|
160 |
-
<h3>Returns</h3>
|
161 |
-
<div class="subelement response">
|
162 |
-
<code>string</code>HTML markup for the attachment list</div>
|
163 |
-
</div></div>
|
164 |
-
</div>
|
165 |
-
<a name="mla_attachment_tag_column_filter" id="mla_attachment_tag_column_filter"></a><div class="element clickable function mla_attachment_tag_column_filter" data-toggle="collapse" data-target=".mla_attachment_tag_column_filter .collapse">
|
166 |
-
<h2>WordPress Filter for Attachment Tag "Attachments" column,
|
167 |
-
which returns a count of the attachments assigned a given tag</h2>
|
168 |
-
<pre>mla_attachment_tag_column_filter(string $place_holder, array $column_name, array $term_id) : array</pre>
|
169 |
-
<div class="labels"></div>
|
170 |
-
<div class="row collapse"><div class="detail-description">
|
171 |
-
<p class="long_description"></p>
|
172 |
-
<table class="table table-bordered"><tr>
|
173 |
-
<th>since</th>
|
174 |
-
<td>0.1</td>
|
175 |
-
</tr></table>
|
176 |
-
<h3>Parameters</h3>
|
177 |
-
<div class="subelement argument">
|
178 |
-
<h4>$place_holder</h4>
|
179 |
-
<code>string</code><p>unknown, undocumented parameter</p></div>
|
180 |
-
<div class="subelement argument">
|
181 |
-
<h4>$column_name</h4>
|
182 |
-
<code>array</code><p>name of the column</p></div>
|
183 |
-
<div class="subelement argument">
|
184 |
-
<h4>$term_id</h4>
|
185 |
-
<code>array</code><p>ID of the term for which the count is desired</p></div>
|
186 |
-
<h3>Returns</h3>
|
187 |
-
<div class="subelement response">
|
188 |
-
<code>array</code>HTML markup for the column content; number of attachments with the tag and alink to retrieve a list of them.</div>
|
189 |
-
</div></div>
|
190 |
-
</div>
|
191 |
-
<a name="mla_attachment_tag_get_columns_filter" id="mla_attachment_tag_get_columns_filter"></a><div class="element clickable function mla_attachment_tag_get_columns_filter" data-toggle="collapse" data-target=".mla_attachment_tag_get_columns_filter .collapse">
|
192 |
-
<h2>WordPress Filter for Attachment Tag "Attachments" column,
|
193 |
-
which replaces the "Posts" column with an equivalent "Attachments" column.</h2>
|
194 |
-
<pre>mla_attachment_tag_get_columns_filter(array $columns) : array</pre>
|
195 |
-
<div class="labels"></div>
|
196 |
-
<div class="row collapse"><div class="detail-description">
|
197 |
-
<p class="long_description"></p>
|
198 |
-
<table class="table table-bordered"><tr>
|
199 |
-
<th>since</th>
|
200 |
-
<td>0.1</td>
|
201 |
-
</tr></table>
|
202 |
-
<h3>Parameters</h3>
|
203 |
-
<div class="subelement argument">
|
204 |
-
<h4>$columns</h4>
|
205 |
-
<code>array</code><p>column definitions for the Attachment Category list table.</p></div>
|
206 |
-
<h3>Returns</h3>
|
207 |
-
<div class="subelement response">
|
208 |
-
<code>array</code>updated column definitions for the Attachment Category list table.</div>
|
209 |
-
</div></div>
|
210 |
-
</div>
|
211 |
-
<a name="mla_build_taxonomies_action" id="mla_build_taxonomies_action"></a><div class="element clickable function mla_build_taxonomies_action" data-toggle="collapse" data-target=".mla_build_taxonomies_action .collapse">
|
212 |
-
<h2>WordPress Action; registers Attachment Categories and Attachment Tags custom taxonomies</h2>
|
213 |
-
<pre>mla_build_taxonomies_action() </pre>
|
214 |
-
<div class="labels"></div>
|
215 |
-
<div class="row collapse"><div class="detail-description">
|
216 |
-
<p class="long_description"></p>
|
217 |
-
<table class="table table-bordered"><tr>
|
218 |
-
<th>since</th>
|
219 |
-
<td>0.1</td>
|
220 |
</tr></table>
|
221 |
</div></div>
|
222 |
</div>
|
@@ -233,18 +127,46 @@ of images and files held in the WordPress Media Library.</p>
|
|
233 |
<a name="MLAData" id="MLAData"></a><div class="element ajax clickable class" href="../classes/MLAData.html">
|
234 |
<h1>MLAData<a href="../classes/MLAData.html">¶</a>
|
235 |
</h1>
|
236 |
-
<p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
237 |
<div class="details collapse"></div>
|
238 |
<a href="../classes/MLAData.html" class="more">« More »</a>
|
239 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
<a name="MLASettings" id="MLASettings"></a><div class="element ajax clickable class" href="../classes/MLASettings.html">
|
241 |
<h1>MLASettings<a href="../classes/MLASettings.html">¶</a>
|
242 |
</h1>
|
243 |
-
<p class="short_description">Class MLA (Media Library Assistant) Settings
|
244 |
-
and provides the settings page to edit them.</p>
|
245 |
<div class="details collapse"></div>
|
246 |
<a href="../classes/MLASettings.html" class="more">« More »</a>
|
247 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
<a name="MLATest" id="MLATest"></a><div class="element ajax clickable class" href="../classes/MLATest.html">
|
249 |
<h1>MLATest<a href="../classes/MLATest.html">¶</a>
|
250 |
</h1>
|
@@ -256,7 +178,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
256 |
<a name="MLA_List_Table" id="MLA_List_Table"></a><div class="element ajax clickable class" href="../classes/MLA_List_Table.html">
|
257 |
<h1>MLA_List_Table<a href="../classes/MLA_List_Table.html">¶</a>
|
258 |
</h1>
|
259 |
-
<p class="short_description">Class MLA (Media Library Assistant) List Table
|
260 |
<div class="details collapse"></div>
|
261 |
<a href="../classes/MLA_List_Table.html" class="more">« More »</a>
|
262 |
</div>
|
@@ -286,7 +208,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
|
|
286 |
<div class="row"><footer class="span12">
|
287 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
288 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
289 |
-
generated on
|
290 |
</div>
|
291 |
</body>
|
292 |
</html>
|
3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4 |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
5 |
<meta charset="utf-8">
|
6 |
+
<title>Media Library Assistant » Media Library Assistant</title>
|
7 |
<meta name="author" content="Mike van Riel">
|
8 |
<meta name="description" content="">
|
9 |
<link href="../css/template.css" rel="stylesheet" media="all">
|
15 |
<body>
|
16 |
<div class="navbar navbar-fixed-top">
|
17 |
<div class="navbar-inner"><div class="container">
|
18 |
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Media Library Assistant</a><div class="nav-collapse"><ul class="nav">
|
19 |
<li class="dropdown">
|
20 |
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
|
21 |
+
API Documentation <b class="caret"></b></a><ul class="dropdown-menu"></ul>
|
|
|
|
|
|
|
22 |
</li>
|
23 |
<li class="dropdown" id="charts-menu">
|
24 |
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
|
57 |
</li>
|
58 |
<li class="nav-header">
|
59 |
<i class="icon-custom icon-function"></i> Functions</li>
|
60 |
+
<li class="function "><a href="#mla_name_conflict_reporting_action" title="mla_name_conflict_reporting_action :: Displays name conflict error messages at the top of the Dashboard"><span class="description">Displays name conflict error messages at the top of the Dashboard</span><pre>mla_name_conflict_reporting_action</pre></a></li>
|
61 |
+
<li class="function "><a href="#mla_plugin_loader_reporting_action" title="mla_plugin_loader_reporting_action :: Displays version conflict error messages at the top of the Dashboard"><span class="description">Displays version conflict error messages at the top of the Dashboard</span><pre>mla_plugin_loader_reporting_action</pre></a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
<li class="nav-header">
|
63 |
<i class="icon-custom icon-class"></i> Classes</li>
|
64 |
+
<li><a href="#MLAData" title="Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs">MLAData</a></li>
|
65 |
+
<li><a href="#MLAEdit" title="Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen">MLAEdit</a></li>
|
66 |
+
<li><a href="#MLA_List_Table" title='Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu'>MLA_List_Table</a></li>
|
67 |
<li><a href="#MLA" title="Class MLA (Media Library Assistant) provides several enhancements to the handling
|
68 |
of images and files held in the WordPress Media Library.">MLA</a></li>
|
69 |
+
<li><a href="#MLAObjects" title="Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags">MLAObjects</a></li>
|
70 |
+
<li><a href="#MLAOptions" title="Class MLA (Media Library Assistant) Options manages the plugin option settings
|
71 |
+
and provides functions to get and put them from/to WordPress option variables">MLAOptions</a></li>
|
72 |
+
<li><a href="#MLASettings" title="Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings">MLASettings</a></li>
|
73 |
+
<li><a href="#MLAShortcodes" title="Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users">MLAShortcodes</a></li>
|
74 |
<li><a href="#MLATest" title="Class MLA (Media Library Assistant) Test provides basic run-time tests
|
75 |
to ensure the plugin can run in the current WordPress envrionment.">MLATest</a></li>
|
76 |
<li class="nav-header">
|
90 |
<div class="package-indent">
|
91 |
<h3>
|
92 |
<i class="icon-custom icon-function"></i> Functions</h3>
|
93 |
+
<a name="mla_name_conflict_reporting_action" id="mla_name_conflict_reporting_action"></a><div class="element clickable function mla_name_conflict_reporting_action" data-toggle="collapse" data-target=".mla_name_conflict_reporting_action .collapse">
|
94 |
+
<h2>Displays name conflict error messages at the top of the Dashboard</h2>
|
95 |
+
<pre>mla_name_conflict_reporting_action() </pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
<div class="labels"></div>
|
97 |
<div class="row collapse"><div class="detail-description">
|
98 |
<p class="long_description"></p>
|
99 |
<table class="table table-bordered"><tr>
|
100 |
<th>since</th>
|
101 |
+
<td>0.20</td>
|
102 |
</tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
</div></div>
|
104 |
</div>
|
105 |
+
<a name="mla_plugin_loader_reporting_action" id="mla_plugin_loader_reporting_action"></a><div class="element clickable function mla_plugin_loader_reporting_action" data-toggle="collapse" data-target=".mla_plugin_loader_reporting_action .collapse">
|
106 |
+
<h2>Displays version conflict error messages at the top of the Dashboard</h2>
|
107 |
+
<pre>mla_plugin_loader_reporting_action() </pre>
|
108 |
<div class="labels"></div>
|
109 |
<div class="row collapse"><div class="detail-description">
|
110 |
<p class="long_description"></p>
|
111 |
<table class="table table-bordered"><tr>
|
112 |
<th>since</th>
|
113 |
+
<td>1.14</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
</tr></table>
|
115 |
</div></div>
|
116 |
</div>
|
127 |
<a name="MLAData" id="MLAData"></a><div class="element ajax clickable class" href="../classes/MLAData.html">
|
128 |
<h1>MLAData<a href="../classes/MLAData.html">¶</a>
|
129 |
</h1>
|
130 |
+
<p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs</p>
|
131 |
<div class="details collapse"></div>
|
132 |
<a href="../classes/MLAData.html" class="more">« More »</a>
|
133 |
</div>
|
134 |
+
<a name="MLAEdit" id="MLAEdit"></a><div class="element ajax clickable class" href="../classes/MLAEdit.html">
|
135 |
+
<h1>MLAEdit<a href="../classes/MLAEdit.html">¶</a>
|
136 |
+
</h1>
|
137 |
+
<p class="short_description">Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen</p>
|
138 |
+
<div class="details collapse"></div>
|
139 |
+
<a href="../classes/MLAEdit.html" class="more">« More »</a>
|
140 |
+
</div>
|
141 |
+
<a name="MLAObjects" id="MLAObjects"></a><div class="element ajax clickable class" href="../classes/MLAObjects.html">
|
142 |
+
<h1>MLAObjects<a href="../classes/MLAObjects.html">¶</a>
|
143 |
+
</h1>
|
144 |
+
<p class="short_description">Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags</p>
|
145 |
+
<div class="details collapse"></div>
|
146 |
+
<a href="../classes/MLAObjects.html" class="more">« More »</a>
|
147 |
+
</div>
|
148 |
+
<a name="MLAOptions" id="MLAOptions"></a><div class="element ajax clickable class" href="../classes/MLAOptions.html">
|
149 |
+
<h1>MLAOptions<a href="../classes/MLAOptions.html">¶</a>
|
150 |
+
</h1>
|
151 |
+
<p class="short_description">Class MLA (Media Library Assistant) Options manages the plugin option settings
|
152 |
+
and provides functions to get and put them from/to WordPress option variables</p>
|
153 |
+
<div class="details collapse"></div>
|
154 |
+
<a href="../classes/MLAOptions.html" class="more">« More »</a>
|
155 |
+
</div>
|
156 |
<a name="MLASettings" id="MLASettings"></a><div class="element ajax clickable class" href="../classes/MLASettings.html">
|
157 |
<h1>MLASettings<a href="../classes/MLASettings.html">¶</a>
|
158 |
</h1>
|
159 |
+
<p class="short_description">Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings</p>
|
|
|
160 |
<div class="details collapse"></div>
|
161 |
<a href="../classes/MLASettings.html" class="more">« More »</a>
|
162 |
</div>
|
163 |
+
<a name="MLAShortcodes" id="MLAShortcodes"></a><div class="element ajax clickable class" href="../classes/MLAShortcodes.html">
|
164 |
+
<h1>MLAShortcodes<a href="../classes/MLAShortcodes.html">¶</a>
|
165 |
+
</h1>
|
166 |
+
<p class="short_description">Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users</p>
|
167 |
+
<div class="details collapse"></div>
|
168 |
+
<a href="../classes/MLAShortcodes.html" class="more">« More »</a>
|
169 |
+
</div>
|
170 |
<a name="MLATest" id="MLATest"></a><div class="element ajax clickable class" href="../classes/MLATest.html">
|
171 |
<h1>MLATest<a href="../classes/MLATest.html">¶</a>
|
172 |
</h1>
|
178 |
<a name="MLA_List_Table" id="MLA_List_Table"></a><div class="element ajax clickable class" href="../classes/MLA_List_Table.html">
|
179 |
<h1>MLA_List_Table<a href="../classes/MLA_List_Table.html">¶</a>
|
180 |
</h1>
|
181 |
+
<p class="short_description">Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu</p>
|
182 |
<div class="details collapse"></div>
|
183 |
<a href="../classes/MLA_List_Table.html" class="more">« More »</a>
|
184 |
</div>
|
208 |
<div class="row"><footer class="span12">
|
209 |
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
|
210 |
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
|
211 |
+
generated on 2013-03-10T17:53:00-07:00.<br></footer></div>
|
212 |
</div>
|
213 |
</body>
|
214 |
</html>
|
phpDocs/structure.xml
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?xml version="1.0" encoding="utf-8"?>
|
2 |
-
<project version="2.0.0a8" title="">
|
3 |
-
<file path="includes\class-mla-data.php" hash="
|
4 |
<docblock line="2">
|
5 |
-
<description><![CDATA[Database and template file access for MLA needs
|
6 |
<long-description><![CDATA[]]></long-description>
|
7 |
<tag line="2" name="package" description="Media Library Assistant"/>
|
8 |
<tag line="2" name="since" description="0.1"/>
|
@@ -12,1928 +12,4449 @@
|
|
12 |
<name>MLAData</name>
|
13 |
<full_name>\MLAData</full_name>
|
14 |
<docblock line="9">
|
15 |
-
<description><![CDATA[Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
|
16 |
<long-description><![CDATA[<p>The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials."
|
17 |
Templates separate HTML markup from PHP code for easier maintenance and localization.</p>]]></long-description>
|
18 |
<tag line="9" name="package" description="Media Library Assistant"/>
|
19 |
<tag line="9" name="since" description="0.1"/>
|
20 |
</docblock>
|
21 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
<name>initialize</name>
|
23 |
<full_name>initialize</full_name>
|
24 |
-
<docblock line="
|
25 |
<description><![CDATA[Initialization function, similar to __construct()]]></description>
|
26 |
<long-description><![CDATA[]]></long-description>
|
27 |
-
<tag line="
|
28 |
</docblock>
|
29 |
</method>
|
30 |
-
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="
|
31 |
<name>mla_load_template</name>
|
32 |
<full_name>mla_load_template</full_name>
|
33 |
-
<docblock line="
|
34 |
<description><![CDATA[Load an HTML template from a file]]></description>
|
35 |
<long-description><![CDATA[<p>Loads a template to a string or a multi-part template to an array.
|
36 |
Multi-part templates are divided by comments of the form <!-- template="key" -->,
|
37 |
where "key" becomes the key part of the array.</p>]]></long-description>
|
38 |
-
<tag line="
|
39 |
-
<tag line="
|
|
|
|
|
|
|
40 |
<type by_reference="false">string</type>
|
41 |
</tag>
|
42 |
-
<tag line="
|
43 |
<type by_reference="false">string</type>
|
|
|
|
|
|
|
44 |
</tag>
|
45 |
</docblock>
|
46 |
-
<argument line="
|
47 |
-
<name>$
|
48 |
<default><![CDATA[]]></default>
|
49 |
<type/>
|
50 |
</argument>
|
|
|
|
|
|
|
|
|
|
|
51 |
</method>
|
52 |
-
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="
|
53 |
<name>mla_parse_template</name>
|
54 |
<full_name>mla_parse_template</full_name>
|
55 |
-
<docblock line="
|
56 |
-
<description><![CDATA[Expand a template, replacing place holders with their values
|
57 |
<long-description><![CDATA[<p>A simple parsing function for basic templating.</p>]]></long-description>
|
58 |
-
<tag line="
|
59 |
-
<tag line="
|
60 |
<type by_reference="false">string</type>
|
61 |
</tag>
|
62 |
-
<tag line="
|
63 |
<type by_reference="false">array</type>
|
64 |
</tag>
|
65 |
-
<tag line="
|
66 |
<type by_reference="false">string</type>
|
67 |
</tag>
|
68 |
</docblock>
|
69 |
-
<argument line="
|
70 |
<name>$tpl</name>
|
71 |
<default><![CDATA[]]></default>
|
72 |
<type/>
|
73 |
</argument>
|
74 |
-
<argument line="
|
75 |
<name>$hash</name>
|
76 |
<default><![CDATA[]]></default>
|
77 |
<type/>
|
78 |
</argument>
|
79 |
</method>
|
80 |
-
<method final="false" abstract="false" static="
|
81 |
-
<name>
|
82 |
-
<full_name>
|
83 |
-
<docblock line="
|
84 |
-
<description><![CDATA[
|
85 |
-
<long-description><![CDATA[
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
90 |
<type by_reference="false">array</type>
|
91 |
</tag>
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
<type by_reference="false">array</type>
|
94 |
</tag>
|
|
|
|
|
|
|
95 |
</docblock>
|
96 |
-
<argument line="
|
97 |
<name>$request</name>
|
98 |
<default><![CDATA[]]></default>
|
99 |
<type/>
|
100 |
</argument>
|
101 |
</method>
|
102 |
-
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="
|
103 |
<name>mla_query_list_table_items</name>
|
104 |
<full_name>mla_query_list_table_items</full_name>
|
105 |
-
<docblock line="
|
106 |
-
<description><![CDATA[Retrieve attachment objects for list table display
|
107 |
-
<long-description><![CDATA[<p>Supports prepare_items in class-mla-list-table.php
|
108 |
Modeled after wp_edit_attachments_query in wp-admin/post.php</p>]]></long-description>
|
109 |
-
<tag line="
|
110 |
-
<tag line="
|
111 |
<type by_reference="false">array</type>
|
112 |
</tag>
|
113 |
-
<tag line="
|
114 |
-
<type by_reference="false">string</type>
|
115 |
-
</tag>
|
116 |
-
<tag line="176" name="param" description="ASC or DESC" type="string" variable="$order">
|
117 |
-
<type by_reference="false">string</type>
|
118 |
-
</tag>
|
119 |
-
<tag line="176" name="param" description="number of rows to skip over to reach desired page" type="int" variable="$offset">
|
120 |
<type by_reference="false">int</type>
|
121 |
</tag>
|
122 |
-
<tag line="
|
123 |
<type by_reference="false">int</type>
|
124 |
</tag>
|
125 |
-
<tag line="
|
126 |
<type by_reference="false">array</type>
|
127 |
</tag>
|
128 |
</docblock>
|
129 |
-
<argument line="
|
130 |
<name>$request</name>
|
131 |
<default><![CDATA[]]></default>
|
132 |
<type/>
|
133 |
</argument>
|
134 |
-
<argument line="
|
135 |
-
<name>$
|
136 |
<default><![CDATA[]]></default>
|
137 |
<type/>
|
138 |
</argument>
|
139 |
-
<argument line="
|
140 |
-
<name>$
|
141 |
<default><![CDATA[]]></default>
|
142 |
<type/>
|
143 |
</argument>
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<default><![CDATA[]]></default>
|
147 |
<type/>
|
148 |
</argument>
|
149 |
-
<argument line="
|
|
|
|
|
|
|
|
|
|
|
150 |
<name>$count</name>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
<default><![CDATA[]]></default>
|
152 |
<type/>
|
153 |
</argument>
|
154 |
</method>
|
155 |
-
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="
|
156 |
-
<name>
|
157 |
-
<full_name>
|
158 |
-
<docblock line="
|
159 |
-
<description><![CDATA[Adds a WHERE clause
|
160 |
-
<long-description><![CDATA[<p>
|
161 |
-
|
162 |
-
<tag line="
|
163 |
-
<tag line="244" name="param" description="query clause before modification" type="string" variable="$where">
|
164 |
<type by_reference="false">string</type>
|
165 |
</tag>
|
166 |
-
<tag line="
|
|
|
|
|
|
|
167 |
<type by_reference="false">string</type>
|
168 |
</tag>
|
169 |
</docblock>
|
170 |
-
<argument line="
|
171 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
172 |
<default><![CDATA[]]></default>
|
173 |
<type/>
|
174 |
</argument>
|
175 |
</method>
|
176 |
-
<method final="false" abstract="false" static="
|
177 |
-
<name>
|
178 |
-
<full_name>
|
179 |
-
<docblock line="
|
180 |
-
<description><![CDATA[
|
181 |
-
<long-description><![CDATA[<p>
|
182 |
-
|
183 |
-
<tag line="
|
184 |
-
|
185 |
-
<type by_reference="false">int</type>
|
186 |
</tag>
|
187 |
-
<tag line="
|
188 |
-
<type by_reference="false">
|
189 |
</tag>
|
190 |
</docblock>
|
191 |
-
<argument line="
|
192 |
-
<name>$
|
193 |
<default><![CDATA[]]></default>
|
194 |
<type/>
|
195 |
</argument>
|
196 |
</method>
|
197 |
-
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="
|
198 |
-
<name>
|
199 |
-
<full_name>
|
200 |
-
<docblock line="
|
201 |
-
<description><![CDATA[
|
202 |
-
<long-description><![CDATA[<p>
|
203 |
-
as
|
204 |
-
<tag line="
|
205 |
-
<tag line="
|
206 |
-
<type by_reference="false">
|
207 |
</tag>
|
208 |
-
<tag line="
|
209 |
-
<type by_reference="false">
|
210 |
</tag>
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
</tag>
|
214 |
</docblock>
|
215 |
-
<argument line="
|
216 |
-
<name>$
|
217 |
<default><![CDATA[]]></default>
|
218 |
<type/>
|
219 |
</argument>
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
<default><![CDATA[]]></default>
|
223 |
<type/>
|
224 |
</argument>
|
225 |
</method>
|
226 |
-
<method final="false" abstract="false" static="true" visibility="
|
227 |
-
<name>
|
228 |
-
<full_name>
|
229 |
-
<docblock line="
|
230 |
-
<description><![CDATA[Returns information about an attachment's parent, if found
|
231 |
<long-description><![CDATA[]]></long-description>
|
232 |
-
<tag line="
|
233 |
-
<tag line="
|
234 |
<type by_reference="false">int</type>
|
235 |
</tag>
|
236 |
-
<tag line="
|
237 |
<type by_reference="false">array</type>
|
238 |
</tag>
|
239 |
</docblock>
|
240 |
-
<argument line="
|
241 |
<name>$parent_id</name>
|
242 |
<default><![CDATA[]]></default>
|
243 |
<type/>
|
244 |
</argument>
|
245 |
</method>
|
246 |
-
<method final="false" abstract="false" static="true" visibility="
|
247 |
-
<name>
|
248 |
-
<full_name>
|
249 |
-
<docblock line="
|
250 |
-
<description><![CDATA[Fetch and filter meta data for an attachment
|
251 |
<long-description><![CDATA[<p>Returns a filtered array of a post's meta data. Internal values beginning with '<em>'
|
252 |
are stripped out or converted to an 'mla</em>' equivalent. Array data is replaced with
|
253 |
a string containing the first array element.</p>]]></long-description>
|
254 |
-
<tag line="
|
255 |
-
<tag line="
|
256 |
<type by_reference="false">int</type>
|
257 |
</tag>
|
258 |
-
<tag line="
|
259 |
<type by_reference="false">array</type>
|
260 |
</tag>
|
261 |
</docblock>
|
262 |
-
<argument line="
|
263 |
<name>$post_id</name>
|
264 |
<default><![CDATA[]]></default>
|
265 |
<type/>
|
266 |
</argument>
|
267 |
</method>
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
<include line="13" type="Require Once" package="Default">
|
278 |
-
<name/>
|
279 |
-
</include>
|
280 |
-
<class final="false" abstract="false" namespace="global" line="22" package="Media Library Assistant">
|
281 |
-
<extends>\WP_List_Table</extends>
|
282 |
-
<name>MLA_List_Table</name>
|
283 |
-
<full_name>\MLA_List_Table</full_name>
|
284 |
-
<docblock line="16">
|
285 |
-
<description><![CDATA[Class MLA (Media Library Assistant) List Table extends the core WP_List_Table class]]></description>
|
286 |
-
<long-description><![CDATA[]]></long-description>
|
287 |
-
<tag line="16" name="package" description="Media Library Assistant"/>
|
288 |
-
<tag line="16" name="since" description="0.1"/>
|
289 |
-
</docblock>
|
290 |
-
<property final="false" static="false" visibility="private" line="36" namespace="global" package="Default">
|
291 |
-
<name>$rollover_id</name>
|
292 |
-
<default><![CDATA[0]]></default>
|
293 |
-
<docblock line="27">
|
294 |
-
<description><![CDATA[Records assignment of row-level actions to a table row]]></description>
|
295 |
-
<long-description><![CDATA[<p>Set to the current Post-ID when row-level actions are output for the row.</p>]]></long-description>
|
296 |
-
<tag line="27" name="since" description="0.1"/>
|
297 |
-
<tag line="27" name="var" description="" type="int">
|
298 |
<type by_reference="false">int</type>
|
299 |
</tag>
|
300 |
-
|
301 |
-
|
302 |
-
<property final="false" static="false" visibility="private" line="47" namespace="global" package="Default">
|
303 |
-
<name>$currently_hidden</name>
|
304 |
-
<default><![CDATA[array()]]></default>
|
305 |
-
<docblock line="38">
|
306 |
-
<description><![CDATA[Currently hidden columns]]></description>
|
307 |
-
<long-description><![CDATA[<p>Records hidden columns so row-level actions are not assigned to them.</p>]]></long-description>
|
308 |
-
<tag line="38" name="since" description="0.1"/>
|
309 |
-
<tag line="38" name="var" description="" type="array">
|
310 |
-
<type by_reference="false">array</type>
|
311 |
</tag>
|
312 |
-
|
313 |
-
</property>
|
314 |
-
<property final="false" static="true" visibility="private" line="68" namespace="global" package="Default">
|
315 |
-
<name>$default_columns</name>
|
316 |
-
<default><![CDATA[array('cb' => '<input type="checkbox" />', 'icon' => '', 'ID_parent' => 'ID/Parent', 'title_name' => 'Title/Name', 'post_title' => 'Title', 'post_name' => 'Name', 'parent' => 'Parent ID', 'featured' => 'Featured in', 'inserted' => 'Inserted in', 'alt_text' => 'ALT Text', 'caption' => 'Caption', 'description' => 'Description', 'base_file' => 'Base File', 'date' => 'Date', 'author' => 'Author', 'attached_to' => 'Attached to', 'categories' => 'Att. Categories', 'tags' => 'Att. Tags')]]></default>
|
317 |
-
<docblock line="53">
|
318 |
-
<description><![CDATA[Table column definitions]]></description>
|
319 |
-
<long-description><![CDATA[<p>This array defines table columns and titles where the key is the column slug (and class)
|
320 |
-
and the value is the column's title text. If you need a checkbox for bulk actions,
|
321 |
-
use the special slug "cb".</p>
|
322 |
-
|
323 |
-
<p>The 'cb' column is treated differently than the rest. If including a checkbox
|
324 |
-
column in your table you must create a column_cb() method. If you don't need
|
325 |
-
bulk actions or checkboxes, simply leave the 'cb' entry out of your array.</p>]]></long-description>
|
326 |
-
<tag line="53" name="since" description="0.1"/>
|
327 |
-
<tag line="53" name="var" description="" type="array">
|
328 |
<type by_reference="false">array</type>
|
329 |
</tag>
|
330 |
</docblock>
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
<
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
</tag>
|
346 |
-
|
347 |
-
|
348 |
-
<property final="false" static="true" visibility="private" line="136" namespace="global" package="Default">
|
349 |
-
<name>$default_sortable_columns</name>
|
350 |
-
<default><![CDATA[array('ID_parent' => array('ID', false), 'title_name' => array('title_name', false), 'post_title' => array('post_title', false), 'post_name' => array('name', false), 'parent' => array('parent', false), 'caption' => array('post_excerpt', false), 'description' => array('post_content', false), 'date' => array('post_date', false), 'author' => array('post_author', false), 'attached_to' => array('post_parent', false))]]></default>
|
351 |
-
<docblock line="121">
|
352 |
-
<description><![CDATA[Sortable column definitions]]></description>
|
353 |
-
<long-description><![CDATA[<p>This array defines the table columns that can be sorted. The array key
|
354 |
-
is the column slug that needs to be sortable, and the value is database column
|
355 |
-
to sort by. Often, the key and value will be the same, but this is not always
|
356 |
-
the case (as the value is a column name from the database, not the list table).</p>
|
357 |
-
|
358 |
-
<p>The array value also contains a boolean which is 'true' if the data is currently
|
359 |
-
sorted by that column. This is computed each time the table is displayed.</p>]]></long-description>
|
360 |
-
<tag line="121" name="since" description="0.1"/>
|
361 |
-
<tag line="121" name="var" description="" type="array">
|
362 |
-
<type by_reference="false">array</type>
|
363 |
</tag>
|
364 |
</docblock>
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
|
|
|
|
|
|
|
|
|
|
371 |
<long-description><![CDATA[]]></long-description>
|
372 |
-
<tag line="
|
373 |
-
<tag line="
|
374 |
-
<type by_reference="false">
|
|
|
|
|
|
|
375 |
</tag>
|
376 |
</docblock>
|
|
|
|
|
|
|
|
|
|
|
377 |
</method>
|
378 |
-
<method final="false" abstract="false" static="true" visibility="
|
379 |
-
<name>
|
380 |
-
<full_name>
|
381 |
-
<docblock line="
|
382 |
-
<description><![CDATA[
|
383 |
-
<long-description><![CDATA[
|
384 |
-
|
385 |
-
|
386 |
-
<tag line="167" name="since" description="0.1"/>
|
387 |
-
<tag line="167" name="param" description="current list of hidden columns, if any" type="string" variable="$result">
|
388 |
<type by_reference="false">string</type>
|
389 |
</tag>
|
390 |
-
<tag line="
|
|
|
|
|
|
|
391 |
<type by_reference="false">string</type>
|
392 |
</tag>
|
393 |
-
<tag line="
|
394 |
-
<type by_reference="false">
|
395 |
</tag>
|
396 |
-
<tag line="
|
397 |
-
<type by_reference="false">
|
398 |
</tag>
|
399 |
</docblock>
|
400 |
-
<argument line="
|
401 |
-
<name>$
|
402 |
<default><![CDATA[]]></default>
|
403 |
<type/>
|
404 |
</argument>
|
405 |
-
<argument line="
|
406 |
-
<name>$
|
407 |
<default><![CDATA[]]></default>
|
408 |
<type/>
|
409 |
</argument>
|
410 |
-
<argument line="
|
411 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
412 |
<default><![CDATA[]]></default>
|
413 |
<type/>
|
414 |
</argument>
|
415 |
</method>
|
416 |
-
<method final="false" abstract="false" static="true" visibility="
|
417 |
-
<name>
|
418 |
-
<full_name>
|
419 |
-
<docblock line="
|
420 |
-
<description><![CDATA[
|
421 |
-
<long-description><![CDATA[<p>This required filter dictates the table's columns and titles. Set when the
|
422 |
-
file is loaded because the list_table object isn't created in time
|
423 |
-
to affect the "screen options" setup.</p>]]></long-description>
|
424 |
-
<tag line="189" name="since" description="0.1"/>
|
425 |
-
<tag line="189" name="return" description="list of table columns" type="array">
|
426 |
-
<type by_reference="false">array</type>
|
427 |
-
</tag>
|
428 |
-
</docblock>
|
429 |
-
</method>
|
430 |
-
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="211" package="Media Library Assistant">
|
431 |
-
<name>__construct</name>
|
432 |
-
<full_name>__construct</full_name>
|
433 |
-
<docblock line="205">
|
434 |
-
<description><![CDATA[Initializes some properties from $_REQUEST vairables, then
|
435 |
-
calls the parent constructor to set some default configs.]]></description>
|
436 |
<long-description><![CDATA[]]></long-description>
|
437 |
-
<tag line="
|
438 |
-
|
439 |
-
</method>
|
440 |
-
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="236" package="Media Library Assistant">
|
441 |
-
<name>column_default</name>
|
442 |
-
<full_name>column_default</full_name>
|
443 |
-
<docblock line="225">
|
444 |
-
<description><![CDATA[Called when the parent class can't find a method specifically built
|
445 |
-
for a given column.]]></description>
|
446 |
-
<long-description><![CDATA[<p>All our columns should have a specific method,
|
447 |
-
so this function returns a troubleshooting message.</p>]]></long-description>
|
448 |
-
<tag line="225" name="since" description="0.1"/>
|
449 |
-
<tag line="225" name="param" description="A singular item (one full row's worth of data)" type="array" variable="$item">
|
450 |
<type by_reference="false">array</type>
|
451 |
</tag>
|
452 |
-
<tag line="
|
453 |
-
<type by_reference="false">
|
454 |
</tag>
|
455 |
-
<tag line="
|
456 |
-
<type by_reference="false">
|
457 |
</tag>
|
458 |
</docblock>
|
459 |
-
<argument line="
|
460 |
-
<name>$
|
461 |
<default><![CDATA[]]></default>
|
462 |
<type/>
|
463 |
</argument>
|
464 |
-
<argument line="
|
465 |
-
<name>$
|
466 |
<default><![CDATA[]]></default>
|
467 |
<type/>
|
468 |
</argument>
|
469 |
</method>
|
470 |
-
<method final="false" abstract="false" static="
|
471 |
-
<name>
|
472 |
-
<full_name>
|
473 |
-
<docblock line="
|
474 |
-
<description><![CDATA[
|
475 |
-
<long-description><![CDATA[<p>
|
476 |
-
|
477 |
-
<tag line="
|
478 |
-
<tag line="
|
479 |
-
<type by_reference="false">
|
480 |
</tag>
|
481 |
-
<tag line="
|
|
|
|
|
|
|
482 |
<type by_reference="false">string</type>
|
483 |
</tag>
|
484 |
</docblock>
|
485 |
-
<argument line="
|
486 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
487 |
<default><![CDATA[]]></default>
|
488 |
<type/>
|
489 |
</argument>
|
490 |
</method>
|
491 |
-
<method final="false" abstract="false" static="
|
492 |
-
<name>
|
493 |
-
<full_name>
|
494 |
-
<docblock line="
|
495 |
-
<description><![CDATA[
|
496 |
-
<long-description><![CDATA[]]></long-description>
|
497 |
-
<tag line="
|
498 |
-
<tag line="
|
499 |
-
<type by_reference="false">
|
500 |
</tag>
|
501 |
-
<tag line="
|
502 |
<type by_reference="false">string</type>
|
503 |
</tag>
|
|
|
|
|
|
|
504 |
</docblock>
|
505 |
-
<argument line="
|
506 |
-
<name>$
|
507 |
<default><![CDATA[]]></default>
|
508 |
<type/>
|
509 |
</argument>
|
|
|
|
|
|
|
|
|
|
|
510 |
</method>
|
511 |
-
<method final="false" abstract="false" static="
|
512 |
-
<name>
|
513 |
-
<full_name>
|
514 |
-
<docblock line="
|
515 |
-
<description><![CDATA[
|
516 |
-
|
517 |
<long-description><![CDATA[]]></long-description>
|
518 |
-
<tag line="
|
519 |
-
<tag line="
|
|
|
|
|
|
|
520 |
<type by_reference="false">array</type>
|
521 |
</tag>
|
522 |
-
<tag line="
|
523 |
-
<type by_reference="false">
|
524 |
</tag>
|
525 |
-
<tag line="
|
|
|
|
|
|
|
526 |
<type by_reference="false">array</type>
|
527 |
</tag>
|
528 |
</docblock>
|
529 |
-
<argument line="
|
530 |
-
<name>$
|
531 |
<default><![CDATA[]]></default>
|
532 |
<type/>
|
533 |
</argument>
|
534 |
-
<argument line="
|
535 |
-
<name>$
|
536 |
<default><![CDATA[]]></default>
|
537 |
<type/>
|
538 |
</argument>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
539 |
</method>
|
540 |
-
<method final="false" abstract="false" static="
|
541 |
-
<name>
|
542 |
-
<full_name>
|
543 |
-
<docblock line="
|
544 |
-
<description><![CDATA[
|
545 |
<long-description><![CDATA[]]></long-description>
|
546 |
-
<tag line="
|
547 |
-
<tag line="
|
548 |
<type by_reference="false">array</type>
|
549 |
</tag>
|
550 |
-
<tag line="
|
551 |
-
<type by_reference="false">
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
</tag>
|
553 |
</docblock>
|
554 |
-
<argument line="
|
555 |
-
<name>$
|
556 |
<default><![CDATA[]]></default>
|
557 |
<type/>
|
558 |
</argument>
|
559 |
-
|
560 |
-
|
561 |
-
<name>column_title_name</name>
|
562 |
-
<full_name>column_title_name</full_name>
|
563 |
-
<docblock line="350">
|
564 |
-
<description><![CDATA[Supply the content for a custom column]]></description>
|
565 |
-
<long-description><![CDATA[]]></long-description>
|
566 |
-
<tag line="350" name="since" description="0.1"/>
|
567 |
-
<tag line="350" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
568 |
-
<type by_reference="false">array</type>
|
569 |
-
</tag>
|
570 |
-
<tag line="350" name="return" description="HTML markup to be placed inside the column" type="string">
|
571 |
-
<type by_reference="false">string</type>
|
572 |
-
</tag>
|
573 |
-
</docblock>
|
574 |
-
<argument line="358">
|
575 |
-
<name>$item</name>
|
576 |
<default><![CDATA[]]></default>
|
577 |
<type/>
|
578 |
</argument>
|
579 |
-
|
580 |
-
|
581 |
-
<name>column_post_title</name>
|
582 |
-
<full_name>column_post_title</full_name>
|
583 |
-
<docblock line="379">
|
584 |
-
<description><![CDATA[Supply the content for a custom column]]></description>
|
585 |
-
<long-description><![CDATA[]]></long-description>
|
586 |
-
<tag line="379" name="since" description="0.1"/>
|
587 |
-
<tag line="379" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
588 |
-
<type by_reference="false">array</type>
|
589 |
-
</tag>
|
590 |
-
<tag line="379" name="return" description="HTML markup to be placed inside the column" type="string">
|
591 |
-
<type by_reference="false">string</type>
|
592 |
-
</tag>
|
593 |
-
</docblock>
|
594 |
-
<argument line="387">
|
595 |
-
<name>$item</name>
|
596 |
<default><![CDATA[]]></default>
|
597 |
<type/>
|
598 |
</argument>
|
599 |
</method>
|
600 |
-
<method final="false" abstract="false" static="
|
601 |
-
<name>
|
602 |
-
<full_name>
|
603 |
-
<docblock line="
|
604 |
-
<description><![CDATA[
|
605 |
<long-description><![CDATA[]]></long-description>
|
606 |
-
<tag line="
|
607 |
-
<tag line="
|
608 |
-
<type by_reference="false">
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
</tag>
|
610 |
-
<tag line="
|
611 |
<type by_reference="false">string</type>
|
612 |
</tag>
|
613 |
</docblock>
|
614 |
-
<argument line="
|
615 |
-
<name>$
|
616 |
<default><![CDATA[]]></default>
|
617 |
<type/>
|
618 |
</argument>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
</method>
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
<type by_reference="false">array</type>
|
629 |
</tag>
|
630 |
-
|
631 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
</tag>
|
633 |
</docblock>
|
634 |
-
<argument line="423">
|
635 |
-
<name>$item</name>
|
636 |
-
<default><![CDATA[]]></default>
|
637 |
-
<type/>
|
638 |
-
</argument>
|
639 |
</method>
|
640 |
-
<method final="false" abstract="false" static="
|
641 |
-
<name>
|
642 |
-
<full_name>
|
643 |
-
<docblock line="
|
644 |
-
<description><![CDATA[
|
645 |
-
<long-description><![CDATA[]]></long-description>
|
646 |
-
<tag line="
|
647 |
-
<tag line="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
<type by_reference="false">array</type>
|
649 |
</tag>
|
650 |
-
<tag line="
|
651 |
-
<type by_reference="false">
|
652 |
</tag>
|
653 |
</docblock>
|
654 |
-
<argument line="
|
655 |
-
<name>$
|
656 |
<default><![CDATA[]]></default>
|
657 |
<type/>
|
658 |
</argument>
|
659 |
</method>
|
660 |
-
<method final="false" abstract="false" static="
|
661 |
-
<name>
|
662 |
-
<full_name>
|
663 |
-
<docblock line="
|
664 |
-
<description><![CDATA[
|
665 |
-
<long-description><![CDATA[]]></long-description>
|
666 |
-
<tag line="
|
667 |
-
<tag line="
|
668 |
-
<type by_reference="false">
|
669 |
</tag>
|
670 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
<type by_reference="false">string</type>
|
672 |
</tag>
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
</docblock>
|
674 |
-
<argument line="
|
675 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
676 |
<default><![CDATA[]]></default>
|
677 |
<type/>
|
678 |
</argument>
|
679 |
</method>
|
680 |
-
<method final="false" abstract="false" static="
|
681 |
-
<name>
|
682 |
-
<full_name>
|
683 |
-
<docblock line="
|
684 |
-
<description><![CDATA[
|
685 |
<long-description><![CDATA[]]></long-description>
|
686 |
-
<tag line="
|
687 |
-
<tag line="
|
688 |
-
<type by_reference="false">
|
689 |
</tag>
|
690 |
-
<tag line="
|
691 |
<type by_reference="false">string</type>
|
692 |
</tag>
|
|
|
|
|
|
|
693 |
</docblock>
|
694 |
-
<argument line="
|
695 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
696 |
<default><![CDATA[]]></default>
|
697 |
<type/>
|
698 |
</argument>
|
699 |
</method>
|
700 |
-
<method final="false" abstract="false" static="
|
701 |
-
<name>
|
702 |
-
<full_name>
|
703 |
-
<docblock line="
|
704 |
-
<description><![CDATA[
|
705 |
-
<long-description><![CDATA[]]></long-description>
|
706 |
-
<tag line="
|
707 |
-
<tag line="
|
708 |
-
<type by_reference="false">
|
709 |
</tag>
|
710 |
-
<tag line="
|
711 |
-
<type by_reference="false">
|
712 |
</tag>
|
713 |
</docblock>
|
714 |
-
<argument line="
|
715 |
-
<name>$
|
716 |
<default><![CDATA[]]></default>
|
717 |
<type/>
|
718 |
</argument>
|
719 |
</method>
|
720 |
-
<method final="false" abstract="false" static="
|
721 |
-
<name>
|
722 |
-
<full_name>
|
723 |
-
<docblock line="
|
724 |
-
<description><![CDATA[
|
725 |
-
<long-description><![CDATA[]]></long-description>
|
726 |
-
<tag line="
|
727 |
-
<tag line="
|
728 |
-
<type by_reference="false">
|
729 |
</tag>
|
730 |
-
<tag line="
|
731 |
-
<type by_reference="false">
|
732 |
</tag>
|
733 |
</docblock>
|
734 |
-
<argument line="
|
735 |
-
<name>$
|
736 |
<default><![CDATA[]]></default>
|
737 |
<type/>
|
738 |
</argument>
|
739 |
</method>
|
740 |
-
<method final="false" abstract="false" static="
|
741 |
-
<name>
|
742 |
-
<full_name>
|
743 |
-
<docblock line="
|
744 |
-
<description><![CDATA[
|
745 |
-
<long-description><![CDATA[]]></long-description>
|
746 |
-
<tag line="
|
747 |
-
<tag line="
|
748 |
-
<type by_reference="false">
|
749 |
</tag>
|
750 |
-
<tag line="
|
751 |
-
<type by_reference="false">
|
752 |
</tag>
|
753 |
</docblock>
|
754 |
-
<argument line="
|
755 |
-
<name>$
|
756 |
<default><![CDATA[]]></default>
|
757 |
<type/>
|
758 |
</argument>
|
759 |
</method>
|
760 |
-
<method final="false" abstract="false" static="
|
761 |
-
<name>
|
762 |
-
<full_name>
|
763 |
-
<docblock line="
|
764 |
-
<description><![CDATA[
|
765 |
-
<long-description><![CDATA[]]></long-description>
|
766 |
-
<tag line="
|
767 |
-
<tag line="
|
768 |
-
<type by_reference="false">
|
769 |
</tag>
|
770 |
-
<tag line="
|
771 |
-
<type by_reference="false">
|
772 |
</tag>
|
773 |
</docblock>
|
774 |
-
<argument line="
|
775 |
-
<name>$
|
776 |
<default><![CDATA[]]></default>
|
777 |
<type/>
|
778 |
</argument>
|
779 |
</method>
|
780 |
-
<method final="false" abstract="false" static="
|
781 |
-
<name>
|
782 |
-
<full_name>
|
783 |
-
<docblock line="
|
784 |
-
<description><![CDATA[
|
785 |
-
<long-description><![CDATA[]]></long-description>
|
786 |
-
<tag line="
|
787 |
-
<tag line="
|
788 |
-
<type by_reference="false">
|
789 |
</tag>
|
790 |
-
<tag line="
|
791 |
-
<type by_reference="false">
|
792 |
</tag>
|
793 |
</docblock>
|
794 |
-
<argument line="
|
795 |
-
<name>$
|
796 |
<default><![CDATA[]]></default>
|
797 |
<type/>
|
798 |
</argument>
|
799 |
</method>
|
800 |
-
<method final="false" abstract="false" static="
|
801 |
-
<name>
|
802 |
-
<full_name>
|
803 |
-
<docblock line="
|
804 |
-
<description><![CDATA[
|
805 |
-
<long-description><![CDATA[]]></long-description>
|
806 |
-
<tag line="
|
807 |
-
<tag line="
|
808 |
-
<type by_reference="false">
|
809 |
</tag>
|
810 |
-
<tag line="
|
811 |
-
<type by_reference="false">
|
812 |
</tag>
|
813 |
</docblock>
|
814 |
-
<argument line="
|
815 |
-
<name>$
|
816 |
<default><![CDATA[]]></default>
|
817 |
<type/>
|
818 |
</argument>
|
819 |
</method>
|
820 |
-
<method final="false" abstract="false" static="
|
821 |
-
<name>
|
822 |
-
<full_name>
|
823 |
-
<docblock line="
|
824 |
-
<description><![CDATA[
|
825 |
-
<long-description><![CDATA[]]></long-description>
|
826 |
-
<tag line="
|
827 |
-
<tag line="
|
828 |
-
<type by_reference="false">
|
829 |
</tag>
|
830 |
-
<tag line="
|
831 |
-
<type by_reference="false">
|
832 |
</tag>
|
833 |
</docblock>
|
834 |
-
<argument line="
|
835 |
-
<name>$
|
836 |
<default><![CDATA[]]></default>
|
837 |
<type/>
|
838 |
</argument>
|
839 |
</method>
|
840 |
-
<method final="false" abstract="false" static="
|
841 |
-
<name>
|
842 |
-
<full_name>
|
843 |
-
<docblock line="
|
844 |
-
<description><![CDATA[
|
845 |
-
<long-description><![CDATA[]]></long-description>
|
846 |
-
<tag line="
|
847 |
-
<tag line="
|
848 |
-
<type by_reference="false">
|
849 |
-
</tag>
|
850 |
-
<tag line="
|
851 |
-
<type by_reference="false">
|
852 |
</tag>
|
853 |
</docblock>
|
854 |
-
<argument line="
|
855 |
-
<name>$
|
856 |
<default><![CDATA[]]></default>
|
857 |
<type/>
|
858 |
</argument>
|
859 |
</method>
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
869 |
</tag>
|
870 |
</docblock>
|
871 |
-
</
|
872 |
-
<
|
873 |
-
<name
|
874 |
-
<
|
875 |
-
<docblock line="
|
876 |
-
<description><![CDATA[
|
877 |
-
|
878 |
-
<
|
879 |
-
<tag line="
|
880 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
881 |
<type by_reference="false">array</type>
|
882 |
</tag>
|
883 |
</docblock>
|
884 |
</method>
|
885 |
-
<method final="false" abstract="false" static="false" visibility="
|
886 |
-
<name>
|
887 |
-
<full_name>
|
888 |
-
<docblock line="
|
889 |
-
<description><![CDATA[
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
<tag line="
|
894 |
-
|
|
|
|
|
895 |
<type by_reference="false">array</type>
|
896 |
</tag>
|
897 |
</docblock>
|
|
|
|
|
|
|
|
|
|
|
898 |
</method>
|
899 |
-
<method final="false" abstract="false" static="
|
900 |
-
<name>
|
901 |
-
<full_name>
|
902 |
-
<docblock line="
|
903 |
-
<description><![CDATA[
|
904 |
-
<long-description><![CDATA[<p>
|
905 |
-
|
906 |
-
<tag line="
|
|
|
907 |
<type by_reference="false">array</type>
|
908 |
</tag>
|
909 |
</docblock>
|
910 |
</method>
|
911 |
-
<method final="false" abstract="false" static="
|
912 |
-
<name>
|
913 |
-
<full_name>
|
914 |
-
<docblock line="
|
915 |
-
<description><![CDATA[
|
916 |
-
of bulk actions available on this table.]]></description>
|
917 |
<long-description><![CDATA[]]></long-description>
|
918 |
-
<tag line="
|
919 |
-
<tag line="
|
920 |
<type by_reference="false">array</type>
|
921 |
</tag>
|
922 |
</docblock>
|
923 |
</method>
|
924 |
-
<method final="false" abstract="false" static="
|
925 |
-
<name>
|
926 |
-
<full_name>
|
927 |
-
<docblock line="
|
928 |
-
<description><![CDATA[
|
929 |
-
<long-description><![CDATA[<p>
|
930 |
-
|
931 |
-
|
|
|
|
|
|
|
|
|
|
|
932 |
<type by_reference="false">string</type>
|
933 |
</tag>
|
934 |
-
<tag line="
|
|
|
|
|
|
|
935 |
<type by_reference="false">array</type>
|
936 |
</tag>
|
937 |
</docblock>
|
938 |
-
<argument line="
|
939 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
940 |
<default><![CDATA[]]></default>
|
941 |
<type/>
|
942 |
</argument>
|
943 |
</method>
|
944 |
-
<method final="false" abstract="false" static="
|
945 |
-
<name>
|
946 |
-
<full_name>
|
947 |
-
<docblock line="
|
948 |
-
<description><![CDATA[
|
949 |
-
<long-description><![CDATA[<p>This
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
<tag line="
|
|
|
|
|
954 |
</docblock>
|
955 |
</method>
|
956 |
-
<method final="false" abstract="false" static="
|
957 |
-
<name>
|
958 |
-
<full_name>
|
959 |
-
<docblock line="
|
960 |
-
<description><![CDATA[
|
961 |
-
<long-description><![CDATA[<p>
|
962 |
-
|
963 |
-
<tag line="
|
964 |
-
<tag line="
|
965 |
-
<type by_reference="false">
|
966 |
</tag>
|
967 |
</docblock>
|
968 |
</method>
|
969 |
-
<method final="false" abstract="false" static="false" visibility="
|
970 |
-
<name>
|
971 |
-
<full_name>
|
972 |
-
<docblock line="
|
973 |
-
<description><![CDATA[
|
974 |
-
|
975 |
-
|
976 |
-
<tag line="
|
977 |
-
<tag line="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
978 |
<type by_reference="false">array</type>
|
979 |
</tag>
|
980 |
-
<tag line="
|
981 |
<type by_reference="false">array</type>
|
982 |
</tag>
|
|
|
|
|
|
|
983 |
</docblock>
|
984 |
-
<argument line="
|
985 |
-
<name>$
|
|
|
|
|
|
|
|
|
|
|
986 |
<default><![CDATA[]]></default>
|
987 |
<type/>
|
988 |
</argument>
|
989 |
</method>
|
990 |
-
<method final="false" abstract="false" static="false" visibility="
|
991 |
-
<name>
|
992 |
-
<full_name>
|
993 |
-
<docblock line="
|
994 |
-
<description><![CDATA[
|
995 |
-
<long-description><![CDATA[
|
996 |
-
|
997 |
-
<tag line="
|
|
|
998 |
<type by_reference="false">array</type>
|
999 |
</tag>
|
1000 |
-
<tag line="
|
1001 |
-
<type by_reference="false">
|
1002 |
</tag>
|
1003 |
</docblock>
|
1004 |
-
<argument line="
|
1005 |
-
<name>$
|
1006 |
<default><![CDATA[]]></default>
|
1007 |
<type/>
|
1008 |
</argument>
|
1009 |
</method>
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
<long-description><![CDATA[]]></long-description>
|
1016 |
-
<tag line="2" name="package" description="Media Library Assistant"/>
|
1017 |
-
<tag line="2" name="since" description="0.1"/>
|
1018 |
-
</docblock>
|
1019 |
-
<include line="13" type="Require Once" package="Default">
|
1020 |
-
<name/>
|
1021 |
-
</include>
|
1022 |
-
<class final="false" abstract="false" namespace="global" line="23" package="Media Library Assistant">
|
1023 |
-
<extends/>
|
1024 |
-
<name>MLA</name>
|
1025 |
-
<full_name>\MLA</full_name>
|
1026 |
-
<docblock line="16">
|
1027 |
-
<description><![CDATA[Class MLA (Media Library Assistant) provides several enhancements to the handling
|
1028 |
-
of images and files held in the WordPress Media Library.]]></description>
|
1029 |
-
<long-description><![CDATA[]]></long-description>
|
1030 |
-
<tag line="16" name="package" description="Media Library Assistant"/>
|
1031 |
-
<tag line="16" name="since" description="0.1"/>
|
1032 |
-
</docblock>
|
1033 |
-
<constant namespace="global" line="32" package="Media Library Assistant">
|
1034 |
-
<name>PLUGIN_NAME</name>
|
1035 |
-
<full_name>PLUGIN_NAME</full_name>
|
1036 |
-
<value><![CDATA['Media Library Assistant']]></value>
|
1037 |
-
<docblock line="25">
|
1038 |
-
<description><![CDATA[Display name for this plugin]]></description>
|
1039 |
<long-description><![CDATA[]]></long-description>
|
1040 |
-
<tag line="
|
1041 |
-
<tag line="
|
|
|
|
|
|
|
1042 |
<type by_reference="false">string</type>
|
1043 |
</tag>
|
1044 |
</docblock>
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
|
|
|
|
|
|
|
|
|
|
1052 |
<long-description><![CDATA[]]></long-description>
|
1053 |
-
<tag line="
|
1054 |
-
<tag line="
|
|
|
|
|
|
|
1055 |
<type by_reference="false">string</type>
|
1056 |
</tag>
|
|
|
|
|
|
|
1057 |
</docblock>
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
<
|
1064 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1065 |
<long-description><![CDATA[]]></long-description>
|
1066 |
-
<tag line="
|
1067 |
-
<tag line="
|
|
|
|
|
|
|
1068 |
<type by_reference="false">string</type>
|
1069 |
</tag>
|
1070 |
</docblock>
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
|
|
|
|
|
|
|
|
1078 |
<long-description><![CDATA[]]></long-description>
|
1079 |
-
<tag line="
|
1080 |
-
<tag line="
|
|
|
|
|
|
|
1081 |
<type by_reference="false">string</type>
|
1082 |
</tag>
|
1083 |
</docblock>
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
|
|
|
|
|
|
|
|
1091 |
<long-description><![CDATA[]]></long-description>
|
1092 |
-
<tag line="
|
1093 |
-
<tag line="
|
|
|
|
|
|
|
1094 |
<type by_reference="false">string</type>
|
1095 |
</tag>
|
1096 |
</docblock>
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1104 |
<long-description><![CDATA[]]></long-description>
|
1105 |
-
<tag line="
|
1106 |
-
<tag line="
|
1107 |
-
<type by_reference="false">
|
|
|
|
|
|
|
|
|
|
|
|
|
1108 |
</tag>
|
1109 |
</docblock>
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
<
|
1116 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1117 |
<long-description><![CDATA[]]></long-description>
|
1118 |
-
<tag line="
|
1119 |
-
<tag line="
|
1120 |
-
<type by_reference="false">
|
|
|
|
|
|
|
|
|
|
|
|
|
1121 |
</tag>
|
1122 |
</docblock>
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
<
|
1129 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1130 |
<long-description><![CDATA[]]></long-description>
|
1131 |
-
<tag line="
|
1132 |
-
<tag line="
|
1133 |
-
<type by_reference="false">
|
1134 |
</tag>
|
1135 |
</docblock>
|
1136 |
-
</
|
1137 |
-
<
|
1138 |
-
<name>
|
1139 |
-
<full_name>
|
1140 |
-
<
|
1141 |
-
|
1142 |
-
<description><![CDATA[mla_admin_action value for permanently deleting a single item]]></description>
|
1143 |
<long-description><![CDATA[]]></long-description>
|
1144 |
-
<tag line="
|
1145 |
-
<tag line="
|
|
|
1146 |
<type by_reference="false">string</type>
|
1147 |
</tag>
|
1148 |
-
</docblock>
|
1149 |
-
</constant>
|
1150 |
-
<constant namespace="global" line="253" package="Media Librar
|
1 |
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<project version="2.0.0a8" title="Media Library Assistant">
|
3 |
+
<file path="includes\class-mla-data.php" hash="0fd1adea8279bf74be51630d9ce38d28" package="Media Library Assistant">
|
4 |
<docblock line="2">
|
5 |
+
<description><![CDATA[Database and template file access for MLA needs]]></description>
|
6 |
<long-description><![CDATA[]]></long-description>
|
7 |
<tag line="2" name="package" description="Media Library Assistant"/>
|
8 |
<tag line="2" name="since" description="0.1"/>
|
12 |
<name>MLAData</name>
|
13 |
<full_name>\MLAData</full_name>
|
14 |
<docblock line="9">
|
15 |
+
<description><![CDATA[Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs]]></description>
|
16 |
<long-description><![CDATA[<p>The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials."
|
17 |
Templates separate HTML markup from PHP code for easier maintenance and localization.</p>]]></long-description>
|
18 |
<tag line="9" name="package" description="Media Library Assistant"/>
|
19 |
<tag line="9" name="since" description="0.1"/>
|
20 |
</docblock>
|
21 |
+
<constant namespace="global" line="24" package="Media Library Assistant">
|
22 |
+
<name>MLA_ALT_TEXT_VIEW_SUFFIX</name>
|
23 |
+
<full_name>MLA_ALT_TEXT_VIEW_SUFFIX</full_name>
|
24 |
+
<value><![CDATA['alt_text_view']]></value>
|
25 |
+
<docblock line="19">
|
26 |
+
<description><![CDATA[Provides a unique suffix for the ALT Text SQL VIEW]]></description>
|
27 |
+
<long-description><![CDATA[]]></long-description>
|
28 |
+
<tag line="19" name="since" description="0.40"/>
|
29 |
+
</docblock>
|
30 |
+
</constant>
|
31 |
+
<property final="false" static="true" visibility="private" line="33" namespace="global" package="Media Library Assistant">
|
32 |
+
<name>$mla_alt_text_view</name>
|
33 |
+
<default><![CDATA[NULL]]></default>
|
34 |
+
<docblock line="26">
|
35 |
+
<description><![CDATA[Provides a unique name for the ALT Text SQL VIEW]]></description>
|
36 |
+
<long-description><![CDATA[]]></long-description>
|
37 |
+
<tag line="26" name="since" description="0.40"/>
|
38 |
+
<tag line="26" name="var" description="" type="array">
|
39 |
+
<type by_reference="false">array</type>
|
40 |
+
</tag>
|
41 |
+
</docblock>
|
42 |
+
</property>
|
43 |
+
<property final="false" static="true" visibility="private" line="288" namespace="global" package="Media Library Assistant">
|
44 |
+
<name>$query_parameters</name>
|
45 |
+
<default><![CDATA[array()]]></default>
|
46 |
+
<docblock line="275">
|
47 |
+
<description><![CDATA[WP_Query filter "parameters"]]></description>
|
48 |
+
<long-description><![CDATA[<p>This array defines parameters for the query's join, where and orderby filters.
|
49 |
+
The parameters are set up in the _prepare_list_table_query function, and
|
50 |
+
any further logic required to translate those values is contained in the filters.</p>
|
51 |
+
|
52 |
+
<p>Array index values are: use_postmeta_view, postmeta_key, detached, orderby, order, s, mla-search-connector, mla-search-fields, sentence, exact</p>]]></long-description>
|
53 |
+
<tag line="275" name="since" description="0.30"/>
|
54 |
+
<tag line="275" name="var" description="" type="array">
|
55 |
+
<type by_reference="false">array</type>
|
56 |
+
</tag>
|
57 |
+
</docblock>
|
58 |
+
</property>
|
59 |
+
<property final="false" static="true" visibility="private" line="1186" namespace="global" package="Media Library Assistant">
|
60 |
+
<name>$galleries</name>
|
61 |
+
<default><![CDATA[null]]></default>
|
62 |
+
<docblock line="1168">
|
63 |
+
<description><![CDATA[Objects containing [gallery] shortcodes]]></description>
|
64 |
+
<long-description><![CDATA[<p>This array contains all of the objects containing one or more [gallery] shortcodes
|
65 |
+
and array(s) of which attachments each [gallery] contains. The arrays are built once
|
66 |
+
each page load and cached for subsequent calls.</p>
|
67 |
+
|
68 |
+
<p>The outer array is keyed by post_id. It contains an array of [gallery] entries numbered from one (1).
|
69 |
+
Each inner array has these elements:
|
70 |
+
['parent_title'] post_title of the gallery parent,
|
71 |
+
['parent_type'] 'post' or 'page' or the custom post_type of the gallery parent,
|
72 |
+
['query'] contains a string with the arguments of the [gallery],
|
73 |
+
['results'] contains an array of post_ids for the objects in the gallery.</p>]]></long-description>
|
74 |
+
<tag line="1168" name="since" description="0.70"/>
|
75 |
+
<tag line="1168" name="var" description="" type="array">
|
76 |
+
<type by_reference="false">array</type>
|
77 |
+
</tag>
|
78 |
+
</docblock>
|
79 |
+
</property>
|
80 |
+
<property final="false" static="true" visibility="private" line="1199" namespace="global" package="Media Library Assistant">
|
81 |
+
<name>$mla_galleries</name>
|
82 |
+
<default><![CDATA[null]]></default>
|
83 |
+
<docblock line="1188">
|
84 |
+
<description><![CDATA[Objects containing [mla_gallery] shortcodes]]></description>
|
85 |
+
<long-description><![CDATA[<p>This array contains all of the objects containing one or more [mla_gallery] shortcodes
|
86 |
+
and array(s) of which attachments each [mla_gallery] contains. The arrays are built once
|
87 |
+
each page load and cached for subsequent calls.</p>]]></long-description>
|
88 |
+
<tag line="1188" name="since" description="0.70"/>
|
89 |
+
<tag line="1188" name="var" description="" type="array">
|
90 |
+
<type by_reference="false">array</type>
|
91 |
+
</tag>
|
92 |
+
</docblock>
|
93 |
+
</property>
|
94 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="40" package="Media Library Assistant">
|
95 |
<name>initialize</name>
|
96 |
<full_name>initialize</full_name>
|
97 |
+
<docblock line="35">
|
98 |
<description><![CDATA[Initialization function, similar to __construct()]]></description>
|
99 |
<long-description><![CDATA[]]></long-description>
|
100 |
+
<tag line="35" name="since" description="0.1"/>
|
101 |
</docblock>
|
102 |
</method>
|
103 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="67" package="Media Library Assistant">
|
104 |
<name>mla_load_template</name>
|
105 |
<full_name>mla_load_template</full_name>
|
106 |
+
<docblock line="49">
|
107 |
<description><![CDATA[Load an HTML template from a file]]></description>
|
108 |
<long-description><![CDATA[<p>Loads a template to a string or a multi-part template to an array.
|
109 |
Multi-part templates are divided by comments of the form <!-- template="key" -->,
|
110 |
where "key" becomes the key part of the array.</p>]]></long-description>
|
111 |
+
<tag line="49" name="since" description="0.1"/>
|
112 |
+
<tag line="49" name="param" description="Complete path and name of the template file, option name or the raw template" type="string" variable="$source">
|
113 |
+
<type by_reference="false">string</type>
|
114 |
+
</tag>
|
115 |
+
<tag line="49" name="param" description="Optional type of template source; 'file' (default), 'option', 'string'" type="string" variable="$type">
|
116 |
<type by_reference="false">string</type>
|
117 |
</tag>
|
118 |
+
<tag line="49" name="return" description="string for files that do not contain template divider comments, array for files containing template divider comments, false if file or option does not exist, NULL if file could not be loaded." type="string|array|false|NULL">
|
119 |
<type by_reference="false">string</type>
|
120 |
+
<type by_reference="false">array</type>
|
121 |
+
<type by_reference="false">false</type>
|
122 |
+
<type by_reference="false">NULL</type>
|
123 |
</tag>
|
124 |
</docblock>
|
125 |
+
<argument line="67">
|
126 |
+
<name>$source</name>
|
127 |
<default><![CDATA[]]></default>
|
128 |
<type/>
|
129 |
</argument>
|
130 |
+
<argument line="67">
|
131 |
+
<name>$type</name>
|
132 |
+
<default><![CDATA['file']]></default>
|
133 |
+
<type/>
|
134 |
+
</argument>
|
135 |
</method>
|
136 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="162" package="Media Library Assistant">
|
137 |
<name>mla_parse_template</name>
|
138 |
<full_name>mla_parse_template</full_name>
|
139 |
+
<docblock line="150">
|
140 |
+
<description><![CDATA[Expand a template, replacing place holders with their values]]></description>
|
141 |
<long-description><![CDATA[<p>A simple parsing function for basic templating.</p>]]></long-description>
|
142 |
+
<tag line="150" name="since" description="0.1"/>
|
143 |
+
<tag line="150" name="param" description="A formatting string containing [+placeholders+]" type="string" variable="$tpl">
|
144 |
<type by_reference="false">string</type>
|
145 |
</tag>
|
146 |
+
<tag line="150" name="param" description="An associative array containing keys and values e.g. array('key' => 'value')" type="array" variable="$hash">
|
147 |
<type by_reference="false">array</type>
|
148 |
</tag>
|
149 |
+
<tag line="150" name="return" description="Placeholders corresponding to the keys of the hash will be replaced with their values" type="string">
|
150 |
<type by_reference="false">string</type>
|
151 |
</tag>
|
152 |
</docblock>
|
153 |
+
<argument line="162">
|
154 |
<name>$tpl</name>
|
155 |
<default><![CDATA[]]></default>
|
156 |
<type/>
|
157 |
</argument>
|
158 |
+
<argument line="162">
|
159 |
<name>$hash</name>
|
160 |
<default><![CDATA[]]></default>
|
161 |
<type/>
|
162 |
</argument>
|
163 |
</method>
|
164 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="181" package="Media Library Assistant">
|
165 |
+
<name>mla_get_template_placeholders</name>
|
166 |
+
<full_name>mla_get_template_placeholders</full_name>
|
167 |
+
<docblock line="171">
|
168 |
+
<description><![CDATA[Analyze a template, returning an array of the place holders it contains]]></description>
|
169 |
+
<long-description><![CDATA[]]></long-description>
|
170 |
+
<tag line="171" name="since" description="0.90"/>
|
171 |
+
<tag line="171" name="param" description="A formatting string containing [+placeholders+]" type="string" variable="$tpl">
|
172 |
+
<type by_reference="false">string</type>
|
173 |
+
</tag>
|
174 |
+
<tag line="171" name="return" description="Placeholder information: each entry is an array with ['prefix'] => string, ['value'] => string, ['single'] => boolean" type="array">
|
175 |
<type by_reference="false">array</type>
|
176 |
</tag>
|
177 |
+
</docblock>
|
178 |
+
<argument line="181">
|
179 |
+
<name>$tpl</name>
|
180 |
+
<default><![CDATA[]]></default>
|
181 |
+
<type/>
|
182 |
+
</argument>
|
183 |
+
</method>
|
184 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="223" package="Media Library Assistant">
|
185 |
+
<name>mla_count_list_table_items</name>
|
186 |
+
<full_name>mla_count_list_table_items</full_name>
|
187 |
+
<docblock line="214">
|
188 |
+
<description><![CDATA[Get the total number of attachment posts]]></description>
|
189 |
+
<long-description><![CDATA[]]></long-description>
|
190 |
+
<tag line="214" name="since" description="0.30"/>
|
191 |
+
<tag line="214" name="param" description="Query variables, e.g., from $_REQUEST" type="array" variable="$request">
|
192 |
<type by_reference="false">array</type>
|
193 |
</tag>
|
194 |
+
<tag line="214" name="return" description="Number of attachment posts" type="integer">
|
195 |
+
<type by_reference="false">integer</type>
|
196 |
+
</tag>
|
197 |
</docblock>
|
198 |
+
<argument line="223">
|
199 |
<name>$request</name>
|
200 |
<default><![CDATA[]]></default>
|
201 |
<type/>
|
202 |
</argument>
|
203 |
</method>
|
204 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="244" package="Media Library Assistant">
|
205 |
<name>mla_query_list_table_items</name>
|
206 |
<full_name>mla_query_list_table_items</full_name>
|
207 |
+
<docblock line="230">
|
208 |
+
<description><![CDATA[Retrieve attachment objects for list table display]]></description>
|
209 |
+
<long-description><![CDATA[<p>Supports prepare_items in class-mla-list-table.php.
|
210 |
Modeled after wp_edit_attachments_query in wp-admin/post.php</p>]]></long-description>
|
211 |
+
<tag line="230" name="since" description="0.1"/>
|
212 |
+
<tag line="230" name="param" description="query parameters from web page, usually found in $_REQUEST" type="array" variable="$request">
|
213 |
<type by_reference="false">array</type>
|
214 |
</tag>
|
215 |
+
<tag line="230" name="param" description="number of rows to skip over to reach desired page" type="int" variable="$offset">
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
<type by_reference="false">int</type>
|
217 |
</tag>
|
218 |
+
<tag line="230" name="param" description="number of rows on each page" type="int" variable="$count">
|
219 |
<type by_reference="false">int</type>
|
220 |
</tag>
|
221 |
+
<tag line="230" name="return" description="attachment objects (posts) including parent data, meta data and references" type="array">
|
222 |
<type by_reference="false">array</type>
|
223 |
</tag>
|
224 |
</docblock>
|
225 |
+
<argument line="244">
|
226 |
<name>$request</name>
|
227 |
<default><![CDATA[]]></default>
|
228 |
<type/>
|
229 |
</argument>
|
230 |
+
<argument line="244">
|
231 |
+
<name>$offset</name>
|
232 |
<default><![CDATA[]]></default>
|
233 |
<type/>
|
234 |
</argument>
|
235 |
+
<argument line="244">
|
236 |
+
<name>$count</name>
|
237 |
<default><![CDATA[]]></default>
|
238 |
<type/>
|
239 |
</argument>
|
240 |
+
</method>
|
241 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="304" package="Media Library Assistant">
|
242 |
+
<name>_prepare_list_table_query</name>
|
243 |
+
<full_name>_prepare_list_table_query</full_name>
|
244 |
+
<docblock line="290">
|
245 |
+
<description><![CDATA[Sanitize and expand query arguments from request variables]]></description>
|
246 |
+
<long-description><![CDATA[<p>Prepare the arguments for WP_Query.
|
247 |
+
Modeled after wp_edit_attachments_query in wp-admin/post.php</p>]]></long-description>
|
248 |
+
<tag line="290" name="since" description="0.1"/>
|
249 |
+
<tag line="290" name="param" description="query parameters from web page, usually found in $_REQUEST" type="array" variable="$raw_request">
|
250 |
+
<type by_reference="false">array</type>
|
251 |
+
</tag>
|
252 |
+
<tag line="290" name="param" description="Optional number of rows (default 0) to skip over to reach desired page" type="int" variable="$offset">
|
253 |
+
<type by_reference="false">int</type>
|
254 |
+
</tag>
|
255 |
+
<tag line="290" name="param" description="Optional number of rows on each page (0 = all rows, default)" type="int" variable="$count">
|
256 |
+
<type by_reference="false">int</type>
|
257 |
+
</tag>
|
258 |
+
<tag line="290" name="return" description="revised arguments suitable for WP_Query" type="array">
|
259 |
+
<type by_reference="false">array</type>
|
260 |
+
</tag>
|
261 |
+
</docblock>
|
262 |
+
<argument line="304">
|
263 |
+
<name>$raw_request</name>
|
264 |
<default><![CDATA[]]></default>
|
265 |
<type/>
|
266 |
</argument>
|
267 |
+
<argument line="304">
|
268 |
+
<name>$offset</name>
|
269 |
+
<default><![CDATA[0]]></default>
|
270 |
+
<type/>
|
271 |
+
</argument>
|
272 |
+
<argument line="304">
|
273 |
<name>$count</name>
|
274 |
+
<default><![CDATA[0]]></default>
|
275 |
+
<type/>
|
276 |
+
</argument>
|
277 |
+
</method>
|
278 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="556" package="Media Library Assistant">
|
279 |
+
<name>_execute_list_table_query</name>
|
280 |
+
<full_name>_execute_list_table_query</full_name>
|
281 |
+
<docblock line="547">
|
282 |
+
<description><![CDATA[Add filters, run query, remove filters]]></description>
|
283 |
+
<long-description><![CDATA[]]></long-description>
|
284 |
+
<tag line="547" name="since" description="0.30"/>
|
285 |
+
<tag line="547" name="param" description="query parameters from web page, usually found in $_REQUEST" type="array" variable="$request">
|
286 |
+
<type by_reference="false">array</type>
|
287 |
+
</tag>
|
288 |
+
<tag line="547" name="return" description="WP_Query object with query results" type="object">
|
289 |
+
<type by_reference="false">object</type>
|
290 |
+
</tag>
|
291 |
+
</docblock>
|
292 |
+
<argument line="556">
|
293 |
+
<name>$request</name>
|
294 |
<default><![CDATA[]]></default>
|
295 |
<type/>
|
296 |
</argument>
|
297 |
</method>
|
298 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="610" package="Media Library Assistant">
|
299 |
+
<name>mla_query_posts_search_filter</name>
|
300 |
+
<full_name>mla_query_posts_search_filter</full_name>
|
301 |
+
<docblock line="598">
|
302 |
+
<description><![CDATA[Adds a keyword search to the WHERE clause, if required]]></description>
|
303 |
+
<long-description><![CDATA[<p>Defined as public because it's a filter.</p>]]></long-description>
|
304 |
+
<tag line="598" name="since" description="0.60"/>
|
305 |
+
<tag line="598" name="param" description="query clause before modification" type="string" variable="$search_string">
|
|
|
306 |
<type by_reference="false">string</type>
|
307 |
</tag>
|
308 |
+
<tag line="598" name="param" description="WP_Query object" type="object" variable="$query_object">
|
309 |
+
<type by_reference="false">object</type>
|
310 |
+
</tag>
|
311 |
+
<tag line="598" name="return" description="query clause after keyword search addition" type="string">
|
312 |
<type by_reference="false">string</type>
|
313 |
</tag>
|
314 |
</docblock>
|
315 |
+
<argument line="610">
|
316 |
+
<name>$search_string</name>
|
317 |
+
<default><![CDATA[]]></default>
|
318 |
+
<type/>
|
319 |
+
</argument>
|
320 |
+
<argument line="610">
|
321 |
+
<name>$query_object</name>
|
322 |
<default><![CDATA[]]></default>
|
323 |
<type/>
|
324 |
</argument>
|
325 |
</method>
|
326 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="690" package="Media Library Assistant">
|
327 |
+
<name>mla_query_posts_join_filter</name>
|
328 |
+
<full_name>mla_query_posts_join_filter</full_name>
|
329 |
+
<docblock line="679">
|
330 |
+
<description><![CDATA[Adds a JOIN clause, if required, to handle sorting/searching on ALT Text]]></description>
|
331 |
+
<long-description><![CDATA[<p>Defined as public because it's a filter.</p>]]></long-description>
|
332 |
+
<tag line="679" name="since" description="0.30"/>
|
333 |
+
<tag line="679" name="param" description="query clause before modification" type="string" variable="$join_clause">
|
334 |
+
<type by_reference="false">string</type>
|
|
|
335 |
</tag>
|
336 |
+
<tag line="679" name="return" description="query clause after "LEFT JOIN view ON post_id" item modification" type="string">
|
337 |
+
<type by_reference="false">string</type>
|
338 |
</tag>
|
339 |
</docblock>
|
340 |
+
<argument line="690">
|
341 |
+
<name>$join_clause</name>
|
342 |
<default><![CDATA[]]></default>
|
343 |
<type/>
|
344 |
</argument>
|
345 |
</method>
|
346 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="717" package="Media Library Assistant">
|
347 |
+
<name>mla_query_posts_where_filter</name>
|
348 |
+
<full_name>mla_query_posts_where_filter</full_name>
|
349 |
+
<docblock line="705">
|
350 |
+
<description><![CDATA[Adds a WHERE clause for detached items]]></description>
|
351 |
+
<long-description><![CDATA[<p>Modeled after _edit_attachments_query_helper in wp-admin/post.php.
|
352 |
+
Defined as public because it's a filter.</p>]]></long-description>
|
353 |
+
<tag line="705" name="since" description="0.1"/>
|
354 |
+
<tag line="705" name="param" description="query clause before modification" type="string" variable="$where_clause">
|
355 |
+
<type by_reference="false">string</type>
|
356 |
</tag>
|
357 |
+
<tag line="705" name="return" description="query clause after "detached" item modification" type="string">
|
358 |
+
<type by_reference="false">string</type>
|
359 |
</tag>
|
360 |
+
</docblock>
|
361 |
+
<argument line="717">
|
362 |
+
<name>$where_clause</name>
|
363 |
+
<default><![CDATA[]]></default>
|
364 |
+
<type/>
|
365 |
+
</argument>
|
366 |
+
</method>
|
367 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="738" package="Media Library Assistant">
|
368 |
+
<name>mla_query_posts_orderby_filter</name>
|
369 |
+
<full_name>mla_query_posts_orderby_filter</full_name>
|
370 |
+
<docblock line="726">
|
371 |
+
<description><![CDATA[Adds a ORDERBY clause, if required]]></description>
|
372 |
+
<long-description><![CDATA[<p>Expands the range of sort options because the logic in WP_Query is limited.
|
373 |
+
Defined as public because it's a filter.</p>]]></long-description>
|
374 |
+
<tag line="726" name="since" description="0.30"/>
|
375 |
+
<tag line="726" name="param" description="query clause before modification" type="string" variable="$orderby_clause">
|
376 |
+
<type by_reference="false">string</type>
|
377 |
+
</tag>
|
378 |
+
<tag line="726" name="return" description="updated query clause" type="string">
|
379 |
+
<type by_reference="false">string</type>
|
380 |
</tag>
|
381 |
</docblock>
|
382 |
+
<argument line="738">
|
383 |
+
<name>$orderby_clause</name>
|
384 |
<default><![CDATA[]]></default>
|
385 |
<type/>
|
386 |
</argument>
|
387 |
+
</method>
|
388 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="796" package="Media Library Assistant">
|
389 |
+
<name>mla_get_attachment_by_id</name>
|
390 |
+
<full_name>mla_get_attachment_by_id</full_name>
|
391 |
+
<docblock line="784">
|
392 |
+
<description><![CDATA[Retrieve an Attachment array given a $post_id]]></description>
|
393 |
+
<long-description><![CDATA[<p>The (associative) array will contain every field that can be found in
|
394 |
+
the posts and postmeta tables, and all references to the attachment.</p>]]></long-description>
|
395 |
+
<tag line="784" name="since" description="0.1"/>
|
396 |
+
<tag line="784" name="uses" description="\global\$post" refers="\global\$post"/>
|
397 |
+
<tag line="784" name="param" description="The ID of the attachment post" type="int" variable="$post_id">
|
398 |
+
<type by_reference="false">int</type>
|
399 |
+
</tag>
|
400 |
+
<tag line="784" name="return" description="NULL on failure else associative array" type="NULL|array">
|
401 |
+
<type by_reference="false">NULL</type>
|
402 |
+
<type by_reference="false">array</type>
|
403 |
+
</tag>
|
404 |
+
</docblock>
|
405 |
+
<argument line="796">
|
406 |
+
<name>$post_id</name>
|
407 |
<default><![CDATA[]]></default>
|
408 |
<type/>
|
409 |
</argument>
|
410 |
</method>
|
411 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="841" package="Media Library Assistant">
|
412 |
+
<name>mla_fetch_attachment_parent_data</name>
|
413 |
+
<full_name>mla_fetch_attachment_parent_data</full_name>
|
414 |
+
<docblock line="832">
|
415 |
+
<description><![CDATA[Returns information about an attachment's parent, if found]]></description>
|
416 |
<long-description><![CDATA[]]></long-description>
|
417 |
+
<tag line="832" name="since" description="0.1"/>
|
418 |
+
<tag line="832" name="param" description="post ID of attachment's parent, if any" type="int" variable="$parent_id">
|
419 |
<type by_reference="false">int</type>
|
420 |
</tag>
|
421 |
+
<tag line="832" name="return" description="Parent information; post_date, post_title and post_type" type="array">
|
422 |
<type by_reference="false">array</type>
|
423 |
</tag>
|
424 |
</docblock>
|
425 |
+
<argument line="841">
|
426 |
<name>$parent_id</name>
|
427 |
<default><![CDATA[]]></default>
|
428 |
<type/>
|
429 |
</argument>
|
430 |
</method>
|
431 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="869" package="Media Library Assistant">
|
432 |
+
<name>mla_fetch_attachment_metadata</name>
|
433 |
+
<full_name>mla_fetch_attachment_metadata</full_name>
|
434 |
+
<docblock line="856">
|
435 |
+
<description><![CDATA[Fetch and filter meta data for an attachment]]></description>
|
436 |
<long-description><![CDATA[<p>Returns a filtered array of a post's meta data. Internal values beginning with '<em>'
|
437 |
are stripped out or converted to an 'mla</em>' equivalent. Array data is replaced with
|
438 |
a string containing the first array element.</p>]]></long-description>
|
439 |
+
<tag line="856" name="since" description="0.1"/>
|
440 |
+
<tag line="856" name="param" description="post ID of attachment" type="int" variable="$post_id">
|
441 |
<type by_reference="false">int</type>
|
442 |
</tag>
|
443 |
+
<tag line="856" name="return" description="Meta data variables" type="array">
|
444 |
<type by_reference="false">array</type>
|
445 |
</tag>
|
446 |
</docblock>
|
447 |
+
<argument line="869">
|
448 |
<name>$post_id</name>
|
449 |
<default><![CDATA[]]></default>
|
450 |
<type/>
|
451 |
</argument>
|
452 |
</method>
|
453 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="935" package="Media Library Assistant">
|
454 |
+
<name>mla_fetch_attachment_references</name>
|
455 |
+
<full_name>mla_fetch_attachment_references</full_name>
|
456 |
+
<docblock line="922">
|
457 |
+
<description><![CDATA[Find Featured Image and inserted image/link references to an attachment]]></description>
|
458 |
+
<long-description><![CDATA[<p>Searches all post and page content to see if the attachment is used
|
459 |
+
as a Featured Image or inserted in the post as an image or link.</p>]]></long-description>
|
460 |
+
<tag line="922" name="since" description="0.1"/>
|
461 |
+
<tag line="922" name="param" description="post ID of attachment" type="int" variable="$ID">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
<type by_reference="false">int</type>
|
463 |
</tag>
|
464 |
+
<tag line="922" name="param" description="post ID of attachment's parent, if any" type="int" variable="$parent">
|
465 |
+
<type by_reference="false">int</type>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
</tag>
|
467 |
+
<tag line="922" name="return" description="Reference information; see $references array comments" type="array">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
<type by_reference="false">array</type>
|
469 |
</tag>
|
470 |
</docblock>
|
471 |
+
<argument line="935">
|
472 |
+
<name>$ID</name>
|
473 |
+
<default><![CDATA[]]></default>
|
474 |
+
<type/>
|
475 |
+
</argument>
|
476 |
+
<argument line="935">
|
477 |
+
<name>$parent</name>
|
478 |
+
<default><![CDATA[]]></default>
|
479 |
+
<type/>
|
480 |
+
</argument>
|
481 |
+
</method>
|
482 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1210" package="Media Library Assistant">
|
483 |
+
<name>mla_flush_mla_galleries</name>
|
484 |
+
<full_name>mla_flush_mla_galleries</full_name>
|
485 |
+
<docblock line="1201">
|
486 |
+
<description><![CDATA[Invalidates the $mla_galleries or $galleries array and cached values]]></description>
|
487 |
+
<long-description><![CDATA[]]></long-description>
|
488 |
+
<tag line="1201" name="since" description="1.00"/>
|
489 |
+
<tag line="1201" name="param" description="name of the gallery's cache/option variable" type="string" variable="$option_name">
|
490 |
+
<type by_reference="false">string</type>
|
491 |
</tag>
|
492 |
+
<tag line="1201" name="return" description="" type="void">
|
493 |
+
<type by_reference="false">void</type>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
</tag>
|
495 |
</docblock>
|
496 |
+
<argument line="1210">
|
497 |
+
<name>$option_name</name>
|
498 |
+
<default><![CDATA[]]></default>
|
499 |
+
<type/>
|
500 |
+
</argument>
|
501 |
+
</method>
|
502 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1234" package="Media Library Assistant">
|
503 |
+
<name>mla_save_post_action</name>
|
504 |
+
<full_name>mla_save_post_action</full_name>
|
505 |
+
<docblock line="1225">
|
506 |
+
<description><![CDATA[Invalidates $mla_galleries and $galleries arrays and cached values after post, page or attachment updates]]></description>
|
507 |
<long-description><![CDATA[]]></long-description>
|
508 |
+
<tag line="1225" name="since" description="1.00"/>
|
509 |
+
<tag line="1225" name="param" description="ID of post/page/attachment; not used at this time" type="integer" variable="$post_id">
|
510 |
+
<type by_reference="false">integer</type>
|
511 |
+
</tag>
|
512 |
+
<tag line="1225" name="return" description="" type="void">
|
513 |
+
<type by_reference="false">void</type>
|
514 |
</tag>
|
515 |
</docblock>
|
516 |
+
<argument line="1234">
|
517 |
+
<name>$post_id</name>
|
518 |
+
<default><![CDATA[]]></default>
|
519 |
+
<type/>
|
520 |
+
</argument>
|
521 |
</method>
|
522 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1251" package="Media Library Assistant">
|
523 |
+
<name>_build_mla_galleries</name>
|
524 |
+
<full_name>_build_mla_galleries</full_name>
|
525 |
+
<docblock line="1239">
|
526 |
+
<description><![CDATA[Builds the $mla_galleries or $galleries array]]></description>
|
527 |
+
<long-description><![CDATA[]]></long-description>
|
528 |
+
<tag line="1239" name="since" description="0.70"/>
|
529 |
+
<tag line="1239" name="param" description="name of the gallery's cache/option variable" type="string" variable="$option_name">
|
|
|
|
|
530 |
<type by_reference="false">string</type>
|
531 |
</tag>
|
532 |
+
<tag line="1239" name="param" description="by reference to the private static galleries array variable" type="array" variable="$galleries_array">
|
533 |
+
<type by_reference="false">array</type>
|
534 |
+
</tag>
|
535 |
+
<tag line="1239" name="param" description="the shortcode to be searched for and processed" type="string" variable="$shortcode">
|
536 |
<type by_reference="false">string</type>
|
537 |
</tag>
|
538 |
+
<tag line="1239" name="param" description="true to exclude revisions from the search" type="boolean" variable="$exclude_revisions">
|
539 |
+
<type by_reference="false">boolean</type>
|
540 |
</tag>
|
541 |
+
<tag line="1239" name="return" description="true if the galleries array is not empty" type="boolean">
|
542 |
+
<type by_reference="false">boolean</type>
|
543 |
</tag>
|
544 |
</docblock>
|
545 |
+
<argument line="1251">
|
546 |
+
<name>$option_name</name>
|
547 |
<default><![CDATA[]]></default>
|
548 |
<type/>
|
549 |
</argument>
|
550 |
+
<argument line="1251">
|
551 |
+
<name>$galleries_array</name>
|
552 |
<default><![CDATA[]]></default>
|
553 |
<type/>
|
554 |
</argument>
|
555 |
+
<argument line="1251">
|
556 |
+
<name>$shortcode</name>
|
557 |
+
<default><![CDATA[]]></default>
|
558 |
+
<type/>
|
559 |
+
</argument>
|
560 |
+
<argument line="1251">
|
561 |
+
<name>$exclude_revisions</name>
|
562 |
<default><![CDATA[]]></default>
|
563 |
<type/>
|
564 |
</argument>
|
565 |
</method>
|
566 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1356" package="Media Library Assistant">
|
567 |
+
<name>_search_mla_galleries</name>
|
568 |
+
<full_name>_search_mla_galleries</full_name>
|
569 |
+
<docblock line="1345">
|
570 |
+
<description><![CDATA[Search the $mla_galleries or $galleries array]]></description>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
571 |
<long-description><![CDATA[]]></long-description>
|
572 |
+
<tag line="1345" name="since" description="0.70"/>
|
573 |
+
<tag line="1345" name="param" description="by reference to the private static galleries array variable" type="array" variable="$galleries_array">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
<type by_reference="false">array</type>
|
575 |
</tag>
|
576 |
+
<tag line="1345" name="param" description="the attachment ID to be searched for and processed" type="int" variable="$attachment_id">
|
577 |
+
<type by_reference="false">int</type>
|
578 |
</tag>
|
579 |
+
<tag line="1345" name="return" description="All posts/pages with one or more galleries that include the attachment. The array key is the parent_post ID; each entry contains post_title and post_type." type="array">
|
580 |
+
<type by_reference="false">array</type>
|
581 |
</tag>
|
582 |
</docblock>
|
583 |
+
<argument line="1356">
|
584 |
+
<name>$galleries_array</name>
|
585 |
<default><![CDATA[]]></default>
|
586 |
<type/>
|
587 |
</argument>
|
588 |
+
<argument line="1356">
|
589 |
+
<name>$attachment_id</name>
|
590 |
<default><![CDATA[]]></default>
|
591 |
<type/>
|
592 |
</argument>
|
593 |
</method>
|
594 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1382" package="Media Library Assistant">
|
595 |
+
<name>mla_exif_metadata_value</name>
|
596 |
+
<full_name>mla_exif_metadata_value</full_name>
|
597 |
+
<docblock line="1369">
|
598 |
+
<description><![CDATA[Parse one EXIF metadata field]]></description>
|
599 |
+
<long-description><![CDATA[<p>Returns a string value, converting array data to a string as necessary.
|
600 |
+
Also handles the special pseudo-values 'ALL_EXIF' and 'ALL_IPTC'.</p>]]></long-description>
|
601 |
+
<tag line="1369" name="since" description="1.13"/>
|
602 |
+
<tag line="1369" name="param" description="field name" type="string" variable="$key">
|
603 |
+
<type by_reference="false">string</type>
|
604 |
</tag>
|
605 |
+
<tag line="1369" name="param" description="metadata array containing 'mla_exif_metadata' and 'mla_iptc_metadata' arrays" type="string" variable="$image_metadata">
|
606 |
+
<type by_reference="false">string</type>
|
607 |
+
</tag>
|
608 |
+
<tag line="1369" name="return" description="string representation of metadata value or an empty string" type="string">
|
609 |
<type by_reference="false">string</type>
|
610 |
</tag>
|
611 |
</docblock>
|
612 |
+
<argument line="1382">
|
613 |
+
<name>$key</name>
|
614 |
+
<default><![CDATA[]]></default>
|
615 |
+
<type/>
|
616 |
+
</argument>
|
617 |
+
<argument line="1382">
|
618 |
+
<name>$image_metadata</name>
|
619 |
<default><![CDATA[]]></default>
|
620 |
<type/>
|
621 |
</argument>
|
622 |
</method>
|
623 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1412" package="Media Library Assistant">
|
624 |
+
<name>mla_fetch_attachment_image_metadata</name>
|
625 |
+
<full_name>mla_fetch_attachment_image_metadata</full_name>
|
626 |
+
<docblock line="1400">
|
627 |
+
<description><![CDATA[Fetch and filter IPTC and EXIF meta data for an image attachment]]></description>
|
628 |
+
<long-description><![CDATA[<p>Returns</p>]]></long-description>
|
629 |
+
<tag line="1400" name="since" description="0.90"/>
|
630 |
+
<tag line="1400" name="param" description="post ID of attachment" type="int" variable="$post_id">
|
631 |
+
<type by_reference="false">int</type>
|
632 |
</tag>
|
633 |
+
<tag line="1400" name="param" description="optional; if $post_id is zero, path to the image file." type="string" variable="$path">
|
634 |
<type by_reference="false">string</type>
|
635 |
</tag>
|
636 |
+
<tag line="1400" name="return" description="Meta data variables" type="array">
|
637 |
+
<type by_reference="false">array</type>
|
638 |
+
</tag>
|
639 |
</docblock>
|
640 |
+
<argument line="1412">
|
641 |
+
<name>$post_id</name>
|
642 |
<default><![CDATA[]]></default>
|
643 |
<type/>
|
644 |
</argument>
|
645 |
+
<argument line="1412">
|
646 |
+
<name>$path</name>
|
647 |
+
<default><![CDATA['']]></default>
|
648 |
+
<type/>
|
649 |
+
</argument>
|
650 |
</method>
|
651 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1478" package="Media Library Assistant">
|
652 |
+
<name>mla_update_single_item</name>
|
653 |
+
<full_name>mla_update_single_item</full_name>
|
654 |
+
<docblock line="1465">
|
655 |
+
<description><![CDATA[Update a single item; change the meta data
|
656 |
+
for a single attachment.]]></description>
|
657 |
<long-description><![CDATA[]]></long-description>
|
658 |
+
<tag line="1465" name="since" description="0.1"/>
|
659 |
+
<tag line="1465" name="param" description="The ID of the attachment to be updated" type="int" variable="$post_id">
|
660 |
+
<type by_reference="false">int</type>
|
661 |
+
</tag>
|
662 |
+
<tag line="1465" name="param" description="Field name => value pairs" type="array" variable="$new_data">
|
663 |
<type by_reference="false">array</type>
|
664 |
</tag>
|
665 |
+
<tag line="1465" name="param" description="Optional taxonomy term values, default null" type="array" variable="$tax_input">
|
666 |
+
<type by_reference="false">array</type>
|
667 |
</tag>
|
668 |
+
<tag line="1465" name="param" description="Optional taxonomy actions (add, remove, replace), default null" type="array" variable="$tax_actions">
|
669 |
+
<type by_reference="false">array</type>
|
670 |
+
</tag>
|
671 |
+
<tag line="1465" name="return" description="success/failure message and NULL content" type="array">
|
672 |
<type by_reference="false">array</type>
|
673 |
</tag>
|
674 |
</docblock>
|
675 |
+
<argument line="1478">
|
676 |
+
<name>$post_id</name>
|
677 |
<default><![CDATA[]]></default>
|
678 |
<type/>
|
679 |
</argument>
|
680 |
+
<argument line="1478">
|
681 |
+
<name>$new_data</name>
|
682 |
<default><![CDATA[]]></default>
|
683 |
<type/>
|
684 |
</argument>
|
685 |
+
<argument line="1478">
|
686 |
+
<name>$tax_input</name>
|
687 |
+
<default><![CDATA[NULL]]></default>
|
688 |
+
<type/>
|
689 |
+
</argument>
|
690 |
+
<argument line="1478">
|
691 |
+
<name>$tax_actions</name>
|
692 |
+
<default><![CDATA[NULL]]></default>
|
693 |
+
<type/>
|
694 |
+
</argument>
|
695 |
</method>
|
696 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1700" package="Media Library Assistant">
|
697 |
+
<name>_remove_tags</name>
|
698 |
+
<full_name>_remove_tags</full_name>
|
699 |
+
<docblock line="1689">
|
700 |
+
<description><![CDATA[Remove tags from a term ids list]]></description>
|
701 |
<long-description><![CDATA[]]></long-description>
|
702 |
+
<tag line="1689" name="since" description="0.40"/>
|
703 |
+
<tag line="1689" name="param" description="The term ids currently assigned" type="array" variable="$terms_before">
|
704 |
<type by_reference="false">array</type>
|
705 |
</tag>
|
706 |
+
<tag line="1689" name="param" description="| string The term ids (array) or names (string) to remove" type="array" variable="$tags">
|
707 |
+
<type by_reference="false">array</type>
|
708 |
+
</tag>
|
709 |
+
<tag line="1689" name="param" description="The taxonomy object" type="object" variable="$taxonomy_obj">
|
710 |
+
<type by_reference="false">object</type>
|
711 |
+
</tag>
|
712 |
+
<tag line="1689" name="return" description="Term ids of the surviving tags" type="array">
|
713 |
+
<type by_reference="false">array</type>
|
714 |
</tag>
|
715 |
</docblock>
|
716 |
+
<argument line="1700">
|
717 |
+
<name>$terms_before</name>
|
718 |
<default><![CDATA[]]></default>
|
719 |
<type/>
|
720 |
</argument>
|
721 |
+
<argument line="1700">
|
722 |
+
<name>$tags</name>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
<default><![CDATA[]]></default>
|
724 |
<type/>
|
725 |
</argument>
|
726 |
+
<argument line="1700">
|
727 |
+
<name>$taxonomy_obj</name>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
728 |
<default><![CDATA[]]></default>
|
729 |
<type/>
|
730 |
</argument>
|
731 |
</method>
|
732 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1743" package="Media Library Assistant">
|
733 |
+
<name>_hex_dump</name>
|
734 |
+
<full_name>_hex_dump</full_name>
|
735 |
+
<docblock line="1732">
|
736 |
+
<description><![CDATA[Format printable version of binary data]]></description>
|
737 |
<long-description><![CDATA[]]></long-description>
|
738 |
+
<tag line="1732" name="since" description="0.90"/>
|
739 |
+
<tag line="1732" name="param" description="Binary data" type="string" variable="$data">
|
740 |
+
<type by_reference="false">string</type>
|
741 |
+
</tag>
|
742 |
+
<tag line="1732" name="param" description="Bytes to format, default = 0 (all bytes)" type="integer" variable="$limit">
|
743 |
+
<type by_reference="false">integer</type>
|
744 |
+
</tag>
|
745 |
+
<tag line="1732" name="param" description="Bytes to format on each line" type="\intger" variable="$bytes_per_row">
|
746 |
+
<type by_reference="false">\intger</type>
|
747 |
</tag>
|
748 |
+
<tag line="1732" name="return" description="Printable representation of $data" type="string">
|
749 |
<type by_reference="false">string</type>
|
750 |
</tag>
|
751 |
</docblock>
|
752 |
+
<argument line="1743">
|
753 |
+
<name>$data</name>
|
754 |
<default><![CDATA[]]></default>
|
755 |
<type/>
|
756 |
</argument>
|
757 |
+
<argument line="1743">
|
758 |
+
<name>$limit</name>
|
759 |
+
<default><![CDATA[0]]></default>
|
760 |
+
<type/>
|
761 |
+
</argument>
|
762 |
+
<argument line="1743">
|
763 |
+
<name>$bytes_per_row</name>
|
764 |
+
<default><![CDATA[16]]></default>
|
765 |
+
<type/>
|
766 |
+
</argument>
|
767 |
</method>
|
768 |
+
</class>
|
769 |
+
</file>
|
770 |
+
<file path="includes\class-mla-edit-media.php" hash="ecf5932a9aa8974651feeb7c4b5352ab" package="Media Library Assistant">
|
771 |
+
<docblock line="2">
|
772 |
+
<description><![CDATA[Media Library Assistant Edit Media screen enhancements]]></description>
|
773 |
+
<long-description><![CDATA[]]></long-description>
|
774 |
+
<tag line="2" name="package" description="Media Library Assistant"/>
|
775 |
+
<tag line="2" name="since" description="0.80"/>
|
776 |
+
</docblock>
|
777 |
+
<class final="false" abstract="false" namespace="global" line="15" package="Media Library Assistant">
|
778 |
+
<extends/>
|
779 |
+
<name>MLAEdit</name>
|
780 |
+
<full_name>\MLAEdit</full_name>
|
781 |
+
<docblock line="9">
|
782 |
+
<description><![CDATA[Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen]]></description>
|
783 |
+
<long-description><![CDATA[]]></long-description>
|
784 |
+
<tag line="9" name="package" description="Media Library Assistant"/>
|
785 |
+
<tag line="9" name="since" description="0.80"/>
|
786 |
+
</docblock>
|
787 |
+
<property final="false" static="true" visibility="private" line="197" namespace="global" package="Media Library Assistant">
|
788 |
+
<name>$mla_references</name>
|
789 |
+
<default><![CDATA[null]]></default>
|
790 |
+
<docblock line="187">
|
791 |
+
<description><![CDATA[Where-used values for the current item]]></description>
|
792 |
+
<long-description><![CDATA[<p>This array contains the Featured/Inserted/Gallery/MLA Gallery references for the item.
|
793 |
+
The array is built once each page load and cached for subsequent calls.</p>]]></long-description>
|
794 |
+
<tag line="187" name="since" description="0.80"/>
|
795 |
+
<tag line="187" name="var" description="" type="array">
|
796 |
<type by_reference="false">array</type>
|
797 |
</tag>
|
798 |
+
</docblock>
|
799 |
+
</property>
|
800 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="23" package="Media Library Assistant">
|
801 |
+
<name>initialize</name>
|
802 |
+
<full_name>initialize</full_name>
|
803 |
+
<docblock line="16">
|
804 |
+
<description><![CDATA[Initialization function, similar to __construct()]]></description>
|
805 |
+
<long-description><![CDATA[]]></long-description>
|
806 |
+
<tag line="16" name="since" description="0.80"/>
|
807 |
+
<tag line="16" name="return" description="" type="void">
|
808 |
+
<type by_reference="false">void</type>
|
809 |
</tag>
|
810 |
</docblock>
|
|
|
|
|
|
|
|
|
|
|
811 |
</method>
|
812 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="55" package="Media Library Assistant">
|
813 |
+
<name>mla_custom_field_support_action</name>
|
814 |
+
<full_name>mla_custom_field_support_action</full_name>
|
815 |
+
<docblock line="47">
|
816 |
+
<description><![CDATA[Adds Custom Field support to the Edit Media screen.]]></description>
|
817 |
+
<long-description><![CDATA[<p>Declared public because it is an action.</p>]]></long-description>
|
818 |
+
<tag line="47" name="since" description="0.80"/>
|
819 |
+
<tag line="47" name="return" description="echoes the HTML markup for the label and value" type="void">
|
820 |
+
<type by_reference="false">void</type>
|
821 |
+
</tag>
|
822 |
+
</docblock>
|
823 |
+
</method>
|
824 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="69" package="Media Library Assistant">
|
825 |
+
<name>mla_post_updated_messages_filter</name>
|
826 |
+
<full_name>mla_post_updated_messages_filter</full_name>
|
827 |
+
<docblock line="59">
|
828 |
+
<description><![CDATA[Adds mapping update messages for display at the top of the Edit Media screen.]]></description>
|
829 |
+
<long-description><![CDATA[<p>Declared public because it is a filter.</p>]]></long-description>
|
830 |
+
<tag line="59" name="since" description="1.10"/>
|
831 |
+
<tag line="59" name="param" description="messages for the Edit screen" type="array" variable="$messages">
|
832 |
<type by_reference="false">array</type>
|
833 |
</tag>
|
834 |
+
<tag line="59" name="return" description="updated messages" type="array">
|
835 |
+
<type by_reference="false">array</type>
|
836 |
</tag>
|
837 |
</docblock>
|
838 |
+
<argument line="69">
|
839 |
+
<name>$messages</name>
|
840 |
<default><![CDATA[]]></default>
|
841 |
<type/>
|
842 |
</argument>
|
843 |
</method>
|
844 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="86" package="Media Library Assistant">
|
845 |
+
<name>mla_attachment_submitbox_action</name>
|
846 |
+
<full_name>mla_attachment_submitbox_action</full_name>
|
847 |
+
<docblock line="78">
|
848 |
+
<description><![CDATA[Adds Last Modified date to the Submit box on the Edit Media screen.]]></description>
|
849 |
+
<long-description><![CDATA[<p>Declared public because it is an action.</p>]]></long-description>
|
850 |
+
<tag line="78" name="since" description="0.80"/>
|
851 |
+
<tag line="78" name="return" description="echoes the HTML markup for the label and value" type="void">
|
852 |
+
<type by_reference="false">void</type>
|
853 |
</tag>
|
854 |
+
</docblock>
|
855 |
+
</method>
|
856 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="119" package="Media Library Assistant">
|
857 |
+
<name>mla_add_meta_boxes_action</name>
|
858 |
+
<full_name>mla_add_meta_boxes_action</full_name>
|
859 |
+
<docblock line="108">
|
860 |
+
<description><![CDATA[Registers meta boxes for the Edit Media screen.]]></description>
|
861 |
+
<long-description><![CDATA[<p>Declared public because it is an action.</p>]]></long-description>
|
862 |
+
<tag line="108" name="since" description="0.80"/>
|
863 |
+
<tag line="108" name="param" description="type of the current post, e.g., 'attachment'" type="string" variable="$post_type">
|
864 |
<type by_reference="false">string</type>
|
865 |
</tag>
|
866 |
+
<tag line="108" name="param" description="current post" type="object" variable="$post">
|
867 |
+
<type by_reference="false">object</type>
|
868 |
+
</tag>
|
869 |
+
<tag line="108" name="return" description="" type="void">
|
870 |
+
<type by_reference="false">void</type>
|
871 |
+
</tag>
|
872 |
</docblock>
|
873 |
+
<argument line="119">
|
874 |
+
<name>$post_type</name>
|
875 |
+
<default><![CDATA[]]></default>
|
876 |
+
<type/>
|
877 |
+
</argument>
|
878 |
+
<argument line="119">
|
879 |
+
<name>$post</name>
|
880 |
<default><![CDATA[]]></default>
|
881 |
<type/>
|
882 |
</argument>
|
883 |
</method>
|
884 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="149" package="Media Library Assistant">
|
885 |
+
<name>mla_edit_add_help_tab</name>
|
886 |
+
<full_name>mla_edit_add_help_tab</full_name>
|
887 |
+
<docblock line="139">
|
888 |
+
<description><![CDATA[Add contextual help tabs to the WordPress Edit Media page]]></description>
|
889 |
<long-description><![CDATA[]]></long-description>
|
890 |
+
<tag line="139" name="since" description="0.90"/>
|
891 |
+
<tag line="139" name="param" description="title as shown on the screen" type="string" variable="$admin_title">
|
892 |
+
<type by_reference="false">string</type>
|
893 |
</tag>
|
894 |
+
<tag line="139" name="param" description="title as shown in the HTML header" type="string" variable="$title">
|
895 |
<type by_reference="false">string</type>
|
896 |
</tag>
|
897 |
+
<tag line="139" name="return" description="" type="void">
|
898 |
+
<type by_reference="false">void</type>
|
899 |
+
</tag>
|
900 |
</docblock>
|
901 |
+
<argument line="149">
|
902 |
+
<name>$admin_title</name>
|
903 |
+
<default><![CDATA[]]></default>
|
904 |
+
<type/>
|
905 |
+
</argument>
|
906 |
+
<argument line="149">
|
907 |
+
<name>$title</name>
|
908 |
<default><![CDATA[]]></default>
|
909 |
<type/>
|
910 |
</argument>
|
911 |
</method>
|
912 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="209" package="Media Library Assistant">
|
913 |
+
<name>mla_parent_info_handler</name>
|
914 |
+
<full_name>mla_parent_info_handler</full_name>
|
915 |
+
<docblock line="199">
|
916 |
+
<description><![CDATA[Renders the Parent Info meta box on the Edit Media page.]]></description>
|
917 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
918 |
+
<tag line="199" name="since" description="0.80"/>
|
919 |
+
<tag line="199" name="param" description="current post" type="object" variable="$post">
|
920 |
+
<type by_reference="false">object</type>
|
921 |
</tag>
|
922 |
+
<tag line="199" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
923 |
+
<type by_reference="false">void</type>
|
924 |
</tag>
|
925 |
</docblock>
|
926 |
+
<argument line="209">
|
927 |
+
<name>$post</name>
|
928 |
<default><![CDATA[]]></default>
|
929 |
<type/>
|
930 |
</argument>
|
931 |
</method>
|
932 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="234" package="Media Library Assistant">
|
933 |
+
<name>mla_menu_order_handler</name>
|
934 |
+
<full_name>mla_menu_order_handler</full_name>
|
935 |
+
<docblock line="224">
|
936 |
+
<description><![CDATA[Renders the Menu Order meta box on the Edit Media page.]]></description>
|
937 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
938 |
+
<tag line="224" name="since" description="0.80"/>
|
939 |
+
<tag line="224" name="param" description="current post" type="object" variable="$post">
|
940 |
+
<type by_reference="false">object</type>
|
941 |
</tag>
|
942 |
+
<tag line="224" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
943 |
+
<type by_reference="false">void</type>
|
944 |
</tag>
|
945 |
</docblock>
|
946 |
+
<argument line="234">
|
947 |
+
<name>$post</name>
|
948 |
<default><![CDATA[]]></default>
|
949 |
<type/>
|
950 |
</argument>
|
951 |
</method>
|
952 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="249" package="Media Library Assistant">
|
953 |
+
<name>mla_image_metadata_handler</name>
|
954 |
+
<full_name>mla_image_metadata_handler</full_name>
|
955 |
+
<docblock line="239">
|
956 |
+
<description><![CDATA[Renders the Image Metadata meta box on the Edit Media page.]]></description>
|
957 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
958 |
+
<tag line="239" name="since" description="0.80"/>
|
959 |
+
<tag line="239" name="param" description="current post" type="object" variable="$post">
|
960 |
+
<type by_reference="false">object</type>
|
961 |
</tag>
|
962 |
+
<tag line="239" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
963 |
+
<type by_reference="false">void</type>
|
964 |
</tag>
|
965 |
</docblock>
|
966 |
+
<argument line="249">
|
967 |
+
<name>$post</name>
|
968 |
<default><![CDATA[]]></default>
|
969 |
<type/>
|
970 |
</argument>
|
971 |
</method>
|
972 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="270" package="Media Library Assistant">
|
973 |
+
<name>mla_featured_in_handler</name>
|
974 |
+
<full_name>mla_featured_in_handler</full_name>
|
975 |
+
<docblock line="260">
|
976 |
+
<description><![CDATA[Renders the Featured in meta box on the Edit Media page.]]></description>
|
977 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
978 |
+
<tag line="260" name="since" description="0.80"/>
|
979 |
+
<tag line="260" name="param" description="current post" type="object" variable="$post">
|
980 |
+
<type by_reference="false">object</type>
|
981 |
</tag>
|
982 |
+
<tag line="260" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
983 |
+
<type by_reference="false">void</type>
|
984 |
</tag>
|
985 |
</docblock>
|
986 |
+
<argument line="270">
|
987 |
+
<name>$post</name>
|
988 |
<default><![CDATA[]]></default>
|
989 |
<type/>
|
990 |
</argument>
|
991 |
</method>
|
992 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="300" package="Media Library Assistant">
|
993 |
+
<name>mla_inserted_in_handler</name>
|
994 |
+
<full_name>mla_inserted_in_handler</full_name>
|
995 |
+
<docblock line="290">
|
996 |
+
<description><![CDATA[Renders the Inserted in meta box on the Edit Media page.]]></description>
|
997 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
998 |
+
<tag line="290" name="since" description="0.80"/>
|
999 |
+
<tag line="290" name="param" description="current post" type="object" variable="$post">
|
1000 |
+
<type by_reference="false">object</type>
|
1001 |
</tag>
|
1002 |
+
<tag line="290" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
1003 |
+
<type by_reference="false">void</type>
|
1004 |
</tag>
|
1005 |
</docblock>
|
1006 |
+
<argument line="300">
|
1007 |
+
<name>$post</name>
|
1008 |
<default><![CDATA[]]></default>
|
1009 |
<type/>
|
1010 |
</argument>
|
1011 |
</method>
|
1012 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="334" package="Media Library Assistant">
|
1013 |
+
<name>mla_gallery_in_handler</name>
|
1014 |
+
<full_name>mla_gallery_in_handler</full_name>
|
1015 |
+
<docblock line="324">
|
1016 |
+
<description><![CDATA[Renders the Gallery in meta box on the Edit Media page.]]></description>
|
1017 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
1018 |
+
<tag line="324" name="since" description="0.80"/>
|
1019 |
+
<tag line="324" name="param" description="current post" type="object" variable="$post">
|
1020 |
+
<type by_reference="false">object</type>
|
1021 |
</tag>
|
1022 |
+
<tag line="324" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
1023 |
+
<type by_reference="false">void</type>
|
1024 |
</tag>
|
1025 |
</docblock>
|
1026 |
+
<argument line="334">
|
1027 |
+
<name>$post</name>
|
1028 |
<default><![CDATA[]]></default>
|
1029 |
<type/>
|
1030 |
</argument>
|
1031 |
</method>
|
1032 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="364" package="Media Library Assistant">
|
1033 |
+
<name>mla_mla_gallery_in_handler</name>
|
1034 |
+
<full_name>mla_mla_gallery_in_handler</full_name>
|
1035 |
+
<docblock line="354">
|
1036 |
+
<description><![CDATA[Renders the Gallery in meta box on the Edit Media page.]]></description>
|
1037 |
+
<long-description><![CDATA[<p>Declared public because it is a callback function.</p>]]></long-description>
|
1038 |
+
<tag line="354" name="since" description="0.80"/>
|
1039 |
+
<tag line="354" name="param" description="current post" type="object" variable="$post">
|
1040 |
+
<type by_reference="false">object</type>
|
1041 |
</tag>
|
1042 |
+
<tag line="354" name="return" description="echoes the HTML markup for the meta box content" type="void">
|
1043 |
+
<type by_reference="false">void</type>
|
1044 |
</tag>
|
1045 |
</docblock>
|
1046 |
+
<argument line="364">
|
1047 |
+
<name>$post</name>
|
1048 |
<default><![CDATA[]]></default>
|
1049 |
<type/>
|
1050 |
</argument>
|
1051 |
</method>
|
1052 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="394" package="Media Library Assistant">
|
1053 |
+
<name>mla_edit_attachment_action</name>
|
1054 |
+
<full_name>mla_edit_attachment_action</full_name>
|
1055 |
+
<docblock line="384">
|
1056 |
+
<description><![CDATA[Saves updates from the Edit Media screen.]]></description>
|
1057 |
+
<long-description><![CDATA[<p>Declared public because it is an action.</p>]]></long-description>
|
1058 |
+
<tag line="384" name="since" description="0.80"/>
|
1059 |
+
<tag line="384" name="param" description="ID of the current post" type="integer" variable="$post_ID">
|
1060 |
+
<type by_reference="false">integer</type>
|
1061 |
+
</tag>
|
1062 |
+
<tag line="384" name="return" description="" type="void">
|
1063 |
+
<type by_reference="false">void</type>
|
1064 |
</tag>
|
1065 |
</docblock>
|
1066 |
+
<argument line="394">
|
1067 |
+
<name>$post_ID</name>
|
1068 |
<default><![CDATA[]]></default>
|
1069 |
<type/>
|
1070 |
</argument>
|
1071 |
</method>
|
1072 |
+
</class>
|
1073 |
+
</file>
|
1074 |
+
<file path="includes\class-mla-list-table.php" hash="055d7201b17048c3b920efe5455b681b" package="Media Library Assistant">
|
1075 |
+
<docblock line="2">
|
1076 |
+
<description><![CDATA[Media Library Assistant extended List Table class]]></description>
|
1077 |
+
<long-description><![CDATA[]]></long-description>
|
1078 |
+
<tag line="2" name="package" description="Media Library Assistant"/>
|
1079 |
+
<tag line="2" name="since" description="0.1"/>
|
1080 |
+
</docblock>
|
1081 |
+
<include line="13" type="Require Once" package="Media Library Assistant">
|
1082 |
+
<name/>
|
1083 |
+
</include>
|
1084 |
+
<class final="false" abstract="false" namespace="global" line="24" package="Media Library Assistant">
|
1085 |
+
<extends>\WP_List_Table</extends>
|
1086 |
+
<name>MLA_List_Table</name>
|
1087 |
+
<full_name>\MLA_List_Table</full_name>
|
1088 |
+
<docblock line="16">
|
1089 |
+
<description><![CDATA[Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu]]></description>
|
1090 |
+
<long-description><![CDATA[<p>Extends the core WP_List_Table class.</p>]]></long-description>
|
1091 |
+
<tag line="16" name="package" description="Media Library Assistant"/>
|
1092 |
+
<tag line="16" name="since" description="0.1"/>
|
1093 |
+
</docblock>
|
1094 |
+
<property final="false" static="false" visibility="private" line="38" namespace="global" package="Media Library Assistant">
|
1095 |
+
<name>$rollover_id</name>
|
1096 |
+
<default><![CDATA[0]]></default>
|
1097 |
+
<docblock line="29">
|
1098 |
+
<description><![CDATA[Records assignment of row-level actions to a table row]]></description>
|
1099 |
+
<long-description><![CDATA[<p>Set to the current Post-ID when row-level actions are output for the row.</p>]]></long-description>
|
1100 |
+
<tag line="29" name="since" description="0.1"/>
|
1101 |
+
<tag line="29" name="var" description="" type="int">
|
1102 |
+
<type by_reference="false">int</type>
|
1103 |
</tag>
|
1104 |
</docblock>
|
1105 |
+
</property>
|
1106 |
+
<property final="false" static="false" visibility="private" line="49" namespace="global" package="Media Library Assistant">
|
1107 |
+
<name>$currently_hidden</name>
|
1108 |
+
<default><![CDATA[array()]]></default>
|
1109 |
+
<docblock line="40">
|
1110 |
+
<description><![CDATA[Currently hidden columns]]></description>
|
1111 |
+
<long-description><![CDATA[<p>Records hidden columns so row-level actions are not assigned to them.</p>]]></long-description>
|
1112 |
+
<tag line="40" name="since" description="0.1"/>
|
1113 |
+
<tag line="40" name="var" description="" type="array">
|
1114 |
+
<type by_reference="false">array</type>
|
1115 |
+
</tag>
|
1116 |
+
</docblock>
|
1117 |
+
</property>
|
1118 |
+
<property final="false" static="true" visibility="private" line="73" namespace="global" package="Media Library Assistant">
|
1119 |
+
<name>$default_columns</name>
|
1120 |
+
<default><![CDATA[array('cb' => '<input type="checkbox" />', 'icon' => '', 'ID_parent' => 'ID/Parent', 'title_name' => 'Title/Name', 'post_title' => 'Title', 'post_name' => 'Name', 'parent' => 'Parent ID', 'menu_order' => 'Menu Order', 'featured' => 'Featured in', 'inserted' => 'Inserted in', 'galleries' => 'Gallery in', 'mla_galleries' => 'MLA Gallery in', 'alt_text' => 'ALT Text', 'caption' => 'Caption', 'description' => 'Description', 'post_mime_type' => 'MIME Type', 'base_file' => 'Base File', 'date' => 'Date', 'modified' => 'Last Modified', 'author' => 'Author', 'attached_to' => 'Attached to')]]></default>
|
1121 |
+
<docblock line="55">
|
1122 |
+
<description><![CDATA[Table column definitions]]></description>
|
1123 |
+
<long-description><![CDATA[<p>This array defines table columns and titles where the key is the column slug (and class)
|
1124 |
+
and the value is the column's title text. If you need a checkbox for bulk actions,
|
1125 |
+
use the special slug "cb".</p>
|
1126 |
+
|
1127 |
+
<p>The 'cb' column is treated differently than the rest. If including a checkbox
|
1128 |
+
column in your table you must create a column_cb() method. If you don't need
|
1129 |
+
bulk actions or checkboxes, simply leave the 'cb' entry out of your array.</p>
|
1130 |
+
|
1131 |
+
<p>Taxonomy columns are added to this array by mla_admin_init_action.
|
1132 |
+
Custom field columns are added to this array by mla_admin_init_action.</p>]]></long-description>
|
1133 |
+
<tag line="55" name="since" description="0.1"/>
|
1134 |
+
<tag line="55" name="var" description="" type="array">
|
1135 |
+
<type by_reference="false">array</type>
|
1136 |
+
</tag>
|
1137 |
+
</docblock>
|
1138 |
+
</property>
|
1139 |
+
<property final="false" static="true" visibility="private" line="115" namespace="global" package="Media Library Assistant">
|
1140 |
+
<name>$default_hidden_columns</name>
|
1141 |
+
<default><![CDATA[array('post_title', 'post_name', 'parent', 'menu_order', 'galleries', 'mla_galleries', 'alt_text', 'caption', 'description', 'post_mime_type', 'base_file', 'date', 'modified', 'author', 'attached_to')]]></default>
|
1142 |
+
<docblock line="99">
|
1143 |
+
<description><![CDATA[Default values for hidden columns]]></description>
|
1144 |
+
<long-description><![CDATA[<p>This array is used when the user-level option is not set, i.e.,
|
1145 |
+
the user has not altered the selection of hidden columns.</p>
|
1146 |
+
|
1147 |
+
<p>The value on the right-hand side must match the column slug, e.g.,
|
1148 |
+
array(0 => 'ID_parent, 1 => 'title_name').</p>
|
1149 |
+
|
1150 |
+
<p>Taxonomy columns are added to this array by mla_admin_init_action.
|
1151 |
+
Custom field columns are added to this array by mla_admin_init_action.</p>]]></long-description>
|
1152 |
+
<tag line="99" name="since" description="0.1"/>
|
1153 |
+
<tag line="99" name="var" description="" type="array">
|
1154 |
+
<type by_reference="false">array</type>
|
1155 |
+
</tag>
|
1156 |
+
</docblock>
|
1157 |
+
</property>
|
1158 |
+
<property final="false" static="true" visibility="private" line="156" namespace="global" package="Media Library Assistant">
|
1159 |
+
<name>$default_sortable_columns</name>
|
1160 |
+
<default><![CDATA[array('ID_parent' => array('ID', false), 'title_name' => array('title_name', false), 'post_title' => array('post_title', false), 'post_name' => array('post_name', false), 'parent' => array('post_parent', false), 'menu_order' => array('menu_order', false), 'alt_text' => array('_wp_attachment_image_alt', false), 'caption' => array('post_excerpt', false), 'description' => array('post_content', false), 'post_mime_type' => array('post_mime_type', false), 'base_file' => array('_wp_attached_file', false), 'date' => array('post_date', false), 'modified' => array('post_modified', false), 'author' => array('post_author', false), 'attached_to' => array('post_parent', false))]]></default>
|
1161 |
+
<docblock line="138">
|
1162 |
+
<description><![CDATA[Sortable column definitions]]></description>
|
1163 |
+
<long-description><![CDATA[<p>This array defines the table columns that can be sorted. The array key
|
1164 |
+
is the column slug that needs to be sortable, and the value is database column
|
1165 |
+
to sort by. Often, the key and value will be the same, but this is not always
|
1166 |
+
the case (as the value is a column name from the database, not the list table).</p>
|
1167 |
+
|
1168 |
+
<p>The array value also contains a boolean which is 'true' if the data is currently
|
1169 |
+
sorted by that column. This is computed each time the table is displayed.</p>
|
1170 |
+
|
1171 |
+
<p>Taxonomy columns, if any, are added to this array by mla_admin_init_action.
|
1172 |
+
Custom field columns are added to this array by mla_admin_init_action.</p>]]></long-description>
|
1173 |
+
<tag line="138" name="since" description="0.1"/>
|
1174 |
+
<tag line="138" name="var" description="" type="array">
|
1175 |
+
<type by_reference="false">array</type>
|
1176 |
+
</tag>
|
1177 |
+
</docblock>
|
1178 |
+
</property>
|
1179 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="187" package="Media Library Assistant">
|
1180 |
+
<name>_default_hidden_columns</name>
|
1181 |
+
<full_name>_default_hidden_columns</full_name>
|
1182 |
+
<docblock line="180">
|
1183 |
+
<description><![CDATA[Access the default list of hidden columns]]></description>
|
1184 |
+
<long-description><![CDATA[]]></long-description>
|
1185 |
+
<tag line="180" name="since" description="0.1"/>
|
1186 |
+
<tag line="180" name="return" description="default list of hidden columns" type="array">
|
1187 |
<type by_reference="false">array</type>
|
1188 |
</tag>
|
1189 |
</docblock>
|
1190 |
</method>
|
1191 |
+
<method final="false" abstract="false" static="false" visibility="private" namespace="global" line="204" package="Media Library Assistant">
|
1192 |
+
<name>_avail_mime_types</name>
|
1193 |
+
<full_name>_avail_mime_types</full_name>
|
1194 |
+
<docblock line="192">
|
1195 |
+
<description><![CDATA[Get mime types with one or more attachments for view preparation]]></description>
|
1196 |
+
<long-description><![CDATA[<p>Modeled after get_available_post_mime_types in wp-admin/includes/post.php,
|
1197 |
+
with additional entries.</p>]]></long-description>
|
1198 |
+
<tag line="192" name="since" description="0.1"/>
|
1199 |
+
<tag line="192" name="param" description="Number of posts for each mime type" type="array" variable="$num_posts">
|
1200 |
+
<type by_reference="false">array</type>
|
1201 |
+
</tag>
|
1202 |
+
<tag line="192" name="return" description="Mime type names" type="array">
|
1203 |
<type by_reference="false">array</type>
|
1204 |
</tag>
|
1205 |
</docblock>
|
1206 |
+
<argument line="204">
|
1207 |
+
<name>$num_posts</name>
|
1208 |
+
<default><![CDATA[]]></default>
|
1209 |
+
<type/>
|
1210 |
+
</argument>
|
1211 |
</method>
|
1212 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="225" package="Media Library Assistant">
|
1213 |
+
<name>mla_get_attachment_mime_types</name>
|
1214 |
+
<full_name>mla_get_attachment_mime_types</full_name>
|
1215 |
+
<docblock line="215">
|
1216 |
+
<description><![CDATA[Get possible mime types for view preparation]]></description>
|
1217 |
+
<long-description><![CDATA[<p>Modeled after get_post_mime_types in wp-includes/post.php,
|
1218 |
+
with additional entries.</p>]]></long-description>
|
1219 |
+
<tag line="215" name="since" description="0.1"/>
|
1220 |
+
<tag line="215" name="return" description="Mime type names and HTML markup for views" type="array">
|
1221 |
<type by_reference="false">array</type>
|
1222 |
</tag>
|
1223 |
</docblock>
|
1224 |
</method>
|
1225 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="298" package="Media Library Assistant">
|
1226 |
+
<name>mla_get_sortable_columns</name>
|
1227 |
+
<full_name>mla_get_sortable_columns</full_name>
|
1228 |
+
<docblock line="291">
|
1229 |
+
<description><![CDATA[Return the names and display values of the sortable columns]]></description>
|
|
|
1230 |
<long-description><![CDATA[]]></long-description>
|
1231 |
+
<tag line="291" name="since" description="0.30"/>
|
1232 |
+
<tag line="291" name="return" description="name => array( orderby value, heading ) for sortable columns" type="array">
|
1233 |
<type by_reference="false">array</type>
|
1234 |
</tag>
|
1235 |
</docblock>
|
1236 |
</method>
|
1237 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="325" package="Media Library Assistant">
|
1238 |
+
<name>mla_manage_hidden_columns_filter</name>
|
1239 |
+
<full_name>mla_manage_hidden_columns_filter</full_name>
|
1240 |
+
<docblock line="310">
|
1241 |
+
<description><![CDATA[Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden']]></description>
|
1242 |
+
<long-description><![CDATA[<p>Required because the screen.php get_hidden_columns function only uses
|
1243 |
+
the get_user_option result. Set when the file is loaded because the object
|
1244 |
+
is not created in time for the call from screen.php.</p>]]></long-description>
|
1245 |
+
<tag line="310" name="since" description="0.1"/>
|
1246 |
+
<tag line="310" name="param" description="current list of hidden columns, if any" type="string" variable="$result">
|
1247 |
+
<type by_reference="false">string</type>
|
1248 |
+
</tag>
|
1249 |
+
<tag line="310" name="param" description="'managemedia_page_mla-menucolumnshidden'" type="string" variable="$option">
|
1250 |
<type by_reference="false">string</type>
|
1251 |
</tag>
|
1252 |
+
<tag line="310" name="param" description="WP_User object, if logged in" type="object" variable="$user_data">
|
1253 |
+
<type by_reference="false">object</type>
|
1254 |
+
</tag>
|
1255 |
+
<tag line="310" name="return" description="updated list of hidden columns" type="array">
|
1256 |
<type by_reference="false">array</type>
|
1257 |
</tag>
|
1258 |
</docblock>
|
1259 |
+
<argument line="325">
|
1260 |
+
<name>$result</name>
|
1261 |
+
<default><![CDATA[]]></default>
|
1262 |
+
<type/>
|
1263 |
+
</argument>
|
1264 |
+
<argument line="325">
|
1265 |
+
<name>$option</name>
|
1266 |
+
<default><![CDATA[]]></default>
|
1267 |
+
<type/>
|
1268 |
+
</argument>
|
1269 |
+
<argument line="325">
|
1270 |
+
<name>$user_data</name>
|
1271 |
<default><![CDATA[]]></default>
|
1272 |
<type/>
|
1273 |
</argument>
|
1274 |
</method>
|
1275 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="343" package="Media Library Assistant">
|
1276 |
+
<name>mla_manage_columns_filter</name>
|
1277 |
+
<full_name>mla_manage_columns_filter</full_name>
|
1278 |
+
<docblock line="332">
|
1279 |
+
<description><![CDATA[Handler for filter 'manage_media_page_mla-menu_columns']]></description>
|
1280 |
+
<long-description><![CDATA[<p>This required filter dictates the table's columns and titles. Set when the
|
1281 |
+
file is loaded because the list_table object isn't created in time
|
1282 |
+
to affect the "screen options" setup.</p>]]></long-description>
|
1283 |
+
<tag line="332" name="since" description="0.1"/>
|
1284 |
+
<tag line="332" name="return" description="list of table columns" type="array">
|
1285 |
+
<type by_reference="false">array</type>
|
1286 |
+
</tag>
|
1287 |
</docblock>
|
1288 |
</method>
|
1289 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="358" package="Media Library Assistant">
|
1290 |
+
<name>mla_admin_init_action</name>
|
1291 |
+
<full_name>mla_admin_init_action</full_name>
|
1292 |
+
<docblock line="348">
|
1293 |
+
<description><![CDATA[Adds support for taxonomy columns]]></description>
|
1294 |
+
<long-description><![CDATA[<p>Called in the admin_init action because the list_table object isn't
|
1295 |
+
created in time to affect the "screen options" setup.</p>]]></long-description>
|
1296 |
+
<tag line="348" name="since" description="0.30"/>
|
1297 |
+
<tag line="348" name="return" description="" type="void">
|
1298 |
+
<type by_reference="false">void</type>
|
1299 |
</tag>
|
1300 |
</docblock>
|
1301 |
</method>
|
1302 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="384" package="Media Library Assistant">
|
1303 |
+
<name>__construct</name>
|
1304 |
+
<full_name>__construct</full_name>
|
1305 |
+
<docblock line="376">
|
1306 |
+
<description><![CDATA[Initializes some properties from $_REQUEST vairables, then
|
1307 |
+
calls the parent constructor to set some default configs.]]></description>
|
1308 |
+
<long-description><![CDATA[]]></long-description>
|
1309 |
+
<tag line="376" name="since" description="0.1"/>
|
1310 |
+
<tag line="376" name="return" description="" type="void">
|
1311 |
+
<type by_reference="false">void</type>
|
1312 |
+
</tag>
|
1313 |
+
</docblock>
|
1314 |
+
</method>
|
1315 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="417" package="Media Library Assistant">
|
1316 |
+
<name>column_default</name>
|
1317 |
+
<full_name>column_default</full_name>
|
1318 |
+
<docblock line="404">
|
1319 |
+
<description><![CDATA[Supply a column value if no column-specific function has been defined]]></description>
|
1320 |
+
<long-description><![CDATA[<p>Called when the parent class can't find a method specifically built for a
|
1321 |
+
given column. The taxonomy columns are handled here. All other columns should
|
1322 |
+
have a specific method, so this function returns a troubleshooting message.</p>]]></long-description>
|
1323 |
+
<tag line="404" name="since" description="0.1"/>
|
1324 |
+
<tag line="404" name="param" description="A singular item (one full row's worth of data)" type="array" variable="$item">
|
1325 |
<type by_reference="false">array</type>
|
1326 |
</tag>
|
1327 |
+
<tag line="404" name="param" description="The name/slug of the column to be processed" type="array" variable="$column_name">
|
1328 |
<type by_reference="false">array</type>
|
1329 |
</tag>
|
1330 |
+
<tag line="404" name="return" description="Text or HTML to be placed inside the column" type="string">
|
1331 |
+
<type by_reference="false">string</type>
|
1332 |
+
</tag>
|
1333 |
</docblock>
|
1334 |
+
<argument line="417">
|
1335 |
+
<name>$item</name>
|
1336 |
+
<default><![CDATA[]]></default>
|
1337 |
+
<type/>
|
1338 |
+
</argument>
|
1339 |
+
<argument line="417">
|
1340 |
+
<name>$column_name</name>
|
1341 |
<default><![CDATA[]]></default>
|
1342 |
<type/>
|
1343 |
</argument>
|
1344 |
</method>
|
1345 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="475" package="Media Library Assistant">
|
1346 |
+
<name>column_cb</name>
|
1347 |
+
<full_name>column_cb</full_name>
|
1348 |
+
<docblock line="466">
|
1349 |
+
<description><![CDATA[Displays checkboxes for using bulk actions.]]></description>
|
1350 |
+
<long-description><![CDATA[<p>The 'cb' column
|
1351 |
+
is given special treatment when columns are processed.</p>]]></long-description>
|
1352 |
+
<tag line="466" name="since" description="0.1"/>
|
1353 |
+
<tag line="466" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1354 |
<type by_reference="false">array</type>
|
1355 |
</tag>
|
1356 |
+
<tag line="466" name="return" description="HTML markup to be placed inside the column" type="string">
|
1357 |
+
<type by_reference="false">string</type>
|
1358 |
</tag>
|
1359 |
</docblock>
|
1360 |
+
<argument line="475">
|
1361 |
+
<name>$item</name>
|
1362 |
<default><![CDATA[]]></default>
|
1363 |
<type/>
|
1364 |
</argument>
|
1365 |
</method>
|
1366 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="491" package="Media Library Assistant">
|
1367 |
+
<name>column_icon</name>
|
1368 |
+
<full_name>column_icon</full_name>
|
1369 |
+
<docblock line="483">
|
1370 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1371 |
<long-description><![CDATA[]]></long-description>
|
1372 |
+
<tag line="483" name="since" description="0.1"/>
|
1373 |
+
<tag line="483" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1374 |
+
<type by_reference="false">array</type>
|
1375 |
+
</tag>
|
1376 |
+
<tag line="483" name="return" description="HTML markup to be placed inside the column" type="string">
|
1377 |
<type by_reference="false">string</type>
|
1378 |
</tag>
|
1379 |
</docblock>
|
1380 |
+
<argument line="491">
|
1381 |
+
<name>$item</name>
|
1382 |
+
<default><![CDATA[]]></default>
|
1383 |
+
<type/>
|
1384 |
+
</argument>
|
1385 |
+
</method>
|
1386 |
+
<method final="false" abstract="false" static="false" visibility="private" namespace="global" line="507" package="Media Library Assistant">
|
1387 |
+
<name>_build_rollover_actions</name>
|
1388 |
+
<full_name>_build_rollover_actions</full_name>
|
1389 |
+
<docblock line="496">
|
1390 |
+
<description><![CDATA[Add rollover actions to exactly one of the following displayed columns:
|
1391 |
+
'ID_parent', 'title_name', 'post_title', 'post_name']]></description>
|
1392 |
<long-description><![CDATA[]]></long-description>
|
1393 |
+
<tag line="496" name="since" description="0.1"/>
|
1394 |
+
<tag line="496" name="param" description="A singular attachment (post) object" type="object" variable="$item">
|
1395 |
+
<type by_reference="false">object</type>
|
1396 |
+
</tag>
|
1397 |
+
<tag line="496" name="param" description="Current column name" type="string" variable="$column">
|
1398 |
<type by_reference="false">string</type>
|
1399 |
</tag>
|
1400 |
+
<tag line="496" name="return" description="Names and URLs of row-level actions" type="array">
|
1401 |
+
<type by_reference="false">array</type>
|
1402 |
+
</tag>
|
1403 |
</docblock>
|
1404 |
+
<argument line="507">
|
1405 |
+
<name>$item</name>
|
1406 |
+
<default><![CDATA[]]></default>
|
1407 |
+
<type/>
|
1408 |
+
</argument>
|
1409 |
+
<argument line="507">
|
1410 |
+
<name>$column</name>
|
1411 |
+
<default><![CDATA[]]></default>
|
1412 |
+
<type/>
|
1413 |
+
</argument>
|
1414 |
+
</method>
|
1415 |
+
<method final="false" abstract="false" static="false" visibility="private" namespace="global" line="585" package="Media Library Assistant">
|
1416 |
+
<name>_build_inline_data</name>
|
1417 |
+
<full_name>_build_inline_data</full_name>
|
1418 |
+
<docblock line="576">
|
1419 |
+
<description><![CDATA[Add hidden fields with the data for use in the inline editor]]></description>
|
1420 |
<long-description><![CDATA[]]></long-description>
|
1421 |
+
<tag line="576" name="since" description="0.20"/>
|
1422 |
+
<tag line="576" name="param" description="A singular attachment (post) object" type="object" variable="$item">
|
1423 |
+
<type by_reference="false">object</type>
|
1424 |
+
</tag>
|
1425 |
+
<tag line="576" name="return" description="HTML <div> with row data" type="string">
|
1426 |
<type by_reference="false">string</type>
|
1427 |
</tag>
|
1428 |
</docblock>
|
1429 |
+
<argument line="585">
|
1430 |
+
<name>$item</name>
|
1431 |
+
<default><![CDATA[]]></default>
|
1432 |
+
<type/>
|
1433 |
+
</argument>
|
1434 |
+
</method>
|
1435 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="633" package="Media Library Assistant">
|
1436 |
+
<name>column_ID_parent</name>
|
1437 |
+
<full_name>column_ID_parent</full_name>
|
1438 |
+
<docblock line="625">
|
1439 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1440 |
<long-description><![CDATA[]]></long-description>
|
1441 |
+
<tag line="625" name="since" description="0.1"/>
|
1442 |
+
<tag line="625" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1443 |
+
<type by_reference="false">array</type>
|
1444 |
+
</tag>
|
1445 |
+
<tag line="625" name="return" description="HTML markup to be placed inside the column" type="string">
|
1446 |
<type by_reference="false">string</type>
|
1447 |
</tag>
|
1448 |
</docblock>
|
1449 |
+
<argument line="633">
|
1450 |
+
<name>$item</name>
|
1451 |
+
<default><![CDATA[]]></default>
|
1452 |
+
<type/>
|
1453 |
+
</argument>
|
1454 |
+
</method>
|
1455 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="665" package="Media Library Assistant">
|
1456 |
+
<name>column_title_name</name>
|
1457 |
+
<full_name>column_title_name</full_name>
|
1458 |
+
<docblock line="657">
|
1459 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1460 |
<long-description><![CDATA[]]></long-description>
|
1461 |
+
<tag line="657" name="since" description="0.1"/>
|
1462 |
+
<tag line="657" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1463 |
+
<type by_reference="false">array</type>
|
1464 |
+
</tag>
|
1465 |
+
<tag line="657" name="return" description="HTML markup to be placed inside the column" type="string">
|
1466 |
<type by_reference="false">string</type>
|
1467 |
</tag>
|
1468 |
</docblock>
|
1469 |
+
<argument line="665">
|
1470 |
+
<name>$item</name>
|
1471 |
+
<default><![CDATA[]]></default>
|
1472 |
+
<type/>
|
1473 |
+
</argument>
|
1474 |
+
</method>
|
1475 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="688" package="Media Library Assistant">
|
1476 |
+
<name>column_post_title</name>
|
1477 |
+
<full_name>column_post_title</full_name>
|
1478 |
+
<docblock line="680">
|
1479 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1480 |
+
<long-description><![CDATA[]]></long-description>
|
1481 |
+
<tag line="680" name="since" description="0.1"/>
|
1482 |
+
<tag line="680" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1483 |
+
<type by_reference="false">array</type>
|
1484 |
+
</tag>
|
1485 |
+
<tag line="680" name="return" description="HTML markup to be placed inside the column" type="string">
|
1486 |
+
<type by_reference="false">string</type>
|
1487 |
+
</tag>
|
1488 |
+
</docblock>
|
1489 |
+
<argument line="688">
|
1490 |
+
<name>$item</name>
|
1491 |
+
<default><![CDATA[]]></default>
|
1492 |
+
<type/>
|
1493 |
+
</argument>
|
1494 |
+
</method>
|
1495 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="706" package="Media Library Assistant">
|
1496 |
+
<name>column_post_name</name>
|
1497 |
+
<full_name>column_post_name</full_name>
|
1498 |
+
<docblock line="698">
|
1499 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1500 |
+
<long-description><![CDATA[]]></long-description>
|
1501 |
+
<tag line="698" name="since" description="0.1"/>
|
1502 |
+
<tag line="698" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1503 |
+
<type by_reference="false">array</type>
|
1504 |
+
</tag>
|
1505 |
+
<tag line="698" name="return" description="HTML markup to be placed inside the column" type="string">
|
1506 |
+
<type by_reference="false">string</type>
|
1507 |
+
</tag>
|
1508 |
+
</docblock>
|
1509 |
+
<argument line="706">
|
1510 |
+
<name>$item</name>
|
1511 |
+
<default><![CDATA[]]></default>
|
1512 |
+
<type/>
|
1513 |
+
</argument>
|
1514 |
+
</method>
|
1515 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="724" package="Media Library Assistant">
|
1516 |
+
<name>column_parent</name>
|
1517 |
+
<full_name>column_parent</full_name>
|
1518 |
+
<docblock line="716">
|
1519 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1520 |
+
<long-description><![CDATA[]]></long-description>
|
1521 |
+
<tag line="716" name="since" description="0.1"/>
|
1522 |
+
<tag line="716" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1523 |
+
<type by_reference="false">array</type>
|
1524 |
+
</tag>
|
1525 |
+
<tag line="716" name="return" description="HTML markup to be placed inside the column" type="string">
|
1526 |
+
<type by_reference="false">string</type>
|
1527 |
+
</tag>
|
1528 |
+
</docblock>
|
1529 |
+
<argument line="724">
|
1530 |
+
<name>$item</name>
|
1531 |
+
<default><![CDATA[]]></default>
|
1532 |
+
<type/>
|
1533 |
+
</argument>
|
1534 |
+
</method>
|
1535 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="749" package="Media Library Assistant">
|
1536 |
+
<name>column_menu_order</name>
|
1537 |
+
<full_name>column_menu_order</full_name>
|
1538 |
+
<docblock line="741">
|
1539 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1540 |
+
<long-description><![CDATA[]]></long-description>
|
1541 |
+
<tag line="741" name="since" description="0.60"/>
|
1542 |
+
<tag line="741" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1543 |
+
<type by_reference="false">array</type>
|
1544 |
+
</tag>
|
1545 |
+
<tag line="741" name="return" description="HTML markup to be placed inside the column" type="string">
|
1546 |
+
<type by_reference="false">string</type>
|
1547 |
+
</tag>
|
1548 |
+
</docblock>
|
1549 |
+
<argument line="749">
|
1550 |
+
<name>$item</name>
|
1551 |
+
<default><![CDATA[]]></default>
|
1552 |
+
<type/>
|
1553 |
+
</argument>
|
1554 |
+
</method>
|
1555 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="761" package="Media Library Assistant">
|
1556 |
+
<name>column_featured</name>
|
1557 |
+
<full_name>column_featured</full_name>
|
1558 |
+
<docblock line="753">
|
1559 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1560 |
+
<long-description><![CDATA[]]></long-description>
|
1561 |
+
<tag line="753" name="since" description="0.1"/>
|
1562 |
+
<tag line="753" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1563 |
+
<type by_reference="false">array</type>
|
1564 |
+
</tag>
|
1565 |
+
<tag line="753" name="return" description="HTML markup to be placed inside the column" type="string">
|
1566 |
+
<type by_reference="false">string</type>
|
1567 |
+
</tag>
|
1568 |
+
</docblock>
|
1569 |
+
<argument line="761">
|
1570 |
+
<name>$item</name>
|
1571 |
+
<default><![CDATA[]]></default>
|
1572 |
+
<type/>
|
1573 |
+
</argument>
|
1574 |
+
</method>
|
1575 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="792" package="Media Library Assistant">
|
1576 |
+
<name>column_inserted</name>
|
1577 |
+
<full_name>column_inserted</full_name>
|
1578 |
+
<docblock line="784">
|
1579 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1580 |
+
<long-description><![CDATA[]]></long-description>
|
1581 |
+
<tag line="784" name="since" description="0.1"/>
|
1582 |
+
<tag line="784" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1583 |
+
<type by_reference="false">array</type>
|
1584 |
+
</tag>
|
1585 |
+
<tag line="784" name="return" description="HTML markup to be placed inside the column" type="string">
|
1586 |
+
<type by_reference="false">string</type>
|
1587 |
+
</tag>
|
1588 |
+
</docblock>
|
1589 |
+
<argument line="792">
|
1590 |
+
<name>$item</name>
|
1591 |
+
<default><![CDATA[]]></default>
|
1592 |
+
<type/>
|
1593 |
+
</argument>
|
1594 |
+
</method>
|
1595 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="827" package="Media Library Assistant">
|
1596 |
+
<name>column_galleries</name>
|
1597 |
+
<full_name>column_galleries</full_name>
|
1598 |
+
<docblock line="819">
|
1599 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1600 |
+
<long-description><![CDATA[]]></long-description>
|
1601 |
+
<tag line="819" name="since" description="0.70"/>
|
1602 |
+
<tag line="819" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1603 |
+
<type by_reference="false">array</type>
|
1604 |
+
</tag>
|
1605 |
+
<tag line="819" name="return" description="HTML markup to be placed inside the column" type="string">
|
1606 |
+
<type by_reference="false">string</type>
|
1607 |
+
</tag>
|
1608 |
+
</docblock>
|
1609 |
+
<argument line="827">
|
1610 |
+
<name>$item</name>
|
1611 |
+
<default><![CDATA[]]></default>
|
1612 |
+
<type/>
|
1613 |
+
</argument>
|
1614 |
+
</method>
|
1615 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="858" package="Media Library Assistant">
|
1616 |
+
<name>column_mla_galleries</name>
|
1617 |
+
<full_name>column_mla_galleries</full_name>
|
1618 |
+
<docblock line="850">
|
1619 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1620 |
+
<long-description><![CDATA[]]></long-description>
|
1621 |
+
<tag line="850" name="since" description="0.70"/>
|
1622 |
+
<tag line="850" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1623 |
+
<type by_reference="false">array</type>
|
1624 |
+
</tag>
|
1625 |
+
<tag line="850" name="return" description="HTML markup to be placed inside the column" type="string">
|
1626 |
+
<type by_reference="false">string</type>
|
1627 |
+
</tag>
|
1628 |
+
</docblock>
|
1629 |
+
<argument line="858">
|
1630 |
+
<name>$item</name>
|
1631 |
+
<default><![CDATA[]]></default>
|
1632 |
+
<type/>
|
1633 |
+
</argument>
|
1634 |
+
</method>
|
1635 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="889" package="Media Library Assistant">
|
1636 |
+
<name>column_alt_text</name>
|
1637 |
+
<full_name>column_alt_text</full_name>
|
1638 |
+
<docblock line="881">
|
1639 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1640 |
+
<long-description><![CDATA[]]></long-description>
|
1641 |
+
<tag line="881" name="since" description="0.1"/>
|
1642 |
+
<tag line="881" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1643 |
+
<type by_reference="false">array</type>
|
1644 |
+
</tag>
|
1645 |
+
<tag line="881" name="return" description="HTML markup to be placed inside the column" type="string">
|
1646 |
+
<type by_reference="false">string</type>
|
1647 |
+
</tag>
|
1648 |
+
</docblock>
|
1649 |
+
<argument line="889">
|
1650 |
+
<name>$item</name>
|
1651 |
+
<default><![CDATA[]]></default>
|
1652 |
+
<type/>
|
1653 |
+
</argument>
|
1654 |
+
</method>
|
1655 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="909" package="Media Library Assistant">
|
1656 |
+
<name>column_caption</name>
|
1657 |
+
<full_name>column_caption</full_name>
|
1658 |
+
<docblock line="901">
|
1659 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1660 |
+
<long-description><![CDATA[]]></long-description>
|
1661 |
+
<tag line="901" name="since" description="0.1"/>
|
1662 |
+
<tag line="901" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1663 |
+
<type by_reference="false">array</type>
|
1664 |
+
</tag>
|
1665 |
+
<tag line="901" name="return" description="HTML markup to be placed inside the column" type="string">
|
1666 |
+
<type by_reference="false">string</type>
|
1667 |
+
</tag>
|
1668 |
+
</docblock>
|
1669 |
+
<argument line="909">
|
1670 |
+
<name>$item</name>
|
1671 |
+
<default><![CDATA[]]></default>
|
1672 |
+
<type/>
|
1673 |
+
</argument>
|
1674 |
+
</method>
|
1675 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="921" package="Media Library Assistant">
|
1676 |
+
<name>column_description</name>
|
1677 |
+
<full_name>column_description</full_name>
|
1678 |
+
<docblock line="913">
|
1679 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1680 |
+
<long-description><![CDATA[]]></long-description>
|
1681 |
+
<tag line="913" name="since" description="0.1"/>
|
1682 |
+
<tag line="913" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1683 |
+
<type by_reference="false">array</type>
|
1684 |
+
</tag>
|
1685 |
+
<tag line="913" name="return" description="HTML markup to be placed inside the column" type="string">
|
1686 |
+
<type by_reference="false">string</type>
|
1687 |
+
</tag>
|
1688 |
+
</docblock>
|
1689 |
+
<argument line="921">
|
1690 |
+
<name>$item</name>
|
1691 |
+
<default><![CDATA[]]></default>
|
1692 |
+
<type/>
|
1693 |
+
</argument>
|
1694 |
+
</method>
|
1695 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="933" package="Media Library Assistant">
|
1696 |
+
<name>column_post_mime_type</name>
|
1697 |
+
<full_name>column_post_mime_type</full_name>
|
1698 |
+
<docblock line="925">
|
1699 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1700 |
+
<long-description><![CDATA[]]></long-description>
|
1701 |
+
<tag line="925" name="since" description="0.30"/>
|
1702 |
+
<tag line="925" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1703 |
+
<type by_reference="false">array</type>
|
1704 |
+
</tag>
|
1705 |
+
<tag line="925" name="return" description="HTML markup to be placed inside the column" type="string">
|
1706 |
+
<type by_reference="false">string</type>
|
1707 |
+
</tag>
|
1708 |
+
</docblock>
|
1709 |
+
<argument line="933">
|
1710 |
+
<name>$item</name>
|
1711 |
+
<default><![CDATA[]]></default>
|
1712 |
+
<type/>
|
1713 |
+
</argument>
|
1714 |
+
</method>
|
1715 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="945" package="Media Library Assistant">
|
1716 |
+
<name>column_base_file</name>
|
1717 |
+
<full_name>column_base_file</full_name>
|
1718 |
+
<docblock line="937">
|
1719 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1720 |
+
<long-description><![CDATA[]]></long-description>
|
1721 |
+
<tag line="937" name="since" description="0.1"/>
|
1722 |
+
<tag line="937" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1723 |
+
<type by_reference="false">array</type>
|
1724 |
+
</tag>
|
1725 |
+
<tag line="937" name="return" description="HTML markup to be placed inside the column" type="string">
|
1726 |
+
<type by_reference="false">string</type>
|
1727 |
+
</tag>
|
1728 |
+
</docblock>
|
1729 |
+
<argument line="945">
|
1730 |
+
<name>$item</name>
|
1731 |
+
<default><![CDATA[]]></default>
|
1732 |
+
<type/>
|
1733 |
+
</argument>
|
1734 |
+
</method>
|
1735 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="957" package="Media Library Assistant">
|
1736 |
+
<name>column_date</name>
|
1737 |
+
<full_name>column_date</full_name>
|
1738 |
+
<docblock line="949">
|
1739 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1740 |
+
<long-description><![CDATA[]]></long-description>
|
1741 |
+
<tag line="949" name="since" description="0.1"/>
|
1742 |
+
<tag line="949" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1743 |
+
<type by_reference="false">array</type>
|
1744 |
+
</tag>
|
1745 |
+
<tag line="949" name="return" description="HTML markup to be placed inside the column" type="string">
|
1746 |
+
<type by_reference="false">string</type>
|
1747 |
+
</tag>
|
1748 |
+
</docblock>
|
1749 |
+
<argument line="957">
|
1750 |
+
<name>$item</name>
|
1751 |
+
<default><![CDATA[]]></default>
|
1752 |
+
<type/>
|
1753 |
+
</argument>
|
1754 |
+
</method>
|
1755 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="986" package="Media Library Assistant">
|
1756 |
+
<name>column_modified</name>
|
1757 |
+
<full_name>column_modified</full_name>
|
1758 |
+
<docblock line="978">
|
1759 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1760 |
+
<long-description><![CDATA[]]></long-description>
|
1761 |
+
<tag line="978" name="since" description="0.30"/>
|
1762 |
+
<tag line="978" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1763 |
+
<type by_reference="false">array</type>
|
1764 |
+
</tag>
|
1765 |
+
<tag line="978" name="return" description="HTML markup to be placed inside the column" type="string">
|
1766 |
+
<type by_reference="false">string</type>
|
1767 |
+
</tag>
|
1768 |
+
</docblock>
|
1769 |
+
<argument line="986">
|
1770 |
+
<name>$item</name>
|
1771 |
+
<default><![CDATA[]]></default>
|
1772 |
+
<type/>
|
1773 |
+
</argument>
|
1774 |
+
</method>
|
1775 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1015" package="Media Library Assistant">
|
1776 |
+
<name>column_author</name>
|
1777 |
+
<full_name>column_author</full_name>
|
1778 |
+
<docblock line="1007">
|
1779 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1780 |
+
<long-description><![CDATA[]]></long-description>
|
1781 |
+
<tag line="1007" name="since" description="0.30"/>
|
1782 |
+
<tag line="1007" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1783 |
+
<type by_reference="false">array</type>
|
1784 |
+
</tag>
|
1785 |
+
<tag line="1007" name="return" description="HTML markup to be placed inside the column" type="string">
|
1786 |
+
<type by_reference="false">string</type>
|
1787 |
+
</tag>
|
1788 |
+
</docblock>
|
1789 |
+
<argument line="1015">
|
1790 |
+
<name>$item</name>
|
1791 |
+
<default><![CDATA[]]></default>
|
1792 |
+
<type/>
|
1793 |
+
</argument>
|
1794 |
+
</method>
|
1795 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1036" package="Media Library Assistant">
|
1796 |
+
<name>column_attached_to</name>
|
1797 |
+
<full_name>column_attached_to</full_name>
|
1798 |
+
<docblock line="1028">
|
1799 |
+
<description><![CDATA[Supply the content for a custom column]]></description>
|
1800 |
+
<long-description><![CDATA[]]></long-description>
|
1801 |
+
<tag line="1028" name="since" description="0.1"/>
|
1802 |
+
<tag line="1028" name="param" description="A singular attachment (post) object" type="array" variable="$item">
|
1803 |
+
<type by_reference="false">array</type>
|
1804 |
+
</tag>
|
1805 |
+
<tag line="1028" name="return" description="HTML markup to be placed inside the column" type="string">
|
1806 |
+
<type by_reference="false">string</type>
|
1807 |
+
</tag>
|
1808 |
+
</docblock>
|
1809 |
+
<argument line="1036">
|
1810 |
+
<name>$item</name>
|
1811 |
+
<default><![CDATA[]]></default>
|
1812 |
+
<type/>
|
1813 |
+
</argument>
|
1814 |
+
</method>
|
1815 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1065" package="Media Library Assistant">
|
1816 |
+
<name>get_columns</name>
|
1817 |
+
<full_name>get_columns</full_name>
|
1818 |
+
<docblock line="1058">
|
1819 |
+
<description><![CDATA[This method dictates the table's columns and titles]]></description>
|
1820 |
+
<long-description><![CDATA[]]></long-description>
|
1821 |
+
<tag line="1058" name="since" description="0.1"/>
|
1822 |
+
<tag line="1058" name="return" description="Column information: 'slugs'=>'Visible Titles'" type="array">
|
1823 |
+
<type by_reference="false">array</type>
|
1824 |
+
</tag>
|
1825 |
+
</docblock>
|
1826 |
+
</method>
|
1827 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1077" package="Media Library Assistant">
|
1828 |
+
<name>get_hidden_columns</name>
|
1829 |
+
<full_name>get_hidden_columns</full_name>
|
1830 |
+
<docblock line="1069">
|
1831 |
+
<description><![CDATA[Returns the list of currently hidden columns from a user option or
|
1832 |
+
from default values if the option is not set]]></description>
|
1833 |
+
<long-description><![CDATA[]]></long-description>
|
1834 |
+
<tag line="1069" name="since" description="0.1"/>
|
1835 |
+
<tag line="1069" name="return" description="Column information,e.g., array(0 => 'ID_parent, 1 => 'title_name')" type="array">
|
1836 |
+
<type by_reference="false">array</type>
|
1837 |
+
</tag>
|
1838 |
+
</docblock>
|
1839 |
+
</method>
|
1840 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1097" package="Media Library Assistant">
|
1841 |
+
<name>get_sortable_columns</name>
|
1842 |
+
<full_name>get_sortable_columns</full_name>
|
1843 |
+
<docblock line="1087">
|
1844 |
+
<description><![CDATA[Returns an array where the key is the column that needs to be sortable
|
1845 |
+
and the value is db column to sort by.]]></description>
|
1846 |
+
<long-description><![CDATA[<p>Also notes the current sort column,
|
1847 |
+
if set.</p>]]></long-description>
|
1848 |
+
<tag line="1087" name="since" description="0.1"/>
|
1849 |
+
<tag line="1087" name="return" description="Sortable column information,e.g., 'slugs'=>array('data_values',boolean)" type="array">
|
1850 |
+
<type by_reference="false">array</type>
|
1851 |
+
</tag>
|
1852 |
+
</docblock>
|
1853 |
+
</method>
|
1854 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1124" package="Media Library Assistant">
|
1855 |
+
<name>get_views</name>
|
1856 |
+
<full_name>get_views</full_name>
|
1857 |
+
<docblock line="1116">
|
1858 |
+
<description><![CDATA[Returns an associative array listing all the views that can be used with this table.]]></description>
|
1859 |
+
<long-description><![CDATA[<p>These are listed across the top of the page and managed by WordPress.</p>]]></long-description>
|
1860 |
+
<tag line="1116" name="since" description="0.1"/>
|
1861 |
+
<tag line="1116" name="return" description="View information,e.g., array ( id => link )" type="array">
|
1862 |
+
<type by_reference="false">array</type>
|
1863 |
+
</tag>
|
1864 |
+
</docblock>
|
1865 |
+
</method>
|
1866 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1199" package="Media Library Assistant">
|
1867 |
+
<name>get_bulk_actions</name>
|
1868 |
+
<full_name>get_bulk_actions</full_name>
|
1869 |
+
<docblock line="1191">
|
1870 |
+
<description><![CDATA[Get an associative array ( option_name => option_title ) with the list
|
1871 |
+
of bulk actions available on this table.]]></description>
|
1872 |
+
<long-description><![CDATA[]]></long-description>
|
1873 |
+
<tag line="1191" name="since" description="0.1"/>
|
1874 |
+
<tag line="1191" name="return" description="Contains all the bulk actions: 'slugs'=>'Visible Titles'" type="array">
|
1875 |
+
<type by_reference="false">array</type>
|
1876 |
+
</tag>
|
1877 |
+
</docblock>
|
1878 |
+
</method>
|
1879 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1230" package="Media Library Assistant">
|
1880 |
+
<name>extra_tablenav</name>
|
1881 |
+
<full_name>extra_tablenav</full_name>
|
1882 |
+
<docblock line="1219">
|
1883 |
+
<description><![CDATA[Extra controls to be displayed between bulk actions and pagination]]></description>
|
1884 |
+
<long-description><![CDATA[<p>Modeled after class-wp-posts-list-table.php in wp-admin/includes.</p>]]></long-description>
|
1885 |
+
<tag line="1219" name="since" description="0.1"/>
|
1886 |
+
<tag line="1219" name="param" description="'top' or 'bottom', i.e., above or below the table rows" type="string" variable="$which">
|
1887 |
+
<type by_reference="false">string</type>
|
1888 |
+
</tag>
|
1889 |
+
<tag line="1219" name="return" description="Contains all the bulk actions: 'slugs'=>'Visible Titles'" type="array">
|
1890 |
+
<type by_reference="false">array</type>
|
1891 |
+
</tag>
|
1892 |
+
</docblock>
|
1893 |
+
<argument line="1230">
|
1894 |
+
<name>$which</name>
|
1895 |
+
<default><![CDATA[]]></default>
|
1896 |
+
<type/>
|
1897 |
+
</argument>
|
1898 |
+
</method>
|
1899 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1290" package="Media Library Assistant">
|
1900 |
+
<name>prepare_items</name>
|
1901 |
+
<full_name>prepare_items</full_name>
|
1902 |
+
<docblock line="1278">
|
1903 |
+
<description><![CDATA[Prepares the list of items for displaying]]></description>
|
1904 |
+
<long-description><![CDATA[<p>This is where you prepare your data for display. This method will usually
|
1905 |
+
be used to query the database, sort and filter the data, and generally
|
1906 |
+
get it ready to be displayed. At a minimum, we should set $this->items and
|
1907 |
+
$this->set_pagination_args().</p>]]></long-description>
|
1908 |
+
<tag line="1278" name="since" description="0.1"/>
|
1909 |
+
<tag line="1278" name="return" description="" type="void">
|
1910 |
+
<type by_reference="false">void</type>
|
1911 |
+
</tag>
|
1912 |
+
</docblock>
|
1913 |
+
</method>
|
1914 |
+
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="1336" package="Media Library Assistant">
|
1915 |
+
<name>single_row</name>
|
1916 |
+
<full_name>single_row</full_name>
|
1917 |
+
<docblock line="1327">
|
1918 |
+
<description><![CDATA[Generates (echoes) content for a single row of the table]]></description>
|
1919 |
+
<long-description><![CDATA[]]></long-description>
|
1920 |
+
<tag line="1327" name="since" description=".20"/>
|
1921 |
+
<tag line="1327" name="param" description="the current item" type="object" variable="$item">
|
1922 |
+
<type by_reference="false">object</type>
|
1923 |
+
</tag>
|
1924 |
+
<tag line="1327" name="return" description="Echoes the row HTML" type="void">
|
1925 |
+
<type by_reference="false">void</type>
|
1926 |
+
</tag>
|
1927 |
+
</docblock>
|
1928 |
+
<argument line="1336">
|
1929 |
+
<name>$item</name>
|
1930 |
+
<default><![CDATA[]]></default>
|
1931 |
+
<type/>
|
1932 |
+
</argument>
|
1933 |
+
</method>
|
1934 |
+
</class>
|
1935 |
+
</file>
|
1936 |
+
<file path="includes\class-mla-main.php" hash="dd93b3e8f36b4cab5558fd1f24618ec8" package="Media Library Assistant">
|
1937 |
+
<docblock line="2">
|
1938 |
+
<description><![CDATA[Top-level functions for the Media Library Assistant]]></description>
|
1939 |
+
<long-description><![CDATA[]]></long-description>
|
1940 |
+
<tag line="2" name="package" description="Media Library Assistant"/>
|
1941 |
+
<tag line="2" name="since" description="0.1"/>
|
1942 |
+
</docblock>
|
1943 |
+
<include line="13" type="Require Once" package="Media Library Assistant">
|
1944 |
+
<name/>
|
1945 |
+
</include>
|
1946 |
+
<class final="false" abstract="false" namespace="global" line="23" package="Media Library Assistant">
|
1947 |
+
<extends/>
|
1948 |
+
<name>MLA</name>
|
1949 |
+
<full_name>\MLA</full_name>
|
1950 |
+
<docblock line="16">
|
1951 |
+
<description><![CDATA[Class MLA (Media Library Assistant) provides several enhancements to the handling
|
1952 |
+
of images and files held in the WordPress Media Library.]]></description>
|
1953 |
+
<long-description><![CDATA[]]></long-description>
|
1954 |
+
<tag line="16" name="package" description="Media Library Assistant"/>
|
1955 |
+
<tag line="16" name="since" description="0.1"/>
|
1956 |
+
</docblock>
|
1957 |
+
<constant namespace="global" line="32" package="Media Library Assistant">
|
1958 |
+
<name>PLUGIN_NAME</name>
|
1959 |
+
<full_name>PLUGIN_NAME</full_name>
|
1960 |
+
<value><![CDATA['Media Library Assistant']]></value>
|
1961 |
+
<docblock line="25">
|
1962 |
+
<description><![CDATA[Display name for this plugin]]></description>
|
1963 |
+
<long-description><![CDATA[]]></long-description>
|
1964 |
+
<tag line="25" name="since" description="0.1"/>
|
1965 |
+
<tag line="25" name="var" description="" type="string">
|
1966 |
+
<type by_reference="false">string</type>
|
1967 |
+
</tag>
|
1968 |
+
</docblock>
|
1969 |
+
</constant>
|
1970 |
+
<constant namespace="global" line="41" package="Media Library Assistant">
|
1971 |
+
<name>CURRENT_MLA_VERSION</name>
|
1972 |
+
<full_name>CURRENT_MLA_VERSION</full_name>
|
1973 |
+
<value><![CDATA['1.14']]></value>
|
1974 |
+
<docblock line="34">
|
1975 |
+
<description><![CDATA[Current version number]]></description>
|
1976 |
+
<long-description><![CDATA[]]></long-description>
|
1977 |
+
<tag line="34" name="since" description="0.1"/>
|
1978 |
+
<tag line="34" name="var" description="" type="string">
|
1979 |
+
<type by_reference="false">string</type>
|
1980 |
+
</tag>
|
1981 |
+
</docblock>
|
1982 |
+
</constant>
|
1983 |
+
<constant namespace="global" line="50" package="Media Library Assistant">
|
1984 |
+
<name>STYLESHEET_SLUG</name>
|
1985 |
+
<full_name>STYLESHEET_SLUG</full_name>
|
1986 |
+
<value><![CDATA['mla-style']]></value>
|
1987 |
+
<docblock line="43">
|
1988 |
+
<description><![CDATA[Slug for registering and enqueueing plugin style sheet]]></description>
|
1989 |
+
<long-description><![CDATA[]]></long-description>
|
1990 |
+
<tag line="43" name="since" description="0.1"/>
|
1991 |
+
<tag line="43" name="var" description="" type="string">
|
1992 |
+
<type by_reference="false">string</type>
|
1993 |
+
</tag>
|
1994 |
+
</docblock>
|
1995 |
+
</constant>
|
1996 |
+
<constant namespace="global" line="59" package="Media Library Assistant">
|
1997 |
+
<name>JAVASCRIPT_SINGLE_EDIT_SLUG</name>
|
1998 |
+
<full_name>JAVASCRIPT_SINGLE_EDIT_SLUG</full_name>
|
1999 |
+
<value><![CDATA['mla-single-edit-scripts']]></value>
|
2000 |
+
<docblock line="52">
|
2001 |
+
<description><![CDATA[Slug for localizing and enqueueing JavaScript - edit single item page]]></description>
|
2002 |
+
<long-description><![CDATA[]]></long-description>
|
2003 |
+
<tag line="52" name="since" description="0.1"/>
|
2004 |
+
<tag line="52" name="var" description="" type="string">
|
2005 |
+
<type by_reference="false">string</type>
|
2006 |
+
</tag>
|
2007 |
+
</docblock>
|
2008 |
+
</constant>
|
2009 |
+
<constant namespace="global" line="68" package="Media Library Assistant">
|
2010 |
+
<name>JAVASCRIPT_SINGLE_EDIT_OBJECT</name>
|
2011 |
+
<full_name>JAVASCRIPT_SINGLE_EDIT_OBJECT</full_name>
|
2012 |
+
<value><![CDATA['mla_single_edit_vars']]></value>
|
2013 |
+
<docblock line="61">
|
2014 |
+
<description><![CDATA[Object name for localizing JavaScript - edit single item page]]></description>
|
2015 |
+
<long-description><![CDATA[]]></long-description>
|
2016 |
+
<tag line="61" name="since" description="0.1"/>
|
2017 |
+
<tag line="61" name="var" description="" type="string">
|
2018 |
+
<type by_reference="false">string</type>
|
2019 |
+
</tag>
|
2020 |
+
</docblock>
|
2021 |
+
</constant>
|
2022 |
+
<constant namespace="global" line="77" package="Media Library Assistant">
|
2023 |
+
<name>JAVASCRIPT_INLINE_EDIT_SLUG</name>
|
2024 |
+
<full_name>JAVASCRIPT_INLINE_EDIT_SLUG</full_name>
|
2025 |
+
<value><![CDATA['mla-inline-edit-scripts']]></value>
|
2026 |
+
<docblock line="70">
|
2027 |
+
<description><![CDATA[Slug for localizing and enqueueing JavaScript - MLA List Table]]></description>
|
2028 |
+
<long-description><![CDATA[]]></long-description>
|
2029 |
+
<tag line="70" name="since" description="0.20"/>
|
2030 |
+
<tag line="70" name="var" description="" type="string">
|
2031 |
+
<type by_reference="false">string</type>
|
2032 |
+
</tag>
|
2033 |
+
</docblock>
|
2034 |
+
</constant>
|
2035 |
+
<constant namespace="global" line="86" package="Media Library Assistant">
|
2036 |
+
<name>JAVASCRIPT_INLINE_EDIT_OBJECT</name>
|
2037 |
+
<full_name>JAVASCRIPT_INLINE_EDIT_OBJECT</full_name>
|
2038 |
+
<value><![CDATA['mla_inline_edit_vars']]></value>
|
2039 |
+
<docblock line="79">
|
2040 |
+
<description><![CDATA[Object name for localizing JavaScript - MLA List Table]]></description>
|
2041 |
+
<long-description><![CDATA[]]></long-description>
|
2042 |
+
<tag line="79" name="since" description="0.20"/>
|
2043 |
+
<tag line="79" name="var" description="" type="string">
|
2044 |
+
<type by_reference="false">string</type>
|
2045 |
+
</tag>
|
2046 |
+
</docblock>
|
2047 |
+
</constant>
|
2048 |
+
<constant namespace="global" line="95" package="Media Library Assistant">
|
2049 |
+
<name>ADMIN_PAGE_SLUG</name>
|
2050 |
+
<full_name>ADMIN_PAGE_SLUG</full_name>
|
2051 |
+
<value><![CDATA['mla-menu']]></value>
|
2052 |
+
<docblock line="88">
|
2053 |
+
<description><![CDATA[Slug for adding plugin submenu]]></description>
|
2054 |
+
<long-description><![CDATA[]]></long-description>
|
2055 |
+
<tag line="88" name="since" description="0.1"/>
|
2056 |
+
<tag line="88" name="var" description="" type="string">
|
2057 |
+
<type by_reference="false">string</type>
|
2058 |
+
</tag>
|
2059 |
+
</docblock>
|
2060 |
+
</constant>
|
2061 |
+
<constant namespace="global" line="104" package="Media Library Assistant">
|
2062 |
+
<name>MLA_ADMIN_NONCE</name>
|
2063 |
+
<full_name>MLA_ADMIN_NONCE</full_name>
|
2064 |
+
<value><![CDATA['mla_admin']]></value>
|
2065 |
+
<docblock line="97">
|
2066 |
+
<description><![CDATA[Action name; uniquely identifies the nonce]]></description>
|
2067 |
+
<long-description><![CDATA[]]></long-description>
|
2068 |
+
<tag line="97" name="since" description="0.1"/>
|
2069 |
+
<tag line="97" name="var" description="" type="string">
|
2070 |
+
<type by_reference="false">string</type>
|
2071 |
+
</tag>
|
2072 |
+
</docblock>
|
2073 |
+
</constant>
|
2074 |
+
<constant namespace="global" line="113" package="Media Library Assistant">
|
2075 |
+
<name>MLA_ADMIN_SINGLE_DELETE</name>
|
2076 |
+
<full_name>MLA_ADMIN_SINGLE_DELETE</full_name>
|
2077 |
+
<value><![CDATA['single_item_delete']]></value>
|
2078 |
+
<docblock line="106">
|
2079 |
+
<description><![CDATA[mla_admin_action value for permanently deleting a single item]]></description>
|
2080 |
+
<long-description><![CDATA[]]></long-description>
|
2081 |
+
<tag line="106" name="since" description="0.1"/>
|
2082 |
+
<tag line="106" name="var" description="" type="string">
|
2083 |
+
<type by_reference="false">string</type>
|
2084 |
+
</tag>
|
2085 |
+
</docblock>
|
2086 |
+
</constant>
|
2087 |
+
<constant namespace="global" line="122" package="Media Library Assistant">
|
2088 |
+
<name>MLA_ADMIN_SINGLE_EDIT_DISPLAY</name>
|
2089 |
+
<full_name>MLA_ADMIN_SINGLE_EDIT_DISPLAY</full_name>
|
2090 |
+
<value><![CDATA['single_item_edit_display']]></value>
|
2091 |
+
<docblock line="115">
|
2092 |
+
<description><![CDATA[mla_admin_action value for displaying a single item]]></description>
|
2093 |
+
<long-description><![CDATA[]]></long-description>
|
2094 |
+
<tag line="115" name="since" description="0.1"/>
|
2095 |
+
<tag line="115" name="var" description="" type="string">
|
2096 |
+
<type by_reference="false">string</type>
|
2097 |
+
</tag>
|
2098 |
+
</docblock>
|
2099 |
+
</constant>
|
2100 |
+
<constant namespace="global" line="131" package="Media Library Assistant">
|
2101 |
+
<name>MLA_ADMIN_SINGLE_EDIT_UPDATE</name>
|
2102 |
+
<full_name>MLA_ADMIN_SINGLE_EDIT_UPDATE</full_name>
|
2103 |
+
<value><![CDATA['single_item_edit_update']]></value>
|
2104 |
+
<docblock line="124">
|
2105 |
+
<description><![CDATA[mla_admin_action value for updating a single item]]></description>
|
2106 |
+
<long-description><![CDATA[]]></long-description>
|
2107 |
+
<tag line="124" name="since" description="0.1"/>
|
2108 |
+
<tag line="124" name="var" description="" type="string">
|
2109 |
+
<type by_reference="false">string</type>
|
2110 |
+
</tag>
|
2111 |
+
</docblock>
|
2112 |
+
</constant>
|
2113 |
+
<constant namespace="global" line="140" package="Media Library Assistant">
|
2114 |
+
<name>MLA_ADMIN_SINGLE_RESTORE</name>
|
2115 |
+
<full_name>MLA_ADMIN_SINGLE_RESTORE</full_name>
|
2116 |
+
<value><![CDATA['single_item_restore']]></value>
|
2117 |
+
<docblock line="133">
|
2118 |
+
<description><![CDATA[mla_admin_action value for restoring a single item from the trash]]></description>
|
2119 |
+
<long-description><![CDATA[]]></long-description>
|
2120 |
+
<tag line="133" name="since" description="0.1"/>
|
2121 |
+
<tag line="133" name="var" description="" type="string">
|
2122 |
+
<type by_reference="false">string</type>
|
2123 |
+
</tag>
|
2124 |
+
</docblock>
|
2125 |
+
</constant>
|
2126 |
+
<constant namespace="global" line="149" package="Media Library Assistant">
|
2127 |
+
<name>MLA_ADMIN_SINGLE_TRASH</name>
|
2128 |
+
<full_name>MLA_ADMIN_SINGLE_TRASH</full_name>
|
2129 |
+
<value><![CDATA['single_item_trash']]></value>
|
2130 |
+
<docblock line="142">
|
2131 |
+
<description><![CDATA[mla_admin_action value for moving a single item to the trash]]></description>
|
2132 |
+
<long-description><![CDATA[]]></long-description>
|
2133 |
+
<tag line="142" name="since" description="0.1"/>
|
2134 |
+
<tag line="142" name="var" description="" type="string">
|
2135 |
+
<type by_reference="false">string</type>
|
2136 |
+
</tag>
|
2137 |
+
</docblock>
|
2138 |
+
</constant>
|
2139 |
+
<constant namespace="global" line="158" package="Media Library Assistant">
|
2140 |
+
<name>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP</name>
|
2141 |
+
<full_name>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP</full_name>
|
2142 |
+
<value><![CDATA['single_item_custom_field_map']]></value>
|
2143 |
+
<docblock line="151">
|
2144 |
+
<description><![CDATA[mla_admin_action value for mapping Custom Field metadata]]></description>
|
2145 |
+
<long-description><![CDATA[]]></long-description>
|
2146 |
+
<tag line="151" name="since" description="1.10"/>
|
2147 |
+
<tag line="151" name="var" description="" type="string">
|
2148 |
+
<type by_reference="false">string</type>
|
2149 |
+
</tag>
|
2150 |
+
</docblock>
|
2151 |
+
</constant>
|
2152 |
+
<constant namespace="global" line="167" package="Media Library Assistant">
|
2153 |
+
<name>MLA_ADMIN_SINGLE_MAP</name>
|
2154 |
+
<full_name>MLA_ADMIN_SINGLE_MAP</full_name>
|
2155 |
+
<value><![CDATA['single_item_map']]></value>
|
2156 |
+
<docblock line="160">
|
2157 |
+
<description><![CDATA[mla_admin_action value for mapping IPTC/EXIF metadata]]></description>
|
2158 |
+
<long-description><![CDATA[]]></long-description>
|
2159 |
+
<tag line="160" name="since" description="1.00"/>
|
2160 |
+
<tag line="160" name="var" description="" type="string">
|
2161 |
+
<type by_reference="false">string</type>
|
2162 |
+
</tag>
|
2163 |
+
</docblock>
|
2164 |
+
</constant>
|
2165 |
+
<property final="false" static="true" visibility="private" line="176" namespace="global" package="Media Library Assistant">
|
2166 |
+
<name>$page_hooks</name>
|
2167 |
+
<default><![CDATA[array()]]></default>
|
2168 |
+
<docblock line="169">
|
2169 |
+
<description><![CDATA[Holds screen ids to match help text to corresponding screen]]></description>
|
2170 |
+
<long-description><![CDATA[]]></long-description>
|
2171 |
+
<tag line="169" name="since" description="0.1"/>
|
2172 |
+
<tag line="169" name="var" description="" type="array">
|
2173 |
+
<type by_reference="false">array</type>
|
2174 |
+
</tag>
|
2175 |
+
</docblock>
|
2176 |
+
</property>
|
2177 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="189" package="Media Library Assistant">
|
2178 |
+
<name>initialize</name>
|
2179 |
+
<full_name>initialize</full_name>
|
2180 |
+
<docblock line="178">
|
2181 |
+
<description><![CDATA[Initialization function, similar to __construct()]]></description>
|
2182 |
+
<long-description><![CDATA[<p>This function contains add_action and add_filter calls
|
2183 |
+
to set up the Ajax handlers, enqueue JavaScript and CSS files, and
|
2184 |
+
set up the Assistant submenu.</p>]]></long-description>
|
2185 |
+
<tag line="178" name="since" description="0.1"/>
|
2186 |
+
<tag line="178" name="return" description="" type="void">
|
2187 |
+
<type by_reference="false">void</type>
|
2188 |
+
</tag>
|
2189 |
+
</docblock>
|
2190 |
+
</method>
|
2191 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="205" package="Media Library Assistant">
|
2192 |
+
<name>mla_admin_init_action</name>
|
2193 |
+
<full_name>mla_admin_init_action</full_name>
|
2194 |
+
<docblock line="198">
|
2195 |
+
<description><![CDATA[Load the plugin's Ajax handler or process Edit Media update actions]]></description>
|
2196 |
+
<long-description><![CDATA[]]></long-description>
|
2197 |
+
<tag line="198" name="since" description="0.20"/>
|
2198 |
+
<tag line="198" name="return" description="" type="void">
|
2199 |
+
<type by_reference="false">void</type>
|
2200 |
+
</tag>
|
2201 |
+
</docblock>
|
2202 |
+
</method>
|
2203 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="247" package="Media Library Assistant">
|
2204 |
+
<name>mla_admin_enqueue_scripts_action</name>
|
2205 |
+
<full_name>mla_admin_enqueue_scripts_action</full_name>
|
2206 |
+
<docblock line="238">
|
2207 |
+
<description><![CDATA[Load the plugin's Style Sheet and Javascript files]]></description>
|
2208 |
+
<long-description><![CDATA[]]></long-description>
|
2209 |
+
<tag line="238" name="since" description="0.1"/>
|
2210 |
+
<tag line="238" name="param" description="Name of the page being loaded" type="string" variable="$page_hook">
|
2211 |
+
<type by_reference="false">string</type>
|
2212 |
+
</tag>
|
2213 |
+
<tag line="238" name="return" description="" type="void">
|
2214 |
+
<type by_reference="false">void</type>
|
2215 |
+
</tag>
|
2216 |
+
</docblock>
|
2217 |
+
<argument line="247">
|
2218 |
+
<name>$page_hook</name>
|
2219 |
+
<default><![CDATA[]]></default>
|
2220 |
+
<type/>
|
2221 |
+
</argument>
|
2222 |
+
</method>
|
2223 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="310" package="Media Library Assistant">
|
2224 |
+
<name>mla_admin_menu_action</name>
|
2225 |
+
<full_name>mla_admin_menu_action</full_name>
|
2226 |
+
<docblock line="295">
|
2227 |
+
<description><![CDATA[Add the submenu pages]]></description>
|
2228 |
+
<long-description><![CDATA[<p>Add a submenu page in the "Media" section,
|
2229 |
+
add settings page in the "Settings" section.
|
2230 |
+
add settings link in the Plugins section entry for MLA.</p>
|
2231 |
+
|
2232 |
+
<p>For WordPress versions before 3.5,
|
2233 |
+
add submenu page(s) for attachment taxonomies,
|
2234 |
+
add filter to clean up taxonomy submenu labels.</p>]]></long-description>
|
2235 |
+
<tag line="295" name="since" description="0.1"/>
|
2236 |
+
<tag line="295" name="return" description="" type="void">
|
2237 |
+
<type by_reference="false">void</type>
|
2238 |
+
</tag>
|
2239 |
+
</docblock>
|
2240 |
+
</method>
|
2241 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="347" package="Media Library Assistant">
|
2242 |
+
<name>mla_add_menu_options</name>
|
2243 |
+
<full_name>mla_add_menu_options</full_name>
|
2244 |
+
<docblock line="340">
|
2245 |
+
<description><![CDATA[Add the "XX Entries per page" filter to the Screen Options tab]]></description>
|
2246 |
+
<long-description><![CDATA[]]></long-description>
|
2247 |
+
<tag line="340" name="since" description="0.1"/>
|
2248 |
+
<tag line="340" name="return" description="" type="void">
|
2249 |
+
<type by_reference="false">void</type>
|
2250 |
+
</tag>
|
2251 |
+
</docblock>
|
2252 |
+
</method>
|
2253 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="366" package="Media Library Assistant">
|
2254 |
+
<name>mla_add_help_tab</name>
|
2255 |
+
<full_name>mla_add_help_tab</full_name>
|
2256 |
+
<docblock line="359">
|
2257 |
+
<description><![CDATA[Add contextual help tabs to all the MLA pages]]></description>
|
2258 |
+
<long-description><![CDATA[]]></long-description>
|
2259 |
+
<tag line="359" name="since" description="0.1"/>
|
2260 |
+
<tag line="359" name="return" description="" type="void">
|
2261 |
+
<type by_reference="false">void</type>
|
2262 |
+
</tag>
|
2263 |
+
</docblock>
|
2264 |
+
</method>
|
2265 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="455" package="Media Library Assistant">
|
2266 |
+
<name>mla_screen_options_show_screen_filter</name>
|
2267 |
+
<full_name>mla_screen_options_show_screen_filter</full_name>
|
2268 |
+
<docblock line="445">
|
2269 |
+
<description><![CDATA[Only show screen options on the table-list screen]]></description>
|
2270 |
+
<long-description><![CDATA[]]></long-description>
|
2271 |
+
<tag line="445" name="since" description="0.1"/>
|
2272 |
+
<tag line="445" name="param" description="True to display "Screen Options", false to suppress them" type="boolean" variable="$show_screen">
|
2273 |
+
<type by_reference="false">boolean</type>
|
2274 |
+
</tag>
|
2275 |
+
<tag line="445" name="param" description="Name of the page being loaded" type="string" variable="$this_screen">
|
2276 |
+
<type by_reference="false">string</type>
|
2277 |
+
</tag>
|
2278 |
+
<tag line="445" name="return" description="True to display "Screen Options", false to suppress them" type="boolean">
|
2279 |
+
<type by_reference="false">boolean</type>
|
2280 |
+
</tag>
|
2281 |
+
</docblock>
|
2282 |
+
<argument line="455">
|
2283 |
+
<name>$show_screen</name>
|
2284 |
+
<default><![CDATA[]]></default>
|
2285 |
+
<type/>
|
2286 |
+
</argument>
|
2287 |
+
<argument line="455">
|
2288 |
+
<name>$this_screen</name>
|
2289 |
+
<default><![CDATA[]]></default>
|
2290 |
+
<type/>
|
2291 |
+
</argument>
|
2292 |
+
</method>
|
2293 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="473" package="Media Library Assistant">
|
2294 |
+
<name>mla_set_screen_option_filter</name>
|
2295 |
+
<full_name>mla_set_screen_option_filter</full_name>
|
2296 |
+
<docblock line="462">
|
2297 |
+
<description><![CDATA[Save the "Entries per page" option set by this user]]></description>
|
2298 |
+
<long-description><![CDATA[]]></long-description>
|
2299 |
+
<tag line="462" name="since" description="0.1"/>
|
2300 |
+
<tag line="462" name="param" description="Unknown - always false?" type="boolean" variable="$status">
|
2301 |
+
<type by_reference="false">boolean</type>
|
2302 |
+
</tag>
|
2303 |
+
<tag line="462" name="param" description="Name of the option being changed" type="string" variable="$option">
|
2304 |
+
<type by_reference="false">string</type>
|
2305 |
+
</tag>
|
2306 |
+
<tag line="462" name="param" description="New value of the option" type="string" variable="$value">
|
2307 |
+
<type by_reference="false">string</type>
|
2308 |
+
</tag>
|
2309 |
+
<tag line="462" name="return" description="New value if this is our option, otherwise nothing" type="string|void">
|
2310 |
+
<type by_reference="false">string</type>
|
2311 |
+
<type by_reference="false">void</type>
|
2312 |
+
</tag>
|
2313 |
+
</docblock>
|
2314 |
+
<argument line="473">
|
2315 |
+
<name>$status</name>
|
2316 |
+
<default><![CDATA[]]></default>
|
2317 |
+
<type/>
|
2318 |
+
</argument>
|
2319 |
+
<argument line="473">
|
2320 |
+
<name>$option</name>
|
2321 |
+
<default><![CDATA[]]></default>
|
2322 |
+
<type/>
|
2323 |
+
</argument>
|
2324 |
+
<argument line="473">
|
2325 |
+
<name>$value</name>
|
2326 |
+
<default><![CDATA[]]></default>
|
2327 |
+
<type/>
|
2328 |
+
</argument>
|
2329 |
+
</method>
|
2330 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="490" package="Media Library Assistant">
|
2331 |
+
<name>mla_edit_tax_redirect</name>
|
2332 |
+
<full_name>mla_edit_tax_redirect</full_name>
|
2333 |
+
<docblock line="479">
|
2334 |
+
<description><![CDATA[Redirect to the Edit Tags/Categories page]]></description>
|
2335 |
+
<long-description><![CDATA[<p>The custom taxonomy add/edit submenu entries go to "upload.php" by default.
|
2336 |
+
This filter is the only way to redirect them to the correct WordPress page.
|
2337 |
+
The filter is not required for WordPress 3.5 and later.</p>]]></long-description>
|
2338 |
+
<tag line="479" name="since" description="0.1"/>
|
2339 |
+
<tag line="479" name="return" description="" type="void">
|
2340 |
+
<type by_reference="false">void</type>
|
2341 |
+
</tag>
|
2342 |
+
</docblock>
|
2343 |
+
</method>
|
2344 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="523" package="Media Library Assistant">
|
2345 |
+
<name>mla_parent_file_filter</name>
|
2346 |
+
<full_name>mla_parent_file_filter</full_name>
|
2347 |
+
<docblock line="507">
|
2348 |
+
<description><![CDATA[Cleanup menus for Edit Tags/Categories page]]></description>
|
2349 |
+
<long-description><![CDATA[<p>For WordPress before 3.5, the submenu entries for custom taxonomies
|
2350 |
+
under the "Media" menu are not set up correctly by WordPress, so this
|
2351 |
+
function cleans them up, redirecting the request to the right WordPress
|
2352 |
+
page for editing/adding taxonomy terms.
|
2353 |
+
For WordPress 3.5 and later, the function fixes the submenu bolding when
|
2354 |
+
going to the Edit Media screen.</p>]]></long-description>
|
2355 |
+
<tag line="507" name="since" description="0.1"/>
|
2356 |
+
<tag line="507" name="param" description="The top-level menu page" type="array" variable="$parent_file">
|
2357 |
+
<type by_reference="false">array</type>
|
2358 |
+
</tag>
|
2359 |
+
<tag line="507" name="return" description="The updated top-level menu page" type="string">
|
2360 |
+
<type by_reference="false">string</type>
|
2361 |
+
</tag>
|
2362 |
+
</docblock>
|
2363 |
+
<argument line="523">
|
2364 |
+
<name>$parent_file</name>
|
2365 |
+
<default><![CDATA[]]></default>
|
2366 |
+
<type/>
|
2367 |
+
</argument>
|
2368 |
+
</method>
|
2369 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="566" package="Media Library Assistant">
|
2370 |
+
<name>mla_render_admin_page</name>
|
2371 |
+
<full_name>mla_render_admin_page</full_name>
|
2372 |
+
<docblock line="559">
|
2373 |
+
<description><![CDATA[Render the "Assistant" subpage in the Media section, using the list_table package]]></description>
|
2374 |
+
<long-description><![CDATA[]]></long-description>
|
2375 |
+
<tag line="559" name="since" description="0.1"/>
|
2376 |
+
<tag line="559" name="return" description="" type="void">
|
2377 |
+
<type by_reference="false">void</type>
|
2378 |
+
</tag>
|
2379 |
+
</docblock>
|
2380 |
+
</method>
|
2381 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="850" package="Media Library Assistant">
|
2382 |
+
<name>mla_inline_edit_action</name>
|
2383 |
+
<full_name>mla_inline_edit_action</full_name>
|
2384 |
+
<docblock line="841">
|
2385 |
+
<description><![CDATA[Ajax handler for inline editing (quick and bulk edit)]]></description>
|
2386 |
+
<long-description><![CDATA[<p>Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php</p>]]></long-description>
|
2387 |
+
<tag line="841" name="since" description="0.20"/>
|
2388 |
+
<tag line="841" name="return" description="echo HTML <tr> markup for updated row or error message, then die()" type="void">
|
2389 |
+
<type by_reference="false">void</type>
|
2390 |
+
</tag>
|
2391 |
+
</docblock>
|
2392 |
+
</method>
|
2393 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="945" package="Media Library Assistant">
|
2394 |
+
<name>_build_inline_edit_form</name>
|
2395 |
+
<full_name>_build_inline_edit_form</full_name>
|
2396 |
+
<docblock line="934">
|
2397 |
+
<description><![CDATA[Build the hidden row templates for inline editing (quick and bulk edit)]]></description>
|
2398 |
+
<long-description><![CDATA[<p>inspired by inline_edit() in wp-admin\includes\class-wp-posts-list-table.php.</p>]]></long-description>
|
2399 |
+
<tag line="934" name="since" description="0.20"/>
|
2400 |
+
<tag line="934" name="param" description="MLA List Table object" type="object" variable="$MLAListTable">
|
2401 |
+
<type by_reference="false">object</type>
|
2402 |
+
</tag>
|
2403 |
+
<tag line="934" name="return" description="HTML <form> markup for hidden rows" type="string">
|
2404 |
+
<type by_reference="false">string</type>
|
2405 |
+
</tag>
|
2406 |
+
</docblock>
|
2407 |
+
<argument line="945">
|
2408 |
+
<name>$MLAListTable</name>
|
2409 |
+
<default><![CDATA[]]></default>
|
2410 |
+
<type/>
|
2411 |
+
</argument>
|
2412 |
+
</method>
|
2413 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1102" package="Media Library Assistant">
|
2414 |
+
<name>_authors_dropdown</name>
|
2415 |
+
<full_name>_authors_dropdown</full_name>
|
2416 |
+
<docblock line="1091">
|
2417 |
+
<description><![CDATA[Get the edit Authors dropdown box, if user has suitable permissions]]></description>
|
2418 |
+
<long-description><![CDATA[]]></long-description>
|
2419 |
+
<tag line="1091" name="since" description="0.20"/>
|
2420 |
+
<tag line="1091" name="param" description="Optional User ID of the current author, default 0" type="integer" variable="$author">
|
2421 |
+
<type by_reference="false">integer</type>
|
2422 |
+
</tag>
|
2423 |
+
<tag line="1091" name="param" description="Optional HTML name attribute, default 'post_author'" type="string" variable="$name">
|
2424 |
+
<type by_reference="false">string</type>
|
2425 |
+
</tag>
|
2426 |
+
<tag line="1091" name="param" description="Optional HTML class attribute, default 'authors'" type="string" variable="$class">
|
2427 |
+
<type by_reference="false">string</type>
|
2428 |
+
</tag>
|
2429 |
+
<tag line="1091" name="return" description="HTML markup for the dropdown field or False" type="string|false">
|
2430 |
+
<type by_reference="false">string</type>
|
2431 |
+
<type by_reference="false">false</type>
|
2432 |
+
</tag>
|
2433 |
+
</docblock>
|
2434 |
+
<argument line="1102">
|
2435 |
+
<name>$author</name>
|
2436 |
+
<default><![CDATA[0]]></default>
|
2437 |
+
<type/>
|
2438 |
+
</argument>
|
2439 |
+
<argument line="1102">
|
2440 |
+
<name>$name</name>
|
2441 |
+
<default><![CDATA['post_author']]></default>
|
2442 |
+
<type/>
|
2443 |
+
</argument>
|
2444 |
+
<argument line="1102">
|
2445 |
+
<name>$class</name>
|
2446 |
+
<default><![CDATA['authors']]></default>
|
2447 |
+
<type/>
|
2448 |
+
</argument>
|
2449 |
+
</method>
|
2450 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1136" package="Media Library Assistant">
|
2451 |
+
<name>_current_bulk_action</name>
|
2452 |
+
<full_name>_current_bulk_action</full_name>
|
2453 |
+
<docblock line="1129">
|
2454 |
+
<description><![CDATA[Get the current action selected from the bulk actions dropdown]]></description>
|
2455 |
+
<long-description><![CDATA[]]></long-description>
|
2456 |
+
<tag line="1129" name="since" description="0.1"/>
|
2457 |
+
<tag line="1129" name="return" description="The action name or False if no action was selected" type="string|false">
|
2458 |
+
<type by_reference="false">string</type>
|
2459 |
+
<type by_reference="false">false</type>
|
2460 |
+
</tag>
|
2461 |
+
</docblock>
|
2462 |
+
</method>
|
2463 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1165" package="Media Library Assistant">
|
2464 |
+
<name>_delete_single_item</name>
|
2465 |
+
<full_name>_delete_single_item</full_name>
|
2466 |
+
<docblock line="1156">
|
2467 |
+
<description><![CDATA[Delete a single item permanently]]></description>
|
2468 |
+
<long-description><![CDATA[]]></long-description>
|
2469 |
+
<tag line="1156" name="since" description="0.1"/>
|
2470 |
+
<tag line="1156" name="param" description="The form POST data" type="array" variable="$post_id">
|
2471 |
+
<type by_reference="false">array</type>
|
2472 |
+
</tag>
|
2473 |
+
<tag line="1156" name="return" description="success/failure message and NULL content" type="array">
|
2474 |
+
<type by_reference="false">array</type>
|
2475 |
+
</tag>
|
2476 |
+
</docblock>
|
2477 |
+
<argument line="1165">
|
2478 |
+
<name>$post_id</name>
|
2479 |
+
<default><![CDATA[]]></default>
|
2480 |
+
<type/>
|
2481 |
+
</argument>
|
2482 |
+
</method>
|
2483 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1194" package="Media Library Assistant">
|
2484 |
+
<name>_display_single_item</name>
|
2485 |
+
<full_name>_display_single_item</full_name>
|
2486 |
+
<docblock line="1184">
|
2487 |
+
<description><![CDATA[Display a single item sub page; prepare the form to
|
2488 |
+
change the meta data for a single attachment.]]></description>
|
2489 |
+
<long-description><![CDATA[]]></long-description>
|
2490 |
+
<tag line="1184" name="since" description="0.1"/>
|
2491 |
+
<tag line="1184" name="param" description="The WordPress Post ID of the attachment item" type="int" variable="$post_id">
|
2492 |
+
<type by_reference="false">int</type>
|
2493 |
+
</tag>
|
2494 |
+
<tag line="1184" name="return" description="message and/or HTML content" type="array">
|
2495 |
+
<type by_reference="false">array</type>
|
2496 |
+
</tag>
|
2497 |
+
</docblock>
|
2498 |
+
<argument line="1194">
|
2499 |
+
<name>$post_id</name>
|
2500 |
+
<default><![CDATA[]]></default>
|
2501 |
+
<type/>
|
2502 |
+
</argument>
|
2503 |
+
</method>
|
2504 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1434" package="Media Library Assistant">
|
2505 |
+
<name>_restore_single_item</name>
|
2506 |
+
<full_name>_restore_single_item</full_name>
|
2507 |
+
<docblock line="1425">
|
2508 |
+
<description><![CDATA[Restore a single item from the Trash]]></description>
|
2509 |
+
<long-description><![CDATA[]]></long-description>
|
2510 |
+
<tag line="1425" name="since" description="0.1"/>
|
2511 |
+
<tag line="1425" name="param" description="The form POST data" type="array" variable="$post_id">
|
2512 |
+
<type by_reference="false">array</type>
|
2513 |
+
</tag>
|
2514 |
+
<tag line="1425" name="return" description="success/failure message and NULL content" type="array">
|
2515 |
+
<type by_reference="false">array</type>
|
2516 |
+
</tag>
|
2517 |
+
</docblock>
|
2518 |
+
<argument line="1434">
|
2519 |
+
<name>$post_id</name>
|
2520 |
+
<default><![CDATA[]]></default>
|
2521 |
+
<type/>
|
2522 |
+
</argument>
|
2523 |
+
</method>
|
2524 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1470" package="Media Library Assistant">
|
2525 |
+
<name>_trash_single_item</name>
|
2526 |
+
<full_name>_trash_single_item</full_name>
|
2527 |
+
<docblock line="1461">
|
2528 |
+
<description><![CDATA[Move a single item to Trash]]></description>
|
2529 |
+
<long-description><![CDATA[]]></long-description>
|
2530 |
+
<tag line="1461" name="since" description="0.1"/>
|
2531 |
+
<tag line="1461" name="param" description="The form POST data" type="array" variable="$post_id">
|
2532 |
+
<type by_reference="false">array</type>
|
2533 |
+
</tag>
|
2534 |
+
<tag line="1461" name="return" description="success/failure message and NULL content" type="array">
|
2535 |
+
<type by_reference="false">array</type>
|
2536 |
+
</tag>
|
2537 |
+
</docblock>
|
2538 |
+
<argument line="1470">
|
2539 |
+
<name>$post_id</name>
|
2540 |
+
<default><![CDATA[]]></default>
|
2541 |
+
<type/>
|
2542 |
+
</argument>
|
2543 |
+
</method>
|
2544 |
+
</class>
|
2545 |
+
</file>
|
2546 |
+
<file path="includes\class-mla-objects.php" hash="e2f22bd27808ab9ba022b324dff4fa6e" package="Media Library Assistant">
|
2547 |
+
<docblock line="2">
|
2548 |
+
<description><![CDATA[Media Library Assistant Custom Taxonomy and Post Type objects]]></description>
|
2549 |
+
<long-description><![CDATA[]]></long-description>
|
2550 |
+
<tag line="2" name="package" description="Media Library Assistant"/>
|
2551 |
+
<tag line="2" name="since" description="0.1"/>
|
2552 |
+
</docblock>
|
2553 |
+
<class final="false" abstract="false" namespace="global" line="15" package="Media Library Assistant">
|
2554 |
+
<extends/>
|
2555 |
+
<name>MLAObjects</name>
|
2556 |
+
<full_name>\MLAObjects</full_name>
|
2557 |
+
<docblock line="9">
|
2558 |
+
<description><![CDATA[Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags]]></description>
|
2559 |
+
<long-description><![CDATA[]]></long-description>
|
2560 |
+
<tag line="9" name="package" description="Media Library Assistant"/>
|
2561 |
+
<tag line="9" name="since" description="0.20"/>
|
2562 |
+
</docblock>
|
2563 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="23" package="Media Library Assistant">
|
2564 |
+
<name>initialize</name>
|
2565 |
+
<full_name>initialize</full_name>
|
2566 |
+
<docblock line="16">
|
2567 |
+
<description><![CDATA[Initialization function, similar to __construct()]]></description>
|
2568 |
+
<long-description><![CDATA[]]></long-description>
|
2569 |
+
<tag line="16" name="since" description="0.20"/>
|
2570 |
+
<tag line="16" name="return" description="" type="void">
|
2571 |
+
<type by_reference="false">void</type>
|
2572 |
+
</tag>
|
2573 |
+
</docblock>
|
2574 |
+
</method>
|
2575 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="34" package="Media Library Assistant">
|
2576 |
+
<name>_build_taxonomies</name>
|
2577 |
+
<full_name>_build_taxonomies</full_name>
|
2578 |
+
<docblock line="27">
|
2579 |
+
<description><![CDATA[Registers Attachment Categories and Attachment Tags custom taxonomies, adds taxonomy-related filters]]></description>
|
2580 |
+
<long-description><![CDATA[]]></long-description>
|
2581 |
+
<tag line="27" name="since" description="0.1"/>
|
2582 |
+
<tag line="27" name="return" description="" type="void">
|
2583 |
+
<type by_reference="false">void</type>
|
2584 |
+
</tag>
|
2585 |
+
</docblock>
|
2586 |
+
</method>
|
2587 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="112" package="Media Library Assistant">
|
2588 |
+
<name>mla_taxonomy_get_columns_filter</name>
|
2589 |
+
<full_name>mla_taxonomy_get_columns_filter</full_name>
|
2590 |
+
<docblock line="102">
|
2591 |
+
<description><![CDATA[WordPress Filter for edit taxonomy "Attachments" column,
|
2592 |
+
which replaces the "Posts" column with an equivalent "Attachments" column.]]></description>
|
2593 |
+
<long-description><![CDATA[]]></long-description>
|
2594 |
+
<tag line="102" name="since" description="0.30"/>
|
2595 |
+
<tag line="102" name="param" description="column definitions for the edit taxonomy list table" type="array" variable="$columns">
|
2596 |
+
<type by_reference="false">array</type>
|
2597 |
+
</tag>
|
2598 |
+
<tag line="102" name="return" description="updated column definitions for the edit taxonomy list table" type="array">
|
2599 |
+
<type by_reference="false">array</type>
|
2600 |
+
</tag>
|
2601 |
+
</docblock>
|
2602 |
+
<argument line="112">
|
2603 |
+
<name>$columns</name>
|
2604 |
+
<default><![CDATA[]]></default>
|
2605 |
+
<type/>
|
2606 |
+
</argument>
|
2607 |
+
</method>
|
2608 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="147" package="Media Library Assistant">
|
2609 |
+
<name>mla_taxonomy_column_filter</name>
|
2610 |
+
<full_name>mla_taxonomy_column_filter</full_name>
|
2611 |
+
<docblock line="134">
|
2612 |
+
<description><![CDATA[WordPress Filter for edit taxonomy "Attachments" column,
|
2613 |
+
which returns a count of the attachments assigned a given term]]></description>
|
2614 |
+
<long-description><![CDATA[]]></long-description>
|
2615 |
+
<tag line="134" name="since" description="0.30"/>
|
2616 |
+
<tag line="134" name="param" description="current column value; always ''" type="string" variable="$place_holder">
|
2617 |
+
<type by_reference="false">string</type>
|
2618 |
+
</tag>
|
2619 |
+
<tag line="134" name="param" description="name of the column" type="array" variable="$column_name">
|
2620 |
+
<type by_reference="false">array</type>
|
2621 |
+
</tag>
|
2622 |
+
<tag line="134" name="param" description="ID of the term for which the count is desired" type="array" variable="$term_id">
|
2623 |
+
<type by_reference="false">array</type>
|
2624 |
+
</tag>
|
2625 |
+
<tag line="134" name="return" description="HTML markup for the column content; number of attachments in the category and alink to retrieve a list of them" type="array">
|
2626 |
+
<type by_reference="false">array</type>
|
2627 |
+
</tag>
|
2628 |
+
</docblock>
|
2629 |
+
<argument line="147">
|
2630 |
+
<name>$place_holder</name>
|
2631 |
+
<default><![CDATA[]]></default>
|
2632 |
+
<type/>
|
2633 |
+
</argument>
|
2634 |
+
<argument line="147">
|
2635 |
+
<name>$column_name</name>
|
2636 |
+
<default><![CDATA[]]></default>
|
2637 |
+
<type/>
|
2638 |
+
</argument>
|
2639 |
+
<argument line="147">
|
2640 |
+
<name>$term_id</name>
|
2641 |
+
<default><![CDATA[]]></default>
|
2642 |
+
<type/>
|
2643 |
+
</argument>
|
2644 |
+
</method>
|
2645 |
+
</class>
|
2646 |
+
</file>
|
2647 |
+
<file path="includes\class-mla-options.php" hash="b52d0ef2bdb1764ab4a36f9c37fdd4d9" package="Media Library Assistant">
|
2648 |
+
<docblock line="2">
|
2649 |
+
<description><![CDATA[Manages the plugin option settings]]></description>
|
2650 |
+
<long-description><![CDATA[]]></long-description>
|
2651 |
+
<tag line="2" name="package" description="Media Library Assistant"/>
|
2652 |
+
<tag line="2" name="since" description="1.00"/>
|
2653 |
+
</docblock>
|
2654 |
+
<class final="false" abstract="false" namespace="global" line="18" package="Media Library Assistant">
|
2655 |
+
<extends/>
|
2656 |
+
<name>MLAOptions</name>
|
2657 |
+
<full_name>\MLAOptions</full_name>
|
2658 |
+
<docblock line="9">
|
2659 |
+
<description><![CDATA[Class MLA (Media Library Assistant) Options manages the plugin option settings
|
2660 |
+
and provides functions to get and put them from/to WordPress option variables]]></description>
|
2661 |
+
<long-description><![CDATA[<p>Separated from class MLASettings in version 1.00</p>]]></long-description>
|
2662 |
+
<tag line="9" name="package" description="Media Library Assistant"/>
|
2663 |
+
<tag line="9" name="since" description="1.00"/>
|
2664 |
+
</docblock>
|
2665 |
+
<constant namespace="global" line="22" package="Media Library Assistant">
|
2666 |
+
<name>MLA_VERSION_OPTION</name>
|
2667 |
+
<full_name>MLA_VERSION_OPTION</full_name>
|
2668 |
+
<value><![CDATA['current_version']]></value>
|
2669 |
+
<docblock line="19">
|
2670 |
+
<description><![CDATA[Provides a unique name for the current version option]]></description>
|
2671 |
+
<long-description><![CDATA[]]></long-description>
|
2672 |
+
</docblock>
|
2673 |
+
</constant>
|
2674 |
+
<constant namespace="global" line="27" package="Media Library Assistant">
|
2675 |
+
<name>MLA_FEATURED_IN_TUNING</name>
|
2676 |
+
<full_name>MLA_FEATURED_IN_TUNING</full_name>
|
2677 |
+
<value><![CDATA['featured_in_tuning']]></value>
|
2678 |
+
<docblock line="24">
|
2679 |
+
<description><![CDATA[Provides a unique name for a database tuning option]]></description>
|
2680 |
+
<long-description><![CDATA[]]></long-description>
|
2681 |
+
</docblock>
|
2682 |
+
</constant>
|
2683 |
+
<constant namespace="global" line="32" package="Media Library Assistant">
|
2684 |
+
<name>MLA_INSERTED_IN_TUNING</name>
|
2685 |
+
<full_name>MLA_INSERTED_IN_TUNING</full_name>
|
2686 |
+
<value><![CDATA['inserted_in_tuning']]></value>
|
2687 |
+
<docblock line="29">
|
2688 |
+
<description><![CDATA[Provides a unique name for a database tuning option]]></description>
|
2689 |
+
<long-description><![CDATA[]]></long-description>
|
2690 |
+
</docblock>
|
2691 |
+
</constant>
|
2692 |
+
<constant namespace="global" line="37" package="Media Library Assistant">
|
2693 |
+
<name>MLA_GALLERY_IN_TUNING</name>
|
2694 |
+
<full_name>MLA_GALLERY_IN_TUNING</full_name>
|
2695 |
+
<value><![CDATA['gallery_in_tuning']]></value>
|
2696 |
+
<docblock line="34">
|
2697 |
+
<description><![CDATA[Provides a unique name for a database tuning option]]></description>
|
2698 |
+
<long-description><![CDATA[]]></long-description>
|
2699 |
+
</docblock>
|
2700 |
+
</constant>
|
2701 |
+
<constant namespace="global" line="42" package="Media Library Assistant">
|
2702 |
+
<name>MLA_MLA_GALLERY_IN_TUNING</name>
|
2703 |
+
<full_name>MLA_MLA_GALLERY_IN_TUNING</full_name>
|
2704 |
+
<value><![CDATA['mla_gallery_in_tuning']]></value>
|
2705 |
+
<docblock line="39">
|
2706 |
+
<description><![CDATA[Provides a unique name for a database tuning option]]></description>
|
2707 |
+
<long-description><![CDATA[]]></long-description>
|
2708 |
+
</docblock>
|
2709 |
+
</constant>
|
2710 |
+
<constant namespace="global" line="47" package="Media Library Assistant">
|
2711 |
+
<name>MLA_NEW_CUSTOM_RULE</name>
|
2712 |
+
<full_name>MLA_NEW_CUSTOM_RULE</full_name>
|
2713 |
+
<value><![CDATA['__NEW RULE__']]></value>
|
2714 |
+
<docblock line="44">
|
2715 |
+
<description><![CDATA[Provides a unique name for the Custom Field "new rule" key]]></description>
|
2716 |
+
<long-description><![CDATA[]]></long-description>
|
2717 |
+
</docblock>
|
2718 |
+
</constant>
|
2719 |
+
<constant namespace="global" line="52" package="Media Library Assistant">
|
2720 |
+
<name>MLA_NEW_CUSTOM_FIELD</name>
|
2721 |
+
<full_name>MLA_NEW_CUSTOM_FIELD</full_name>
|
2722 |
+
<value><![CDATA['__NEW FIELD__']]></value>
|
2723 |
+
<docblock line="49">
|
2724 |
+
<description><![CDATA[Provides a unique name for the Custom Field "new field" key]]></description>
|
2725 |
+
<long-description><![CDATA[]]></long-description>
|
2726 |
+
</docblock>
|
2727 |
+
</constant>
|
2728 |
+
<property final="false" static="true" visibility="public" line="63" namespace="global" package="Media Library Assistant">
|
2729 |
+
<name>$process_featured_in</name>
|
2730 |
+
<default><![CDATA[true]]></default>
|
2731 |
+
<docblock line="54">
|
2732 |
+
<description><![CDATA[Option setting for "Featured in" reporting]]></description>
|
2733 |
+
<long-description><![CDATA[<p>This setting is false if the "Featured in" database access setting is "disabled", else true.</p>]]></long-description>
|
2734 |
+
<tag line="54" name="since" description="1.00"/>
|
2735 |
+
<tag line="54" name="var" description="" type="boolean">
|
2736 |
+
<type by_reference="false">boolean</type>
|
2737 |
+
</tag>
|
2738 |
+
</docblock>
|
2739 |
+
</property>
|
2740 |
+
<property final="false" static="true" visibility="public" line="74" namespace="global" package="Media Library Assistant">
|
2741 |
+
<name>$process_inserted_in</name>
|
2742 |
+
<default><![CDATA[true]]></default>
|
2743 |
+
<docblock line="65">
|
2744 |
+
<description><![CDATA[Option setting for "Inserted in" reporting]]></description>
|
2745 |
+
<long-description><![CDATA[<p>This setting is false if the "Inserted in" database access setting is "disabled", else true.</p>]]></long-description>
|
2746 |
+
<tag line="65" name="since" description="1.00"/>
|
2747 |
+
<tag line="65" name="var" description="" type="boolean">
|
2748 |
+
<type by_reference="false">boolean</type>
|
2749 |
+
</tag>
|
2750 |
+
</docblock>
|
2751 |
+
</property>
|
2752 |
+
<property final="false" static="true" visibility="public" line="85" namespace="global" package="Media Library Assistant">
|
2753 |
+
<name>$process_gallery_in</name>
|
2754 |
+
<default><![CDATA[true]]></default>
|
2755 |
+
<docblock line="76">
|
2756 |
+
<description><![CDATA[Option setting for "Gallery in" reporting]]></description>
|
2757 |
+
<long-description><![CDATA[<p>This setting is false if the "Gallery in" database access setting is "disabled", else true.</p>]]></long-description>
|
2758 |
+
<tag line="76" name="since" description="1.00"/>
|
2759 |
+
<tag line="76" name="var" description="" type="boolean">
|
2760 |
+
<type by_reference="false">boolean</type>
|
2761 |
+
</tag>
|
2762 |
+
</docblock>
|
2763 |
+
</property>
|
2764 |
+
<property final="false" static="true" visibility="public" line="96" namespace="global" package="Media Library Assistant">
|
2765 |
+
<name>$process_mla_gallery_in</name>
|
2766 |
+
<default><![CDATA[true]]></default>
|
2767 |
+
<docblock line="87">
|
2768 |
+
<description><![CDATA[Option setting for "MLA Gallery in" reporting]]></description>
|
2769 |
+
<long-description><![CDATA[<p>This setting is false if the "MLA Gallery in" database access setting is "disabled", else true.</p>]]></long-description>
|
2770 |
+
<tag line="87" name="since" description="1.00"/>
|
2771 |
+
<tag line="87" name="var" description="" type="boolean">
|
2772 |
+
<type by_reference="false">boolean</type>
|
2773 |
+
</tag>
|
2774 |
+
</docblock>
|
2775 |
+
</property>
|
2776 |
+
<property final="false" static="true" visibility="public" line="123" namespace="global" package="Media Library Assistant">
|
2777 |
+
<name>$mla_option_definitions</name>
|
2778 |
+
<default><![CDATA[array(self::MLA_VERSION_OPTION => array('tab' => '', 'type' => 'hidden', 'std' => '0'), 'attachment_category' => array('tab' => '', 'name' => 'Attachment Categories', 'type' => 'hidden', 'std' => 'checked', 'help' => 'Check this option to add support for Attachment Categories.'), 'attachment_tag' => array('tab' => '', 'name' => 'Attachment Tags', 'type' => 'hidden', 'std' => 'checked', 'help' => 'Check this option to add support for Attachment Tags.'), 'where_used_heading' => array('tab' => 'general', 'name' => 'Where-used Reporting', 'type' => 'header'), 'exclude_revisions' => array('tab' => 'general', 'name' => 'Exclude Revisions', 'type' => 'checkbox', 'std' => 'checked', 'help' => 'Check this option to exclude revisions from where-used reporting.'), 'where_used_subheading' => array('tab' => 'general', 'name' => 'Where-used database access tuning', 'type' => 'subheader'), self::MLA_FEATURED_IN_TUNING => array('tab' => 'general', 'name' => 'Featured in', 'type' => 'select', 'std' => 'enabled', 'options' => array('enabled', 'disabled'), 'texts' => array('Enabled', 'Disabled'), 'help' => 'Search database posts and pages for Featured Image attachments.'), self::MLA_INSERTED_IN_TUNING => array('tab' => 'general', 'name' => 'Inserted in', 'type' => 'select', 'std' => 'enabled', 'options' => array('enabled', 'disabled'), 'texts' => array('Enabled', 'Disabled'), 'help' => 'Search database posts and pages for attachments embedded in content.'), self::MLA_GALLERY_IN_TUNING => array('tab' => 'general', 'name' => 'Gallery in', 'type' => 'select', 'std' => 'cached', 'options' => array('dynamic', 'refresh', 'cached', 'disabled'), 'texts' => array('Dynamic', 'Refresh', 'Cached', 'Disabled'), 'help' => 'Search database posts and pages for [gallery] shortcode results.<br> Dynamic = once every page load, Cached = once every login, Disabled = never.<br> Refresh = update references, then set to Cached.'), self::MLA_MLA_GALLERY_IN_TUNING => array('tab' => 'general', 'name' => 'MLA Gallery in', 'type' => 'select', 'std' => 'cached', 'options' => array('dynamic', 'refresh', 'cached', 'disabled'), 'texts' => array('Dynamic', 'Refresh', 'Cached', 'Disabled'), 'help' => 'Search database posts and pages for [mla_gallery] shortcode results.<br> Dynamic = once every page load, Cached = once every login, Disabled = never.<br> Refresh = update references, then set to Cached.'), 'taxonomy_heading' => array('tab' => 'general', 'name' => 'Taxonomy Support', 'type' => 'header'), 'taxonomy_support' => array('tab' => 'general', 'help' => 'Check the "Support" box to add the taxonomy to the Assistant and the Edit Media screen.<br>Check the "Inline Edit" box to display the taxonomy in the Quick Edit and Bulk Edit areas.<br>Use the "List Filter" option to select the taxonomy on which to filter the Assistant table listing.', 'std' => array('tax_support' => array('attachment_category' => 'checked', 'attachment_tag' => 'checked'), 'tax_quick_edit' => array('attachment_category' => 'checked', 'attachment_tag' => 'checked'), 'tax_filter' => 'attachment_category'), 'type' => 'custom', 'render' => 'mla_taxonomy_option_handler', 'update' => 'mla_taxonomy_option_handler', 'delete' => 'mla_taxonomy_option_handler', 'reset' => 'mla_taxonomy_option_handler'), 'orderby_heading' => array('tab' => 'general', 'name' => 'Default Table Listing Sort Order', 'type' => 'header'), 'default_orderby' => array('tab' => 'general', 'name' => 'Order By', 'type' => 'select', 'std' => 'title_name', 'options' => array('none', 'title_name'), 'texts' => array('None', 'Title/Name'), 'help' => 'Select the column for the sort order of the Assistant table listing.'), 'default_order' => array('tab' => 'general', 'name' => 'Order', 'type' => 'radio', 'std' => 'ASC', 'options' => array('ASC', 'DESC'), 'texts' => array('Ascending', 'Descending'), 'help' => 'Choose the sort order.'), 'template_heading' => array('tab' => 'mla-gallery', 'name' => 'Default [mla_gallery] Templates', 'type' => 'header'), 'default_style' => array('tab' => 'mla-gallery', 'name' => 'Style Template', 'type' => 'select', 'std' => 'default', 'options' => array(), 'texts' => array(), 'help' => 'Select the default style template for your [mla_gallery] shortcodes.'), 'default_markup' => array('tab' => 'mla-gallery', 'name' => 'Markup Template', 'type' => 'select', 'std' => 'default', 'options' => array(), 'texts' => array(), 'help' => 'Select the default markup template for your [mla_gallery] shortcodes.'), 'style_templates' => array('tab' => '', 'type' => 'hidden', 'std' => array()), 'markup_templates' => array('tab' => '', 'type' => 'hidden', 'std' => array()), 'enable_custom_field_mapping' => array('tab' => 'custom-field', 'name' => 'Enable custom field mapping when adding new media', 'type' => 'checkbox', 'std' => '', 'help' => 'Check this option to enable mapping when uploading new media (attachments).<br> Click Save Changes at the bottom of the screen if you change this option.<br> Does NOT affect the operation of the "Map" buttons on the bulk edit, single edit and settings screens.'), 'custom_field_mapping' => array('tab' => '', 'help' => ' <br>Update the custom field mapping values above, then click Save Changes to make the updates permanent.<br>You can also make temporary updates and click a Map All Attachments button to apply the rule(s) to all attachments without saving any rule changes.', 'std' => array(), 'type' => 'custom', 'render' => 'mla_custom_field_option_handler', 'update' => 'mla_custom_field_option_handler', 'delete' => 'mla_custom_field_option_handler', 'reset' => 'mla_custom_field_option_handler'), 'enable_iptc_exif_mapping' => array('tab' => 'iptc-exif', 'name' => 'Enable IPTC/EXIF Mapping when adding new media', 'type' => 'checkbox', 'std' => '', 'help' => 'Check this option to enable mapping when uploading new media (attachments).<br> Does NOT affect the operation of the "Map" buttons on the bulk edit, single edit and settings screens.'), 'iptc_exif_standard_mapping' => array('tab' => '', 'help' => 'Update the standard field mapping values above, then click Save Changes to make the updates permanent.<br>You can also make temporary updates and click Map All Attachments Now to apply the updates to all attachments without saving the rule changes.', 'std' => NULL, 'type' => 'custom', 'render' => 'mla_iptc_exif_option_handler', 'update' => 'mla_iptc_exif_option_handler', 'delete' => 'mla_iptc_exif_option_handler', 'reset' => 'mla_iptc_exif_option_handler'), 'iptc_exif_taxonomy_mapping' => array('tab' => '', 'help' => 'Update the taxonomy term mapping values above, then click Save Changes or Map All Attachments Now.', 'std' => NULL, 'type' => 'custom', 'render' => 'mla_iptc_exif_option_handler', 'update' => 'mla_iptc_exif_option_handler', 'delete' => 'mla_iptc_exif_option_handler', 'reset' => 'mla_iptc_exif_option_handler'), 'iptc_exif_custom_mapping' => array('tab' => '', 'help' => 'Update the custom field mapping values above.<br>To define a new custom field, enter a field name in the "Field Title" text box at the end of the list and Save Changes.', 'std' => NULL, 'type' => 'custom', 'render' => 'mla_iptc_exif_option_handler', 'update' => 'mla_iptc_exif_option_handler', 'delete' => 'mla_iptc_exif_option_handler', 'reset' => 'mla_iptc_exif_option_handler'), 'iptc_exif_mapping' => array('tab' => '', 'help' => 'IPTC/EXIF Mapping help', 'std' => array('standard' => array('post_title' => array('name' => 'Title', 'iptc_value' => 'none', 'exif_value' => '', 'iptc_first' => true, 'keep_existing' => true), 'post_name' => array('name' => 'Name/Slug', 'iptc_value' => 'none', 'exif_value' => '', 'iptc_first' => true, 'keep_existing' => true), 'image_alt' => array('name' => 'Alternate Text', 'iptc_value' => 'none', 'exif_value' => '', 'iptc_first' => true, 'keep_existing' => true), 'post_excerpt' => array('name' => 'Caption', 'iptc_value' => 'none', 'exif_value' => '', 'iptc_first' => true, 'keep_existing' => true), 'post_content' => array('name' => 'Description', 'iptc_value' => 'none', 'exif_value' => '', 'iptc_first' => true, 'keep_existing' => true)), 'taxonomy' => array(), 'custom' => array()), 'type' => 'custom', 'render' => 'mla_iptc_exif_option_handler', 'update' => 'mla_iptc_exif_option_handler', 'delete' => 'mla_iptc_exif_option_handler', 'reset' => 'mla_iptc_exif_option_handler'))]]></default>
|
2779 |
+
<docblock line="98">
|
2780 |
+
<description><![CDATA[$mla_option_definitions defines the database options and admin page areas for setting/updating them.]]></description>
|
2781 |
+
<long-description><![CDATA[<p>Each option is defined by an array with the following elements:</p>
|
2782 |
+
|
2783 |
+
<p>array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
|
2784 |
+
|
2785 |
+
<p>tab => Settings page tab id for the option
|
2786 |
+
name => admin page label or heading text
|
2787 |
+
type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea', 'custom', 'hidden'
|
2788 |
+
std => default value
|
2789 |
+
help => help text
|
2790 |
+
size => text size, default 40
|
2791 |
+
cols => textbox columns, default 90
|
2792 |
+
rows => textbox rows, default 5
|
2793 |
+
options => array of radio or select option values
|
2794 |
+
texts => array of radio or select option display texts
|
2795 |
+
render => rendering function for 'custom' options. Usage:
|
2796 |
+
$options_list .= ['render']( 'render', $key, $value );
|
2797 |
+
update => update function for 'custom' options; returns nothing. Usage:
|
2798 |
+
$message = ['update']( 'update', $key, $value, $_REQUEST );
|
2799 |
+
delete => delete function for 'custom' options; returns nothing. Usage:
|
2800 |
+
$message = ['delete']( 'delete', $key, $value, $_REQUEST );
|
2801 |
+
reset => reset function for 'custom' options; returns nothing. Usage:
|
2802 |
+
$message = ['reset']( 'reset', $key, $value, $_REQUEST );</p>]]></long-description>
|
2803 |
+
</docblock>
|
2804 |
+
</property>
|
2805 |
+
<property final="false" static="true" visibility="private" line="447" namespace="global" package="Media Library Assistant">
|
2806 |
+
<name>$mla_option_templates</name>
|
2807 |
+
<default><![CDATA[null]]></default>
|
2808 |
+
<docblock line="440">
|
2809 |
+
<description><![CDATA[Style and Markup templates]]></description>
|
2810 |
+
<long-description><![CDATA[]]></long-description>
|
2811 |
+
<tag line="440" name="since" description="0.80"/>
|
2812 |
+
<tag line="440" name="var" description="" type="array">
|
2813 |
+
<type by_reference="false">array</type>
|
2814 |
+
</tag>
|
2815 |
+
</docblock>
|
2816 |
+
</property>
|
2817 |
+
<property final="false" static="true" visibility="private" line="1367" namespace="global" package="Media Library Assistant">
|
2818 |
+
<name>$custom_field_data_sources</name>
|
2819 |
+
<default><![CDATA[array('path', 'file_name', 'extension', 'file_size', 'dimensions', 'pixels', 'width', 'height', 'hwstring_small', 'size_keys', 'size_names', 'size_bytes', 'size_pixels', 'size_dimensions', 'size_name[size]', 'size_bytes[size]', 'size_pixels[size]', 'size_dimensions[size]', 'parent_type', 'parent_title', 'parent_issues', 'reference_issues', 'aperture', 'credit', 'camera', 'caption', 'created_timestamp', 'copyright', 'focal_length', 'iso', 'shutter_speed', 'title')]]></default>
|
2820 |
+
<docblock line="1360">
|
2821 |
+
<description><![CDATA[Array of Data Source names for custom field mapping]]></description>
|
2822 |
+
<long-description><![CDATA[]]></long-description>
|
2823 |
+
<tag line="1360" name="since" description="1.10"/>
|
2824 |
+
<tag line="1360" name="var" description="" type="array">
|
2825 |
+
<type by_reference="false">array</type>
|
2826 |
+
</tag>
|
2827 |
+
</docblock>
|
2828 |
+
</property>
|
2829 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="421" package="Media Library Assistant">
|
2830 |
+
<name>initialize</name>
|
2831 |
+
<full_name>initialize</full_name>
|
2832 |
+
<docblock line="414">
|
2833 |
+
<description><![CDATA[Initialization function, similar to __construct()]]></description>
|
2834 |
+
<long-description><![CDATA[]]></long-description>
|
2835 |
+
<tag line="414" name="since" description="1.00"/>
|
2836 |
+
<tag line="414" name="return" description="" type="void">
|
2837 |
+
<type by_reference="false">void</type>
|
2838 |
+
</tag>
|
2839 |
+
</docblock>
|
2840 |
+
</method>
|
2841 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="456" package="Media Library Assistant">
|
2842 |
+
<name>_load_option_templates</name>
|
2843 |
+
<full_name>_load_option_templates</full_name>
|
2844 |
+
<docblock line="449">
|
2845 |
+
<description><![CDATA[Load style and markup templates to $mla_templates]]></description>
|
2846 |
+
<long-description><![CDATA[]]></long-description>
|
2847 |
+
<tag line="449" name="since" description="0.80"/>
|
2848 |
+
<tag line="449" name="return" description="" type="void">
|
2849 |
+
<type by_reference="false">void</type>
|
2850 |
+
</tag>
|
2851 |
+
</docblock>
|
2852 |
+
</method>
|
2853 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="504" package="Media Library Assistant">
|
2854 |
+
<name>mla_fetch_gallery_template</name>
|
2855 |
+
<full_name>mla_fetch_gallery_template</full_name>
|
2856 |
+
<docblock line="494">
|
2857 |
+
<description><![CDATA[Fetch style or markup template from $mla_templates]]></description>
|
2858 |
+
<long-description><![CDATA[]]></long-description>
|
2859 |
+
<tag line="494" name="since" description="0.80"/>
|
2860 |
+
<tag line="494" name="param" description="Template name" type="string" variable="$key">
|
2861 |
+
<type by_reference="false">string</type>
|
2862 |
+
</tag>
|
2863 |
+
<tag line="494" name="param" description="Template type; 'style' (default) or 'markup'" type="string" variable="$type">
|
2864 |
+
<type by_reference="false">string</type>
|
2865 |
+
</tag>
|
2866 |
+
<tag line="494" name="return" description="requested template, false if not found or null if no templates" type="string|boolean|null">
|
2867 |
+
<type by_reference="false">string</type>
|
2868 |
+
<type by_reference="false">boolean</type>
|
2869 |
+
<type by_reference="false">null</type>
|
2870 |
+
</tag>
|
2871 |
+
</docblock>
|
2872 |
+
<argument line="504">
|
2873 |
+
<name>$key</name>
|
2874 |
+
<default><![CDATA[]]></default>
|
2875 |
+
<type/>
|
2876 |
+
</argument>
|
2877 |
+
<argument line="504">
|
2878 |
+
<name>$type</name>
|
2879 |
+
<default><![CDATA['style']]></default>
|
2880 |
+
<type/>
|
2881 |
+
</argument>
|
2882 |
+
</method>
|
2883 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="526" package="Media Library Assistant">
|
2884 |
+
<name>mla_get_style_templates</name>
|
2885 |
+
<full_name>mla_get_style_templates</full_name>
|
2886 |
+
<docblock line="519">
|
2887 |
+
<description><![CDATA[Get ALL style templates from $mla_templates, including 'default']]></description>
|
2888 |
+
<long-description><![CDATA[]]></long-description>
|
2889 |
+
<tag line="519" name="since" description="0.80"/>
|
2890 |
+
<tag line="519" name="return" description="name => value for all style templates or null if no templates" type="array|null">
|
2891 |
+
<type by_reference="false">array</type>
|
2892 |
+
<type by_reference="false">null</type>
|
2893 |
+
</tag>
|
2894 |
+
</docblock>
|
2895 |
+
</method>
|
2896 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="552" package="Media Library Assistant">
|
2897 |
+
<name>mla_put_style_templates</name>
|
2898 |
+
<full_name>mla_put_style_templates</full_name>
|
2899 |
+
<docblock line="544">
|
2900 |
+
<description><![CDATA[Put user-defined style templates to $mla_templates and database]]></description>
|
2901 |
+
<long-description><![CDATA[]]></long-description>
|
2902 |
+
<tag line="544" name="since" description="0.80"/>
|
2903 |
+
<tag line="544" name="param" description="name => value for all user-defined style templates" type="array" variable="$templates">
|
2904 |
+
<type by_reference="false">array</type>
|
2905 |
+
</tag>
|
2906 |
+
<tag line="544" name="return" description="true if success, false if failure" type="boolean">
|
2907 |
+
<type by_reference="false">boolean</type>
|
2908 |
+
</tag>
|
2909 |
+
</docblock>
|
2910 |
+
<argument line="552">
|
2911 |
+
<name>$templates</name>
|
2912 |
+
<default><![CDATA[]]></default>
|
2913 |
+
<type/>
|
2914 |
+
</argument>
|
2915 |
+
</method>
|
2916 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="568" package="Media Library Assistant">
|
2917 |
+
<name>mla_get_markup_templates</name>
|
2918 |
+
<full_name>mla_get_markup_templates</full_name>
|
2919 |
+
<docblock line="561">
|
2920 |
+
<description><![CDATA[Get ALL markup templates from $mla_templates, including 'default']]></description>
|
2921 |
+
<long-description><![CDATA[]]></long-description>
|
2922 |
+
<tag line="561" name="since" description="0.80"/>
|
2923 |
+
<tag line="561" name="return" description="name => value for all markup templates or null if no templates" type="array|null">
|
2924 |
+
<type by_reference="false">array</type>
|
2925 |
+
<type by_reference="false">null</type>
|
2926 |
+
</tag>
|
2927 |
+
</docblock>
|
2928 |
+
</method>
|
2929 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="622" package="Media Library Assistant">
|
2930 |
+
<name>mla_put_markup_templates</name>
|
2931 |
+
<full_name>mla_put_markup_templates</full_name>
|
2932 |
+
<docblock line="614">
|
2933 |
+
<description><![CDATA[Put user-defined markup templates to $mla_templates and database]]></description>
|
2934 |
+
<long-description><![CDATA[]]></long-description>
|
2935 |
+
<tag line="614" name="since" description="0.80"/>
|
2936 |
+
<tag line="614" name="param" description="name => value for all user-defined markup templates" type="array" variable="$templates">
|
2937 |
+
<type by_reference="false">array</type>
|
2938 |
+
</tag>
|
2939 |
+
<tag line="614" name="return" description="true if success, false if failure" type="boolean">
|
2940 |
+
<type by_reference="false">boolean</type>
|
2941 |
+
</tag>
|
2942 |
+
</docblock>
|
2943 |
+
<argument line="622">
|
2944 |
+
<name>$templates</name>
|
2945 |
+
<default><![CDATA[]]></default>
|
2946 |
+
<type/>
|
2947 |
+
</argument>
|
2948 |
+
</method>
|
2949 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="640" package="Media Library Assistant">
|
2950 |
+
<name>mla_get_option</name>
|
2951 |
+
<full_name>mla_get_option</full_name>
|
2952 |
+
<docblock line="631">
|
2953 |
+
<description><![CDATA[Return the stored value or default value of a defined MLA option]]></description>
|
2954 |
+
<long-description><![CDATA[]]></long-description>
|
2955 |
+
<tag line="631" name="since" description="0.1"/>
|
2956 |
+
<tag line="631" name="param" description="Name of the desired option" type="string" variable="$option">
|
2957 |
+
<type by_reference="false">string</type>
|
2958 |
+
</tag>
|
2959 |
+
<tag line="631" name="return" description="Value(s) for the option or false if the option is not a defined MLA option" type="mixed">
|
2960 |
+
<type by_reference="false">mixed</type>
|
2961 |
+
</tag>
|
2962 |
+
</docblock>
|
2963 |
+
<argument line="640">
|
2964 |
+
<name>$option</name>
|
2965 |
+
<default><![CDATA[]]></default>
|
2966 |
+
<type/>
|
2967 |
+
</argument>
|
2968 |
+
</method>
|
2969 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="661" package="Media Library Assistant">
|
2970 |
+
<name>mla_update_option</name>
|
2971 |
+
<full_name>mla_update_option</full_name>
|
2972 |
+
<docblock line="651">
|
2973 |
+
<description><![CDATA[Add or update the stored value of a defined MLA option]]></description>
|
2974 |
+
<long-description><![CDATA[]]></long-description>
|
2975 |
+
<tag line="651" name="since" description="0.1"/>
|
2976 |
+
<tag line="651" name="param" description="Name of the desired option" type="string" variable="$option">
|
2977 |
+
<type by_reference="false">string</type>
|
2978 |
+
</tag>
|
2979 |
+
<tag line="651" name="param" description="New value for the desired option" type="mixed" variable="$newvalue">
|
2980 |
+
<type by_reference="false">mixed</type>
|
2981 |
+
</tag>
|
2982 |
+
<tag line="651" name="return" description="True if the value was changed or false if the update failed" type="boolean">
|
2983 |
+
<type by_reference="false">boolean</type>
|
2984 |
+
</tag>
|
2985 |
+
</docblock>
|
2986 |
+
<argument line="661">
|
2987 |
+
<name>$option</name>
|
2988 |
+
<default><![CDATA[]]></default>
|
2989 |
+
<type/>
|
2990 |
+
</argument>
|
2991 |
+
<argument line="661">
|
2992 |
+
<name>$newvalue</name>
|
2993 |
+
<default><![CDATA[]]></default>
|
2994 |
+
<type/>
|
2995 |
+
</argument>
|
2996 |
+
</method>
|
2997 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="677" package="Media Library Assistant">
|
2998 |
+
<name>mla_delete_option</name>
|
2999 |
+
<full_name>mla_delete_option</full_name>
|
3000 |
+
<docblock line="668">
|
3001 |
+
<description><![CDATA[Delete the stored value of a defined MLA option]]></description>
|
3002 |
+
<long-description><![CDATA[]]></long-description>
|
3003 |
+
<tag line="668" name="since" description="0.1"/>
|
3004 |
+
<tag line="668" name="param" description="Name of the desired option" type="string" variable="$option">
|
3005 |
+
<type by_reference="false">string</type>
|
3006 |
+
</tag>
|
3007 |
+
<tag line="668" name="return" description="True if the option was deleted, otherwise false" type="boolean">
|
3008 |
+
<type by_reference="false">boolean</type>
|
3009 |
+
</tag>
|
3010 |
+
</docblock>
|
3011 |
+
<argument line="677">
|
3012 |
+
<name>$option</name>
|
3013 |
+
<default><![CDATA[]]></default>
|
3014 |
+
<type/>
|
3015 |
+
</argument>
|
3016 |
+
</method>
|
3017 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="698" package="Media Library Assistant">
|
3018 |
+
<name>mla_taxonomy_support</name>
|
3019 |
+
<full_name>mla_taxonomy_support</full_name>
|
3020 |
+
<docblock line="685">
|
3021 |
+
<description><![CDATA[Determine MLA support for a taxonomy, handling the special case where the
|
3022 |
+
settings are being updated or reset.]]></description>
|
3023 |
+
<long-description><![CDATA[]]></long-description>
|
3024 |
+
<tag line="685" name="since" description="0.30"/>
|
3025 |
+
<tag line="685" name="param" description="Taxonomy name, e.g., attachment_category" type="string" variable="$tax_name">
|
3026 |
+
<type by_reference="false">string</type>
|
3027 |
+
</tag>
|
3028 |
+
<tag line="685" name="param" description="Optional. 'support' (default), 'quick-edit' or 'filter'" type="string" variable="$support_type">
|
3029 |
+
<type by_reference="false">string</type>
|
3030 |
+
</tag>
|
3031 |
+
<tag line="685" name="return" description="true if the taxonomy is supported in this way else false string if $tax_name is '' and $support_type is 'filter', returns the taxonomy to filter by" type="boolean|string">
|
3032 |
+
<type by_reference="false">boolean</type>
|
3033 |
+
<type by_reference="false">string</type>
|
3034 |
+
</tag>
|
3035 |
+
</docblock>
|
3036 |
+
<argument line="698">
|
3037 |
+
<name>$tax_name</name>
|
3038 |
+
<default><![CDATA[]]></default>
|
3039 |
+
<type/>
|
3040 |
+
</argument>
|
3041 |
+
<argument line="698">
|
3042 |
+
<name>$support_type</name>
|
3043 |
+
<default><![CDATA['support']]></default>
|
3044 |
+
<type/>
|
3045 |
+
</argument>
|
3046 |
+
</method>
|
3047 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="774" package="Media Library Assistant">
|
3048 |
+
<name>mla_taxonomy_option_handler</name>
|
3049 |
+
<full_name>mla_taxonomy_option_handler</full_name>
|
3050 |
+
<docblock line="761">
|
3051 |
+
<description><![CDATA[Render and manage taxonomy support options, e.g., Categories and Post Tags]]></description>
|
3052 |
+
<long-description><![CDATA[]]></long-description>
|
3053 |
+
<tag line="761" name="since" description="0.30"/>
|
3054 |
+
<tag line="761" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3055 |
+
<tag line="761" name="param" description="'render', 'update', 'delete', or 'reset'" type="string" variable="$action">
|
3056 |
+
<type by_reference="false">string</type>
|
3057 |
+
</tag>
|
3058 |
+
<tag line="761" name="param" description="option name, e.g., 'taxonomy_support'" type="string" variable="$key">
|
3059 |
+
<type by_reference="false">string</type>
|
3060 |
+
</tag>
|
3061 |
+
<tag line="761" name="param" description="option parameters" type="array" variable="$value">
|
3062 |
+
<type by_reference="false">array</type>
|
3063 |
+
</tag>
|
3064 |
+
<tag line="761" name="param" description="Optional. null (default) for 'render' else option data, e.g., $_REQUEST" type="array" variable="$args">
|
3065 |
+
<type by_reference="false">array</type>
|
3066 |
+
</tag>
|
3067 |
+
<tag line="761" name="return" description="HTML table row markup for 'render' else message(s) reflecting the results of the operation." type="string">
|
3068 |
+
<type by_reference="false">string</type>
|
3069 |
+
</tag>
|
3070 |
+
</docblock>
|
3071 |
+
<argument line="774">
|
3072 |
+
<name>$action</name>
|
3073 |
+
<default><![CDATA[]]></default>
|
3074 |
+
<type/>
|
3075 |
+
</argument>
|
3076 |
+
<argument line="774">
|
3077 |
+
<name>$key</name>
|
3078 |
+
<default><![CDATA[]]></default>
|
3079 |
+
<type/>
|
3080 |
+
</argument>
|
3081 |
+
<argument line="774">
|
3082 |
+
<name>$value</name>
|
3083 |
+
<default><![CDATA[]]></default>
|
3084 |
+
<type/>
|
3085 |
+
</argument>
|
3086 |
+
<argument line="774">
|
3087 |
+
<name>$args</name>
|
3088 |
+
<default><![CDATA[null]]></default>
|
3089 |
+
<type/>
|
3090 |
+
</argument>
|
3091 |
+
</method>
|
3092 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="882" package="Media Library Assistant">
|
3093 |
+
<name>mla_add_attachment_action</name>
|
3094 |
+
<full_name>mla_add_attachment_action</full_name>
|
3095 |
+
<docblock line="873">
|
3096 |
+
<description><![CDATA[Perform ITC/EXIF mapping on just-inserted attachment]]></description>
|
3097 |
+
<long-description><![CDATA[]]></long-description>
|
3098 |
+
<tag line="873" name="since" description="1.00"/>
|
3099 |
+
<tag line="873" name="param" description="ID of just-inserted attachment" type="integer" variable="$post_id">
|
3100 |
+
<type by_reference="false">integer</type>
|
3101 |
+
</tag>
|
3102 |
+
<tag line="873" name="return" description="" type="void">
|
3103 |
+
<type by_reference="false">void</type>
|
3104 |
+
</tag>
|
3105 |
+
</docblock>
|
3106 |
+
<argument line="882">
|
3107 |
+
<name>$post_id</name>
|
3108 |
+
<default><![CDATA[]]></default>
|
3109 |
+
<type/>
|
3110 |
+
</argument>
|
3111 |
+
</method>
|
3112 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="902" package="Media Library Assistant">
|
3113 |
+
<name>mla_update_attachment_metadata_filter</name>
|
3114 |
+
<full_name>mla_update_attachment_metadata_filter</full_name>
|
3115 |
+
<docblock line="892">
|
3116 |
+
<description><![CDATA[Perform Custom Field mapping on just-inserted or updated attachment]]></description>
|
3117 |
+
<long-description><![CDATA[]]></long-description>
|
3118 |
+
<tag line="892" name="since" description="1.10"/>
|
3119 |
+
<tag line="892" name="param" description="Attachment metadata for just-inserted attachment" type="array" variable="$data">
|
3120 |
+
<type by_reference="false">array</type>
|
3121 |
+
</tag>
|
3122 |
+
<tag line="892" name="param" description="ID of just-inserted attachment" type="integer" variable="$post_id">
|
3123 |
+
<type by_reference="false">integer</type>
|
3124 |
+
</tag>
|
3125 |
+
<tag line="892" name="return" description="" type="void">
|
3126 |
+
<type by_reference="false">void</type>
|
3127 |
+
</tag>
|
3128 |
+
</docblock>
|
3129 |
+
<argument line="902">
|
3130 |
+
<name>$data</name>
|
3131 |
+
<default><![CDATA[]]></default>
|
3132 |
+
<type/>
|
3133 |
+
</argument>
|
3134 |
+
<argument line="902">
|
3135 |
+
<name>$post_id</name>
|
3136 |
+
<default><![CDATA[]]></default>
|
3137 |
+
<type/>
|
3138 |
+
</argument>
|
3139 |
+
</method>
|
3140 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="922" package="Media Library Assistant">
|
3141 |
+
<name>mla_custom_field_option_value</name>
|
3142 |
+
<full_name>mla_custom_field_option_value</full_name>
|
3143 |
+
<docblock line="913">
|
3144 |
+
<description><![CDATA[Fetch custom field option value given a slug]]></description>
|
3145 |
+
<long-description><![CDATA[]]></long-description>
|
3146 |
+
<tag line="913" name="since" description="1.10"/>
|
3147 |
+
<tag line="913" name="param" description="slug, e.g., 'c_file-size' for the 'File Size' field" type="string" variable="$slug">
|
3148 |
+
<type by_reference="false">string</type>
|
3149 |
+
</tag>
|
3150 |
+
<tag line="913" name="return" description="option value, e.g., array( 'name' => 'File Size', ... )" type="array">
|
3151 |
+
<type by_reference="false">array</type>
|
3152 |
+
</tag>
|
3153 |
+
</docblock>
|
3154 |
+
<argument line="922">
|
3155 |
+
<name>$slug</name>
|
3156 |
+
<default><![CDATA[]]></default>
|
3157 |
+
<type/>
|
3158 |
+
</argument>
|
3159 |
+
</method>
|
3160 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="942" package="Media Library Assistant">
|
3161 |
+
<name>mla_custom_field_support</name>
|
3162 |
+
<full_name>mla_custom_field_support</full_name>
|
3163 |
+
<docblock line="933">
|
3164 |
+
<description><![CDATA[Evaluate file information for custom field mapping]]></description>
|
3165 |
+
<long-description><![CDATA[]]></long-description>
|
3166 |
+
<tag line="933" name="since" description="1.10"/>
|
3167 |
+
<tag line="933" name="param" description="array format; 'default_columns' (default), 'default_hidden_columns', 'default_sortable_columns', 'quick_edit' or 'bulk_edit'" type="string" variable="$support_type">
|
3168 |
+
<type by_reference="false">string</type>
|
3169 |
+
</tag>
|
3170 |
+
<tag line="933" name="return" description="default, hidden, sortable quick_edit or bulk_edit colums in appropriate format" type="array">
|
3171 |
+
<type by_reference="false">array</type>
|
3172 |
+
</tag>
|
3173 |
+
</docblock>
|
3174 |
+
<argument line="942">
|
3175 |
+
<name>$support_type</name>
|
3176 |
+
<default><![CDATA['default_columns']]></default>
|
3177 |
+
<type/>
|
3178 |
+
</argument>
|
3179 |
+
</method>
|
3180 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="988" package="Media Library Assistant">
|
3181 |
+
<name>_evaluate_file_information</name>
|
3182 |
+
<full_name>_evaluate_file_information</full_name>
|
3183 |
+
<docblock line="976">
|
3184 |
+
<description><![CDATA[Evaluate file information for custom field mapping]]></description>
|
3185 |
+
<long-description><![CDATA[]]></long-description>
|
3186 |
+
<tag line="976" name="since" description="1.10"/>
|
3187 |
+
<tag line="976" name="param" description="absolute path the the uploads base directory" type="string" variable="$upload_dir">
|
3188 |
+
<type by_reference="false">string</type>
|
3189 |
+
</tag>
|
3190 |
+
<tag line="976" name="param" description="_wp_attached_file meta_value array, indexed by post_id" type="array" variable="$wp_attached_files">
|
3191 |
+
<type by_reference="false">array</type>
|
3192 |
+
</tag>
|
3193 |
+
<tag line="976" name="param" description="_wp_attachment_metadata meta_value array, indexed by post_id" type="array" variable="$wp_attachment_metadata">
|
3194 |
+
<type by_reference="false">array</type>
|
3195 |
+
</tag>
|
3196 |
+
<tag line="976" name="param" description="post->ID of attachment" type="integer" variable="$post_id">
|
3197 |
+
<type by_reference="false">integer</type>
|
3198 |
+
</tag>
|
3199 |
+
<tag line="976" name="return" description="absolute_path, base_file, path, file_name, extension, dimensions, width, height, hwstring_small, array of intermediate sizes" type="array">
|
3200 |
+
<type by_reference="false">array</type>
|
3201 |
+
</tag>
|
3202 |
+
</docblock>
|
3203 |
+
<argument line="988">
|
3204 |
+
<name>$upload_dir</name>
|
3205 |
+
<default><![CDATA[]]></default>
|
3206 |
+
<type/>
|
3207 |
+
</argument>
|
3208 |
+
<argument line="988">
|
3209 |
+
<name>$wp_attached_files</name>
|
3210 |
+
<default><![CDATA[]]></default>
|
3211 |
+
<type/>
|
3212 |
+
</argument>
|
3213 |
+
<argument line="988">
|
3214 |
+
<name>$wp_attachment_metadata</name>
|
3215 |
+
<default><![CDATA[]]></default>
|
3216 |
+
<type/>
|
3217 |
+
</argument>
|
3218 |
+
<argument line="988">
|
3219 |
+
<name>$post_id</name>
|
3220 |
+
<default><![CDATA[]]></default>
|
3221 |
+
<type/>
|
3222 |
+
</argument>
|
3223 |
+
</method>
|
3224 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1061" package="Media Library Assistant">
|
3225 |
+
<name>_evaluate_data_source</name>
|
3226 |
+
<full_name>_evaluate_data_source</full_name>
|
3227 |
+
<docblock line="1048">
|
3228 |
+
<description><![CDATA[Evaluate custom field mapping data source]]></description>
|
3229 |
+
<long-description><![CDATA[]]></long-description>
|
3230 |
+
<tag line="1048" name="since" description="1.10"/>
|
3231 |
+
<tag line="1048" name="param" description="post->ID of attachment" type="integer" variable="$post_id">
|
3232 |
+
<type by_reference="false">integer</type>
|
3233 |
+
</tag>
|
3234 |
+
<tag line="1048" name="param" description="category/scope to evaluate against: custom_field_mapping or single_attachment_mapping" type="string" variable="$category">
|
3235 |
+
<type by_reference="false">string</type>
|
3236 |
+
</tag>
|
3237 |
+
<tag line="1048" name="param" description="data source name" type="string" variable="$data_source">
|
3238 |
+
<type by_reference="false">string</type>
|
3239 |
+
</tag>
|
3240 |
+
<tag line="1048" name="param" description="desired results format, default 'native'" type="string" variable="$format">
|
3241 |
+
<type by_reference="false">string</type>
|
3242 |
+
</tag>
|
3243 |
+
<tag line="1048" name="param" description="(optional) attachment_metadata, default NULL (use current postmeta database value)" type="array" variable="$attachment_metadata">
|
3244 |
+
<type by_reference="false">array</type>
|
3245 |
+
</tag>
|
3246 |
+
<tag line="1048" name="return" description="data source value" type="string">
|
3247 |
+
<type by_reference="false">string</type>
|
3248 |
+
</tag>
|
3249 |
+
</docblock>
|
3250 |
+
<argument line="1061">
|
3251 |
+
<name>$post_id</name>
|
3252 |
+
<default><![CDATA[]]></default>
|
3253 |
+
<type/>
|
3254 |
+
</argument>
|
3255 |
+
<argument line="1061">
|
3256 |
+
<name>$category</name>
|
3257 |
+
<default><![CDATA[]]></default>
|
3258 |
+
<type/>
|
3259 |
+
</argument>
|
3260 |
+
<argument line="1061">
|
3261 |
+
<name>$data_source</name>
|
3262 |
+
<default><![CDATA[]]></default>
|
3263 |
+
<type/>
|
3264 |
+
</argument>
|
3265 |
+
<argument line="1061">
|
3266 |
+
<name>$format</name>
|
3267 |
+
<default><![CDATA['native']]></default>
|
3268 |
+
<type/>
|
3269 |
+
</argument>
|
3270 |
+
<argument line="1061">
|
3271 |
+
<name>$attachment_metadata</name>
|
3272 |
+
<default><![CDATA[NULL]]></default>
|
3273 |
+
<type/>
|
3274 |
+
</argument>
|
3275 |
+
</method>
|
3276 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1301" package="Media Library Assistant">
|
3277 |
+
<name>mla_evaluate_custom_field_mapping</name>
|
3278 |
+
<full_name>mla_evaluate_custom_field_mapping</full_name>
|
3279 |
+
<docblock line="1289">
|
3280 |
+
<description><![CDATA[Evaluate custom field mapping updates for a post]]></description>
|
3281 |
+
<long-description><![CDATA[]]></long-description>
|
3282 |
+
<tag line="1289" name="since" description="1.10"/>
|
3283 |
+
<tag line="1289" name="param" description="post ID to be evaluated" type="integer" variable="$post_id">
|
3284 |
+
<type by_reference="false">integer</type>
|
3285 |
+
</tag>
|
3286 |
+
<tag line="1289" name="param" description="category/scope to evaluate against: custom_field_mapping or single_attachment_mapping" type="string" variable="$category">
|
3287 |
+
<type by_reference="false">string</type>
|
3288 |
+
</tag>
|
3289 |
+
<tag line="1289" name="param" description="(optional) custom_field_mapping values, default NULL (use current option value)" type="array" variable="$settings">
|
3290 |
+
<type by_reference="false">array</type>
|
3291 |
+
</tag>
|
3292 |
+
<tag line="1289" name="param" description="(optional) attachment_metadata, default NULL (use current postmeta database value)" type="array" variable="$attachment_metadata">
|
3293 |
+
<type by_reference="false">array</type>
|
3294 |
+
</tag>
|
3295 |
+
<tag line="1289" name="return" description="Updates suitable for MLAData::mla_update_single_item, if any" type="array">
|
3296 |
+
<type by_reference="false">array</type>
|
3297 |
+
</tag>
|
3298 |
+
</docblock>
|
3299 |
+
<argument line="1301">
|
3300 |
+
<name>$post_id</name>
|
3301 |
+
<default><![CDATA[]]></default>
|
3302 |
+
<type/>
|
3303 |
+
</argument>
|
3304 |
+
<argument line="1301">
|
3305 |
+
<name>$category</name>
|
3306 |
+
<default><![CDATA[]]></default>
|
3307 |
+
<type/>
|
3308 |
+
</argument>
|
3309 |
+
<argument line="1301">
|
3310 |
+
<name>$settings</name>
|
3311 |
+
<default><![CDATA[NULL]]></default>
|
3312 |
+
<type/>
|
3313 |
+
</argument>
|
3314 |
+
<argument line="1301">
|
3315 |
+
<name>$attachment_metadata</name>
|
3316 |
+
<default><![CDATA[NULL]]></default>
|
3317 |
+
<type/>
|
3318 |
+
</argument>
|
3319 |
+
</method>
|
3320 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1337" package="Media Library Assistant">
|
3321 |
+
<name>_compose_custom_field_option_list</name>
|
3322 |
+
<full_name>_compose_custom_field_option_list</full_name>
|
3323 |
+
<docblock line="1327">
|
3324 |
+
<description><![CDATA[Compose a Custom Field Options list with current selection]]></description>
|
3325 |
+
<long-description><![CDATA[]]></long-description>
|
3326 |
+
<tag line="1327" name="since" description="1.10"/>
|
3327 |
+
<tag line="1327" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3328 |
+
<tag line="1327" name="param" description="current selection or 'none' (default)" type="string" variable="$selection">
|
3329 |
+
<type by_reference="false">string</type>
|
3330 |
+
</tag>
|
3331 |
+
<tag line="1327" name="return" description="HTML markup with select field options" type="string">
|
3332 |
+
<type by_reference="false">string</type>
|
3333 |
+
</tag>
|
3334 |
+
</docblock>
|
3335 |
+
<argument line="1337">
|
3336 |
+
<name>$selection</name>
|
3337 |
+
<default><![CDATA['none']]></default>
|
3338 |
+
<type/>
|
3339 |
+
</argument>
|
3340 |
+
</method>
|
3341 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1412" package="Media Library Assistant">
|
3342 |
+
<name>_compose_data_source_option_list</name>
|
3343 |
+
<full_name>_compose_data_source_option_list</full_name>
|
3344 |
+
<docblock line="1402">
|
3345 |
+
<description><![CDATA[Compose a (Custom Field) Data Source Options list with current selection]]></description>
|
3346 |
+
<long-description><![CDATA[]]></long-description>
|
3347 |
+
<tag line="1402" name="since" description="1.10"/>
|
3348 |
+
<tag line="1402" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3349 |
+
<tag line="1402" name="param" description="current selection or 'none' (default)" type="string" variable="$selection">
|
3350 |
+
<type by_reference="false">string</type>
|
3351 |
+
</tag>
|
3352 |
+
<tag line="1402" name="return" description="HTML markup with select field options" type="string">
|
3353 |
+
<type by_reference="false">string</type>
|
3354 |
+
</tag>
|
3355 |
+
</docblock>
|
3356 |
+
<argument line="1412">
|
3357 |
+
<name>$selection</name>
|
3358 |
+
<default><![CDATA['none']]></default>
|
3359 |
+
<type/>
|
3360 |
+
</argument>
|
3361 |
+
</method>
|
3362 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1463" package="Media Library Assistant">
|
3363 |
+
<name>_update_custom_field_mapping</name>
|
3364 |
+
<full_name>_update_custom_field_mapping</full_name>
|
3365 |
+
<docblock line="1453">
|
3366 |
+
<description><![CDATA[Update custom field mappings]]></description>
|
3367 |
+
<long-description><![CDATA[]]></long-description>
|
3368 |
+
<tag line="1453" name="since" description="1.10"/>
|
3369 |
+
<tag line="1453" name="param" description="current custom_field_mapping values" type="array" variable="$current_values">
|
3370 |
+
<type by_reference="false">array</type>
|
3371 |
+
</tag>
|
3372 |
+
<tag line="1453" name="param" description="new values" type="array" variable="$new_values">
|
3373 |
+
<type by_reference="false">array</type>
|
3374 |
+
</tag>
|
3375 |
+
<tag line="1453" name="return" description="( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )" type="array">
|
3376 |
+
<type by_reference="false">array</type>
|
3377 |
+
</tag>
|
3378 |
+
</docblock>
|
3379 |
+
<argument line="1463">
|
3380 |
+
<name>$current_values</name>
|
3381 |
+
<default><![CDATA[]]></default>
|
3382 |
+
<type/>
|
3383 |
+
</argument>
|
3384 |
+
<argument line="1463">
|
3385 |
+
<name>$new_values</name>
|
3386 |
+
<default><![CDATA[]]></default>
|
3387 |
+
<type/>
|
3388 |
+
</argument>
|
3389 |
+
</method>
|
3390 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1619" package="Media Library Assistant">
|
3391 |
+
<name>mla_custom_field_option_handler</name>
|
3392 |
+
<full_name>mla_custom_field_option_handler</full_name>
|
3393 |
+
<docblock line="1606">
|
3394 |
+
<description><![CDATA[Render and manage custom field mapping options]]></description>
|
3395 |
+
<long-description><![CDATA[]]></long-description>
|
3396 |
+
<tag line="1606" name="since" description="1.10"/>
|
3397 |
+
<tag line="1606" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3398 |
+
<tag line="1606" name="param" description="'render', 'update', 'delete', or 'reset'" type="string" variable="$action">
|
3399 |
+
<type by_reference="false">string</type>
|
3400 |
+
</tag>
|
3401 |
+
<tag line="1606" name="param" description="option name, e.g., 'custom_field_mapping'" type="string" variable="$key">
|
3402 |
+
<type by_reference="false">string</type>
|
3403 |
+
</tag>
|
3404 |
+
<tag line="1606" name="param" description="option parameters" type="array" variable="$value">
|
3405 |
+
<type by_reference="false">array</type>
|
3406 |
+
</tag>
|
3407 |
+
<tag line="1606" name="param" description="Optional. null (default) for 'render' else option data, e.g., $_REQUEST" type="array" variable="$args">
|
3408 |
+
<type by_reference="false">array</type>
|
3409 |
+
</tag>
|
3410 |
+
<tag line="1606" name="return" description="HTML table row markup for 'render' else message(s) reflecting the results of the operation." type="string">
|
3411 |
+
<type by_reference="false">string</type>
|
3412 |
+
</tag>
|
3413 |
+
</docblock>
|
3414 |
+
<argument line="1619">
|
3415 |
+
<name>$action</name>
|
3416 |
+
<default><![CDATA[]]></default>
|
3417 |
+
<type/>
|
3418 |
+
</argument>
|
3419 |
+
<argument line="1619">
|
3420 |
+
<name>$key</name>
|
3421 |
+
<default><![CDATA[]]></default>
|
3422 |
+
<type/>
|
3423 |
+
</argument>
|
3424 |
+
<argument line="1619">
|
3425 |
+
<name>$value</name>
|
3426 |
+
<default><![CDATA[]]></default>
|
3427 |
+
<type/>
|
3428 |
+
</argument>
|
3429 |
+
<argument line="1619">
|
3430 |
+
<name>$args</name>
|
3431 |
+
<default><![CDATA[null]]></default>
|
3432 |
+
<type/>
|
3433 |
+
</argument>
|
3434 |
+
</method>
|
3435 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1763" package="Media Library Assistant">
|
3436 |
+
<name>mla_evaluate_iptc_exif_mapping</name>
|
3437 |
+
<full_name>mla_evaluate_iptc_exif_mapping</full_name>
|
3438 |
+
<docblock line="1752">
|
3439 |
+
<description><![CDATA[Evaluate IPTC/EXIF mapping updates for a post]]></description>
|
3440 |
+
<long-description><![CDATA[]]></long-description>
|
3441 |
+
<tag line="1752" name="since" description="1.00"/>
|
3442 |
+
<tag line="1752" name="param" description="post object with current values" type="object" variable="$post">
|
3443 |
+
<type by_reference="false">object</type>
|
3444 |
+
</tag>
|
3445 |
+
<tag line="1752" name="param" description="category to evaluate against, e.g., iptc_exif_standard_mapping or iptc_exif_mapping" type="string" variable="$category">
|
3446 |
+
<type by_reference="false">string</type>
|
3447 |
+
</tag>
|
3448 |
+
<tag line="1752" name="param" description="(optional) iptc_exif_mapping values, default - current option value" type="array" variable="$settings">
|
3449 |
+
<type by_reference="false">array</type>
|
3450 |
+
</tag>
|
3451 |
+
<tag line="1752" name="return" description="Updates suitable for MLAData::mla_update_single_item, if any" type="array">
|
3452 |
+
<type by_reference="false">array</type>
|
3453 |
+
</tag>
|
3454 |
+
</docblock>
|
3455 |
+
<argument line="1763">
|
3456 |
+
<name>$post</name>
|
3457 |
+
<default><![CDATA[]]></default>
|
3458 |
+
<type/>
|
3459 |
+
</argument>
|
3460 |
+
<argument line="1763">
|
3461 |
+
<name>$category</name>
|
3462 |
+
<default><![CDATA[]]></default>
|
3463 |
+
<type/>
|
3464 |
+
</argument>
|
3465 |
+
<argument line="1763">
|
3466 |
+
<name>$settings</name>
|
3467 |
+
<default><![CDATA[NULL]]></default>
|
3468 |
+
<type/>
|
3469 |
+
</argument>
|
3470 |
+
</method>
|
3471 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1924" package="Media Library Assistant">
|
3472 |
+
<name>_compose_iptc_option_list</name>
|
3473 |
+
<full_name>_compose_iptc_option_list</full_name>
|
3474 |
+
<docblock line="1914">
|
3475 |
+
<description><![CDATA[Compose an IPTC Options list with current selection]]></description>
|
3476 |
+
<long-description><![CDATA[]]></long-description>
|
3477 |
+
<tag line="1914" name="since" description="1.00"/>
|
3478 |
+
<tag line="1914" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3479 |
+
<tag line="1914" name="param" description="current selection or 'none' (default)" type="string" variable="$selection">
|
3480 |
+
<type by_reference="false">string</type>
|
3481 |
+
</tag>
|
3482 |
+
<tag line="1914" name="return" description="HTML markup with select field options" type="string">
|
3483 |
+
<type by_reference="false">string</type>
|
3484 |
+
</tag>
|
3485 |
+
</docblock>
|
3486 |
+
<argument line="1924">
|
3487 |
+
<name>$selection</name>
|
3488 |
+
<default><![CDATA['none']]></default>
|
3489 |
+
<type/>
|
3490 |
+
</argument>
|
3491 |
+
</method>
|
3492 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1957" package="Media Library Assistant">
|
3493 |
+
<name>_compose_parent_option_list</name>
|
3494 |
+
<full_name>_compose_parent_option_list</full_name>
|
3495 |
+
<docblock line="1946">
|
3496 |
+
<description><![CDATA[Compose an hierarchical taxonomy Parent options list with current selection]]></description>
|
3497 |
+
<long-description><![CDATA[]]></long-description>
|
3498 |
+
<tag line="1946" name="since" description="1.00"/>
|
3499 |
+
<tag line="1946" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3500 |
+
<tag line="1946" name="param" description="taxonomy slug" type="string" variable="$taxonomy">
|
3501 |
+
<type by_reference="false">string</type>
|
3502 |
+
</tag>
|
3503 |
+
<tag line="1946" name="param" description="current selection or 0 (zero, default)" type="integer" variable="$selection">
|
3504 |
+
<type by_reference="false">integer</type>
|
3505 |
+
</tag>
|
3506 |
+
<tag line="1946" name="return" description="HTML markup with select field options" type="string">
|
3507 |
+
<type by_reference="false">string</type>
|
3508 |
+
</tag>
|
3509 |
+
</docblock>
|
3510 |
+
<argument line="1957">
|
3511 |
+
<name>$taxonomy</name>
|
3512 |
+
<default><![CDATA[]]></default>
|
3513 |
+
<type/>
|
3514 |
+
</argument>
|
3515 |
+
<argument line="1957">
|
3516 |
+
<name>$selection</name>
|
3517 |
+
<default><![CDATA[0]]></default>
|
3518 |
+
<type/>
|
3519 |
+
</argument>
|
3520 |
+
</method>
|
3521 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1991" package="Media Library Assistant">
|
3522 |
+
<name>_update_iptc_exif_standard_mapping</name>
|
3523 |
+
<full_name>_update_iptc_exif_standard_mapping</full_name>
|
3524 |
+
<docblock line="1981">
|
3525 |
+
<description><![CDATA[Update Standard field portion of IPTC/EXIF mappings]]></description>
|
3526 |
+
<long-description><![CDATA[]]></long-description>
|
3527 |
+
<tag line="1981" name="since" description="1.00"/>
|
3528 |
+
<tag line="1981" name="param" description="current iptc_exif_mapping values" type="array" variable="$current_values">
|
3529 |
+
<type by_reference="false">array</type>
|
3530 |
+
</tag>
|
3531 |
+
<tag line="1981" name="param" description="new values" type="array" variable="$new_values">
|
3532 |
+
<type by_reference="false">array</type>
|
3533 |
+
</tag>
|
3534 |
+
<tag line="1981" name="return" description="( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )" type="array">
|
3535 |
+
<type by_reference="false">array</type>
|
3536 |
+
</tag>
|
3537 |
+
</docblock>
|
3538 |
+
<argument line="1991">
|
3539 |
+
<name>$current_values</name>
|
3540 |
+
<default><![CDATA[]]></default>
|
3541 |
+
<type/>
|
3542 |
+
</argument>
|
3543 |
+
<argument line="1991">
|
3544 |
+
<name>$new_values</name>
|
3545 |
+
<default><![CDATA[]]></default>
|
3546 |
+
<type/>
|
3547 |
+
</argument>
|
3548 |
+
</method>
|
3549 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="2070" package="Media Library Assistant">
|
3550 |
+
<name>_update_iptc_exif_taxonomy_mapping</name>
|
3551 |
+
<full_name>_update_iptc_exif_taxonomy_mapping</full_name>
|
3552 |
+
<docblock line="2060">
|
3553 |
+
<description><![CDATA[Update Taxonomy term portion of IPTC/EXIF mappings]]></description>
|
3554 |
<long-description><![CDATA[]]></long-description>
|
3555 |
+
<tag line="2060" name="since" description="1.00"/>
|
3556 |
+
<tag line="2060" name="param" description="current iptc_exif_mapping values" type="array" variable="$current_values">
|
3557 |
+
<type by_reference="false">array</type>
|
3558 |
+
</tag>
|
3559 |
+
<tag line="2060" name="param" description="new values" type="array" variable="$new_values">
|
3560 |
+
<type by_reference="false">array</type>
|
3561 |
+
</tag>
|
3562 |
+
<tag line="2060" name="return" description="( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )" type="array">
|
3563 |
+
<type by_reference="false">array</type>
|
3564 |
</tag>
|
3565 |
</docblock>
|
3566 |
+
<argument line="2070">
|
3567 |
+
<name>$current_values</name>
|
3568 |
+
<default><![CDATA[]]></default>
|
3569 |
+
<type/>
|
3570 |
+
</argument>
|
3571 |
+
<argument line="2070">
|
3572 |
+
<name>$new_values</name>
|
3573 |
+
<default><![CDATA[]]></default>
|
3574 |
+
<type/>
|
3575 |
+
</argument>
|
3576 |
+
</method>
|
3577 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="2162" package="Media Library Assistant">
|
3578 |
+
<name>_update_iptc_exif_custom_mapping</name>
|
3579 |
+
<full_name>_update_iptc_exif_custom_mapping</full_name>
|
3580 |
+
<docblock line="2152">
|
3581 |
+
<description><![CDATA[Update Custom field portion of IPTC/EXIF mappings]]></description>
|
3582 |
<long-description><![CDATA[]]></long-description>
|
3583 |
+
<tag line="2152" name="since" description="1.00"/>
|
3584 |
+
<tag line="2152" name="param" description="current iptc_exif_mapping values" type="array" variable="$current_values">
|
3585 |
+
<type by_reference="false">array</type>
|
3586 |
+
</tag>
|
3587 |
+
<tag line="2152" name="param" description="new values" type="array" variable="$new_values">
|
3588 |
+
<type by_reference="false">array</type>
|
3589 |
+
</tag>
|
3590 |
+
<tag line="2152" name="return" description="( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )" type="array">
|
3591 |
+
<type by_reference="false">array</type>
|
3592 |
</tag>
|
3593 |
</docblock>
|
3594 |
+
<argument line="2162">
|
3595 |
+
<name>$current_values</name>
|
3596 |
+
<default><![CDATA[]]></default>
|
3597 |
+
<type/>
|
3598 |
+
</argument>
|
3599 |
+
<argument line="2162">
|
3600 |
+
<name>$new_values</name>
|
3601 |
+
<default><![CDATA[]]></default>
|
3602 |
+
<type/>
|
3603 |
+
</argument>
|
3604 |
+
</method>
|
3605 |
+
<method final="false" abstract="false" static="true" visibility="private" namespace="global" line="2258" package="Media Library Assistant">
|
3606 |
+
<name>_get_custom_field_names</name>
|
3607 |
+
<full_name>_get_custom_field_names</full_name>
|
3608 |
+
<docblock line="2251">
|
3609 |
+
<description><![CDATA[Generate a list of all (post) Custom Field names]]></description>
|
3610 |
<long-description><![CDATA[]]></long-description>
|
3611 |
+
<tag line="2251" name="since" description="1.00"/>
|
3612 |
+
<tag line="2251" name="return" description="Custom field names from the postmeta table" type="array">
|
3613 |
+
<type by_reference="false">array</type>
|
3614 |
</tag>
|
3615 |
</docblock>
|
3616 |
+
</method>
|
3617 |
+
<method final="false" abstract="false" static="true" visibility="public" namespace="global" line="2287" package="Media Library Assistant">
|
3618 |
+
<name>mla_iptc_exif_option_handler</name>
|
3619 |
+
<full_name>mla_iptc_exif_option_handler</full_name>
|
3620 |
+
<docblock line="2274">
|
3621 |
+
<description><![CDATA[Render and manage iptc/exif support options]]></description>
|
|
|
3622 |
<long-description><![CDATA[]]></long-description>
|
3623 |
+
<tag line="2274" name="since" description="1.00"/>
|
3624 |
+
<tag line="2274" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
|
3625 |
+
<tag line="2274" name="param" description="'render', 'update', 'delete', or 'reset'" type="string" variable="$action">
|
3626 |
<type by_reference="false">string</type>
|
3627 |
</tag>
|
|
|
|
|
|