Media Library Assistant - Version 0.1

Version Description

  • Initial release.

=

Download this release

Release Info

Developer dglingren
Plugin Icon 128x128 Media Library Assistant
Version 0.1
Comparing to
See all releases

Code changes from version 1.13 to 0.1

css/mla-style.css CHANGED
@@ -6,19 +6,6 @@
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,58 +61,3 @@ textarea[readonly] {
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
- }
6
  * to avoid conflicts.
7
  */
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /*
10
  * MLA List Table ID_parent column
11
  */
61
  .mla-media-item .describe textarea {
62
  width: 100%
63
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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,34 +16,13 @@
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,42 +34,21 @@ class MLAData {
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,58 +64,24 @@ class MLAData {
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,632 +93,185 @@ class MLAData {
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,12 +291,12 @@ class MLAData {
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,119 +307,27 @@ class MLAData {
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
@@ -951,48 +336,38 @@ class MLAData {
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,782 +375,140 @@ class MLAData {
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
-
1730
- return $terms_after;
1731
  }
1732
 
1733
- /**
1734
- * Format printable version of binary data
1735
- *
1736
- * @since 0.90
1737
- *
1738
- * @param string Binary data
1739
- * @param integer Bytes to format, default = 0 (all bytes)
1740
- * @param intger Bytes to format on each line
1741
- *
1742
- * @return string Printable representation of $data
1743
- */
1744
- private static function _hex_dump( $data, $limit = 0, $bytes_per_row = 16 ) {
1745
- if ( 0 == $limit )
1746
- $limit = strlen( $data );
1747
-
1748
- $position = 0;
1749
- $output = "\r\n";
1750
-
1751
- while ( $position < $limit ) {
1752
- $row_length = strlen( substr( $data, $position ) );
1753
-
1754
- if ( $row_length > ( $limit - $position ) )
1755
- $row_length = $limit - $position;
1756
-
1757
- if ( $row_length > $bytes_per_row )
1758
- $row_length = $bytes_per_row;
1759
-
1760
- $row_data = substr( $data, $position, $row_length );
1761
-
1762
- $print_string = '';
1763
- $hex_string = '';
1764
- for ( $index = 0; $index < $row_length; $index++ ) {
1765
- $char = ord( substr( $row_data, $index, 1 ) );
1766
- if ( ( 31 < $char ) && ( 127 > $char ) )
1767
- $print_string .= chr($char);
1768
- else
1769
- $print_string .= '.';
1770
-
1771
- $hex_string .= ' ' . bin2hex( chr($char) );
1772
- } // for
1773
-
1774
- $output .= str_pad( $print_string, $bytes_per_row, ' ', STR_PAD_RIGHT ) . $hex_string . "\r\n";
1775
- $position += $row_length;
1776
- } // while
1777
-
1778
- return $output;
1779
- }
1780
  } // class MLAData
1781
  ?>
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
  * Initialization function, similar to __construct()
21
  *
22
  * @since 0.1
23
  */
24
  public static function initialize() {
25
+ /* Nothing to do at this point. */
 
 
 
 
 
26
  }
27
 
28
  /**
34
  *
35
  * @since 0.1
36
  *
37
+ * @param string $filepath Complete path and name of the template file
 
38
  *
39
+ * @return string For files that do not contain template divider comments
40
+ * array For files containing template divider comments
41
+ * false If file does not exist
42
+ * NULL If file could not be loaded
 
43
  */
44
+ public static function mla_load_template( $filepath ) {
45
+ if ( !file_exists( $filepath ) )
46
+ return false;
47
+
48
+ $template = file_get_contents( $filepath, true );
49
+ if ( $template == false ) {
50
+ error_log( 'ERROR: mla_load_template file not found ' . var_export( $filepath, true ), 0 );
51
+ return NULL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  $match_count = preg_match_all( '#\<!-- template=".+" --\>#', $template, $matches, PREG_OFFSET_CAPTURE );
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
+ $template_array[ $template_key ] = $template_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $tpl A formatting string containing [+placeholders+]
82
+ * @param array $hash An associative array containing keys and values e.g. array('key' => 'value');
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
  }
94
 
95
  /**
96
+ * Sanitize and expand query arguments from request variables.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $request query parameters from web page, usually found in $_REQUEST
 
 
105
  *
106
  * @return array revised arguments suitable for WP_Query
107
  */
108
+ function mla_prepare_list_table_query( $request ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  /*
110
+ * ['m'] - filter by year and month of post, e.g., 201204
 
111
  */
112
+ $request['m'] = isset( $request['m'] ) ? (int) $request['m'] : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  /*
115
+ * ['att_cat'] - filter by attachment_category taxonomy
116
  *
117
+ * cat = '0' is "All Categories", i.e., no filtering
118
+ * cat = '-1' is "No Categories"
119
  */
120
+ if ( isset( $request['att_cat'] ) && ( $request['att_cat'] != '0' ) ) {
121
+ if ( $request['att_cat'] == '-1' ) {
122
+ $term_list = get_terms( 'attachment_category', array(
123
+ 'fields' => 'ids',
124
+ 'hide_empty' => true
125
+ ) );
126
+ $request['tax_query'] = array(
127
+ array(
128
+ 'taxonomy' => 'attachment_category',
129
+ 'field' => 'id',
130
+ 'terms' => $term_list,
131
+ 'operator' => 'NOT IN'
132
+ )
133
+ );
134
+ } else {
135
+ $request['tax_query'] = array(
136
+ array(
137
+ 'taxonomy' => 'attachment_category',
138
+ 'field' => 'id',
139
+ 'terms' => array(
140
+ (int) $request['att_cat']
 
 
 
 
141
  )
142
+ )
143
+ );
144
+ }
145
+ }
 
 
146
 
147
+ if ( isset( $request['attachment_category'] ) ) {
148
+ $request['tax_query'] = array(
149
  array(
150
+ 'taxonomy' => 'attachment_category',
151
  'field' => 'slug',
152
+ 'terms' => $request['attachment_category'],
153
  'include_children' => false
154
  )
155
  );
156
 
157
+ unset( $request['attachment_category'] );
158
+ }
 
159
 
160
+ $request['post_type'] = 'attachment';
161
+ $states = 'inherit';
162
+ if ( current_user_can( 'read_private_posts' ) )
163
+ $states .= ',private';
 
 
 
164
 
165
+ $request['post_status'] = isset( $request['status'] ) && 'trash' == $request['status'] ? 'trash' : $states;
 
 
 
 
 
 
 
 
 
 
 
 
 
166
 
167
  /*
168
+ * The caller must remove this filter if it is added.
 
 
169
  */
170
+ if ( isset( $request['detached'] ) )
171
+ add_filter( 'posts_where', 'MLAData::mla_query_list_table_items_helper' );
172
+
173
+ return $request;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
 
176
  /**
177
+ * Retrieve attachment objects for list table display.
 
 
178
  *
179
+ * Supports prepare_items in class-mla-list-table.php
180
+ * Modeled after wp_edit_attachments_query in wp-admin/post.php
181
+ *
182
+ * @since 0.1
183
  *
184
+ * @param array $request query parameters from web page, usually found in $_REQUEST
185
+ * @param string $orderby database column to sort by
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 array attachment objects (posts) including parent data, meta data and references
191
  */
192
+ public static function mla_query_list_table_items( $request, $orderby, $order, $offset, $count ) {
193
+ $request = self::mla_prepare_list_table_query( $request );
194
+
195
  /*
196
+ * There are two columns defined that end up sorting on post_title,
197
+ * so we can't use the database column to identify the column but
198
+ * we actually sort on the database column.
199
  */
200
+ if ( $orderby == 'title_name' )
201
+ $orderby = 'post_title';
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
+ * Add parent data
221
  */
222
+ $parent_data = self::_fetch_attachment_parent_data( $attachment->post_parent );
223
+ foreach ( $parent_data as $parent_key => $parent_value ) {
224
+ $attachments[ $index ]->$parent_key = $parent_value;
 
 
 
 
 
 
225
  }
226
 
227
+ /*
228
+ * Add meta data
229
+ */
230
+ $meta_data = self::_fetch_attachment_metadata( $attachment->ID );
231
+ foreach ( $meta_data as $meta_key => $meta_value ) {
232
+ $attachments[ $index ]->$meta_key = $meta_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
234
+ /*
235
+ * Add references
236
+ */
237
+ $references = self::mla_fetch_attachment_references( $attachment->ID, $attachment->post_parent );
238
+ $attachments[ $index ]->references = $references;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  }
240
+
241
+ return $attachments;
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 so callers can remove it after the query
249
  *
250
  * @since 0.1
251
  *
252
+ * @param string $where query clause before modification
253
  *
254
  * @return string query clause after "detached" item modification
255
  */
256
+ public static function mla_query_list_table_items_helper( $where ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  global $table_prefix;
258
+
259
+ return $where .= " AND {$table_prefix}posts.post_parent < 1";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $post_id The ID of the attachment post.
271
+ * @return Null on failure else associative array.
272
  */
273
  function mla_get_attachment_by_id( $post_id ) {
274
+ global $wpdb, $post;
275
 
276
  $item = get_post( $post_id );
277
  if ( empty( $item ) ) {
291
  /*
292
  * Add parent data
293
  */
294
+ $post_data = array_merge( $post_data, self::_fetch_attachment_parent_data( $post_data['post_parent'] ) );
295
 
296
  /*
297
  * Add meta data
298
  */
299
+ $post_data = array_merge( $post_data, self::_fetch_attachment_metadata( $post_id ) );
300
 
301
  /*
302
  * Add references
307
  }
308
 
309
  /**
310
+ * Find Featured Image and inserted image/link references to an attachment.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $ID post ID of attachment
318
+ * @param int $parent post ID of attachment's parent, if any
319
  *
320
+ * @return array Reference information; see $references array comments
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  */
322
  public static function mla_fetch_attachment_references( $ID, $parent ) {
323
  global $wpdb;
324
 
325
  /*
326
+ * found_reference true if either features or inserts is not empty()
327
+ * found_parent true if $parent matches a features or inserts post ID
 
328
  * is_unattached true if $parent is zero (0)
329
  * base_file relative path and name of the uploaded file, e.g., 2012/04/image.jpg
330
+ * path path to the file, relative to the "uploads/" directory
 
331
  * files base file and any other image size files. Array key is path and file name.
332
  * Non-image file value is a string containing file name without path
333
  * Image file value is an array with file name, width and height
336
  * inserts Array of specific files (i.e., sizes) found in one or more posts/pages
337
  * as an image (<img>) or link (<a href>). The array key is the path and file name.
338
  * The array value is an array with the ID, post_type and post_title of each reference
339
+ * file The name portion of the base file, e.g., image.jpg
 
 
 
340
  * parent_type 'post' or 'page' or the custom post type of the attachment's parent
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
+ 'file' => '',
 
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
+ $references['files'][ $references['base_file'] ] = $references['base_file'];
361
+ $last_slash = strrpos( $references['base_file'], '/' );
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
+ $references['files'][ $references['base_file'] ] = $references['base_file'];
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
  }
376
 
377
  }
 
 
 
 
 
 
 
378
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
 
380
  /*
381
+ * Look for the "Featured Image(s)"
382
  */
383
+ $features = $wpdb->get_results( "
384
+ SELECT post_id
385
+ FROM $wpdb->postmeta
386
+ WHERE meta_key = '_thumbnail_id'
387
+ AND meta_value = $ID
388
+ " );
389
+
390
+ if ( !empty( $features ) ) {
391
+ $references['found_reference'] = true;
392
+
393
+ foreach ( $features as $feature ) {
394
+ $feature_results = $wpdb->get_results( "
395
+ SELECT post_type, post_title
396
+ FROM $wpdb->posts
397
+ WHERE ID = $feature->post_id
398
+ " );
399
+ $references['features'][ $feature->post_id ] = $feature_results[0];
400
 
401
+ if ( $feature->post_id == $parent ) {
402
+ $references['found_parent'] = true;
403
+ $references['parent_type'] = $feature_results[0]->post_type;
404
+ $references['parent_title'] = $feature_results[0]->post_title;
405
+ }
406
+ } // foreach $feature
407
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
 
409
  /*
410
+ * Look for item(s) inserted in post_content
411
  */
412
+ foreach ( $references['files'] as $file => $file_data ) {
413
+ $inserts = $wpdb->get_results( "
414
+ SELECT ID, post_type, post_title
415
+ FROM $wpdb->posts
416
+ WHERE (
417
+ CONVERT(`post_content` USING utf8 )
418
+ LIKE '%$file%'
419
+ )
420
+ " );
 
 
421
 
422
+ if ( !empty( $inserts ) ) {
423
+ $references['found_reference'] = true;
424
+ $references['inserts'][ $file ] = $inserts;
425
+ foreach ( $inserts as $insert ) {
426
+ if ( $insert->ID == $parent ) {
427
+ $references['found_parent'] = true;
428
+ $references['parent_type'] = $insert->post_type;
429
+ $references['parent_title'] = $insert->post_title;
430
+ }
431
+ } // foreach $insert
432
+ }
433
+ } // foreach $file
434
 
 
 
 
 
 
 
435
  return $references;
436
  }
437
 
438
  /**
439
+ * Returns information about an attachment's parent, if found.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  *
441
+ * @since 0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  *
443
+ * @param int $parent_id post ID of attachment's parent, if any
 
 
 
444
  *
445
+ * @return array Parent information; post_date, post_title and post_type
446
  */
447
+ private static function _fetch_attachment_parent_data( $parent_id ) {
448
+ $parent_data = array();
449
+ if ( $parent_id ) {
450
+ $parent = get_post( $parent_id );
451
+ if ( isset( $parent->post_date ) )
452
+ $parent_data['parent_date'] = $parent->post_date;
453
+ if ( isset( $parent->post_title ) )
454
+ $parent_data['parent_title'] = $parent->post_title;
455
+ if ( isset( $parent->post_type ) )
456
+ $parent_data['parent_type'] = $parent->post_type;
457
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
 
459
+ return $parent_data;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  }
461
 
462
  /**
463
+ * Fetch and filter meta data for an attachment.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  *
465
+ * Returns a filtered array of a post's meta data. Internal values beginning with '_'
466
+ * are stripped out or converted to an 'mla_' equivalent. Array data is replaced with
467
+ * a string containing the first array element.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  *
469
+ * @since 0.1
470
  *
471
+ * @param int $post_id post ID of attachment
 
472
  *
473
  * @return array Meta data variables
474
  */
475
+ private static function _fetch_attachment_metadata( $post_id ) {
476
+ $results = array();
477
+ $post_meta = get_metadata( 'post', $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
 
479
+ if ( is_array( $post_meta ) ) {
480
+ foreach ( $post_meta as $post_meta_key => $post_meta_value ) {
481
+ if ( '_' == $post_meta_key{0} ) {
482
+ if ( stripos( $post_meta_key, '_wp_attached_file' ) === 0 ) {
483
+ $key = 'mla_wp_attached_file';
484
+ } elseif ( stripos( $post_meta_key, '_wp_attachment_metadata' ) === 0 ) {
485
+ $key = 'mla_wp_attachment_metadata';
486
+ $post_meta_value = unserialize( $post_meta_value[0] );
487
+ } elseif ( stripos( $post_meta_key, '_wp_attachment_image_alt' ) === 0 ) {
488
+ $key = 'mla_wp_attachment_image_alt';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  } else {
490
+ continue;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  }
492
+ } else {
493
+ if ( stripos( $post_meta_key, 'mla_' ) === 0 )
494
+ $key = $post_meta_key;
495
+ else
496
+ $key = 'mla_item_' . $post_meta_key;
 
 
 
 
 
497
  }
498
+
499
+ if ( is_array( $post_meta_value ) && count( $post_meta_value ) == 1 )
500
+ $value = $post_meta_value[0];
 
 
 
 
501
  else
502
+ $value = $post_meta_value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
 
504
+ $results[ $key ] = $value;
 
 
 
505
  }
506
+ /* foreach $post_meta */
 
 
 
 
507
  }
508
+ /* is_array($post_meta) */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
510
+ return $results;
 
 
 
 
511
  }
512
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
  } // class MLAData
514
  ?>
includes/class-mla-edit-media.php DELETED
@@ -1,407 +0,0 @@
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,16 +7,14 @@
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,10 +44,10 @@ class MLA_List_Table extends WP_List_Table {
46
  *
47
  * @var array
48
  */
49
- private $currently_hidden = array();
50
 
51
  /*
52
- * These arrays define the table columns.
53
  */
54
 
55
  /**
@@ -63,9 +61,6 @@ class MLA_List_Table extends WP_List_Table {
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,26 +73,21 @@ class MLA_List_Table extends WP_List_Table {
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,9 +95,6 @@ class MLA_List_Table extends WP_List_Table {
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,24 +102,20 @@ class MLA_List_Table extends WP_List_Table {
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,35 +129,27 @@ class MLA_List_Table extends WP_List_Table {
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,124 +164,6 @@ class MLA_List_Table extends WP_List_Table {
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,7 +179,7 @@ class MLA_List_Table extends WP_List_Table {
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,73 +197,35 @@ class MLA_List_Table extends WP_List_Table {
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,52 +234,8 @@ class MLA_List_Table extends WP_List_Table {
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,13 +274,13 @@ class MLA_List_Table extends WP_List_Table {
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,15 +291,6 @@ class MLA_List_Table extends WP_List_Table {
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,34 +302,24 @@ class MLA_List_Table extends WP_List_Table {
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,55 +329,6 @@ class MLA_List_Table extends WP_List_Table {
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,25 +339,11 @@ class MLA_List_Table extends WP_List_Table {
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,17 +356,23 @@ class MLA_List_Table extends WP_List_Table {
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,9 +388,9 @@ class MLA_List_Table extends WP_List_Table {
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,9 +406,9 @@ class MLA_List_Table extends WP_List_Table {
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,32 +421,7 @@ class MLA_List_Table extends WP_List_Table {
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,23 +433,17 @@ class MLA_List_Table extends WP_List_Table {
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,94 +458,26 @@ class MLA_List_Table extends WP_List_Table {
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,12 +488,7 @@ class MLA_List_Table extends WP_List_Table {
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,7 +502,7 @@ class MLA_List_Table extends WP_List_Table {
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,19 +514,7 @@ class MLA_List_Table extends WP_List_Table {
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,7 +526,7 @@ class MLA_List_Table extends WP_List_Table {
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,36 +561,7 @@ class MLA_List_Table extends WP_List_Table {
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,11 +570,7 @@ class MLA_List_Table extends WP_List_Table {
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,15 +590,12 @@ class MLA_List_Table extends WP_List_Table {
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,14 +603,80 @@ class MLA_List_Table extends WP_List_Table {
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,7 +705,7 @@ class MLA_List_Table extends WP_List_Table {
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,7 +722,7 @@ class MLA_List_Table extends WP_List_Table {
1109
  } else {
1110
  $columns['title_name'][ 1 ] = true;
1111
  }
1112
-
1113
  return $columns;
1114
  }
1115
 
@@ -1124,17 +737,12 @@ class MLA_List_Table extends WP_List_Table {
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,9 +756,9 @@ class MLA_List_Table extends WP_List_Table {
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,7 +782,7 @@ class MLA_List_Table extends WP_List_Table {
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,14 +806,16 @@ class MLA_List_Table extends WP_List_Table {
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,9 +827,8 @@ class MLA_List_Table extends WP_List_Table {
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,12 +843,10 @@ class MLA_List_Table extends WP_List_Table {
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,13 +857,13 @@ class MLA_List_Table extends WP_List_Table {
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,7 +883,7 @@ class MLA_List_Table extends WP_List_Table {
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,8 +891,6 @@ class MLA_List_Table extends WP_List_Table {
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,10 +899,18 @@ class MLA_List_Table extends WP_List_Table {
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,6 +919,12 @@ class MLA_List_Table extends WP_List_Table {
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,32 +933,124 @@ class MLA_List_Table extends WP_List_Table {
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,8 +1058,6 @@ class MLA_List_Table extends WP_List_Table {
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
  ?>
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 extends the core WP_List_Table class
 
 
18
  *
19
  * @package Media Library Assistant
20
  * @since 0.1
44
  *
45
  * @var array
46
  */
47
+ private $currently_hidden = array( );
48
 
49
  /*
50
+ * These arrays help define the table columns.
51
  */
52
 
53
  /**
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
  '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
+ 'categories'=> 'Att. Categories',
86
+ 'tags' => 'Att. Tags'
87
  );
88
 
89
  /**
90
+ * Default values for hdden columns
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
  * 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
  private static $default_hidden_columns = array(
103
  // 'ID_parent',
104
  // 'title_name',
105
+ 0 => 'post_title',
106
+ 1 => 'post_name',
107
+ 2 => 'parent',
 
108
  // 'featured',
109
  // 'inserted,
110
+ 3 => 'alt_text',
111
+ 4 => 'caption',
112
+ 5 => 'description',
113
+ 6 => 'base_file',
114
+ 7 => 'date',
115
+ 8 => 'author',
116
+ 9 => 'attached_to',
117
+ 10 => 'categories',
118
+ 11 => 'tags'
 
 
 
119
  );
120
 
121
  /**
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' => array('ID',false),
138
+ 'title_name' => array('title_name',false),
139
+ 'post_title' => array('post_title',false),
140
+ 'post_name' => array('name',false),
141
+ 'parent' => array('parent',false),
 
142
  // 'featured' => array('featured',false),
143
  // 'inserted' => array('inserted',false),
144
+ // 'alt_text' => array('alt_text',false),
 
 
145
  'caption' => array('post_excerpt',false),
146
  'description' => array('post_content',false),
147
+ // 'base_file' => array('base_file',false),
 
148
  'date' => array('post_date',false),
 
149
  'author' => array('post_author',false),
150
  'attached_to' => array('post_parent',false),
151
+ // 'categories' => array('categories',false),
152
+ // 'tags' => array('tags',false),
153
  );
154
 
155
  /**
164
  return MLA_List_Table::$default_hidden_columns;
165
  }
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  /**
168
  * Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'
169
  *
179
  *
180
  * @return array updated list of hidden columns
181
  */
182
+ public static function mla_manage_hidden_columns( $result, $option, $user_data ) {
183
  if ( $result )
184
  return $result;
185
  else
197
  *
198
  * @return array list of table columns
199
  */
200
+ public static function mla_manage_columns( )
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'] ) || isset( $_REQUEST['find_detached'] );
213
  $this->is_trash = isset( $_REQUEST['status'] ) && $_REQUEST['status'] == 'trash';
214
 
215
  //Set parent defaults
216
  parent::__construct( array(
217
+ 'singular' => 'attachment', //singular name of the listed records
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
+ * Called when the parent class can't find a method specifically built
227
+ * for a given column. All our columns should have a specific method,
228
+ * so this function returns a troubleshooting message.
 
 
229
  *
230
  * @since 0.1
231
  *
234
  * @return string Text or HTML to be placed inside the column
235
  */
236
  function column_default( $item, $column_name ) {
237
+ //Show the whole array for troubleshooting purposes
238
+ return 'column_default: ' . $column_name . ', ' . print_r( $item, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  }
240
 
241
  /**
274
  *
275
  * @since 0.1
276
  *
277
+ * @param array A singular attachment (post) object
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
  'page' => $_REQUEST['page'],
292
  'mla_item_ID' => $item->ID
293
  );
 
 
 
 
 
 
 
 
 
294
 
295
  if ( isset( $_REQUEST['detached'] ) )
296
  $view_args['detached'] = $_REQUEST['detached'];
302
  if ( isset( $_REQUEST['m'] ) )
303
  $view_args['m'] = $_REQUEST['m'];
304
 
305
+ if ( isset( $_REQUEST['att_cat'] ) )
306
+ $view_args['att_cat'] = $_REQUEST['att_cat'];
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
+ $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 ) ) . '">Edit</a>';
 
 
 
 
 
 
 
 
 
 
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
  return $actions;
330
  }
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  /**
333
  * Supply the content for a custom column
334
  *
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">(parent:%2$s)</span><br>%3$s', /*%1$s*/ $item->ID, /*%2$s*/ $item->post_parent, /*%3$s*/ $this->row_actions( $row_actions ) );
345
  } else {
346
+ return sprintf( '%1$s<br><span style="color:silver">(parent:%2$s)</span>', /*%1$s*/ $item->ID, /*%2$s*/ $item->post_parent );
347
  }
348
  }
349
 
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*/ $item->post_title, /*%2$s*/ $item->post_name, /*%3$s*/ $errors, /*%4$s*/ $this->row_actions( $row_actions ) );
374
  } else {
375
+ return sprintf( '%1$s<br>%2$s<br>%3$s', /*%1$s*/ $item->post_title, /*%2$s*/ $item->post_name, /*%3$s*/ $errors );
376
  }
377
  }
378
 
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
  $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
  * @return string HTML markup to be placed inside the column
422
  */
423
  function column_parent( $item ) {
424
+ return (string) $item->post_parent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  }
426
 
427
  /**
433
  * @return string HTML markup to be placed inside the column
434
  */
435
  function column_featured( $item ) {
 
 
 
436
  $value = '';
437
 
438
+ foreach ( $item->references['features'] as $feature_id => $feature ) {
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 (%2$s %3$s), %4$s', /*%1$s*/ $parent, /*%2$s*/ $feature->post_type, /*%3$s*/ $feature_id, /*%4$s*/ $feature->post_title ) . "<br>\r\n";
 
 
 
 
 
447
  } // foreach $feature
448
 
449
  return $value;
458
  * @return string HTML markup to be placed inside the column
459
  */
460
  function column_inserted( $item ) {
 
 
 
461
  $value = '';
462
 
463
+ foreach ( $item->references['inserts'] as $file => $inserts ) {
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 = '&nbsp;&nbsp;PARENT ';
471
  else
472
+ $parent = '&nbsp;&nbsp;';
473
 
474
+ $value .= 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 ) . "<br>\r\n";
 
 
 
 
 
475
  } // foreach $insert
476
  } // foreach $file
477
 
478
  return $value;
479
  }
480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  /**
482
  * Supply the content for a custom column
483
  *
488
  */
489
  function column_alt_text( $item ) {
490
  if ( isset( $item->mla_wp_attachment_image_alt ) )
491
+ return $item->mla_wp_attachment_image_alt;
 
 
 
 
 
492
  else
493
  return '';
494
  }
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
  * @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
  * @return string HTML markup to be placed inside the column
527
  */
528
  function column_base_file( $item ) {
529
+ return $item->references['base_file'];
530
  }
531
 
532
  /**
561
  /**
562
  * Supply the content for a custom column
563
  *
564
+ * @since 0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  *
566
  * @param array A singular attachment (post) object
567
  * @return string HTML markup to be placed inside the column
570
  $user = get_user_by( 'id', $item->post_author );
571
 
572
  if ( isset( $user->data->display_name ) )
573
+ return $user->data->display_name;
 
 
 
 
574
  else
575
  return 'unknown';
576
  }
590
  $parent_date = '';
591
 
592
  if ( isset( $item->parent_title ) )
593
+ $parent_title = $item->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
  }
604
 
605
  /**
606
+ * Supply the content for a custom column
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::mla_manage_columns();
680
  }
681
 
682
  /**
705
  * @since 0.1
706
  *
707
  * @return array Sortable column information,e.g.,
708
+ * 'slugs'=>array('data_values',bool)
709
  */
710
  function get_sortable_columns( ) {
711
  $columns = MLA_List_Table::$default_sortable_columns;
722
  } else {
723
  $columns['title_name'][ 1 ] = true;
724
  }
725
+
726
  return $columns;
727
  }
728
 
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( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
 
 
 
 
 
744
 
745
+ $post_mime_types = $this->_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
  'm' => $_REQUEST['m']
757
  ), $base_url );
758
 
759
+ if ( isset( $_REQUEST['att_cat'] ) )
760
  $base_url = add_query_arg( array(
761
+ 'att_cat' => $_REQUEST['att_cat']
762
  ), $base_url );
763
 
764
  foreach ( $matches as $type => $reals )
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 post_mimie_types
786
 
787
  $type_links['detached'] = '<a href="' . add_query_arg( array(
788
  'detached' => '1'
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
+ // $actions['edit'] = 'Edit';
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
  }
828
 
829
  /**
830
+ * Extra controls to be displayed between bulk actions and pagination.
831
+ * Modeled after class-wp-posts-list-table.php in wp-admin/includes
 
832
  *
833
  * @since 0.1
834
  *
843
  if ( 'top' == $which ) {
844
  $this->months_dropdown( 'attachment' );
845
 
846
+ if ( ( 'checked' == MLASettings::mla_get_option( 'attachment_category' ) ) && ( is_object_in_taxonomy( 'attachment', 'attachment_category' ) ) ) {
 
 
847
  $dropdown_options = array(
848
+ 'show_option_all' => 'All Categories',
849
+ 'show_option_none' => 'No Categories',
850
  'orderby' => 'ID',
851
  'order' => 'ASC',
852
  'show_count' => false,
857
  'echo' => true,
858
  'depth' => 3,
859
  'tab_index' => 0,
860
+ 'name' => 'att_cat',
861
  'id' => 'name',
862
  'class' => 'postform',
863
+ 'selected' => isset( $_REQUEST['att_cat'] ) ? $_REQUEST['att_cat'] : 0,
864
  'hierarchical' => true,
865
  'pad_counts' => false,
866
+ 'taxonomy' => 'attachment_category',
867
  'hide_if_empty' => false
868
  );
869
 
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
  * $this->set_pagination_args().
892
  *
893
  * @since 0.1
 
 
894
  */
895
  function prepare_items( ) {
896
  $this->_column_headers = array(
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
+ $current_page = $this->get_pagenum();
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
  $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
  '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
+ * Get possible mime types for view preparation.
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 0.1
1039
+ *
1040
+ * @param array Query variables, e.g., from $_REQUEST
1041
+ *
1042
+ * @return int Number of attachment posts
1043
+ */
1044
+ private function _count_list_table_items( $request )
1045
+ {
1046
+ $request = MLAData::mla_prepare_list_table_query( $request );
1047
+ unset( $request['paged'] ); // ignore pagination here - we need the total count
1048
+ $results = new WP_Query( $request );
1049
+
1050
+ if ( isset( $request['detached'] ) )
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
  * 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
+ add_filter( 'get_user_option_managemedia_page_mla-menucolumnshidden', 'MLA_List_Table::mla_manage_hidden_columns', 10, 3 );
1062
+ add_filter( 'manage_media_page_mla-menu_columns', 'MLA_List_Table::mla_manage_columns', 10, 0 );
 
 
1063
  ?>
includes/class-mla-main.php CHANGED
@@ -38,7 +38,7 @@ class MLA {
38
  *
39
  * @var string
40
  */
41
- const CURRENT_MLA_VERSION = '1.13';
42
 
43
  /**
44
  * Minimum version of PHP required for this plugin
@@ -56,7 +56,7 @@ class MLA {
56
  *
57
  * @var string
58
  */
59
- const MIN_WORDPRESS_VERSION = '3.3';
60
 
61
  /**
62
  * Slug for registering and enqueueing plugin style sheet
@@ -68,58 +68,13 @@ class MLA {
68
  const STYLESHEET_SLUG = 'mla-style';
69
 
70
  /**
71
- * Slug for localizing and enqueueing JavaScript - edit single item page
72
  *
73
  * @since 0.1
74
  *
75
  * @var string
76
  */
77
- const JAVASCRIPT_SINGLE_EDIT_SLUG = 'mla-single-edit-scripts';
78
-
79
- /**
80
- * Object name for localizing JavaScript - edit single item page
81
- *
82
- * @since 0.1
83
- *
84
- * @var string
85
- */
86
- const JAVASCRIPT_SINGLE_EDIT_OBJECT = 'mla_single_edit_vars';
87
-
88
- /**
89
- * Slug for localizing and enqueueing JavaScript - MLA List Table
90
- *
91
- * @since 0.20
92
- *
93
- * @var string
94
- */
95
- const JAVASCRIPT_INLINE_EDIT_SLUG = 'mla-inline-edit-scripts';
96
-
97
- /**
98
- * Object name for localizing JavaScript - MLA List Table
99
- *
100
- * @since 0.20
101
- *
102
- * @var string
103
- */
104
- const JAVASCRIPT_INLINE_EDIT_OBJECT = 'mla_inline_edit_vars';
105
-
106
- /**
107
- * Slug for localizing and enqueueing JavaScript - Add Media and related dialogs
108
- *
109
- * @since 1.13
110
- *
111
- * @var string
112
- */
113
- const JAVASCRIPT_MEDIA_POPUP_SLUG = 'mla-media-popup-scripts';
114
-
115
- /**
116
- * Object name for localizing JavaScript - Add Media and related dialogs
117
- *
118
- * @since 1.13
119
- *
120
- * @var string
121
- */
122
- const JAVASCRIPT_MEDIA_POPUP_OBJECT = 'mla_media_popup_vars';
123
 
124
  /**
125
  * Slug for adding plugin submenu
@@ -130,78 +85,6 @@ class MLA {
130
  */
131
  const ADMIN_PAGE_SLUG = 'mla-menu';
132
 
133
- /**
134
- * Action name; uniquely identifies the nonce
135
- *
136
- * @since 0.1
137
- *
138
- * @var string
139
- */
140
- const MLA_ADMIN_NONCE = 'mla_admin';
141
-
142
- /**
143
- * mla_admin_action value for permanently deleting a single item
144
- *
145
- * @since 0.1
146
- *
147
- * @var string
148
- */
149
- const MLA_ADMIN_SINGLE_DELETE = 'single_item_delete';
150
-
151
- /**
152
- * mla_admin_action value for displaying a single item
153
- *
154
- * @since 0.1
155
- *
156
- * @var string
157
- */
158
- const MLA_ADMIN_SINGLE_EDIT_DISPLAY = 'single_item_edit_display';
159
-
160
- /**
161
- * mla_admin_action value for updating a single item
162
- *
163
- * @since 0.1
164
- *
165
- * @var string
166
- */
167
- const MLA_ADMIN_SINGLE_EDIT_UPDATE = 'single_item_edit_update';
168
-
169
- /**
170
- * mla_admin_action value for restoring a single item from the trash
171
- *
172
- * @since 0.1
173
- *
174
- * @var string
175
- */
176
- const MLA_ADMIN_SINGLE_RESTORE = 'single_item_restore';
177
-
178
- /**
179
- * mla_admin_action value for moving a single item to the trash
180
- *
181
- * @since 0.1
182
- *
183
- * @var string
184
- */
185
- const MLA_ADMIN_SINGLE_TRASH = 'single_item_trash';
186
-
187
- /**
188
- * mla_admin_action value for mapping Custom Field metadata
189
- *
190
- * @since 1.10
191
- *
192
- * @var string
193
- */
194
- const MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP = 'single_item_custom_field_map';
195
-
196
- /**
197
- * mla_admin_action value for mapping IPTC/EXIF metadata
198
- *
199
- * @since 1.00
200
- *
201
- * @var string
202
- */
203
- const MLA_ADMIN_SINGLE_MAP = 'single_item_map';
204
-
205
  /**
206
  * Holds screen ids to match help text to corresponding screen
207
  *
@@ -209,71 +92,24 @@ class MLA {
209
  *
210
  * @var array
211
  */
212
- private static $page_hooks = array();
213
 
214
  /**
215
  * Initialization function, similar to __construct()
216
  *
217
- * This function contains add_action and add_filter calls
218
- * to set up the Ajax handlers, enqueue JavaScript and CSS files, and
219
- * set up the Assistant submenu.
220
- *
221
  * @since 0.1
222
- *
223
- * @return void
224
  */
225
  public static function initialize( )
226
  {
227
  MLATest::min_php_version( self::MIN_PHP_VERSION, self::PLUGIN_NAME );
228
  MLATest::min_WordPress_version( self::MIN_WORDPRESS_VERSION, self::PLUGIN_NAME );
229
 
230
- add_action( 'admin_init', 'MLA::mla_admin_init_action' );
231
  add_action( 'admin_enqueue_scripts', 'MLA::mla_admin_enqueue_scripts_action' );
232
  add_action( 'admin_menu', 'MLA::mla_admin_menu_action' );
233
  add_filter( 'set-screen-option', 'MLA::mla_set_screen_option_filter', 10, 3 ); // $status, $option, $value
234
  add_filter( 'screen_options_show_screen', 'MLA::mla_screen_options_show_screen_filter', 10, 2 ); // $show_screen, $this
235
  }
236
 
237
- /**
238
- * Load the plugin's Ajax handler or process Edit Media update actions
239
- *
240
- * @since 0.20
241
- *
242
- * @return void
243
- */
244
- public static function mla_admin_init_action() {
245
- /*
246
- * Process row-level actions from the Edit Media screen
247
- */
248
- if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
249
- check_admin_referer( self::MLA_ADMIN_NONCE );
250
-
251
- switch ( $_REQUEST['mla_admin_action'] ) {
252
- case self::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP:
253
- $updates = MLAOptions::mla_evaluate_custom_field_mapping( $_REQUEST['mla_item_ID'], 'single_attachment_mapping' );
254
-
255
- if ( !empty( $updates ) )
256
- $item_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
257
-
258
- $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
259
- wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $_REQUEST['mla_item_ID'] . '&action=edit&message=101' ), 302 );
260
- exit;
261
- case self::MLA_ADMIN_SINGLE_MAP:
262
- $item = get_post( $_REQUEST['mla_item_ID'] );
263
- $updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
264
- $page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
265
-
266
- $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
267
- wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $_REQUEST['mla_item_ID'] . '&action=edit&message=102' ), 302 );
268
- exit;
269
- default:
270
- // ignore the rest
271
- } // switch ($_REQUEST['mla_admin_action'])
272
- } // (!empty($_REQUEST['mla_admin_action'])
273
-
274
- add_action( 'wp_ajax_' . self::JAVASCRIPT_INLINE_EDIT_SLUG, 'MLA::mla_inline_edit_action' );
275
- }
276
-
277
  /**
278
  * Load the plugin's Style Sheet and Javascript files
279
  *
@@ -281,61 +117,25 @@ class MLA {
281
  *
282
  * @param string Name of the page being loaded
283
  *
284
- * @return void
285
  */
286
  public static function mla_admin_enqueue_scripts_action( $page_hook ) {
287
- // error_log('mla_admin_enqueue_scripts_action $page_hook = ' . var_export( $page_hook, true ), 0 );
288
- $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
289
-
290
- /* if( 'post.php' == $page_hook ) {
291
- wp_enqueue_script( self::JAVASCRIPT_MEDIA_POPUP_SLUG, MLA_PLUGIN_URL . "js/mla-media-popup-scripts{$suffix}.js",
292
- array( 'media-views' ), self::CURRENT_MLA_VERSION, false );
293
- $script_variables = array(
294
- 'menu_title' => 'MLA Custom Menu',
295
- 'button_title' => 'MLA Custom Button',
296
- 'comma' => _x( ',', 'tag delimiter' ),
297
- 'ajax_action' => self::JAVASCRIPT_MEDIA_POPUP_SLUG,
298
- 'ajax_nonce' => wp_create_nonce( self::MLA_ADMIN_NONCE )
299
- );
300
- wp_localize_script( self::JAVASCRIPT_MEDIA_POPUP_SLUG, self::JAVASCRIPT_MEDIA_POPUP_OBJECT, $script_variables );
301
- } */
302
-
303
- if ( ( 'media_page_mla-menu' != $page_hook ) && ( 'settings_page_mla-settings-menu' != $page_hook ) )
304
  return;
305
-
306
  wp_register_style( self::STYLESHEET_SLUG, MLA_PLUGIN_URL . 'css/mla-style.css', false, self::CURRENT_MLA_VERSION );
307
  wp_enqueue_style( self::STYLESHEET_SLUG );
308
-
309
  if ( isset( $_REQUEST['mla_admin_action'] ) && ( $_REQUEST['mla_admin_action'] == self::MLA_ADMIN_SINGLE_EDIT_DISPLAY ) ) {
310
- wp_enqueue_script( self::JAVASCRIPT_SINGLE_EDIT_SLUG, MLA_PLUGIN_URL . "js/mla-single-edit-scripts{$suffix}.js",
311
- array( 'wp-lists', 'suggest', 'jquery' ), self::CURRENT_MLA_VERSION, false );
312
- $script_variables = array(
313
- 'comma' => _x( ',', 'tag delimiter' ),
314
- 'Ajax_Url' => admin_url( 'admin-ajax.php' )
315
- );
316
- wp_localize_script( self::JAVASCRIPT_SINGLE_EDIT_SLUG, self::JAVASCRIPT_SINGLE_EDIT_OBJECT, $script_variables );
317
- }
318
- else {
319
- wp_enqueue_script( self::JAVASCRIPT_INLINE_EDIT_SLUG, MLA_PLUGIN_URL . "js/mla-inline-edit-scripts{$suffix}.js",
320
- array( 'wp-lists', 'suggest', 'jquery' ), self::CURRENT_MLA_VERSION, false );
321
-
322
- $fields = array( 'post_title', 'post_name', 'post_excerpt', 'image_alt', 'post_parent', 'menu_order', 'post_author' );
323
- $custom_fields = MLAOptions::mla_custom_field_support( 'quick_edit' );
324
- $custom_fields = array_merge( $custom_fields, MLAOptions::mla_custom_field_support( 'bulk_edit' ) );
325
- foreach ($custom_fields as $slug => $label ) {
326
- $fields[] = $slug;
327
- }
328
-
329
  $script_variables = array(
330
- 'fields' => $fields,
331
- 'error' => 'Error while saving the changes.',
332
- 'ntdeltitle' => 'Remove From Bulk Edit',
333
- 'notitle' => '(no title)',
334
- 'comma' => _x( ',', 'tag delimiter' ),
335
- 'ajax_action' => self::JAVASCRIPT_INLINE_EDIT_SLUG,
336
- 'ajax_nonce' => wp_create_nonce( self::MLA_ADMIN_NONCE )
337
  );
338
- wp_localize_script( self::JAVASCRIPT_INLINE_EDIT_SLUG, self::JAVASCRIPT_INLINE_EDIT_OBJECT, $script_variables );
339
  }
340
  }
341
 
@@ -343,16 +143,12 @@ class MLA {
343
  * Add the submenu pages
344
  *
345
  * Add a submenu page in the "Media" section,
346
- * add settings page in the "Settings" section.
347
- * add settings link in the Plugins section entry for MLA.
348
- *
349
- * For WordPress versions before 3.5,
350
  * add submenu page(s) for attachment taxonomies,
351
- * add filter to clean up taxonomy submenu labels.
 
 
352
  *
353
  * @since 0.1
354
- *
355
- * @return void
356
  */
357
  public static function mla_admin_menu_action( ) {
358
  $hook = add_submenu_page( 'upload.php', 'Media Library Assistant', 'Assistant', 'upload_files', self::ADMIN_PAGE_SLUG, 'MLA::mla_render_admin_page' );
@@ -363,33 +159,25 @@ class MLA {
363
  $taxonomies = get_object_taxonomies( 'attachment', 'objects' );
364
  if ( !empty( $taxonomies ) ) {
365
  foreach ( $taxonomies as $tax_name => $tax_object ) {
 
 
366
  /*
367
- * WordPress 3.5 adds native support for taxonomies
368
- */
369
- if( ! MLATest::$wordpress_3point5_plus ) {
370
- $hook = add_submenu_page( 'upload.php', $tax_object->label, $tax_object->label, 'manage_categories', 'mla-edit-tax-' . $tax_name, 'MLA::mla_edit_tax_redirect' );
371
- add_action( 'load-' . $hook, 'MLA::mla_edit_tax_redirect' );
372
- } // ! MLATest::$wordpress_3point5_plus
373
-
374
- /*
375
- * The page_hook we need for taxonomy edits is slightly different
376
  */
377
  $hook = 'edit-' . $tax_name;
378
- self::$page_hooks[ $hook ] = 't_' . $tax_name;
379
- } // foreach $taxonomies
380
 
381
  add_action( 'load-edit-tags.php', 'MLA::mla_add_help_tab' );
382
  }
383
 
384
- add_filter( 'parent_file', 'MLA::mla_parent_file_filter', 10, 1 );
385
  }
386
 
387
  /**
388
  * Add the "XX Entries per page" filter to the Screen Options tab
389
  *
390
  * @since 0.1
391
- *
392
- * @return void
393
  */
394
  public static function mla_add_menu_options( ) {
395
  $option = 'per_page';
@@ -403,92 +191,6 @@ class MLA {
403
  add_screen_option( $option, $args );
404
  }
405
 
406
- /**
407
- * Add contextual help tabs to all the MLA pages
408
- *
409
- * @since 0.1
410
- *
411
- * @return void
412
- */
413
- public static function mla_add_help_tab( )
414
- {
415
- $screen = get_current_screen();
416
-
417
- /*
418
- * Is this one of our pages?
419
- */
420
- if ( !array_key_exists( $screen->id, self::$page_hooks ) ) {
421
- return;
422
- }
423
-
424
- $file_suffix = $screen->id;
425
-
426
- /*
427
- * Override the screen suffix if we are going to display something other than the attachment table
428
- */
429
- if ( isset( $_REQUEST['mla_admin_action'] ) ) {
430
- switch ( $_REQUEST['mla_admin_action'] ) {
431
- case self::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
432
- $file_suffix = self::MLA_ADMIN_SINGLE_EDIT_DISPLAY;
433
- break;
434
- } // switch
435
- } // isset( $_REQUEST['mla_admin_action'] )
436
- else {
437
- /*
438
- * Use a generic page for edit taxonomy screens
439
- */
440
- if ( 't_' == substr( self::$page_hooks[ $file_suffix ], 0, 2 ) ) {
441
- $taxonomy = substr( self::$page_hooks[ $file_suffix ], 2 );
442
- switch ( $taxonomy ) {
443
- case 'attachment_category':
444
- case 'attachment_tag':
445
- break;
446
- default:
447
- $tax_object = get_taxonomy( $taxonomy );
448
-
449
- if ( $tax_object->hierarchical )
450
- $file_suffix = 'edit-hierarchical-taxonomy';
451
- else
452
- $file_suffix = 'edit-flat-taxonomy';
453
- } // $taxonomy switch
454
- } // is taxonomy
455
- }
456
-
457
- $template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/help-for-' . $file_suffix . '.tpl' );
458
- if ( empty( $template_array ) ) {
459
- return;
460
- }
461
-
462
- if ( !empty( $template_array['sidebar'] ) ) {
463
- $screen->set_help_sidebar( $template_array['sidebar'] );
464
- unset( $template_array['sidebar'] );
465
- }
466
-
467
- /*
468
- * Provide explicit control over tab order
469
- */
470
- $tab_array = array();
471
-
472
- foreach ( $template_array as $id => $content ) {
473
- $match_count = preg_match( '#\<!-- title="(.+)" order="(.+)" --\>#', $content, $matches, PREG_OFFSET_CAPTURE );
474
-
475
- if ( $match_count > 0 ) {
476
- $tab_array[ $matches[ 2 ][ 0 ] ] = array(
477
- 'id' => $id,
478
- 'title' => $matches[ 1 ][ 0 ],
479
- 'content' => $content
480
- );
481
- } else {
482
- error_log( 'ERROR: mla_add_help_tab discarding '.var_export( $id, true ), 0 );
483
- }
484
- }
485
-
486
- ksort( $tab_array, SORT_NUMERIC );
487
- foreach ( $tab_array as $indx => $value ) {
488
- $screen->add_help_tab( $value );
489
- }
490
- }
491
-
492
  /**
493
  * Only show screen options on the table-list screen
494
  *
@@ -515,7 +217,7 @@ class MLA {
515
  * @param string Name of the option being changed
516
  * @param string New value of the option
517
  *
518
- * @return string|void New value if this is our option, otherwise nothing
519
  */
520
  public static function mla_set_screen_option_filter( $status, $option, $value )
521
  {
@@ -523,43 +225,147 @@ class MLA {
523
  return $value;
524
  }
525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  /**
527
  * Redirect to the Edit Tags/Categories page
528
  *
529
  * The custom taxonomy add/edit submenu entries go to "upload.php" by default.
530
  * This filter is the only way to redirect them to the correct WordPress page.
531
- * The filter is not required for WordPress 3.5 and later.
532
  *
533
  * @since 0.1
 
 
 
 
 
 
 
 
 
 
 
 
534
  *
535
- * @return void
536
  */
537
- public static function mla_edit_tax_redirect( )
538
  {
 
 
539
  /*
540
- * WordPress 3.5 adds native support for taxonomies
541
  */
542
- if( MLATest::$wordpress_3point5_plus )
543
  return;
544
-
545
- $screen = get_current_screen();
546
-
547
- if ( isset( $_REQUEST['page'] ) && ( substr( $_REQUEST['page'], 0, 13 ) == 'mla-edit-tax-' ) ) {
548
- $taxonomy = substr( $_REQUEST['page'], 13 );
549
- wp_redirect( admin_url( 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=attachment' ), 302 );
550
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  }
552
  }
553
 
554
  /**
555
  * Cleanup menus for Edit Tags/Categories page
556
  *
557
- * For WordPress before 3.5, the submenu entries for custom taxonomies
558
- * under the "Media" menu are not set up correctly by WordPress, so this
559
- * function cleans them up, redirecting the request to the right WordPress
560
- * page for editing/adding taxonomy terms.
561
- * For WordPress 3.5 and later, the function fixes the submenu bolding when
562
- * going to the Edit Media screen.
563
  *
564
  * @since 0.1
565
  *
@@ -567,27 +373,15 @@ class MLA {
567
  *
568
  * @return string The updated top-level menu page
569
  */
570
- public static function mla_parent_file_filter( $parent_file ) {
571
- global $submenu_file, $submenu;
572
 
573
- /*
574
- * Make sure the "Assistant" submenu line is bolded when we go to the Edit Media page
575
- */
576
- if ( isset( $_REQUEST['mla_source'] ) )
577
- $submenu_file = 'mla-menu';
578
-
579
- /*
580
- * WordPress 3.5 adds native support for taxonomies
581
- */
582
- if( MLATest::$wordpress_3point5_plus )
583
- return $parent_file;
584
-
585
  if ( isset( $_REQUEST['taxonomy'] ) ) {
586
  $taxonomies = get_object_taxonomies( 'attachment', 'objects' );
587
 
588
  foreach ( $taxonomies as $tax_name => $tax_object ) {
589
  if ( $_REQUEST['taxonomy'] == $tax_name ) {
590
- $mla_page = 'mla-edit-tax-' . $tax_name;
591
  $real_page = 'edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment';
592
 
593
  foreach ( $submenu['upload.php'] as $submenu_index => $submenu_entry ) {
@@ -607,15 +401,13 @@ class MLA {
607
  * Render the "Assistant" subpage in the Media section, using the list_table package
608
  *
609
  * @since 0.1
610
- *
611
- * @return void
612
  */
613
  public static function mla_render_admin_page( ) {
614
  $bulk_action = self::_current_bulk_action();
615
 
616
  echo "<div class=\"wrap\">\r\n";
617
  echo "<div id=\"icon-upload\" class=\"icon32\"><br/></div>\r\n";
618
- echo "<h2>Media Library Assistant"; // trailing </h2> is action-specific
619
 
620
  if ( !current_user_can( 'upload_files' ) ) {
621
  echo " - Error</h2>\r\n";
@@ -627,17 +419,6 @@ class MLA {
627
  'body' => ''
628
  );
629
 
630
- /*
631
- * The category taxonomy is a special case because post_categories_meta_box() changes the input name
632
- */
633
- if ( !isset( $_REQUEST['tax_input'] ) )
634
- $_REQUEST['tax_input'] = array();
635
-
636
- if ( isset( $_REQUEST['post_category'] ) ) {
637
- $_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
638
- unset ( $_REQUEST['post_category'] );
639
- }
640
-
641
  /*
642
  * Process bulk actions that affect an array of items
643
  */
@@ -652,45 +433,7 @@ class MLA {
652
  case 'delete':
653
  $item_content = self::_delete_single_item( $post_id );
654
  break;
655
- case 'edit':
656
- if ( !empty( $_REQUEST['bulk_custom_field_map'] ) ) {
657
- $updates = MLAOptions::mla_evaluate_custom_field_mapping( $post_id, 'single_attachment_mapping' );
658
-
659
- $item_content = MLAData::mla_update_single_item( $post_id, $updates );
660
- break;
661
- }
662
-
663
- if ( !empty( $_REQUEST['bulk_map'] ) ) {
664
- $item = get_post( $post_id );
665
- $updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
666
-
667
- $item_content = MLAData::mla_update_single_item( $post_id, $updates );
668
- break;
669
- }
670
-
671
- $new_data = array() ;
672
- if ( isset( $_REQUEST['post_parent'] ) && is_numeric( $_REQUEST['post_parent'] ) )
673
- $new_data['post_parent'] = $_REQUEST['post_parent'];
674
-
675
- if ( isset( $_REQUEST['post_author'] ) && ( -1 != $_REQUEST['post_author'] ) )
676
- $new_data['post_author'] = $_REQUEST['post_author'];
677
-
678
- /*
679
- * Custom field support
680
- */
681
- $custom_fields = array();
682
- foreach (MLAOptions::mla_custom_field_support( 'bulk_edit' ) as $slug => $label ) {
683
- $field_name = $slug;
684
- if ( isset( $_REQUEST[ $field_name ] ) && ( ! empty( $_REQUEST[ $field_name ] ) ) ) {
685
- $custom_fields[ $label ] = $_REQUEST[ $field_name ];
686
- }
687
- }
688
-
689
- if ( ! empty( $custom_fields ) )
690
- $new_data[ 'custom_updates' ] = $custom_fields;
691
-
692
- $item_content = MLAData::mla_update_single_item( $post_id, $new_data, $_REQUEST['tax_input'], $_REQUEST['tax_action'] );
693
- break;
694
  case 'restore':
695
  $item_content = self::_restore_single_item( $post_id );
696
  break;
@@ -721,33 +464,34 @@ class MLA {
721
 
722
  switch ( $_REQUEST['mla_admin_action'] ) {
723
  case self::MLA_ADMIN_SINGLE_DELETE:
 
724
  $page_content = self::_delete_single_item( $_REQUEST['mla_item_ID'] );
725
  break;
726
  case self::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
727
- echo " - Edit single item</h2>";
728
  $page_content = self::_display_single_item( $_REQUEST['mla_item_ID'] );
729
  break;
730
  case self::MLA_ADMIN_SINGLE_EDIT_UPDATE:
 
731
  if ( !empty( $_REQUEST['update'] ) ) {
732
- $page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $_REQUEST['attachments'][ $_REQUEST['mla_item_ID'] ], $_REQUEST['tax_input'] );
733
- } elseif ( !empty( $_REQUEST['map-iptc-exif'] ) ) {
734
- $item = get_post( $_REQUEST['mla_item_ID'] );
735
- $updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
736
- $page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
737
  } else {
738
  $page_content = array(
739
- 'message' => 'Item: ' . $_REQUEST['mla_item_ID'] . ' cancelled.',
740
  'body' => ''
741
  );
742
  }
743
  break;
744
  case self::MLA_ADMIN_SINGLE_RESTORE:
 
745
  $page_content = self::_restore_single_item( $_REQUEST['mla_item_ID'] );
746
  break;
747
  case self::MLA_ADMIN_SINGLE_TRASH:
 
748
  $page_content = self::_trash_single_item( $_REQUEST['mla_item_ID'] );
749
  break;
750
  default:
 
751
  $page_content = array(
752
  'message' => sprintf( 'Unknown mla_admin_action - "%1$s"', $_REQUEST['mla_admin_action'] ),
753
  'body' => ''
@@ -756,13 +500,13 @@ class MLA {
756
  } // switch ($_REQUEST['mla_admin_action'])
757
  } // (!empty($_REQUEST['mla_admin_action'])
758
 
 
 
 
 
 
 
759
  if ( !empty( $page_content['body'] ) ) {
760
- if ( !empty( $page_content['message'] ) ) {
761
- echo " <div class=\"mla_messages\"><p>\r\n";
762
- echo ' ' . $page_content['message'] . "\r\n";
763
- echo " </p></div>\r\n"; // id="message"
764
- }
765
-
766
  echo $page_content['body'];
767
  } else {
768
  /*
@@ -780,18 +524,10 @@ class MLA {
780
  ), $_SERVER['REQUEST_URI'] );
781
 
782
  if ( !empty( $_REQUEST['heading_suffix'] ) ) {
783
- echo ' - ' . esc_html( $_REQUEST['heading_suffix'] ) . "</h2>\r\n";
784
- } elseif ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['mla-search-fields'] ) ) {
785
- echo ' - search results for "' . stripslashes( trim( $_REQUEST['s'] ) ) . "\"</h2>\r\n";
786
  } else
787
  echo "</h2>\r\n";
788
 
789
- if ( !empty( $page_content['message'] ) ) {
790
- echo " <div class=\"mla_messages\"><p>\r\n";
791
- echo ' ' . $page_content['message'] . "\r\n";
792
- echo " </p></div>\r\n"; // id="message"
793
- }
794
-
795
  // Create an instance of our package class...
796
  $MLAListTable = new MLA_List_Table();
797
 
@@ -800,59 +536,8 @@ class MLA {
800
  $MLAListTable->views();
801
 
802
  // Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions
803
- echo '<form id="mla-filter" action="' . admin_url( 'upload.php' ) . "\" method=\"get\">\r\n";
804
- /*
805
- * Compose the Search Media box
806
- */
807
- if ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['mla-search-fields'] ) ) {
808
- $search_value = esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) );
809
- $search_fields = $_REQUEST['mla-search-fields'];
810
- $search_connector = $_REQUEST['mla-search-connector'];
811
- } else {
812
- $search_value = '';
813
- $search_fields = array ( 'title', 'content' );
814
- $search_connector = 'AND';
815
- }
816
-
817
- echo '<p class="search-box">' . "\r\n";
818
- echo '<label class="screen-reader-text" for="media-search-input">Search Media:</label>' . "\r\n";
819
- echo '<input type="text" size="45" id="media-search-input" name="s" value="' . $search_value . '" />' . "\r\n";
820
- echo '<input type="submit" name="mla-search-submit" id="search-submit" class="button" value="Search Media" /><br>' . "\r\n";
821
- if ( 'OR' == $search_connector ) {
822
- echo '<input type="radio" name="mla-search-connector" value="AND" />&nbsp;and&nbsp;' . "\r\n";
823
- echo '<input type="radio" name="mla-search-connector" checked="checked" value="OR" />&nbsp;or&nbsp;' . "\r\n";
824
- } else {
825
- echo '<input type="radio" name="mla-search-connector" checked="checked" value="AND" />&nbsp;and&nbsp;' . "\r\n";
826
- echo '<input type="radio" name="mla-search-connector" value="OR" />&nbsp;or&nbsp;' . "\r\n";
827
- }
828
-
829
- if ( in_array( 'title', $search_fields ) )
830
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-title" checked="checked" value="title" />&nbsp;title&nbsp;' . "\r\n";
831
- else
832
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-title" value="title" />&nbsp;title&nbsp;' . "\r\n";
833
-
834
- if ( in_array( 'name', $search_fields ) )
835
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-name" checked="checked" value="name" />&nbsp;name&nbsp;' . "\r\n";
836
- else
837
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-name" value="name" />&nbsp;name&nbsp;' . "\r\n";
838
-
839
- if ( in_array( 'alt-text', $search_fields ) )
840
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-alt-text" checked="checked" value="alt-text" />&nbsp;ALT text&nbsp;' . "\r\n";
841
- else
842
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-alt-text" value="alt-text" />&nbsp;ALT text&nbsp;' . "\r\n";
843
-
844
- if ( in_array( 'excerpt', $search_fields ) )
845
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-excerpt" checked="checked" value="excerpt" />&nbsp;caption&nbsp;' . "\r\n";
846
- else
847
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-excerpt" value="excerpt" />&nbsp;caption&nbsp;' . "\r\n";
848
-
849
- if ( in_array( 'content', $search_fields ) )
850
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-content" checked="checked" value="content" />&nbsp;description&nbsp;' . "\r\n";
851
- else
852
- echo '<input type="checkbox" name="mla-search-fields[]" id="search-content" value="content" />&nbsp;description&nbsp;' . "\r\n";
853
-
854
- echo '</p>' . "\r\n";
855
-
856
  /*
857
  * We also need to ensure that the form posts back to our current page and remember all the view arguments
858
  */
@@ -870,317 +555,24 @@ class MLA {
870
  if ( isset( $_REQUEST['m'] ) ) // filter by date
871
  echo sprintf( '<input type="hidden" name="m" value="%1$s" />', $_REQUEST['m'] ) . "\r\n";
872
 
 
 
 
873
  // Now we can render the completed list table
874
  $MLAListTable->display();
875
- echo "</form><!-- id=mla-filter -->\r\n";
876
-
877
- /*
878
- * Insert the hidden form and table for inline edits (quick & bulk)
879
- */
880
- echo self::_build_inline_edit_form($MLAListTable);
881
-
882
- echo "<div id=\"ajax-response\"></div>\r\n";
883
- echo "<br class=\"clear\" />\r\n";
884
- echo "</div><!-- class=wrap -->\r\n";
885
- }
886
- }
887
-
888
- /**
889
- * Ajax handler for inline editing (quick and bulk edit)
890
- *
891
- * Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php
892
- *
893
- * @since 0.20
894
- *
895
- * @return void echo HTML <tr> markup for updated row or error message, then die()
896
- */
897
- public static function mla_inline_edit_action() {
898
- set_current_screen( $_REQUEST['screen'] );
899
-
900
- check_ajax_referer( self::MLA_ADMIN_NONCE, 'nonce' );
901
-
902
- if ( empty( $_REQUEST['post_ID'] ) ) {
903
- echo 'Error: no post ID found';
904
- die();
905
- }
906
- else
907
- $post_id = $_REQUEST['post_ID'];
908
-
909
- if ( ! current_user_can( 'edit_post', $post_id ) )
910
- wp_die( __( 'You are not allowed to edit this Attachment.' ) );
911
-
912
- /*
913
- * Custom field support
914
- */
915
- $custom_fields = array();
916
- foreach (MLAOptions::mla_custom_field_support( 'quick_edit' ) as $slug => $label ) {
917
- $field_name = $slug;
918
- if ( isset( $_REQUEST[ $field_name ] ) ) {
919
- $custom_fields[ $label ] = $_REQUEST[ $field_name ];
920
- unset ( $_REQUEST[ $field_name ] );
921
- }
922
- }
923
-
924
- if ( ! empty( $custom_fields ) )
925
- $_REQUEST[ 'custom_updates' ] = $custom_fields;
926
-
927
- /*
928
- * The category taxonomy is a special case because post_categories_meta_box() changes the input name
929
- */
930
- if ( !isset( $_REQUEST['tax_input'] ) )
931
- $_REQUEST['tax_input'] = array();
932
-
933
- if ( isset( $_REQUEST['post_category'] ) ) {
934
- $_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
935
- unset ( $_REQUEST['post_category'] );
936
- }
937
-
938
- if ( ! empty( $_REQUEST['tax_input'] ) ) {
939
- /*
940
- * Flat taxonomy strings must be cleaned up and duplicates removed
941
- */
942
- $tax_output = array();
943
- $tax_input = $_REQUEST['tax_input'];
944
- foreach ( $tax_input as $tax_name => $tax_value ) {
945
- if ( ! is_array( $tax_value ) ) {
946
- $comma = _x( ',', 'tag delimiter' );
947
- if ( ',' != $comma )
948
- $tax_value = str_replace( $comma, ',', $tax_value );
949
-
950
- $tax_value = preg_replace( '#\s*,\s*#', ',', $tax_value );
951
- $tax_value = preg_replace( '#,+#', ',', $tax_value );
952
- $tax_value = preg_replace( '#[,\s]+$#', '', $tax_value );
953
- $tax_value = preg_replace( '#^[,\s]+#', '', $tax_value );
954
-
955
- if ( ',' != $comma )
956
- $tax_value = str_replace( ',', $comma, $tax_value );
957
-
958
- $tax_array = array();
959
- $dedup_array = explode( $comma, $tax_value );
960
- foreach ( $dedup_array as $tax_value )
961
- $tax_array [$tax_value] = $tax_value;
962
-
963
- $tax_value = implode( $comma, $tax_array );
964
- } // ! array( $tax_value )
965
-
966
- $tax_output[$tax_name] = $tax_value;
967
- } // foreach $tax_input
968
- } // ! empty( $_REQUEST['tax_input'] )
969
- else
970
- $tax_output = NULL;
971
-
972
- $results = MLAData::mla_update_single_item( $post_id, $_REQUEST, $tax_output );
973
- $new_item = (object) MLAData::mla_get_attachment_by_id( $post_id );
974
-
975
- // Create an instance of our package class and echo the new HTML
976
- $MLAListTable = new MLA_List_Table();
977
- $MLAListTable->single_row( $new_item );
978
- die(); // this is required to return a proper result
979
- }
980
-
981
- /**
982
- * Build the hidden row templates for inline editing (quick and bulk edit)
983
- *
984
- * inspired by inline_edit() in wp-admin\includes\class-wp-posts-list-table.php.
985
- *
986
- * @since 0.20
987
- *
988
- * @param object MLA List Table object
989
- *
990
- * @return string HTML <form> markup for hidden rows
991
- */
992
- private static function _build_inline_edit_form( $MLAListTable ) {
993
- $taxonomies = get_object_taxonomies( 'attachment', 'objects' );
994
-
995
- $hierarchical_taxonomies = array();
996
- $flat_taxonomies = array();
997
- foreach ( $taxonomies as $tax_name => $tax_object ) {
998
- if ( $tax_object->hierarchical && $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit') ) {
999
- $hierarchical_taxonomies[$tax_name] = $tax_object;
1000
- } elseif ( $tax_object->show_ui && MLAOptions::mla_taxonomy_support($tax_name, 'quick-edit') ) {
1001
- $flat_taxonomies[$tax_name] = $tax_object;
1002
- }
1003
- }
1004
-
1005
- $page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-inline-edit-form.tpl' );
1006
- if ( ! array( $page_template_array ) ) {
1007
- error_log( "ERROR: MLA::_build_inline_edit_form \$page_template_array = " . var_export( $page_template_array, true ), 0 );
1008
- return '';
1009
- }
1010
-
1011
- if ( $authors = self::_authors_dropdown() ) {
1012
- $authors_dropdown = ' <label class="inline-edit-author">' . "\r\n";
1013
- $authors_dropdown .= ' <span class="title">' . __( 'Author' ) . '</span>' . "\r\n";
1014
- $authors_dropdown .= $authors . "\r\n";
1015
- $authors_dropdown .= ' </label>' . "\r\n";
1016
- }
1017
- else
1018
- $authors_dropdown = '';
1019
-
1020
- $custom_fields = '';
1021
- foreach (MLAOptions::mla_custom_field_support( 'quick_edit' ) as $slug => $label ) {
1022
- $page_values = array(
1023
- 'slug' => $slug,
1024
- 'label' => esc_attr( $label ),
1025
- );
1026
- $custom_fields .= MLAData::mla_parse_template( $page_template_array['custom_field'], $page_values );
1027
- }
1028
-
1029
- /*
1030
- * The middle column contains the hierarchical taxonomies, e.g., Attachment Category
1031
- */
1032
- $quick_middle_column = '';
1033
- $bulk_middle_column = '';
1034
-
1035
- if ( count( $hierarchical_taxonomies ) ) {
1036
- $quick_category_blocks = '';
1037
- $bulk_category_blocks = '';
1038
-
1039
- foreach ( $hierarchical_taxonomies as $tax_name => $tax_object ) {
1040
- if ( current_user_can( $tax_object->cap->assign_terms ) ) {
1041
- ob_start();
1042
- wp_terms_checklist( NULL, array( 'taxonomy' => $tax_name ) );
1043
- $tax_checklist = ob_get_contents();
1044
- ob_end_clean();
1045
-
1046
- $page_values = array(
1047
- 'tax_html' => esc_html( $tax_object->labels->name ),
1048
- 'tax_attr' => esc_attr( $tax_name ),
1049
- 'tax_checklist' => $tax_checklist
1050
- );
1051
- $category_block = MLAData::mla_parse_template( $page_template_array['category_block'], $page_values );
1052
- $taxonomy_options = MLAData::mla_parse_template( $page_template_array['taxonomy_options'], $page_values );
1053
-
1054
- $quick_category_blocks .= $category_block;
1055
- $bulk_category_blocks .= $category_block . $taxonomy_options;
1056
- } // current_user_can
1057
- } // foreach $hierarchical_taxonomies
1058
-
1059
- $page_values = array(
1060
- 'category_blocks' => $quick_category_blocks
1061
- );
1062
- $quick_middle_column = MLAData::mla_parse_template( $page_template_array['category_fieldset'], $page_values );
1063
-
1064
- $page_values = array(
1065
- 'category_blocks' => $bulk_category_blocks
1066
- );
1067
- $bulk_middle_column = MLAData::mla_parse_template( $page_template_array['category_fieldset'], $page_values );
1068
- } // count( $hierarchical_taxonomies )
1069
-
1070
- /*
1071
- * The right-hand column contains the flat taxonomies, e.g., Attachment Tag
1072
- */
1073
- $quick_right_column = '';
1074
- $bulk_right_column = '';
1075
-
1076
- if ( count( $flat_taxonomies ) ) {
1077
- $quick_tag_blocks = '';
1078
- $bulk_tag_blocks = '';
1079
-
1080
- foreach ( $flat_taxonomies as $tax_name => $tax_object ) {
1081
- if ( current_user_can( $tax_object->cap->assign_terms ) ) {
1082
- $page_values = array(
1083
- 'tax_html' => esc_html( $tax_object->labels->name ),
1084
- 'tax_attr' => esc_attr( $tax_name )
1085
- );
1086
- $tag_block = MLAData::mla_parse_template( $page_template_array['tag_block'], $page_values );
1087
- $taxonomy_options = MLAData::mla_parse_template( $page_template_array['taxonomy_options'], $page_values );
1088
-
1089
- $quick_tag_blocks .= $tag_block;
1090
- $bulk_tag_blocks .= $tag_block . $taxonomy_options;
1091
- } // current_user_can
1092
- } // foreach $flat_taxonomies
1093
-
1094
- $page_values = array(
1095
- 'tag_blocks' => $quick_tag_blocks
1096
- );
1097
- $quick_right_column = MLAData::mla_parse_template( $page_template_array['tag_fieldset'], $page_values );
1098
-
1099
- $page_values = array(
1100
- 'tag_blocks' => $bulk_tag_blocks
1101
- );
1102
- $bulk_right_column = MLAData::mla_parse_template( $page_template_array['tag_fieldset'], $page_values );
1103
- } // count( $flat_taxonomies )
1104
-
1105
- if ( $authors = self::_authors_dropdown( -1 ) ) {
1106
- $bulk_authors_dropdown = ' <label class="inline-edit-author">' . "\r\n";
1107
- $bulk_authors_dropdown .= ' <span class="title">' . __( 'Author' ) . '</span>' . "\r\n";
1108
- $bulk_authors_dropdown .= $authors . "\r\n";
1109
- $bulk_authors_dropdown .= ' </label>' . "\r\n";
1110
- }
1111
- else
1112
- $bulk_authors_dropdown = '';
1113
-
1114
- $bulk_custom_fields = '';
1115
- foreach (MLAOptions::mla_custom_field_support( 'bulk_edit' ) as $slug => $label ) {
1116
- $page_values = array(
1117
- 'slug' => $slug,
1118
- 'label' => esc_attr( $label ),
1119
- );
1120
- $bulk_custom_fields .= MLAData::mla_parse_template( $page_template_array['custom_field'], $page_values );
1121
- }
1122
-
1123
- $page_values = array(
1124
- 'colspan' => count( $MLAListTable->get_columns() ),
1125
- 'authors' => $authors_dropdown,
1126
- 'custom_fields' => $custom_fields,
1127
- 'quick_middle_column' => $quick_middle_column,
1128
- 'quick_right_column' => $quick_right_column,
1129
- 'bulk_middle_column' => $bulk_middle_column,
1130
- 'bulk_right_column' => $bulk_right_column,
1131
- 'bulk_authors' => $bulk_authors_dropdown,
1132
- 'bulk_custom_fields' => $bulk_custom_fields
1133
- );
1134
- $page_template = MLAData::mla_parse_template( $page_template_array['page'], $page_values );
1135
- return $page_template;
1136
- }
1137
-
1138
- /**
1139
- * Get the edit Authors dropdown box, if user has suitable permissions
1140
- *
1141
- * @since 0.20
1142
- *
1143
- * @param integer Optional User ID of the current author, default 0
1144
- * @param string Optional HTML name attribute, default 'post_author'
1145
- * @param string Optional HTML class attribute, default 'authors'
1146
- *
1147
- * @return string|false HTML markup for the dropdown field or False
1148
- */
1149
- private static function _authors_dropdown( $author = 0, $name = 'post_author', $class = 'authors' ) {
1150
- $post_type_object = get_post_type_object('attachment');
1151
- if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) {
1152
- $users_opt = array(
1153
- 'hide_if_only_one_author' => false,
1154
- 'who' => 'authors',
1155
- 'name' => $name,
1156
- 'class'=> $class,
1157
- 'multi' => 1,
1158
- 'echo' => 0
1159
- );
1160
-
1161
- if ( $author > 0 ) {
1162
- $users_opt['selected'] = $author;
1163
- $users_opt['include_selected'] = true;
1164
- }
1165
- elseif ( -1 == $author )
1166
- $users_opt['show_option_none'] = __( '&mdash; No Change &mdash;' );
1167
-
1168
- if ( $authors = wp_dropdown_users( $users_opt ) ) {
1169
- return $authors;
1170
- }
1171
  }
1172
-
1173
- return false;
1174
  }
1175
 
1176
  /**
1177
- * Get the current action selected from the bulk actions dropdown
1178
  *
1179
  * @since 0.1
1180
  *
1181
- * @return string|false The action name or False if no action was selected
1182
  */
1183
- private static function _current_bulk_action( ) {
 
1184
  $action = false;
1185
 
1186
  if ( isset( $_REQUEST['action'] ) ) {
@@ -1201,13 +593,12 @@ class MLA {
1201
  }
1202
 
1203
  /**
1204
- * Delete a single item permanently
1205
  *
1206
  * @since 0.1
1207
  *
1208
- * @param array The form POST data
1209
- *
1210
- * @return array success/failure message and NULL content
1211
  */
1212
  private static function _delete_single_item( $post_id ) {
1213
  if ( !current_user_can( 'delete_post', $post_id ) )
@@ -1235,28 +626,22 @@ class MLA {
1235
  * @since 0.1
1236
  *
1237
  * @param int The WordPress Post ID of the attachment item
1238
- *
1239
- * @return array message and/or HTML content
1240
  */
1241
  private static function _display_single_item( $post_id ) {
1242
  global $post;
1243
-
1244
  /*
1245
  * This function sets the global $post
1246
  */
1247
  $post_data = MLAData::mla_get_attachment_by_id( $post_id );
 
1248
  if ( !isset( $post_data ) )
1249
  return array(
1250
  'message' => 'ERROR: Could not retrieve Attachment.',
1251
  'body' => ''
1252
  );
1253
 
1254
- if ( ! current_user_can( 'edit_post', $post_id ) )
1255
- return array(
1256
- 'message' => 'You are not allowed to edit this Attachment.',
1257
- 'body' => ''
1258
- );
1259
-
1260
  if ( !empty( $post_data['mla_wp_attachment_metadata'] ) ) {
1261
  $page_template_array = MLAData::mla_load_template( MLA_PLUGIN_PATH . 'tpls/admin-display-single-image.tpl' );
1262
  $width = $post_data['mla_wp_attachment_metadata']['width'];
@@ -1272,112 +657,65 @@ class MLA {
1272
  $image_meta = '';
1273
  }
1274
 
1275
- if ( array( $page_template_array ) ) {
 
 
1276
  $page_template = $page_template_array['page'];
1277
- $authors_template = $page_template_array['authors'];
1278
  $postbox_template = $page_template_array['postbox'];
1279
  } else {
1280
  error_log( "ERROR: MLA::_display_single_item \$page_template_array = " . var_export( $page_template_array, true ), 0 );
1281
  $page_template = $page_template_array;
1282
- $authors_template = '';
1283
  $postbox_template = '';
1284
  }
1285
 
1286
- if ( empty($post_data['mla_references']['parent_title'] ) )
1287
- $parent_info = $post_data['mla_references']['parent_errors'];
1288
- else
1289
- $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'] );
1290
-
1291
- if ( $authors = self::_authors_dropdown( $post_data['post_author'], 'attachments[' . $post_data['ID'] . '][post_author]' ) ) {
1292
- $args = array (
1293
- 'ID' => $post_data['ID'],
1294
- 'authors' => $authors
1295
- );
1296
- $authors = MLAData::mla_parse_template( $authors_template, $args );
1297
- }
1298
- else
1299
- $authors = '';
1300
-
1301
- if ( MLAOptions::$process_featured_in ) {
1302
- $features = '';
1303
 
1304
- foreach ( $post_data['mla_references']['features'] as $feature_id => $feature ) {
1305
- if ( $feature_id == $post_data['post_parent'] )
1306
- $parent = 'PARENT ';
1307
- else
1308
- $parent = '';
1309
-
1310
- $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";
1311
- } // foreach $feature
1312
  }
1313
- else
1314
- $features = 'disabled';
1315
-
1316
- if ( MLAOptions::$process_inserted_in ) {
1317
- $inserts = '';
 
 
 
1318
 
1319
- foreach ( $post_data['mla_references']['inserts'] as $file => $insert_array ) {
1320
- $inserts .= $file . "\r\n";
1321
-
1322
- foreach ( $insert_array as $insert ) {
1323
- if ( $insert->ID == $post_data['post_parent'] )
1324
- $parent = ' PARENT ';
1325
- else
1326
- $parent = ' ';
1327
-
1328
- $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";
1329
- } // foreach $insert
1330
- } // foreach $file
1331
- }
1332
- else
1333
- $inserts = 'disabled';
1334
 
1335
- if ( MLAOptions::$process_gallery_in ) {
1336
- $galleries = '';
1337
-
1338
- foreach ( $post_data['mla_references']['galleries'] as $gallery_id => $gallery ) {
1339
- if ( $gallery_id == $post_data['post_parent'] )
1340
- $parent = 'PARENT ';
1341
- else
1342
- $parent = '';
1343
-
1344
- $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";
1345
- } // foreach $gallery
1346
- }
1347
- else
1348
- $galleries = 'disabled';
1349
-
1350
- if ( MLAOptions::$process_mla_gallery_in ) {
1351
- $mla_galleries = '';
1352
-
1353
- foreach ( $post_data['mla_references']['mla_galleries'] as $gallery_id => $gallery ) {
1354
- if ( $gallery_id == $post_data['post_parent'] )
1355
- $parent = 'PARENT ';
1356
  else
1357
- $parent = '';
1358
 
1359
- $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";
1360
- } // foreach $gallery
1361
- }
1362
- else
1363
- $mla_galleries = 'disabled';
1364
 
1365
  /*
1366
- * WordPress doesn't look in hidden fields to set the month filter dropdown or pagination filter
1367
  */
1368
  if ( isset( $_REQUEST['m'] ) )
1369
- $url_args = '&m=' . $_REQUEST['m'];
1370
  else
1371
- $url_args = '';
1372
-
1373
- if ( isset( $_REQUEST['post_mime_type'] ) )
1374
- $url_args .= '&post_mime_type=' . $_REQUEST['post_mime_type'];
1375
-
1376
- if ( isset( $_REQUEST['order'] ) )
1377
- $url_args .= '&order=' . $_REQUEST['order'];
1378
-
1379
- if ( isset( $_REQUEST['orderby'] ) )
1380
- $url_args .= '&orderby=' . $_REQUEST['orderby'];
1381
 
1382
  /*
1383
  * Add the current view arguments
@@ -1386,11 +724,13 @@ class MLA {
1386
  $view_args = '<input type="hidden" name="detached" value="' . $_REQUEST['detached'] . "\" />\r\n";
1387
  elseif ( isset( $_REQUEST['status'] ) )
1388
  $view_args = '<input type="hidden" name="status" value="' . $_REQUEST['status'] . "\" />\r\n";
 
 
1389
  else
1390
  $view_args = '';
1391
 
1392
- if ( isset( $_REQUEST['paged'] ) )
1393
- $view_args .= sprintf( '<input type="hidden" name="paged" value="%1$s" />', $_REQUEST['paged'] ) . "\r\n";
1394
 
1395
  $side_info_column = '';
1396
  $taxonomies = get_object_taxonomies( 'attachment', 'objects' );
@@ -1398,10 +738,10 @@ class MLA {
1398
  foreach ( $taxonomies as $tax_name => $tax_object ) {
1399
  ob_start();
1400
 
1401
- if ( $tax_object->hierarchical && $tax_object->show_ui ) {
1402
  $box = array(
1403
  'id' => $tax_name . 'div',
1404
- 'title' => esc_html( $tax_object->labels->name ),
1405
  'callback' => 'categories_meta_box',
1406
  'args' => array(
1407
  'taxonomy' => $tax_name
@@ -1409,10 +749,10 @@ class MLA {
1409
  'inside_html' => ''
1410
  );
1411
  post_categories_meta_box( $post, $box );
1412
- } elseif ( $tax_object->show_ui ) {
1413
  $box = array(
1414
  'id' => 'tagsdiv-' . $tax_name,
1415
- 'title' => esc_html( $tax_object->labels->name ),
1416
  'callback' => 'post_tags_meta_box',
1417
  'args' => array(
1418
  'taxonomy' => $tax_name
@@ -1428,47 +768,165 @@ class MLA {
1428
  }
1429
 
1430
  $page_values = array(
1431
- 'ID' => $post_data['ID'],
1432
- 'post_mime_type' => $post_data['post_mime_type'],
1433
- 'menu_order' => $post_data['menu_order'],
1434
- 'post_date' => $post_data['post_date'],
1435
- 'post_modified' => $post_data['post_modified'],
1436
- 'post_parent' => $post_data['post_parent'],
1437
- 'menu_order' => $post_data['menu_order'],
1438
  'attachment_icon' => wp_get_attachment_image( $post_id, array( 160, 120 ), true ),
1439
- 'file_name' => esc_html( $post_data['mla_references']['file'] ),
1440
  'width' => $width,
1441
  'height' => $height,
1442
- 'post_title_attr' => esc_attr( $post_data['post_title'] ),
1443
- 'post_name_attr' => esc_attr( $post_data['post_name'] ),
1444
- 'image_alt_attr' => '',
1445
- 'post_excerpt_attr' => esc_attr( $post_data['post_excerpt'] ),
1446
- 'post_content' => esc_textarea( $post_data['post_content'] ),
1447
- 'image_meta' => esc_textarea( $image_meta ),
1448
- 'parent_info' => esc_attr( $parent_info ),
1449
- 'guid_attr' => esc_attr( $post_data['guid'] ),
1450
- 'authors' => $authors,
1451
- 'features' => esc_textarea( $features ),
1452
- 'inserts' => esc_textarea( $inserts ),
1453
- 'galleries' => esc_textarea( $galleries ),
1454
- 'mla_galleries' => esc_textarea( $mla_galleries ),
1455
  'mla_admin_action' => self::MLA_ADMIN_SINGLE_EDIT_UPDATE,
1456
- 'form_url' => admin_url( 'upload.php' ) . '?page=' . self::ADMIN_PAGE_SLUG . $url_args,
 
1457
  'view_args' => $view_args,
1458
- 'wpnonce' => wp_nonce_field( self::MLA_ADMIN_NONCE, '_wpnonce', true, false ),
1459
  'side_info_column' => $side_info_column
1460
  );
1461
 
1462
- if ( !empty( $post_data['mla_wp_attachment_metadata'] ) ) {
1463
- $page_values['image_alt_attr'] = esc_attr( $post_data['mla_wp_attachment_image_alt'] );
1464
- }
1465
-
1466
  return array(
1467
- 'message' => '',
1468
  'body' => MLAData::mla_parse_template( $page_template, $page_values )
1469
  );
1470
  }
1471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1472
  /**
1473
  * Restore a single item from the Trash
1474
  *
@@ -1476,7 +934,7 @@ class MLA {
1476
  *
1477
  * @param array The form POST data
1478
  *
1479
- * @return array success/failure message and NULL content
1480
  */
1481
  private static function _restore_single_item( $post_id ) {
1482
  if ( !current_user_can( 'delete_post', $post_id ) )
@@ -1494,7 +952,7 @@ class MLA {
1494
  /*
1495
  * Posts are restored to "draft" status, so this must be updated.
1496
  */
1497
- $update_post = array();
1498
  $update_post['ID'] = $post_id;
1499
  $update_post['post_status'] = 'inherit';
1500
  wp_update_post( $update_post );
@@ -1511,8 +969,7 @@ class MLA {
1511
  * @since 0.1
1512
  *
1513
  * @param array The form POST data
1514
- *
1515
- * @return array success/failure message and NULL content
1516
  */
1517
  private static function _trash_single_item( $post_id ) {
1518
  if ( !current_user_can( 'delete_post', $post_id ) )
@@ -1532,5 +989,6 @@ class MLA {
1532
  'body' => ''
1533
  );
1534
  }
 
1535
  } // class MLA
1536
  ?>
38
  *
39
  * @var string
40
  */
41
+ const CURRENT_MLA_VERSION = '0.1';
42
 
43
  /**
44
  * Minimum version of PHP required for this plugin
56
  *
57
  * @var string
58
  */
59
+ const MIN_WORDPRESS_VERSION = '3.3.0';
60
 
61
  /**
62
  * Slug for registering and enqueueing plugin style sheet
68
  const STYLESHEET_SLUG = 'mla-style';
69
 
70
  /**
71
+ * Slug for localizing and enqueueing plugin JavaScript
72
  *
73
  * @since 0.1
74
  *
75
  * @var string
76
  */
77
+ const JAVASCRIPT_SLUG = 'mla-scripts';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
  /**
80
  * Slug for adding plugin submenu
85
  */
86
  const ADMIN_PAGE_SLUG = 'mla-menu';
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  /**
89
  * Holds screen ids to match help text to corresponding screen
90
  *
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
  MLATest::min_php_version( self::MIN_PHP_VERSION, self::PLUGIN_NAME );
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
  *
118
  * @param string Name of the page being loaded
119
  *
120
+ * @return nothing
121
  */
122
  public static function mla_admin_enqueue_scripts_action( $page_hook ) {
123
+ if ( 'media_page_mla-menu' != $page_hook )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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::JAVASCRIPT_SLUG, MLA_PLUGIN_URL . 'js/mla-scripts.js', array(
131
+ 'wp-lists',
132
+ 'suggest',
133
+ 'jquery'
134
+ ), self::CURRENT_MLA_VERSION, false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  $script_variables = array(
136
+ 'Ajax_Url' => admin_url( 'admin-ajax.php' )
 
 
 
 
 
 
137
  );
138
+ wp_localize_script( self::JAVASCRIPT_SLUG, 'mlascripts', $script_variables );
139
  }
140
  }
141
 
143
  * Add the submenu pages
144
  *
145
  * Add a submenu page in the "Media" section,
 
 
 
 
146
  * add submenu page(s) for attachment taxonomies,
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
  $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
+ * The hook we need for taxonomy edits is slightly different
 
 
 
 
 
 
 
 
166
  */
167
  $hook = 'edit-' . $tax_name;
168
+ self::$page_hooks[ $hook ] = $hook;
169
+ }
170
 
171
  add_action( 'load-edit-tags.php', 'MLA::mla_add_help_tab' );
172
  }
173
 
174
+ add_filter( 'parent_file', 'MLA::mla_modify_parent_menu', 10, 1 );
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
  add_screen_option( $option, $args );
192
  }
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  /**
195
  * Only show screen options on the table-list screen
196
  *
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
  {
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
  {
306
+ $screen = get_current_screen();
307
+
308
  /*
309
+ * Is this one of our pages?
310
  */
311
+ if ( !array_key_exists( $screen->id, self::$page_hooks ) ) {
312
  return;
313
+ }
314
+
315
+ $file_suffix = $screen->id;
316
+
317
+ /*
318
+ * Override the screen suffix if we are going to display something other than the attachment table
319
+ */
320
+ if ( isset( $_REQUEST['mla_admin_action'] ) ) {
321
+ switch ( $_REQUEST['mla_admin_action'] ) {
322
+ case self::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
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' );
329
+ if ( empty( $template_array ) ) {
330
+ return;
331
+ }
332
+
333
+ if ( !empty( $template_array['sidebar'] ) ) {
334
+ $screen->set_help_sidebar( $template_array['sidebar'] );
335
+ unset( $template_array['sidebar'] );
336
+ }
337
+
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 );
345
+
346
+ if ( $match_count > 0 ) {
347
+ $tab_array[ $matches[ 2 ][ 0 ] ] = array(
348
+ 'id' => $id,
349
+ 'title' => $matches[ 1 ][ 0 ],
350
+ 'content' => $content
351
+ );
352
+ } else {
353
+ // error_log('mla_add_help_tab discarding '.var_export($id, true), 0);
354
+ }
355
+ }
356
+
357
+ ksort( $tab_array, SORT_NUMERIC );
358
+ foreach ( $tab_array as $indx => $value ) {
359
+ $screen->add_help_tab( $value );
360
  }
361
  }
362
 
363
  /**
364
  * Cleanup menus for Edit Tags/Categories page
365
  *
366
+ * The submenu entries for custom taxonomies under the "Media" menu are not set up
367
+ * correctly by WordPress, so this function cleans them up, redirecting the request
368
+ * to the right WordPress page for editing/adding taxonomy terms.
 
 
 
369
  *
370
  * @since 0.1
371
  *
373
  *
374
  * @return string The updated top-level menu page
375
  */
376
+ public static function mla_modify_parent_menu( $parent_file ) {
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-tags-' . $tax_name;
385
  $real_page = 'edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment';
386
 
387
  foreach ( $submenu['upload.php'] as $submenu_index => $submenu_entry ) {
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"; // omit trailing </h2> for now
411
 
412
  if ( !current_user_can( 'upload_files' ) ) {
413
  echo " - Error</h2>\r\n";
419
  'body' => ''
420
  );
421
 
 
 
 
 
 
 
 
 
 
 
 
422
  /*
423
  * Process bulk actions that affect an array of items
424
  */
433
  case 'delete':
434
  $item_content = self::_delete_single_item( $post_id );
435
  break;
436
+ //case 'edit':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  case 'restore':
438
  $item_content = self::_restore_single_item( $post_id );
439
  break;
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>\r\n";
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 = self::_update_single_item( $_REQUEST['mla_item_ID'], $_REQUEST['attachments'][ $_REQUEST['mla_item_ID'] ], $_REQUEST['tax_input'] );
 
 
 
 
478
  } else {
479
  $page_content = array(
480
+ 'message' => 'Item: ' . $_REQUEST['mla_item_ID'] . ' cancelled.',
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
  } // 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
  ), $_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
  $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 "<form id=\"mla-filter\" action=\"/wp-admin/upload.php\" method=\"get\">\r\n";
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
  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>\r\n</div>\r\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
  }
 
 
565
  }
566
 
567
  /**
568
+ * Get the current action selected from the bulk actions dropdown.
569
  *
570
  * @since 0.1
571
  *
572
+ * @return string|bool The action name or False if no action was selected
573
  */
574
+ private static function _current_bulk_action( )
575
+ {
576
  $action = false;
577
 
578
  if ( isset( $_REQUEST['action'] ) ) {
593
  }
594
 
595
  /**
596
+ * Delete a single item permanently.
597
  *
598
  * @since 0.1
599
  *
600
+ * @param array The form POST data.
601
+ * @return array success/failure message and null content
 
602
  */
603
  private static function _delete_single_item( $post_id ) {
604
  if ( !current_user_can( 'delete_post', $post_id ) )
626
  * @since 0.1
627
  *
628
  * @param int The WordPress Post ID of the attachment item
629
+ * @return array message and/or HTML content.
 
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
  $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']['found_parent'] ) {
672
+ $parent_info = sprintf( '(%1$s) %2$s', $post_data['mla_references']['parent_type'], $post_data['mla_references']['parent_title'] );
673
+ } else {
674
+ $parent_info = '';
675
+ if ( !$post_data['mla_references']['found_reference'] )
676
+ $parent_info .= '(ORPHAN) ';
 
 
 
 
 
 
 
 
 
 
 
677
 
678
+ if ( $post_data['mla_references']['is_unattached'] )
679
+ $parent_info .= '(UNATTACHED) ';
680
+ else {
681
+ if ( !$post_data['mla_references']['found_parent'] )
682
+ $parent_info .= '(BAD PARENT) ';
683
+ }
 
 
684
  }
685
+
686
+ $features = '';
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
+ $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";
695
+ } // foreach $feature
 
 
 
 
 
 
 
 
 
 
 
 
 
696
 
697
+ $inserts = '';
698
+
699
+ foreach ( $post_data['mla_references']['inserts'] as $file => $insert_array ) {
700
+ $inserts .= $file . "\r\n";
701
+
702
+ foreach ( $insert_array as $insert ) {
703
+ if ( $insert->ID == $post_data['post_parent'] )
704
+ $parent = ' PARENT ';
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  else
706
+ $parent = ' ';
707
 
708
+ $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";
709
+ } // foreach $insert
710
+ } // foreach $file
 
 
711
 
712
  /*
713
+ * WordPress doesn't look in hidden fields to set the month filter dropdown
714
  */
715
  if ( isset( $_REQUEST['m'] ) )
716
+ $month = '&m=' . $_REQUEST['m'];
717
  else
718
+ $month = '';
 
 
 
 
 
 
 
 
 
719
 
720
  /*
721
  * Add the current view arguments
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['att_cat'] ) )
733
+ $view_args .= sprintf( '<input type="hidden" name="att_cat" value="%1$s" />', $_REQUEST['att_cat'] ) . "\r\n";
734
 
735
  $side_info_column = '';
736
  $taxonomies = get_object_taxonomies( 'attachment', 'objects' );
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
  'inside_html' => ''
750
  );
751
  post_categories_meta_box( $post, $box );
752
+ } else {
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
  }
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
+ 'image_meta' => $image_meta,
776
+ 'parent_info' => $parent_info,
777
+ 'features' => $features,
778
+ 'inserts' => $inserts,
 
 
 
 
 
 
 
 
 
779
  'mla_admin_action' => self::MLA_ADMIN_SINGLE_EDIT_UPDATE,
780
+ 'page' => self::ADMIN_PAGE_SLUG,
781
+ 'month' => $month,
782
  'view_args' => $view_args,
783
+ '_wpnonce' => wp_nonce_field( self::MLA_ADMIN_NONCE ),
784
  'side_info_column' => $side_info_column
785
  );
786
 
787
+ $page_template = MLAData::mla_parse_template( $page_template, $post_data );
 
 
 
788
  return array(
789
+ 'message' => '',
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
  *
935
  * @param array The form POST data
936
  *
937
+ * @return array success/failure message and null content
938
  */
939
  private static function _restore_single_item( $post_id ) {
940
  if ( !current_user_can( 'delete_post', $post_id ) )
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
  * @since 0.1
970
  *
971
  * @param array The form POST data
972
+ * @return array success/failure message and null content
 
973
  */
974
  private static function _trash_single_item( $post_id ) {
975
  if ( !current_user_can( 'delete_post', $post_id ) )
989
  'body' => ''
990
  );
991
  }
992
+
993
  } // class MLA
994
  ?>
includes/class-mla-objects.php DELETED
@@ -1,190 +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
- * 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 a tag is done with AJAX, and there's no current screen object
115
- */
116
- if ( isset( $_POST['action'] ) && ( 'add-tag' == $_POST['action'] ) ) {
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 a tag is done with AJAX, and there's no current screen object
150
- */
151
- if ( isset( $_POST['action'] ) && ( 'add-tag' == $_POST['action'] ) ) {
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
- 'post_type' => 'attachment',
168
- 'post_status' => 'inherit',
169
- 'tax_query' => array(
170
- array(
171
- 'taxonomy' => $taxonomy,
172
- 'field' => 'slug',
173
- 'terms' => $term->slug,
174
- 'include_children' => false
175
- ) )
176
- );
177
-
178
- $results = new WP_Query( $request );
179
- if ( ! empty( $results->error ) ){
180
- error_log( "ERROR: mla_taxonomy_column_filter( {$taxonomy} ) - WP_Query " . $results->error, 0 );
181
- return 0;
182
- }
183
-
184
- $tax_object = get_taxonomy($taxonomy);
185
-
186
- return sprintf( '<a href="%s">%d</a>', esc_url( add_query_arg(
187
- array( 'page' => 'mla-menu', 'mla-tax' => $taxonomy, 'mla-term' => $term->slug, 'heading_suffix' => urlencode( $tax_object->label . ':' . $term->name ) ), 'upload.php' ) ), $results->post_count );
188
- }
189
- } //Class MLAObjects
190
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-mla-options.php DELETED
@@ -1,2558 +0,0 @@
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>&nbsp;&nbsp;Dynamic = once every page load, Cached = once every login, Disabled = never.<br>&nbsp;&nbsp;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>&nbsp;&nbsp;Dynamic = once every page load, Cached = once every login, Disabled = never.<br>&nbsp;&nbsp;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.<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>&nbsp;&nbsp;Click Save Changes at the bottom of the screen if you change this option.<br>&nbsp;&nbsp;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' => '&nbsp;<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>&nbsp;&nbsp;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 ( $new_value['keep_existing'] )
1310
- $old_text = get_metadata( 'post', $post_id, $new_key, true );
1311
- else
1312
- $old_text = '';
1313
-
1314
- if ( empty( $old_text ) )
1315
- $custom_updates[ $new_value['name'] ] = self::_evaluate_data_source( $post_id, $category, $new_value['data_source'], $new_value['format'], $attachment_metadata );
1316
- } // foreach new setting
1317
-
1318
- if ( ! empty( $custom_updates ) )
1319
- $updates['custom_updates'] = $custom_updates;
1320
-
1321
- return $updates;
1322
- } // mla_evaluate_custom_field_mapping
1323
-
1324
- /**
1325
- * Compose a Custom Field Options list with current selection
1326
- *
1327
- * @since 1.10
1328
- * @uses $mla_option_templates contains row and table templates
1329
- *
1330
- * @param string current selection or 'none' (default)
1331
- *
1332
- * @return string HTML markup with select field options
1333
- */
1334
- private static function _compose_custom_field_option_list( $selection = 'none' ) {
1335
- $option_template = self::$mla_option_templates['custom-field-select-option'];
1336
- $option_values = array (
1337
- 'selected' => ( 'none' == $selection ) ? 'selected="selected"' : '',
1338
- 'value' => 'none',
1339
- 'text' => ' -- None (select a value) -- '
1340
- );
1341
-
1342
- $custom_field_options = MLAData::mla_parse_template( $option_template, $option_values );
1343
- $custom_field_names = MLAOptions::_get_custom_field_names();
1344
- foreach ( $custom_field_names as $value ) {
1345
- $option_values = array (
1346
- 'selected' => ( $value == $selection ) ? 'selected="selected"' : '',
1347
- 'value' => $value,
1348
- 'text' => $value
1349
- );
1350
-
1351
- $custom_field_options .= MLAData::mla_parse_template( $option_template, $option_values );
1352
- } // foreach custom_field_name
1353
-
1354
- return $custom_field_options;
1355
- } // _compose_custom_field_option_list
1356
-
1357
- /**
1358
- * Array of Data Source names for custom field mapping
1359
- *
1360
- * @since 1.10
1361
- *
1362
- * @var array
1363
- */
1364
- private static $custom_field_data_sources = array (
1365
- 'path',
1366
- 'file_name',
1367
- 'extension',
1368
- 'file_size',
1369
- 'dimensions',
1370
- 'pixels',
1371
- 'width',
1372
- 'height',
1373
- 'hwstring_small',
1374
- 'size_keys',
1375
- 'size_names',
1376
- 'size_bytes',
1377
- 'size_pixels',
1378
- 'size_dimensions',
1379
- 'size_name[size]',
1380
- 'size_bytes[size]',
1381
- 'size_pixels[size]',
1382
- 'size_dimensions[size]',
1383
- 'parent_type',
1384
- 'parent_title',
1385
- 'parent_issues',
1386
- 'reference_issues',
1387
- 'aperture',
1388
- 'credit',
1389
- 'camera',
1390
- 'caption',
1391
- 'created_timestamp',
1392
- 'copyright',
1393
- 'focal_length',
1394
- 'iso',
1395
- 'shutter_speed',
1396
- 'title'
1397
- );
1398
-
1399
- /**
1400
- * Compose a (Custom Field) Data Source Options list with current selection
1401
- *
1402
- * @since 1.10
1403
- * @uses $mla_option_templates contains row and table templates
1404
- *
1405
- * @param string current selection or 'none' (default)
1406
- *
1407
- * @return string HTML markup with select field options
1408
- */
1409
- private static function _compose_data_source_option_list( $selection = 'none' ) {
1410
- $option_template = self::$mla_option_templates['custom-field-select-option'];
1411
- $option_values = array (
1412
- 'selected' => ( 'none' == $selection ) ? 'selected="selected"' : '',
1413
- 'value' => 'none',
1414
- 'text' => ' -- None (select a value) -- '
1415
- );
1416
-
1417
- $custom_field_options = MLAData::mla_parse_template( $option_template, $option_values );
1418
- $intermediate_sizes = get_intermediate_image_sizes();
1419
-
1420
- foreach ( self::$custom_field_data_sources as $value ) {
1421
- $size_pos = strpos( $value, '[size]' );
1422
- if ( $size_pos ) {
1423
- $root_value = substr( $value, 0, $size_pos );
1424
- foreach( $intermediate_sizes as $size_name ) {
1425
- $value = $root_value . '[' . $size_name . ']';
1426
- $option_values = array (
1427
- 'selected' => ( $value == $selection ) ? 'selected="selected"' : '',
1428
- 'value' => $value,
1429
- 'text' => $value
1430
- );
1431
-
1432
- $custom_field_options .= MLAData::mla_parse_template( $option_template, $option_values );
1433
- } // foreach size_name
1434
- continue;
1435
- }
1436
- else {
1437
- $option_values = array (
1438
- 'selected' => ( $value == $selection ) ? 'selected="selected"' : '',
1439
- 'value' => $value,
1440
- 'text' => $value
1441
- );
1442
- }
1443
-
1444
- $custom_field_options .= MLAData::mla_parse_template( $option_template, $option_values );
1445
- } // foreach custom_field_name
1446
-
1447
- return $custom_field_options;
1448
- } // _compose_data_source_option_list
1449
-
1450
- /**
1451
- * Update custom field mappings
1452
- *
1453
- * @since 1.10
1454
- *
1455
- * @param array current custom_field_mapping values
1456
- * @param array new values
1457
- *
1458
- * @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
1459
- */
1460
- private static function _update_custom_field_mapping( $current_values, $new_values ) {
1461
- $error_list = '';
1462
- $message_list = '';
1463
- $settings_changed = false;
1464
-
1465
- foreach ( $new_values as $new_key => $new_value ) {
1466
- $any_setting_changed = false;
1467
-
1468
- /*
1469
- * Check for the addition of a new rule or field
1470
- */
1471
- if ( self::MLA_NEW_CUSTOM_FIELD == $new_key ) {
1472
- $new_key = trim( $new_value['name'] );
1473
-
1474
- if ( empty( $new_key ) )
1475
- continue;
1476
-
1477
- $message_list .= "<br>Adding new field {$new_key}.\r\n";
1478
- $any_setting_changed = true;
1479
- }
1480
- elseif ( self::MLA_NEW_CUSTOM_RULE == $new_key ) {
1481
- $new_key = trim( $new_value['name'] );
1482
-
1483
- if ( 'none' == $new_key )
1484
- continue;
1485
-
1486
- $message_list .= "<br>Adding new rule for {$new_key}.\r\n";
1487
- $any_setting_changed = true;
1488
- }
1489
- else {
1490
- /*
1491
- * Replace slug with field name
1492
- */
1493
- $new_key = trim( $new_value['name'] );
1494
- }
1495
-
1496
- if ( isset( $current_values[ $new_key ] ) ) {
1497
- $old_values = $current_values[ $new_key ];
1498
- $any_setting_changed = false;
1499
- }
1500
- else {
1501
- $old_values = array(
1502
- 'name' => $new_key,
1503
- 'data_source' => 'none',
1504
- 'keep_existing' => true,
1505
- 'format' => 'native',
1506
- 'mla_column' => false,
1507
- 'quick_edit' => false,
1508
- 'bulk_edit' => false
1509
- );
1510
- }
1511
-
1512
- if ( isset( $new_value['action'] ) ) {
1513
- if ( array_key_exists( 'delete_rule', $new_value['action'] ) || array_key_exists( 'delete_field', $new_value['action'] ) ) {
1514
- $settings_changed = true;
1515
- $message_list .= "<br>deleting rule for {$old_values['name']}.\r\n";
1516
- unset( $current_values[ $new_key ] );
1517
- continue;
1518
- } // delete rule
1519
- } // isset action
1520
-
1521
- if ( $old_values['data_source'] != $new_value['data_source'] ) {
1522
- $any_setting_changed = true;
1523
- $message_list .= "<br>{$old_values['name']} changing Data Source from {$old_values['data_source']} to {$new_value['data_source']}.\r\n";
1524
- $old_values['data_source'] = $new_value['data_source'];
1525
- }
1526
-
1527
- if ( $new_value['keep_existing'] ) {
1528
- $boolean_value = true;
1529
- $boolean_text = 'Replace to Keep';
1530
- }
1531
- else {
1532
- $boolean_value = false;
1533
- $boolean_text = 'Keep to Replace';
1534
- }
1535
- if ( $old_values['keep_existing'] != $boolean_value ) {
1536
- $any_setting_changed = true;
1537
- $message_list .= "<br>{$old_values['name']} changing Existing Text value from {$boolean_text}.\r\n";
1538
- $old_values['keep_existing'] = $boolean_value;
1539
- }
1540
-
1541
- if ( $old_values['format'] != $new_value['format'] ) {
1542
- $any_setting_changed = true;
1543
- $message_list .= "<br>{$old_values['name']} changing Format from {$old_values['format']} to {$new_value['format']}.\r\n";
1544
- $old_values['format'] = $new_value['format'];
1545
- }
1546
-
1547
- if ( isset( $new_value['mla_column'] ) ) {
1548
- $boolean_value = true;
1549
- $boolean_text = 'unchecked to checked';
1550
- }
1551
- else {
1552
- $boolean_value = false;
1553
- $boolean_text = 'checked to unchecked';
1554
- }
1555
- if ( $old_values['mla_column'] != $boolean_value ) {
1556
- $any_setting_changed = true;
1557
- $message_list .= "<br>{$old_values['name']} changing MLA Column value from {$boolean_text}.\r\n";
1558
- $old_values['mla_column'] = $boolean_value;
1559
- }
1560
-
1561
- if ( isset( $new_value['quick_edit'] ) ) {
1562
- $boolean_value = true;
1563
- $boolean_text = 'unchecked to checked';
1564
- }
1565
- else {
1566
- $boolean_value = false;
1567
- $boolean_text = 'checked to unchecked';
1568
- }
1569
- if ( $old_values['quick_edit'] != $boolean_value ) {
1570
- $any_setting_changed = true;
1571
- $message_list .= "<br>{$old_values['name']} changing Quick Edit value from {$boolean_text}.\r\n";
1572
- $old_values['quick_edit'] = $boolean_value;
1573
- }
1574
-
1575
- if ( isset( $new_value['bulk_edit'] ) ) {
1576
- $boolean_value = true;
1577
- $boolean_text = 'unchecked to checked';
1578
- }
1579
- else {
1580
- $boolean_value = false;
1581
- $boolean_text = 'checked to unchecked';
1582
- }
1583
- if ( $old_values['bulk_edit'] != $boolean_value ) {
1584
- $any_setting_changed = true;
1585
- $message_list .= "<br>{$old_values['name']} changing Bulk Edit value from {$boolean_text}.\r\n";
1586
- $old_values['bulk_edit'] = $boolean_value;
1587
- }
1588
-
1589
- if ( $any_setting_changed ) {
1590
- $settings_changed = true;
1591
- $current_values[ $new_key ] = $old_values;
1592
- }
1593
- } // foreach new value
1594
-
1595
- /*
1596
- * Uncomment this for debugging.
1597
- */
1598
- // $error_list .= $message_list;
1599
-
1600
- return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
1601
- } // _update_custom_field_mapping
1602
-
1603
- /**
1604
- * Render and manage custom field mapping options
1605
- *
1606
- * @since 1.10
1607
- * @uses $mla_option_templates contains row and table templates
1608
- *
1609
- * @param string 'render', 'update', 'delete', or 'reset'
1610
- * @param string option name, e.g., 'custom_field_mapping'
1611
- * @param array option parameters
1612
- * @param array Optional. null (default) for 'render' else option data, e.g., $_REQUEST
1613
- *
1614
- * @return string HTML table row markup for 'render' else message(s) reflecting the results of the operation.
1615
- */
1616
- public static function mla_custom_field_option_handler( $action, $key, $value, $args = null ) {
1617
- $current_values = self::mla_get_option( 'custom_field_mapping' );
1618
-
1619
- switch ( $action ) {
1620
- case 'render':
1621
- if (empty( $current_values ) ) {
1622
- $table_rows = MLAData::mla_parse_template( self::$mla_option_templates['custom-field-empty-row'], array( 'column_count' => 7 ) );
1623
- }
1624
- else {
1625
- $row_template = self::$mla_option_templates['custom-field-rule-row'];
1626
- $table_rows = '';
1627
- }
1628
-
1629
- foreach ( $current_values as $row_name => $current_value ) {
1630
- $row_values = array (
1631
- 'key' => sanitize_title( $row_name ),
1632
- 'name' => $row_name,
1633
- 'data_source_options' => self::_compose_data_source_option_list( $current_value['data_source'] ),
1634
- 'keep_selected' => '',
1635
- 'replace_selected' => '',
1636
- 'native_format' => '',
1637
- 'commas_format' => '',
1638
- 'mla_column_checked' => '',
1639
- 'quick_edit_checked' => '',
1640
- 'bulk_edit_checked' => '',
1641
- 'column_count' => 7
1642
- );
1643
-
1644
- if ( $current_value['keep_existing'] )
1645
- $row_values['keep_selected'] = 'selected="selected"';
1646
- else
1647
- $row_values['replace_selected'] = 'selected="selected"';
1648
-
1649
- switch( $current_value['format'] ) {
1650
- case 'native':
1651
- $row_values['native_format'] = 'selected="selected"';
1652
- break;
1653
- case 'commas':
1654
- $row_values['commas_format'] = 'selected="selected"';
1655
- break;
1656
- default:
1657
- $row_values['native_format'] = 'selected="selected"';
1658
- } // format
1659
-
1660
- if ( $current_value['mla_column'] )
1661
- $row_values['mla_column_checked'] = 'checked="checked"';
1662
-
1663
- if ( $current_value['quick_edit'] )
1664
- $row_values['quick_edit_checked'] = 'checked="checked"';
1665
-
1666
- if ( $current_value['bulk_edit'] )
1667
- $row_values['bulk_edit_checked'] = 'checked="checked"';
1668
-
1669
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
1670
- } // foreach current_value
1671
-
1672
- /*
1673
- * Add a row for defining a new Custom Rule
1674
- */
1675
- $row_template = self::$mla_option_templates['custom-field-new-rule-row'];
1676
- $row_values = array (
1677
- 'key' => self::MLA_NEW_CUSTOM_RULE,
1678
- 'field_name_options' => self::_compose_custom_field_option_list( 'none' ),
1679
- 'data_source_options' => self::_compose_data_source_option_list( 'none' ),
1680
- 'keep_selected' => '',
1681
- 'replace_selected' => 'selected="selected"',
1682
- 'native_format' => 'selected="selected"',
1683
- 'commas_format' => '',
1684
- 'mla_column_checked' => '',
1685
- 'quick_edit_checked' => '',
1686
- 'bulk_edit_checked' => '',
1687
- 'column_count' => 7
1688
- );
1689
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
1690
-
1691
- /*
1692
- * Add a row for defining a new Custom Field
1693
- */
1694
- $row_template = self::$mla_option_templates['custom-field-new-field-row'];
1695
- $row_values = array (
1696
- 'key' => self::MLA_NEW_CUSTOM_FIELD,
1697
- 'field_name_size' => '24',
1698
- 'data_source_options' => self::_compose_data_source_option_list( 'none' ),
1699
- 'keep_selected' => '',
1700
- 'replace_selected' => 'selected="selected"',
1701
- 'native_format' => 'selected="selected"',
1702
- 'commas_format' => '',
1703
- 'mla_column_checked' => '',
1704
- 'quick_edit_checked' => '',
1705
- 'bulk_edit_checked' => '',
1706
- 'column_count' => 7
1707
- );
1708
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
1709
-
1710
- $option_values = array (
1711
- 'table_rows' => $table_rows,
1712
- 'help' => $value['help']
1713
- );
1714
-
1715
- return MLAData::mla_parse_template( self::$mla_option_templates['custom-field-table'], $option_values );
1716
- case 'update':
1717
- case 'delete':
1718
- $settings_changed = false;
1719
- $messages = '';
1720
-
1721
- $results = self::_update_custom_field_mapping( $current_values, $args );
1722
- $messages .= $results['message'];
1723
- $current_values = $results['values'];
1724
- $settings_changed = $results['changed'];
1725
-
1726
- if ( $settings_changed ) {
1727
- $settings_changed = MLAOptions::mla_update_option( 'custom_field_mapping', $current_values );
1728
- if ( $settings_changed )
1729
- $results = "Custom field mapping rules updated.\r\n";
1730
- else
1731
- $results = "ERROR: Custom field mapping rules update failed.\r\n";
1732
- }
1733
- else
1734
- $results = "Custom field no mapping rule changes detected.\r\n";
1735
-
1736
- return $results . $messages;
1737
- case 'reset':
1738
- $current_values = self::$mla_option_definitions['custom_field_mapping']['std'];
1739
- $settings_changed = MLAOptions::mla_update_option( 'custom_field_mapping', $current_values );
1740
- if ( $settings_changed )
1741
- return "Custom field mapping settings saved.\r\n";
1742
- else
1743
- return "ERROR: Custom field mapping settings reset failed.\r\n";
1744
- default:
1745
- return "<br>ERROR: Custom {$key} unknown action: {$action}\r\n";
1746
- } // switch $action
1747
- } // mla_custom_field_option_handler
1748
-
1749
- /**
1750
- * Evaluate IPTC/EXIF mapping updates for a post
1751
- *
1752
- * @since 1.00
1753
- *
1754
- * @param object post object with current values
1755
- * @param string category to evaluate against, e.g., iptc_exif_standard_mapping or iptc_exif_mapping
1756
- * @param array (optional) iptc_exif_mapping values, default - current option value
1757
- *
1758
- * @return array Updates suitable for MLAData::mla_update_single_item, if any
1759
- */
1760
- public static function mla_evaluate_iptc_exif_mapping( $post, $category, $settings = NULL ) {
1761
- $metadata = MLAData::mla_fetch_attachment_image_metadata( $post->ID );
1762
- $iptc_metadata = $metadata['mla_iptc_metadata'];
1763
- $updates = array();
1764
- $update_all = ( 'iptc_exif_mapping' == $category );
1765
- if ( NULL == $settings )
1766
- $settings = self::mla_get_option( 'iptc_exif_mapping' );
1767
-
1768
- if ( $update_all || ( 'iptc_exif_standard_mapping' == $category ) ) {}{
1769
- foreach( $settings['standard'] as $new_key => $new_value ) {
1770
- $iptc_value = ( isset( $iptc_metadata[ $new_value['iptc_value'] ] ) ) ? $iptc_metadata[ $new_value['iptc_value'] ] : '';
1771
- $exif_value = MLAData::mla_exif_metadata_value( $new_value['exif_value'], $metadata );
1772
- $keep_existing = (boolean) $new_value['keep_existing'];
1773
-
1774
- if ( $new_value['iptc_first'] )
1775
- if ( ! empty( $iptc_value ) )
1776
- $new_text = $iptc_value;
1777
- else
1778
- $new_text = $exif_value;
1779
- else
1780
- if ( ! empty( $exif_value ) )
1781
- $new_text = $exif_value;
1782
- else
1783
- $new_text = $iptc_value;
1784
-
1785
- $new_text = trim( convert_chars( $new_text ) );
1786
- if ( !empty( $new_text ) )
1787
- switch ( $new_key ) {
1788
- case 'post_title':
1789
- if ( ( empty( $post->post_title ) || !$keep_existing ) &&
1790
- ( trim( $new_text ) && ! is_numeric( sanitize_title( $new_text ) ) ) )
1791
- $updates[ $new_key ] = $new_text;
1792
- break;
1793
- case 'post_name':
1794
- $updates[ $new_key ] = wp_unique_post_slug( sanitize_title( $new_text ), $post->ID, $post->post_status, $post->post_type, $post->post_parent);
1795
- break;
1796
- case 'image_alt':
1797
- $old_text = get_metadata( 'post', $post->ID, '_wp_attachment_image_alt', true );
1798
- if ( empty( $old_text ) || !$keep_existing ) {
1799
- $updates[ $new_key ] = $new_text; }
1800
- break;
1801
- case 'post_excerpt':
1802
- if ( empty( $post->post_excerpt ) || !$keep_existing )
1803
- $updates[ $new_key ] = $new_text;
1804
- break;
1805
- case 'post_content':
1806
- if ( empty( $post->post_content ) || !$keep_existing )
1807
- $updates[ $new_key ] = $new_text;
1808
- break;
1809
- default:
1810
- // ignore anything else
1811
- } // $new_key
1812
- } // foreach new setting
1813
- } // update standard field mappings
1814
-
1815
- if ( $update_all || ( 'iptc_exif_taxonomy_mapping' == $category ) ) {
1816
- $tax_inputs = array();
1817
- $tax_actions = array();
1818
-
1819
- foreach( $settings['taxonomy'] as $new_key => $new_value ) {
1820
- $iptc_value = ( isset( $iptc_metadata[ $new_value['iptc_value'] ] ) ) ? $iptc_metadata[ $new_value['iptc_value'] ] : '';
1821
- $exif_value = MLAData::mla_exif_metadata_value( $new_value['exif_value'], $metadata );
1822
-
1823
- $tax_action = ( $new_value['keep_existing'] ) ? 'add' : 'replace';
1824
- $tax_parent = ( isset( $new_value['parent'] ) && (0 != (integer) $new_value['parent'] ) ) ? (integer) $new_value['parent'] : 0;
1825
-
1826
- if ( $new_value['iptc_first'] )
1827
- if ( ! empty( $iptc_value ) )
1828
- $new_text = $iptc_value;
1829
- else
1830
- $new_text = $exif_value;
1831
- else
1832
- if ( ! empty( $exif_value ) )
1833
- $new_text = $exif_value;
1834
- else
1835
- $new_text = $iptc_value;
1836
-
1837
- if ( !empty( $new_text ) ) {
1838
- if ( $new_value['hierarchical'] ) {
1839
- if ( is_string( $new_text ) )
1840
- $new_text = array( $new_text );
1841
-
1842
- $new_terms = array();
1843
- foreach( $new_text as $new_term ) {
1844
- $term_object = term_exists( $new_term, $new_key );
1845
- if ($term_object !== 0 && $term_object !== null)
1846
- $new_terms[] = $term_object['term_id'];
1847
- else {
1848
- $term_object = wp_insert_term( $new_term, $new_key, array( 'parent' => $tax_parent ) );
1849
- if ( isset( $term_object['term_id'] ) )
1850
- $new_terms[] = $term_object['term_id'];
1851
- }
1852
- } // foreach new_term
1853
-
1854
- $tax_inputs[ $new_key ] = $new_terms;
1855
- } // hierarchical
1856
- else {
1857
- $tax_inputs[ $new_key ] = $new_text;
1858
- }
1859
-
1860
- $tax_actions[ $new_key ] = $tax_action;
1861
- } // new_text
1862
- } // foreach new setting
1863
-
1864
- if ( ! empty( $tax_inputs ) )
1865
- $updates['taxonomy_updates'] = array ( 'inputs' => $tax_inputs, 'actions' => $tax_actions );
1866
- } // update taxonomy term mappings
1867
-
1868
- if ( $update_all || ( 'iptc_exif_custom_mapping' == $category ) ) {
1869
- $custom_updates = array();
1870
-
1871
- foreach( $settings['custom'] as $new_key => $new_value ) {
1872
- $iptc_value = ( isset( $iptc_metadata[ $new_value['iptc_value'] ] ) ) ? $iptc_metadata[ $new_value['iptc_value'] ] : '';
1873
- $exif_value = MLAData::mla_exif_metadata_value( $new_value['exif_value'], $metadata );
1874
-
1875
- if ( $new_value['iptc_first'] )
1876
- if ( ! empty( $iptc_value ) )
1877
- $new_text = $iptc_value;
1878
- else
1879
- $new_text = $exif_value;
1880
- else
1881
- if ( ! empty( $exif_value ) )
1882
- $new_text = $exif_value;
1883
- else
1884
- $new_text = $iptc_value;
1885
-
1886
- if ( $new_value['keep_existing'] )
1887
- $old_text = get_metadata( 'post', $post->ID, $new_key, true );
1888
- else
1889
- $old_text = '';
1890
-
1891
- if ( empty( $old_text ) ) {
1892
- $custom_updates[ $new_key ] = $new_text;
1893
- }
1894
- } // foreach new setting
1895
-
1896
- if ( ! empty( $custom_updates ) )
1897
- $updates['custom_updates'] = $custom_updates;
1898
- } // update custom field mappings
1899
-
1900
- return $updates;
1901
- } // mla_evaluate_iptc_exif_mapping
1902
-
1903
- /**
1904
- * Compose an IPTC Options list with current selection
1905
- *
1906
- * @since 1.00
1907
- * @uses $mla_option_templates contains row and table templates
1908
- *
1909
- * @param string current selection or 'none' (default)
1910
- *
1911
- * @return string HTML markup with select field options
1912
- */
1913
- private static function _compose_iptc_option_list( $selection = 'none' ) {
1914
- $option_template = self::$mla_option_templates['iptc-exif-select-option'];
1915
- $option_values = array (
1916
- 'selected' => ( 'none' == $selection ) ? 'selected="selected"' : '',
1917
- 'value' => 'none',
1918
- 'text' => ' -- None (select a value) -- '
1919
- );
1920
-
1921
- $iptc_options = MLAData::mla_parse_template( $option_template, $option_values );
1922
- foreach ( MLAShortcodes::$mla_iptc_keys as $iptc_name => $iptc_code ) {
1923
- $option_values = array (
1924
- 'selected' => ( $iptc_code == $selection ) ? 'selected="selected"' : '',
1925
- 'value' => $iptc_code,
1926
- 'text' => $iptc_code . ' ' . $iptc_name
1927
- );
1928
-
1929
- $iptc_options .= MLAData::mla_parse_template( $option_template, $option_values );
1930
- } // foreach iptc_key
1931
-
1932
- return $iptc_options;
1933
- } // _compose_iptc_option_list
1934
-
1935
- /**
1936
- * Compose an hierarchical taxonomy Parent options list with current selection
1937
- *
1938
- * @since 1.00
1939
- * @uses $mla_option_templates contains row and table templates
1940
- *
1941
- * @param string taxonomy slug
1942
- * @param integer current selection or 0 (zero, default)
1943
- *
1944
- * @return string HTML markup with select field options
1945
- */
1946
- private static function _compose_parent_option_list( $taxonomy, $selection = 0 ) {
1947
- $option_template = self::$mla_option_templates['iptc-exif-select-option'];
1948
- $option_values = array (
1949
- 'selected' => ( 0 == $selection ) ? 'selected="selected"' : '',
1950
- 'value' => 0,
1951
- 'text' => ' -- None (select a value) -- '
1952
- );
1953
-
1954
- $parent_options = MLAData::mla_parse_template( $option_template, $option_values );
1955
-
1956
- $terms = get_terms( $taxonomy, array( 'orderby' => 'name', 'get' => 'all' ) );
1957
- foreach ( $terms as $term ) {
1958
- $option_values = array (
1959
- 'selected' => ( $term->term_id == $selection ) ? 'selected="selected"' : '',
1960
- 'value' => $term->term_id,
1961
- 'text' => $term->name
1962
- );
1963
-
1964
- $parent_options .= MLAData::mla_parse_template( $option_template, $option_values );
1965
- } // foreach iptc_key
1966
-
1967
- return $parent_options;
1968
- } // _compose_parent_option_list
1969
-
1970
- /**
1971
- * Update Standard field portion of IPTC/EXIF mappings
1972
- *
1973
- * @since 1.00
1974
- *
1975
- * @param array current iptc_exif_mapping values
1976
- * @param array new values
1977
- *
1978
- * @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
1979
- */
1980
- private static function _update_iptc_exif_standard_mapping( $current_values, $new_values ) {
1981
- $error_list = '';
1982
- $message_list = '';
1983
- $settings_changed = false;
1984
-
1985
- foreach ( $new_values['standard'] as $new_key => $new_value ) {
1986
- if ( isset( $current_values['standard'][ $new_key ] ) ) {
1987
- $old_values = $current_values['standard'][ $new_key ];
1988
- $any_setting_changed = false;
1989
- }
1990
- else {
1991
- $error_list .= "<br>ERROR: No old values for {$new_key}.\r\n";
1992
- continue;
1993
- }
1994
-
1995
- if ( $old_values['iptc_value'] != $new_value['iptc_value'] ) {
1996
- $any_setting_changed = true;
1997
- $message_list .= "<br>{$old_values['name']} changing IPTC Value from {$old_values['iptc_value']} to {$new_value['iptc_value']}.\r\n";
1998
- $old_values['iptc_value'] = $new_value['iptc_value'];
1999
- }
2000
-
2001
- if ( $old_values['exif_value'] != $new_value['exif_value'] ) {
2002
- $any_setting_changed = true;
2003
- $message_list .= "<br>{$old_values['name']} changing EXIF Value from {$old_values['exif_value']} to {$new_value['exif_value']}.\r\n";
2004
- $old_values['exif_value'] = $new_value['exif_value'];
2005
- }
2006
-
2007
- if ( $new_value['iptc_first'] ) {
2008
- $boolean_value = true;
2009
- $boolean_text = 'EXIF to IPTC';
2010
- }
2011
- else {
2012
- $boolean_value = false;
2013
- $boolean_text = 'IPTC to EXIF';
2014
- }
2015
- if ( $old_values['iptc_first'] != $boolean_value ) {
2016
- $any_setting_changed = true;
2017
- $message_list .= "<br>{$old_values['name']} changing Priority Value from {$boolean_text}.\r\n";
2018
- $old_values['iptc_first'] = $boolean_value;
2019
- }
2020
-
2021
- if ( $new_value['keep_existing'] ) {
2022
- $boolean_value = true;
2023
- $boolean_text = 'Replace to Keep';
2024
- }
2025
- else {
2026
- $boolean_value = false;
2027
- $boolean_text = 'Keep to Replace';
2028
- }
2029
- if ( $old_values['keep_existing'] != $boolean_value ) {
2030
- $any_setting_changed = true;
2031
- $message_list .= "<br>{$old_values['name']} changing Existing Text Value from {$boolean_text}.\r\n";
2032
- $old_values['keep_existing'] = $boolean_value;
2033
- }
2034
-
2035
- if ( $any_setting_changed ) {
2036
- $settings_changed = true;
2037
- $current_values['standard'][ $new_key ] = $old_values;
2038
- }
2039
- } // new standard value
2040
-
2041
- /*
2042
- * Uncomment this for debugging.
2043
- */
2044
- // $error_list .= $message_list;
2045
-
2046
- return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
2047
- } // _update_iptc_exif_standard_mapping
2048
-
2049
- /**
2050
- * Update Taxonomy term portion of IPTC/EXIF mappings
2051
- *
2052
- * @since 1.00
2053
- *
2054
- * @param array current iptc_exif_mapping values
2055
- * @param array new values
2056
- *
2057
- * @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
2058
- */
2059
- private static function _update_iptc_exif_taxonomy_mapping( $current_values, $new_values ) {
2060
- $error_list = '';
2061
- $message_list = '';
2062
- $settings_changed = false;
2063
-
2064
- foreach ( $new_values['taxonomy'] as $new_key => $new_value ) {
2065
- if ( isset( $current_values['taxonomy'][ $new_key ] ) ) {
2066
- $old_values = $current_values['taxonomy'][ $new_key ];
2067
- }
2068
- else {
2069
- $old_values = array(
2070
- 'name' => $new_value['name'],
2071
- 'hierarchical' => $new_value['hierarchical'],
2072
- 'iptc_value' => 'none',
2073
- 'exif_value' => '',
2074
- 'iptc_first' => true,
2075
- 'keep_existing' => true,
2076
- 'parent' => 0
2077
- );
2078
- }
2079
-
2080
- $any_setting_changed = false;
2081
- if ( $old_values['iptc_value'] != $new_value['iptc_value'] ) {
2082
- $any_setting_changed = true;
2083
- $message_list .= "<br>{$old_values['name']} changing IPTC Value from {$old_values['iptc_value']} to {$new_value['iptc_value']}.\r\n";
2084
- $old_values['iptc_value'] = $new_value['iptc_value'];
2085
- }
2086
-
2087
- if ( $old_values['exif_value'] != $new_value['exif_value'] ) {
2088
- $any_setting_changed = true;
2089
- $message_list .= "<br>{$old_values['name']} changing EXIF Value from {$old_values['exif_value']} to {$new_value['exif_value']}.\r\n";
2090
- $old_values['exif_value'] = $new_value['exif_value'];
2091
- }
2092
-
2093
- if ( $new_value['iptc_first'] ) {
2094
- $boolean_value = true;
2095
- $boolean_text = 'EXIF to IPTC';
2096
- }
2097
- else {
2098
- $boolean_value = false;
2099
- $boolean_text = 'IPTC to EXIF';
2100
- }
2101
- if ( $old_values['iptc_first'] != $boolean_value ) {
2102
- $any_setting_changed = true;
2103
- $message_list .= "<br>{$old_values['name']} changing Priority Value from {$boolean_text}.\r\n";
2104
- $old_values['iptc_first'] = $boolean_value;
2105
- }
2106
-
2107
- if ( $new_value['keep_existing'] ) {
2108
- $boolean_value = true;
2109
- $boolean_text = 'Replace to Keep';
2110
- }
2111
- else {
2112
- $boolean_value = false;
2113
- $boolean_text = 'Keep to Replace';
2114
- }
2115
- if ( $old_values['keep_existing'] != $boolean_value ) {
2116
- $any_setting_changed = true;
2117
- $message_list .= "<br>{$old_values['name']} changing Existing Text Value from {$boolean_text}.\r\n";
2118
- $old_values['keep_existing'] = $boolean_value;
2119
- }
2120
-
2121
- if ( isset( $new_value['parent'] ) && ( $old_values['parent'] != $new_value['parent'] ) ) {
2122
- $any_setting_changed = true;
2123
- $message_list .= "<br>{$old_values['name']} changing Parent from {$old_values['parent']} to {$new_value['parent']}.\r\n";
2124
- $old_values['parent'] = $new_value['parent'];
2125
- }
2126
-
2127
- if ( $any_setting_changed ) {
2128
- $settings_changed = true;
2129
- $current_values['taxonomy'][ $new_key ] = $old_values;
2130
- }
2131
- } // new taxonomy value
2132
-
2133
- /*
2134
- * Uncomment this for debugging.
2135
- */
2136
- // $error_list .= $message_list;
2137
-
2138
- return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
2139
- } // _update_iptc_exif_taxonomy_mapping
2140
-
2141
- /**
2142
- * Update Custom field portion of IPTC/EXIF mappings
2143
- *
2144
- * @since 1.00
2145
- *
2146
- * @param array current iptc_exif_mapping values
2147
- * @param array new values
2148
- *
2149
- * @return array ( 'message' => HTML message(s) reflecting results, 'values' => updated iptc_exif_mapping values, 'changed' => true if any changes detected else false )
2150
- */
2151
- private static function _update_iptc_exif_custom_mapping( $current_values, $new_values ) {
2152
- $error_list = '';
2153
- $message_list = '';
2154
- $settings_changed = false;
2155
-
2156
- foreach ( $new_values['custom'] as $new_key => $new_value ) {
2157
- $any_setting_changed = false;
2158
-
2159
- /*
2160
- * Check for the addition of a new field
2161
- */
2162
- if ( self::MLA_NEW_CUSTOM_FIELD == $new_key ) {
2163
- $new_key = trim( $new_value['name'] );
2164
-
2165
- if ( empty( $new_key ) )
2166
- continue;
2167
-
2168
- $message_list .= "<br>Adding new field {$new_key}.\r\n";
2169
- $any_setting_changed = true;
2170
- }
2171
-
2172
- if ( isset( $current_values['custom'][ $new_key ] ) ) {
2173
- $old_values = $current_values['custom'][ $new_key ];
2174
- $any_setting_changed = false;
2175
- }
2176
- else {
2177
- $old_values = array(
2178
- 'name' => $new_key,
2179
- 'iptc_value' => 'none',
2180
- 'exif_value' => '',
2181
- 'iptc_first' => true,
2182
- 'keep_existing' => true
2183
- );
2184
- }
2185
-
2186
- if ( $old_values['iptc_value'] != $new_value['iptc_value'] ) {
2187
- $any_setting_changed = true;
2188
- $message_list .= "<br>{$old_values['name']} changing IPTC Value from {$old_values['iptc_value']} to {$new_value['iptc_value']}.\r\n";
2189
- $old_values['iptc_value'] = $new_value['iptc_value'];
2190
- }
2191
-
2192
- if ( $old_values['exif_value'] != $new_value['exif_value'] ) {
2193
- $any_setting_changed = true;
2194
- $message_list .= "<br>{$old_values['name']} changing EXIF Value from {$old_values['exif_value']} to {$new_value['exif_value']}.\r\n";
2195
- $old_values['exif_value'] = $new_value['exif_value'];
2196
- }
2197
-
2198
- if ( $new_value['iptc_first'] ) {
2199
- $boolean_value = true;
2200
- $boolean_text = 'EXIF to IPTC';
2201
- }
2202
- else {
2203
- $boolean_value = false;
2204
- $boolean_text = 'IPTC to EXIF';
2205
- }
2206
- if ( $old_values['iptc_first'] != $boolean_value ) {
2207
- $any_setting_changed = true;
2208
- $message_list .= "<br>{$old_values['name']} changing Priority Value from {$boolean_text}.\r\n";
2209
- $old_values['iptc_first'] = $boolean_value;
2210
- }
2211
-
2212
- if ( $new_value['keep_existing'] ) {
2213
- $boolean_value = true;
2214
- $boolean_text = 'Replace to Keep';
2215
- }
2216
- else {
2217
- $boolean_value = false;
2218
- $boolean_text = 'Keep to Replace';
2219
- }
2220
- if ( $old_values['keep_existing'] != $boolean_value ) {
2221
- $any_setting_changed = true;
2222
- $message_list .= "<br>{$old_values['name']} changing Existing Text Value from {$boolean_text}.\r\n";
2223
- $old_values['keep_existing'] = $boolean_value;
2224
- }
2225
-
2226
- if ( $any_setting_changed ) {
2227
- $settings_changed = true;
2228
- $current_values['custom'][ $new_key ] = $old_values;
2229
- }
2230
- } // new standard value
2231
-
2232
- /*
2233
- * Uncomment this for debugging.
2234
- */
2235
- // $error_list .= $message_list;
2236
-
2237
- return array( 'message' => $error_list, 'values' => $current_values, 'changed' => $settings_changed );
2238
- } // _update_iptc_exif_custom_mapping
2239
-
2240
- /**
2241
- * Generate a list of all (post) Custom Field names
2242
- *
2243
- * @since 1.00
2244
- *
2245
- * @return array Custom field names from the postmeta table
2246
- */
2247
- private static function _get_custom_field_names( ) {
2248
- global $wpdb;
2249
- $limit = (int) apply_filters( 'postmeta_form_limit', 30 );
2250
- $keys = $wpdb->get_col( "
2251
- SELECT meta_key
2252
- FROM $wpdb->postmeta
2253
- GROUP BY meta_key
2254
- HAVING meta_key NOT LIKE '\_%'
2255
- ORDER BY meta_key
2256
- LIMIT $limit" );
2257
- if ( $keys )
2258
- natcasesort($keys);
2259
-
2260
- return $keys;
2261
- } // _get_custom_field_names
2262
-
2263
- /**
2264
- * Render and manage iptc/exif support options
2265
- *
2266
- * @since 1.00
2267
- * @uses $mla_option_templates contains row and table templates
2268
- *
2269
- * @param string 'render', 'update', 'delete', or 'reset'
2270
- * @param string option name, e.g., 'iptc_exif_mapping'
2271
- * @param array option parameters
2272
- * @param array Optional. null (default) for 'render' else option data, e.g., $_REQUEST
2273
- *
2274
- * @return string HTML table row markup for 'render' else message(s) reflecting the results of the operation.
2275
- */
2276
- public static function mla_iptc_exif_option_handler( $action, $key, $value, $args = null ) {
2277
- $current_values = self::mla_get_option( 'iptc_exif_mapping' );
2278
-
2279
- switch ( $action ) {
2280
- case 'render':
2281
-
2282
- switch ( $key ) {
2283
- case 'iptc_exif_standard_mapping':
2284
- $row_template = self::$mla_option_templates['iptc-exif-standard-row'];
2285
- $table_rows = '';
2286
-
2287
- foreach ( $current_values['standard'] as $row_name => $row_value ) {
2288
- $row_values = array (
2289
- 'key' => $row_name,
2290
- 'name' => $row_value['name'],
2291
- 'iptc_field_options' => self::_compose_iptc_option_list( $row_value['iptc_value'] ),
2292
- 'exif_size' => 20,
2293
- 'exif_text' => $row_value['exif_value'],
2294
- 'iptc_selected' => '',
2295
- 'exif_selected' => '',
2296
- 'keep_selected' => '',
2297
- 'replace_selected' => ''
2298
- );
2299
-
2300
- if ( $row_value['iptc_first'] )
2301
- $row_values['iptc_selected'] = 'selected="selected"';
2302
- else
2303
- $row_values['exif_selected'] = 'selected="selected"';
2304
-
2305
- if ( $row_value['keep_existing'] )
2306
- $row_values['keep_selected'] = 'selected="selected"';
2307
- else
2308
- $row_values['replace_selected'] = 'selected="selected"';
2309
-
2310
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
2311
- } // foreach row
2312
-
2313
- $option_values = array (
2314
- 'table_rows' => $table_rows,
2315
- 'help' => $value['help']
2316
- );
2317
-
2318
- return MLAData::mla_parse_template( self::$mla_option_templates['iptc-exif-standard-table'], $option_values );
2319
- case 'iptc_exif_taxonomy_mapping':
2320
- $row_template = self::$mla_option_templates['iptc-exif-taxonomy-row'];
2321
- $select_template = self::$mla_option_templates['iptc-exif-select'];
2322
- $table_rows = '';
2323
- $taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'objects' );
2324
-
2325
- foreach ( $taxonomies as $row_name => $row_value ) {
2326
- $row_values = array (
2327
- 'key' => $row_name,
2328
- 'name' => esc_html( $row_value->labels->name ),
2329
- 'hierarchical' => (string) $row_value->hierarchical,
2330
- 'iptc_field_options' => '',
2331
- 'exif_size' => 20,
2332
- 'exif_text' => '',
2333
- 'iptc_selected' => '',
2334
- 'exif_selected' => '',
2335
- 'keep_selected' => '',
2336
- 'replace_selected' => '',
2337
- 'parent_select' => ''
2338
- );
2339
-
2340
- if ( array_key_exists( $row_name, $current_values['taxonomy'] ) ) {
2341
- $current_value = $current_values['taxonomy'][ $row_name ];
2342
- $row_values['iptc_field_options'] = self::_compose_iptc_option_list( $current_value['iptc_value'] );
2343
- $row_values['exif_text'] = $current_value['exif_value'];
2344
-
2345
- if ( $current_value['iptc_first'] )
2346
- $row_values['iptc_selected'] = 'selected="selected"';
2347
- else
2348
- $row_values['exif_selected'] = 'selected="selected"';
2349
-
2350
- if ( $current_value['keep_existing'] )
2351
- $row_values['keep_selected'] = 'selected="selected"';
2352
- else
2353
- $row_values['replace_selected'] = 'selected="selected"';
2354
-
2355
- if ( $row_value->hierarchical ) {
2356
- $parent = ( isset( $current_value['parent'] ) ) ? (integer) $current_value['parent'] : 0;
2357
- $select_values = array (
2358
- 'array' => 'taxonomy',
2359
- 'key' => $row_name,
2360
- 'element' => 'parent',
2361
- 'options' => self::_compose_parent_option_list( $row_name, $parent )
2362
- );
2363
- $row_values['parent_select'] = MLAData::mla_parse_template( $select_template, $select_values );
2364
- }
2365
- }
2366
- else {
2367
- $row_values['iptc_field_options'] = self::_compose_iptc_option_list( 'none' );
2368
- $row_values['iptc_selected'] = 'selected="selected"';
2369
- $row_values['keep_selected'] = 'selected="selected"';
2370
-
2371
- if ( $row_value->hierarchical ) {
2372
- $select_values = array (
2373
- 'array' => 'taxonomy',
2374
- 'key' => $row_name,
2375
- 'element' => 'parent',
2376
- 'options' => self::_compose_parent_option_list( $row_name, 0 )
2377
- );
2378
- $row_values['parent_select'] = MLAData::mla_parse_template( $select_template, $select_values );
2379
- }
2380
- }
2381
-
2382
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
2383
- } // foreach row
2384
-
2385
- $option_values = array (
2386
- 'table_rows' => $table_rows,
2387
- 'help' => $value['help']
2388
- );
2389
-
2390
- return MLAData::mla_parse_template( self::$mla_option_templates['iptc-exif-taxonomy-table'], $option_values );
2391
- case 'iptc_exif_custom_mapping':
2392
- $custom_field_names = MLAOptions::_get_custom_field_names();
2393
- $row_template = self::$mla_option_templates['iptc-exif-custom-row'];
2394
- $table_rows = '';
2395
-
2396
- /*
2397
- * Add fields defined here but not yet assigned to any attachments
2398
- */
2399
- foreach ( $current_values['custom'] as $row_name => $row_values ) {
2400
- if ( in_array( $row_name, $custom_field_names ) )
2401
- continue;
2402
-
2403
- $custom_field_names[] = $row_name;
2404
- }
2405
-
2406
- foreach ( $custom_field_names as $row_name ) {
2407
- $row_values = array (
2408
- 'key' => $row_name,
2409
- 'name' => $row_name,
2410
- 'iptc_field_options' => '',
2411
- 'exif_size' => 20,
2412
- 'exif_text' => '',
2413
- 'iptc_selected' => '',
2414
- 'exif_selected' => '',
2415
- 'keep_selected' => '',
2416
- 'replace_selected' => ''
2417
- );
2418
-
2419
- if ( array_key_exists( $row_name, $current_values['custom'] ) ) {
2420
- $current_value = $current_values['custom'][ $row_name ];
2421
- $row_values['iptc_field_options'] = self::_compose_iptc_option_list( $current_value['iptc_value'] );
2422
- $row_values['exif_text'] = $current_value['exif_value'];
2423
-
2424
- if ( $current_value['iptc_first'] )
2425
- $row_values['iptc_selected'] = 'selected="selected"';
2426
- else
2427
- $row_values['exif_selected'] = 'selected="selected"';
2428
-
2429
- if ( $current_value['keep_existing'] )
2430
- $row_values['keep_selected'] = 'selected="selected"';
2431
- else
2432
- $row_values['replace_selected'] = 'selected="selected"';
2433
- }
2434
- else {
2435
- $row_values['iptc_field_options'] = self::_compose_iptc_option_list( 'none' );
2436
- $row_values['iptc_selected'] = 'selected="selected"';
2437
- $row_values['keep_selected'] = 'selected="selected"';
2438
-
2439
- }
2440
-
2441
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
2442
- } // foreach row
2443
-
2444
- /*
2445
- * Add a row for defining a new Custom Field
2446
- */
2447
- $row_values = array (
2448
- 'key' => self::MLA_NEW_CUSTOM_FIELD,
2449
- '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="" />',
2450
- 'iptc_field_options' => self::_compose_iptc_option_list( 'none' ),
2451
- 'exif_size' => 20,
2452
- 'exif_text' => '',
2453
- 'iptc_selected' => 'selected="selected"',
2454
- 'exif_selected' => '',
2455
- 'keep_selected' => 'selected="selected"',
2456
- 'replace_selected' => ''
2457
- );
2458
- $table_rows .= MLAData::mla_parse_template( $row_template, $row_values );
2459
-
2460
- $option_values = array (
2461
- 'table_rows' => $table_rows,
2462
- 'help' => $value['help']
2463
- );
2464
-
2465
- return MLAData::mla_parse_template( self::$mla_option_templates['iptc-exif-custom-table'], $option_values );
2466
- default:
2467
- return "<br>ERROR: Render unknown custom {$key}\r\n";
2468
- } // switch $key
2469
- case 'update':
2470
- case 'delete':
2471
- $settings_changed = false;
2472
- $messages = '';
2473
-
2474
- switch ( $key ) {
2475
- case 'iptc_exif_standard_mapping':
2476
- $results = self::_update_iptc_exif_standard_mapping( $current_values, $args );
2477
- $messages .= $results['message'];
2478
- $current_values = $results['values'];
2479
- $settings_changed = $results['changed'];
2480
- break;
2481
- case 'iptc_exif_taxonomy_mapping':
2482
- $results = self::_update_iptc_exif_taxonomy_mapping( $current_values, $args );
2483
- $messages .= $results['message'];
2484
- $current_values = $results['values'];
2485
- $settings_changed = $results['changed'];
2486
- break;
2487
- case 'iptc_exif_custom_mapping':
2488
- $results = self::_update_iptc_exif_custom_mapping( $current_values, $args );
2489
- $messages .= $results['message'];
2490
- $current_values = $results['values'];
2491
- $settings_changed = $results['changed'];
2492
- break;
2493
- case 'iptc_exif_mapping':
2494
- $results = self::_update_iptc_exif_standard_mapping( $current_values, $args );
2495
- $messages .= $results['message'];
2496
- $current_values = $results['values'];
2497
- $settings_changed = $results['changed'];
2498
-
2499
- $results = self::_update_iptc_exif_taxonomy_mapping( $current_values, $args );
2500
- $messages .= $results['message'];
2501
- $current_values = $results['values'];
2502
- $settings_changed |= $results['changed'];
2503
-
2504
- $results = self::_update_iptc_exif_custom_mapping( $current_values, $args );
2505
- $messages .= $results['message'];
2506
- $current_values = $results['values'];
2507
- $settings_changed |= $results['changed'];
2508
- break;
2509
- default:
2510
- return "<br>ERROR: Update/delete unknown custom {$key}\r\n";
2511
- } // switch $key
2512
-
2513
- if ( $settings_changed ) {
2514
- $settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
2515
- if ( $settings_changed )
2516
- $results = "IPTC/EXIF mapping settings updated.\r\n";
2517
- else
2518
- $results = "ERROR: IPTC/EXIF settings update failed.\r\n";
2519
- }
2520
- else
2521
- $results = "IPTC/EXIF no mapping changes detected.\r\n";
2522
-
2523
- return $results . $messages;
2524
- case 'reset':
2525
- switch ( $key ) {
2526
- case 'iptc_exif_standard_mapping':
2527
- $current_values['standard'] = self::$mla_option_definitions['iptc_exif_mapping']['std']['standard'];
2528
- $settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
2529
- if ( $settings_changed )
2530
- return "IPTC/EXIF Standard field settings saved.\r\n";
2531
- else
2532
- return "ERROR: IPTC/EXIF Standard field settings update failed.\r\n";
2533
- case 'iptc_exif_taxonomy_mapping':
2534
- $current_values['taxonomy'] = self::$mla_option_definitions['iptc_exif_mapping']['std']['taxonomy'];
2535
- $settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
2536
- if ( $settings_changed )
2537
- return "IPTC/EXIF Taxonomy term settings saved.\r\n";
2538
- else
2539
- return "ERROR: IPTC/EXIF Taxonomy term settings update failed.\r\n";
2540
- case 'iptc_exif_custom_mapping':
2541
- $current_values['custom'] = self::$mla_option_definitions['iptc_exif_mapping']['std']['custom'];
2542
- $settings_changed = MLAOptions::mla_update_option( 'iptc_exif_mapping', $current_values );
2543
- if ( $settings_changed )
2544
- return "IPTC/EXIF Custom field settings saved.\r\n";
2545
- else
2546
- return "ERROR: IPTC/EXIF Custom field settings reset failed.\r\n";
2547
- case 'iptc_exif_mapping':
2548
- self::mla_delete_option( $key );
2549
- return "<br>Reset custom {$key}\r\n";
2550
- default:
2551
- return "<br>ERROR: Reset unknown custom {$key}\r\n";
2552
- } // switch $key
2553
- default:
2554
- return "<br>ERROR: Custom {$key} unknown action: {$action}\r\n";
2555
- } // switch $action
2556
- } // mla_iptc_exif_option_handler
2557
- } // class MLAOptions
2558
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-mla-settings.php CHANGED
@@ -1,120 +1,99 @@
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,15 +101,11 @@ class MLASettings {
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,293 +128,91 @@ class MLASettings {
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,16 +221,10 @@ class MLASettings {
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,1204 +233,245 @@ class MLASettings {
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 . '&amp;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>&nbsp;<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'] ) )
1501
- return array(
1502
- 'message' => 'ERROR: No custom field settings to process.',
1503
- 'body' => ''
1504
- );
1505
-
1506
- $examine_count = 0;
1507
- $update_count = 0;
1508
-
1509
- $query = array( 'orderby' => 'none', 'post_parent' => 'all' );
1510
- $posts = MLAShortcodes::mla_get_shortcode_attachments( 0, $query );
1511
-
1512
- foreach( $posts as $key => $post ) {
1513
- $updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $post, 'iptc_exif_custom_mapping', $_REQUEST['iptc_exif_mapping'] );
1514
-
1515
- $examine_count += 1;
1516
- if ( ! empty( $updates ) ) {
1517
- $results = MLAData::mla_update_single_item( $post->ID, $updates );
1518
- if ( stripos( $results['message'], 'updated.' ) )
1519
- $update_count += 1;
1520
- }
1521
- } // foreach post
1522
-
1523
- if ( $update_count )
1524
- $message = "IPTC/EXIF custom field mapping completed; {$examine_count} attachment(s) examined, {$update_count} updated.\r\n";
1525
- else
1526
- $message = "IPTC/EXIF custom field mapping completed; {$examine_count} attachment(s) examined, no changes detected.\r\n";
1527
-
1528
- return array(
1529
- 'message' => $message,
1530
- 'body' => ''
1531
- );
1532
- } // _process_iptc_exif_custom
1533
-
1534
- /**
1535
- * Save IPTC/EXIF settings to the options table
1536
- *
1537
- * @since 1.00
1538
- *
1539
- * @uses $_REQUEST
1540
- *
1541
- * @return array Message(s) reflecting the results of the operation
1542
- */
1543
- private static function _save_iptc_exif_settings( ) {
1544
- $message_list = '';
1545
- $option_messages = '';
1546
-
1547
- /*
1548
- * Start with any page-level options
1549
- */
1550
- foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
1551
- if ( 'iptc-exif' == $value['tab'] )
1552
- $option_messages .= self::_update_option_row( $key, $value );
1553
- }
1554
-
1555
  /*
1556
  * Uncomment this for debugging.
 
1557
  */
1558
- // $message_list = $option_messages . '<br>';
1559
-
1560
- /*
1561
- * Add mapping options
1562
- */
1563
- $new_values = ( isset( $_REQUEST['iptc_exif_mapping'] ) ) ? $_REQUEST['iptc_exif_mapping'] : array( 'standard' => array(), 'taxonomy' => array(), 'custom' => array() );
1564
-
1565
- return array(
1566
- 'message' => $message_list . MLAOptions::mla_iptc_exif_option_handler( 'update', 'iptc_exif_mapping', MLAOptions::$mla_option_definitions['iptc_exif_mapping'], $new_values ),
1567
- 'body' => ''
1568
- );
1569
- } // _save_iptc_exif_settings
1570
-
1571
- /**
1572
- * Save General settings to the options table
1573
- *
1574
- * @since 0.1
1575
- *
1576
- * @uses $_REQUEST
1577
- *
1578
- * @return array Message(s) reflecting the results of the operation
1579
- */
1580
- private static function _save_general_settings( ) {
1581
- $message_list = '';
1582
-
1583
- foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
1584
- if ( 'general' == $value['tab'] ) {
1585
- switch ( $key ) {
1586
- case MLAOptions::MLA_FEATURED_IN_TUNING:
1587
- MLAOptions::$process_featured_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1588
- break;
1589
- case MLAOptions::MLA_INSERTED_IN_TUNING:
1590
- MLAOptions::$process_inserted_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1591
- break;
1592
- case MLAOptions::MLA_GALLERY_IN_TUNING:
1593
- MLAOptions::$process_gallery_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1594
-
1595
- if ( 'refresh' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
1596
- MLAData::mla_flush_mla_galleries( MLAOptions::MLA_GALLERY_IN_TUNING );
1597
- $message_list .= "<br>Gallery in - references updated.\r\n";
1598
- $_REQUEST[ MLA_OPTION_PREFIX . $key ] = 'cached';
1599
- }
1600
- break;
1601
- case MLAOptions::MLA_MLA_GALLERY_IN_TUNING:
1602
- MLAOptions::$process_mla_gallery_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1603
-
1604
- if ( 'refresh' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
1605
- MLAData::mla_flush_mla_galleries( MLAOptions::MLA_MLA_GALLERY_IN_TUNING );
1606
- $message_list .= "<br>MLA Gallery in - references updated.\r\n";
1607
- $_REQUEST[ MLA_OPTION_PREFIX . $key ] = 'cached';
1608
- }
1609
- break;
1610
- default:
1611
- // ignore everything else
1612
- } // switch
1613
-
1614
- $message_list .= self::_update_option_row( $key, $value );
1615
- } // general option
1616
- } // foreach mla_options
1617
-
1618
- $page_content = array(
1619
- 'message' => "General settings saved.\r\n",
1620
- 'body' => ''
1621
- );
1622
-
1623
- /*
1624
- * Uncomment this for debugging.
1625
- */
1626
- // $page_content['message'] .= $message_list;
1627
-
1628
  return $page_content;
1629
- } // _save_general_settings
1630
 
1631
  /**
1632
  * Delete saved settings, restoring default values
1633
  *
1634
  * @since 0.1
1635
  *
1636
- * @return array Message(s) reflecting the results of the operation
 
 
1637
  */
1638
- private static function _reset_general_settings( ) {
1639
- $message_list = '';
1640
 
1641
- foreach ( MLAOptions::$mla_option_definitions as $key => $value ) {
1642
- if ( 'custom' == $value['type'] ) {
1643
- $message = MLAOptions::$value['reset']( 'reset', $key, $value, $_REQUEST );
1644
- }
1645
- elseif ( ('header' == $value['type']) || ('hidden' == $value['type']) ) {
1646
- $message = '';
1647
- }
1648
- else {
1649
- MLAOptions::mla_delete_option( $key );
1650
- $message = '<br>delete_option(' . $key . ')';
1651
- }
1652
-
1653
- $message_list .= $message;
1654
  }
1655
 
1656
  $page_content = array(
1657
- 'message' => 'Settings reset to default values.',
1658
  'body' => ''
1659
  );
1660
 
1661
  /*
1662
  * Uncomment this for debugging.
 
1663
  */
1664
- // $page_content['message'] .= $message_list;
1665
-
1666
  return $page_content;
1667
- } // _reset_general_settings
1668
  } // class MLASettings
1669
  ?>
1
  <?php
2
  /**
3
+ * Manages the plugin option settings and provides the settings page to edit them
4
  *
5
  * @package Media Library Assistant
6
  * @since 0.1
7
  */
8
 
9
  /**
10
+ * Class MLA (Media Library Assistant) Settings manages the plugin option 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
+ * $mla_options defines the database options and admin page areas for setting/updating them.
24
+ * Each option is defined by an array with the following elements:
25
  *
26
+ * array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
27
  *
28
+ * name => admin page label or heading text
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
+ private static $mla_options = array (
38
+ 'taxonomies' =>
39
+ array('name' => 'Pre-defined Taxonomies',
40
+ 'type' => 'header'),
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
+ 'select' =>
67
+ array('name' => 'Dropdown list',
68
+ 'type' => 'select',
69
+ 'std' => 'Red',
70
+ 'options' => array('Red', 'Green', 'Blue'),
71
+ 'help' => 'This is your help text.'),
72
+
73
+ 'text' =>
74
+ array('name' => 'Text Field',
75
+ 'type' => 'text',
76
+ 'std' => 'default text',
77
+ 'size' => 20,
78
+ 'help' => 'Enter the text...'),
79
+
80
+ 'textarea' =>
81
+ array('name' => 'Text Area',
82
+ 'type' => 'textarea',
83
+ 'std' => 'default text area',
84
+ 'cols' => 60,
85
+ 'rows' => 4,
86
+ 'help' => 'Enter the text area...'),
87
+ */
88
+ );
89
 
90
  /**
91
+ * Initialization function, similar to __construct()
 
 
 
 
92
  *
93
+ * @since 0.1
94
  */
95
+ public static function initialize( ) {
96
+ add_action( 'admin_menu', 'MLASettings::mla_admin_menu_action' );
 
 
 
 
 
 
 
97
  }
98
 
99
  /**
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
  }
129
 
130
  /**
131
+ * Return the stored value or default value of a defined MLA option
 
 
 
 
 
 
132
  *
133
+ * @since 0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  *
135
+ * @param string Name of the desired option
 
 
 
 
136
  *
137
+ * @return mixed Value(s) for the option or false if the option is not a defined MLA option
138
  */
139
+ public static function mla_get_option( $option ) {
140
+ if ( array_key_exists( $option, self::$mla_options ) ) {
141
+ if ( array_key_exists( 'std', self::$mla_options[ $option ] ) )
142
+ return get_option( MLA_OPTION_PREFIX . $option, self::$mla_options[ $option ]['std'] );
143
+ else
144
+ return get_option( MLA_OPTION_PREFIX . $option, false );
145
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
+ return false;
148
  }
149
 
150
  /**
151
+ * Add or update the stored value of a defined MLA option
152
  *
153
+ * @since 0.1
 
154
  *
155
+ * @param string Name of the desired option
156
+ * @param mixed New value for the desired option
157
  *
158
+ * @return boolean True if the value was changed or false if the update failed
159
  */
160
+ public static function mla_update_option( $option, $newvalue ) {
161
+ if ( array_key_exists( $option, self::$mla_options ) )
162
+ return update_option( MLA_OPTION_PREFIX . $option, $newvalue );
163
+
164
+ return false;
165
+ }
166
+
167
  /**
168
+ * Delete the stored value of a defined MLA option
 
 
 
 
 
 
 
 
 
169
  *
170
+ * @since 0.1
 
 
 
 
 
 
 
 
 
 
 
171
  *
172
+ * @param string Name of the desired option
 
 
 
173
  *
174
+ * @return boolean True if the option was deleted, otherwise false
175
  */
176
+ public static function mla_delete_option( $option ) {
177
+ if ( array_key_exists( $option, self::$mla_options ) ) {
178
+ return delete_option( MLA_OPTION_PREFIX . $option );
179
+ }
 
 
 
 
 
 
 
 
 
180
 
181
+ return false;
 
182
  }
183
 
184
  /**
185
+ * Render the "Media Library Assistant" subpage in the Settings section
186
  *
187
+ * @since 0.1
188
+ *
189
+ * @return HTML markup for the settings subpage
 
190
  */
191
+ public static function mla_render_settings_page( ) {
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
+ $page_content = self::_save_settings( $page_template_array );
214
+ } elseif ( !empty( $_REQUEST['reset'] ) ) {
215
+ $page_content = self::_reset_settings( $page_template_array );
 
 
216
  } else {
217
  $page_content = array(
218
  'message' => '',
221
  }
222
 
223
  if ( !empty( $page_content['body'] ) ) {
224
+ echo $page_content['body'];
225
+ return;
226
  }
227
 
 
 
 
 
 
 
 
228
  /*
229
  * $custom_fields documents the name and description of custom fields
230
  */
233
  );
234
 
235
  /*
236
+ * $shortcodes documents the name and description of theme shortcodes
237
  */
238
  $shortcodes = array(
239
  // array("name" => "shortcode", "description" => "This shortcode...")
 
 
240
  );
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
  $options_list = '';
244
+ foreach ( self::$mla_options as $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' == 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
+ if ( !empty( $page_content['message'] ) )
364
+ $page_values['messages'] = MLAData::mla_parse_template( $page_template_array['messages'], array(
365
+ 'messages' => $page_content['message']
366
+ ) );
367
+
368
  $page_values['options_list'] = $options_list;
369
+ echo MLAData::mla_parse_template( $page_template_array['page'], $page_values );
370
+ } // mla_render_settings_page
 
371
 
372
  /**
373
+ * Save settings to the options table
 
 
 
374
  *
375
+ * @since 0.1
376
+ *
377
+ * @param array HTML template(s) for the settings page
378
+ *
379
+ * @return array Message(s) reflecting the results of the operation.
380
  */
381
+ private static function _save_settings( $template_array ) {
382
+ $message = '';
383
+
384
+ foreach ( self::$mla_options as $key => $value ) {
385
+ if ( isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ) {
386
+ switch ( $value['type'] ) {
387
+ case 'checkbox':
388
+ self::mla_update_option( $key, 'checked' );
389
+ break;
390
+ case 'header':
391
+ break;
392
+ case 'radio':
393
+ self::mla_update_option( $key, $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
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 = array(
437
+ 'message' => 'Settings saved.',
438
+ 'body' => ''
 
 
 
439
  );
440
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
441
  /*
442
  * Uncomment this for debugging.
443
+ * $page_content['message'] .= $message;
444
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  return $page_content;
446
+ } // _save_settings
447
 
448
  /**
449
  * Delete saved settings, restoring default values
450
  *
451
  * @since 0.1
452
  *
453
+ * @param array HTML template(s) for the settings page
454
+ *
455
+ * @return array Message(s) reflecting the results of the operation.
456
  */
457
+ private static function _reset_settings( $template_array ) {
458
+ $message = '';
459
 
460
+ foreach ( self::$mla_options as $key => $value ) {
461
+ self::mla_delete_option( $key );
462
+ $message .= '<br>delete_option(' . $key . ')';
 
 
 
 
 
 
 
 
 
 
463
  }
464
 
465
  $page_content = array(
466
+ 'message' => 'Settings reset to default values.',
467
  'body' => ''
468
  );
469
 
470
  /*
471
  * Uncomment this for debugging.
472
+ * $page_content['message'] .= $message;
473
  */
 
 
474
  return $page_content;
475
+ } // _reset_settings
476
  } // class MLASettings
477
  ?>
includes/class-mla-shortcodes.php DELETED
@@ -1,1460 +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
- * 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 '&nbsp;<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 "&nbsp;&nbsp;&nbsp;&nbsp;not featured in any posts.<br>\r\n";
69
- } else {
70
- echo "&nbsp;&nbsp;&nbsp;&nbsp;Featured in<br>\r\n";
71
- foreach ( $references['features'] as $feature_id => $feature ) {
72
- echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
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 "&nbsp;&nbsp;&nbsp;&nbsp;no inserts in any post_content.<br>\r\n";
88
- } else {
89
- foreach ( $references['inserts'] as $file => $inserts ) {
90
- echo '&nbsp;&nbsp;&nbsp;&nbsp;' . $file . " inserted in<br>\r\n";
91
- foreach ( $inserts as $insert ) {
92
- echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
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 '&nbsp;&nbsp;&nbsp;&nbsp;' . $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
- * These are the parameters for gallery display
178
- */
179
- $default_arguments = array(
180
- 'size' => 'thumbnail', // or 'medium', 'large', 'full' or registered size
181
- 'itemtag' => 'dl',
182
- 'icontag' => 'dt',
183
- 'captiontag' => 'dd',
184
- 'columns' => 3,
185
- 'link' => 'permalink', // or 'file' or a registered size
186
- // MLA-specific
187
- 'mla_style' => MLAOptions::mla_get_option('default_style'),
188
- 'mla_markup' => MLAOptions::mla_get_option('default_markup'),
189
- 'mla_float' => is_rtl() ? 'right' : 'left',
190
- 'mla_itemwidth' => NULL,
191
- 'mla_margin' => '1.5',
192
- 'mla_link_text' => '',
193
- 'mla_rollover_text' => '',
194
- 'mla_caption' => '',
195
- 'mla_debug' => false,
196
- 'mla_viewer' => false,
197
- 'mla_viewer_extensions' => 'doc,xls,ppt,pdf,txt',
198
- 'mla_viewer_page' => '1',
199
- 'mla_viewer_width' => '150',
200
- // Photonic-specific
201
- 'id' => NULL,
202
- 'style' => NULL,
203
- 'type' => 'default',
204
- 'thumb_width' => 75,
205
- 'thumb_height' => 75,
206
- 'thumbnail_size' => 'thumbnail',
207
- 'slide_size' => 'large',
208
- 'slideshow_height' => 500,
209
- 'fx' => 'fade',
210
- 'timeout' => 4000,
211
- 'speed' => 1000,
212
- 'pause' => true
213
- );
214
-
215
- /*
216
- * Merge gallery arguments with defaults, pass the query arguments on to mla_get_shortcode_attachments.
217
- */
218
-
219
- $arguments = shortcode_atts( $default_arguments, $attr );
220
- self::$mla_debug = !empty( $arguments['mla_debug'] ) && ( 'true' == strtolower( $arguments['mla_debug'] ) );
221
-
222
- $attachments = self::mla_get_shortcode_attachments( $post->ID, $attr );
223
- if ( is_string( $attachments ) )
224
- return $attachments;
225
-
226
- if ( empty($attachments) ) {
227
- if ( self::$mla_debug ) {
228
- $output = '<p><strong>mla_debug</strong> empty gallery, query = ' . var_export( $attr, true ) . '</p>';
229
- $output .= self::$mla_debug_messages;
230
- self::$mla_debug_messages = '';
231
- return $output;
232
- }
233
- else {
234
- return '';
235
- }
236
- } // empty $attachments
237
-
238
- /*
239
- * Look for Photonic-enhanced gallery
240
- */
241
- global $photonic;
242
-
243
- if ( is_object( $photonic ) && ! empty( $arguments['style'] ) ) {
244
- if ( 'default' != strtolower( $arguments['type'] ) )
245
- return '<p><strong>Photonic-enhanced [mla_gallery]</strong> type must be <strong>default</strong>, query = ' . var_export( $attr, true ) . '</p>';
246
-
247
- $images = array();
248
- foreach ($attachments as $key => $val) {
249
- $images[$val->ID] = $attachments[$key];
250
- }
251
-
252
- $output = $photonic->build_gallery( $images, $arguments['style'], $arguments );
253
- return $output;
254
- }
255
-
256
- $size = $size_class = $arguments['size'];
257
- if ( 'icon' == strtolower( $size) ) {
258
- $size = array( 60, 60 );
259
- $show_icon = true;
260
- }
261
- else
262
- $show_icon = false;
263
-
264
- if ( is_feed() ) {
265
- $output = "\n";
266
- foreach ( $attachments as $att_id => $attachment )
267
- $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
268
- return $output;
269
- }
270
-
271
- /*
272
- * Check for Google File Viewer arguments
273
- */
274
- $arguments['mla_viewer'] = !empty( $arguments['mla_viewer'] ) && ( 'true' == strtolower( $arguments['mla_viewer'] ) );
275
- if ( $arguments['mla_viewer'] ) {
276
- $arguments['mla_viewer_extensions'] = array_filter( array_map( 'trim', explode( ',', $arguments['mla_viewer_extensions'] ) ) );
277
- $arguments['mla_viewer_page'] = absint( $arguments['mla_viewer_page'] );
278
- $arguments['mla_viewer_width'] = absint( $arguments['mla_viewer_width'] );
279
- }
280
-
281
- // $instance supports multiple galleries in one page/post
282
- static $instance = 0;
283
- $instance++;
284
-
285
- /*
286
- * The default style template includes "margin: 1.5%" to put a bit of
287
- * minimum space between the columns. "mla_margin" can be used to increase
288
- * this. "mla_itemwidth" can be used with "columns=0" to achieve a "responsive"
289
- * layout.
290
- */
291
-
292
- $margin = absint( 2 * (float) $arguments['mla_margin'] );
293
- if ( isset ( $arguments['mla_itemwidth'] ) ) {
294
- $itemwidth = absint( $arguments['mla_itemwidth'] );
295
- }
296
- else {
297
- $itemwidth = $arguments['columns'] > 0 ? (floor(100/$arguments['columns']) - $margin) : 100 - $margin;
298
- }
299
-
300
- $float = strtolower( $arguments['mla_float'] );
301
- if ( ! in_array( $float, array( 'left', 'none', 'right' ) ) )
302
- $float = is_rtl() ? 'right' : 'left';
303
-
304
- $style_values = array(
305
- 'mla_style' => $arguments['mla_style'],
306
- 'mla_markup' => $arguments['mla_markup'],
307
- 'instance' => $instance,
308
- 'id' => $post->ID,
309
- 'itemtag' => tag_escape( $arguments['itemtag'] ),
310
- 'icontag' => tag_escape( $arguments['icontag'] ),
311
- 'captiontag' => tag_escape( $arguments['captiontag'] ),
312
- 'columns' => intval( $arguments['columns']),
313
- 'itemwidth' => intval( $itemwidth ),
314
- 'margin' => $arguments['mla_margin'],
315
- 'float' => $float,
316
- 'selector' => "mla_gallery-{$instance}",
317
- 'size_class' => sanitize_html_class( $size_class )
318
- );
319
-
320
- $style_template = $gallery_style = '';
321
- $use_mla_gallery_style = ( 'none' != strtolower( $style_values['mla_style'] ) );
322
- if ( apply_filters( 'use_mla_gallery_style', $use_mla_gallery_style ) ) {
323
- $style_template = MLAOptions::mla_fetch_gallery_template( $style_values['mla_style'], 'style' );
324
- if ( empty( $style_template ) ) {
325
- $style_values['mla_style'] = 'default';
326
- $style_template = MLAOptions::mla_fetch_gallery_template( 'default', 'style' );
327
- }
328
-
329
- if ( ! empty ( $style_template ) ) {
330
- $gallery_style = MLAData::mla_parse_template( $style_template, $style_values );
331
- } // !empty template
332
- } // use_mla_gallery_style
333
-
334
- $upload_dir = wp_upload_dir();
335
- $markup_values = $style_values;
336
- $markup_values['base_url'] = $upload_dir['baseurl'];
337
- $markup_values['base_dir'] = $upload_dir['basedir'];
338
-
339
- /*
340
- * Variable item-level placeholders
341
- */
342
- $terms_placeholders = array();
343
- $custom_placeholders = array();
344
- $iptc_placeholders = array();
345
- $exif_placeholders = array();
346
-
347
- $markup_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-open', 'markup' );
348
- if ( empty( $markup_template ) ) {
349
- $markup_values['mla_markup'] = 'default';
350
- $markup_template = MLAOptions::mla_fetch_gallery_template( 'default-open', 'markup' );
351
- }
352
-
353
- if ( ! empty( $markup_template ) ) {
354
- $gallery_div = MLAData::mla_parse_template( $markup_template, $markup_values );
355
-
356
- $row_open_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-row-open', 'markup' );
357
- if ( empty( $row_open_template ) )
358
- $row_open_template = '';
359
-
360
- $item_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-item', 'markup' );
361
- if ( empty( $item_template ) )
362
- $item_template = '';
363
- else {
364
- /*
365
- * Look for variable item-level placeholders
366
- */
367
- $new_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_link_text'] . $arguments['mla_rollover_text'] . $arguments['mla_caption'] ) );
368
- $placeholders = MLAData::mla_get_template_placeholders( $item_template . $new_text );
369
- foreach ($placeholders as $key => $value ) {
370
- switch ( $value['prefix'] ) {
371
- case 'terms':
372
- $terms_placeholders[ $key ] = $value;
373
- break;
374
- case 'custom':
375
- $custom_placeholders[ $key ] = $value;
376
- break;
377
- case 'iptc':
378
- $iptc_placeholders[ $key ] = $value;
379
- break;
380
- case 'exif':
381
- $exif_placeholders[ $key ] = $value;
382
- break;
383
- default:
384
- // ignore anything else
385
- } // switch
386
- } // $placeholders
387
- } // $item_template
388
-
389
- $row_close_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-row-close', 'markup' );
390
- if ( empty( $row_close_template ) )
391
- $row_close_template = '';
392
-
393
- $close_template = MLAOptions::mla_fetch_gallery_template( $markup_values['mla_markup'] . '-close', 'markup' );
394
- if ( empty( $close_template ) )
395
- $close_template = '';
396
- }
397
-
398
- if ( self::$mla_debug ) {
399
- $output = self::$mla_debug_messages;
400
- self::$mla_debug_messages = '';
401
- }
402
- else
403
- $output = '';
404
-
405
- $output .= apply_filters( 'mla_gallery_style', $gallery_style . $gallery_div, $style_values, $markup_values, $style_template, $markup_template );
406
-
407
- $i = 0;
408
- foreach ( $attachments as $id => $attachment ) {
409
- /*
410
- * fill in item-specific elements
411
- */
412
- $markup_values['index'] = (string) 1 + $i;
413
-
414
- $markup_values['excerpt'] = wptexturize( $attachment->post_excerpt );
415
- $markup_values['attachment_ID'] = $attachment->ID;
416
- $markup_values['mime_type'] = $attachment->post_mime_type;
417
- $markup_values['menu_order'] = $attachment->menu_order;
418
- $markup_values['date'] = $attachment->post_date;
419
- $markup_values['modified'] = $attachment->post_modified;
420
- $markup_values['parent'] = $attachment->post_parent;
421
- $markup_values['parent_title'] = '(unattached)';
422
- $markup_values['parent_type'] = '';
423
- $markup_values['parent_date'] = '';
424
- $markup_values['title'] = wptexturize( $attachment->post_title );
425
- $markup_values['slug'] = wptexturize( $attachment->post_name );
426
- $markup_values['width'] = '';
427
- $markup_values['height'] = '';
428
- $markup_values['image_meta'] = '';
429
- $markup_values['image_alt'] = '';
430
- $markup_values['base_file'] = '';
431
- $markup_values['path'] = '';
432
- $markup_values['file'] = '';
433
- $markup_values['description'] = wptexturize( $attachment->post_content );
434
- $markup_values['file_url'] = wptexturize( $attachment->guid );
435
- $markup_values['author_id'] = $attachment->post_author;
436
-
437
- $user = get_user_by( 'id', $attachment->post_author );
438
- if ( isset( $user->data->display_name ) )
439
- $markup_values['author'] = wptexturize( $user->data->display_name );
440
- else
441
- $markup_values['author'] = 'unknown';
442
-
443
- $post_meta = MLAData::mla_fetch_attachment_metadata( $attachment->ID );
444
- if ( !empty( $post_meta['mla_wp_attachment_metadata'] ) ) {
445
- $base_file = $post_meta['mla_wp_attachment_metadata']['file'];
446
- $sizes = $post_meta['mla_wp_attachment_metadata']['sizes'];
447
- $markup_values['width'] = $post_meta['mla_wp_attachment_metadata']['width'];
448
- $markup_values['height'] = $post_meta['mla_wp_attachment_metadata']['height'];
449
- $markup_values['image_meta'] = wptexturize( var_export( $post_meta['mla_wp_attachment_metadata']['image_meta'], true ) );
450
- }
451
- else {
452
- $base_file = $post_meta['mla_wp_attached_file'];
453
- $sizes = array();
454
- }
455
-
456
- if ( isset( $post_meta['mla_wp_attachment_image_alt'] ) )
457
- $markup_values['image_alt'] = wptexturize( $post_meta['mla_wp_attachment_image_alt'] );
458
-
459
- if ( ! empty( $base_file ) ) {
460
- $last_slash = strrpos( $base_file, '/' );
461
- if ( false === $last_slash ) {
462
- $file_name = $base_file;
463
- $markup_values['base_file'] = wptexturize( $base_file );
464
- $markup_values['file'] = wptexturize( $base_file );
465
- }
466
- else {
467
- $file_name = substr( $base_file, $last_slash + 1 );
468
- $markup_values['base_file'] = wptexturize( $base_file );
469
- $markup_values['path'] = wptexturize( substr( $base_file, 0, $last_slash + 1 ) );
470
- $markup_values['file'] = wptexturize( $file_name );
471
- }
472
- }
473
- else
474
- $file_name = '';
475
-
476
- $parent_info = MLAData::mla_fetch_attachment_parent_data( $attachment->post_parent );
477
- if ( isset( $parent_info['parent_title'] ) )
478
- $markup_values['parent_title'] = wptexturize( $parent_info['parent_title'] );
479
-
480
- if ( isset( $parent_info['parent_date'] ) )
481
- $markup_values['parent_date'] = wptexturize( $parent_info['parent_date'] );
482
-
483
- if ( isset( $parent_info['parent_type'] ) )
484
- $markup_values['parent_type'] = wptexturize( $parent_info['parent_type'] );
485
-
486
- /*
487
- * Add variable placeholders
488
- */
489
- foreach ( $terms_placeholders as $key => $value ) {
490
- $text = '';
491
- $terms = wp_get_object_terms( $attachment->ID, $value['value'] );
492
-
493
- if ( is_wp_error( $terms ) || empty( $terms ) )
494
- $text = '';
495
- else {
496
- if ( $value['single'] )
497
- $text = sanitize_term_field( 'name', $terms[0]->name, $terms[0]->term_id, $value, 'display' );
498
- else
499
- foreach ( $terms as $term ) {
500
- $term_name = sanitize_term_field( 'name', $term->name, $term->term_id, $value, 'display' );
501
- $text .= strlen( $text ) ? ', ' . $term_name : $term_name;
502
- }
503
- }
504
-
505
- $markup_values[ $key ] = $text;
506
- } // $terms_placeholders
507
-
508
- foreach ( $custom_placeholders as $key => $value ) {
509
- $record = get_metadata( 'post', $attachment->ID, $value['value'], $value['single'] );
510
-
511
- if ( is_wp_error( $record ) || empty( $record ) )
512
- $text = '';
513
- elseif ( is_scalar( $record ) )
514
- $text = (string) $record;
515
- elseif ( is_array( $record ) ) {
516
- $text = '';
517
- foreach ( $record as $term ) {
518
- $term_name = sanitize_text_field( $term );
519
- $text .= strlen( $text ) ? ', ' . $term_name : $term_name;
520
- }
521
- } // is_array
522
- else
523
- $text = '';
524
-
525
- $markup_values[ $key ] = $text;
526
- } // $custom_placeholders
527
-
528
- if ( !empty( $iptc_placeholders ) || !empty( $exif_placeholders ) ) {
529
- $image_metadata = MLAData::mla_fetch_attachment_image_metadata( $attachment->ID );
530
- }
531
-
532
- foreach ( $iptc_placeholders as $key => $value ) {
533
- // convert friendly name/slug to identifier
534
- if ( array_key_exists( $value['value'], self::$mla_iptc_keys ) ) {
535
- $value['value'] = self::$mla_iptc_keys[ $value['value'] ];
536
- }
537
-
538
- $text = '';
539
- if ( array_key_exists( $value['value'], $image_metadata['mla_iptc_metadata'] ) ) {
540
- $record = $image_metadata['mla_iptc_metadata'][ $value['value'] ];
541
- if ( is_array( $record ) ) {
542
- if ( $value['single'] )
543
- $text = $record[0];
544
- else
545
- foreach ( $record as $term ) {
546
- $term_name = sanitize_text_field( $term );
547
- $text .= strlen( $text ) ? ', ' . $term_name : $term_name;
548
- }
549
- } // is_array
550
- else
551
- $text = $record;
552
- }
553
-
554
- $markup_values[ $key ] = $text;
555
- } // $iptc_placeholders
556
-
557
- foreach ( $exif_placeholders as $key => $value ) {
558
- $markup_values[ $key ] = MLAData::mla_exif_metadata_value( $value['value'], $image_metadata );
559
- } // $exif_placeholders
560
-
561
- unset(
562
- $markup_values['caption'],
563
- $markup_values['pagelink'],
564
- $markup_values['filelink'],
565
- $markup_values['link'],
566
- $markup_values['pagelink_url'],
567
- $markup_values['filelink_url'],
568
- $markup_values['link_url'],
569
- $markup_values['thumbnail_content'],
570
- $markup_values['thumbnail_width'],
571
- $markup_values['thumbnail_height'],
572
- $markup_values['thumbnail_url']
573
- );
574
-
575
- if ( $markup_values['captiontag'] ) {
576
- if ( ! empty( $arguments['mla_caption'] ) ) {
577
- $new_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_caption'] ) );
578
- $markup_values['caption'] = wptexturize( MLAData::mla_parse_template( $new_text, $markup_values ) );
579
- }
580
- else
581
- $markup_values['caption'] = wptexturize( $attachment->post_excerpt );
582
- }
583
- else
584
- $markup_values['caption'] = '';
585
-
586
- if ( ! empty( $arguments['mla_link_text'] ) ) {
587
- $link_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_link_text'] ) );
588
- $link_text = MLAData::mla_parse_template( $link_text, $markup_values );
589
- }
590
- else
591
- $link_text = false;
592
-
593
- $markup_values['pagelink'] = wp_get_attachment_link($attachment->ID, $size, true, $show_icon, $link_text);
594
- $markup_values['filelink'] = wp_get_attachment_link($attachment->ID, $size, false, $show_icon, $link_text);
595
- if ( ! empty( $arguments['mla_rollover_text'] ) ) {
596
- $new_text = str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments['mla_rollover_text'] ) );
597
- $new_text = MLAData::mla_parse_template( $new_text, $markup_values );
598
-
599
- /*
600
- * Replace single- and double-quote delimited values
601
- */
602
- $markup_values['pagelink'] = preg_replace('# title=\'([^\']*)\'#', " title='{$new_text}'", $markup_values['pagelink'] );
603
- $markup_values['pagelink'] = preg_replace('# title=\"([^\"]*)\"#', " title=\"{$new_text}\"", $markup_values['pagelink'] );
604
- $markup_values['filelink'] = preg_replace('# title=\'([^\']*)\'#', " title='{$new_text}'", $markup_values['filelink'] );
605
- $markup_values['filelink'] = preg_replace('# title=\"([^\"]*)\"#', " title=\"{$new_text}\"", $markup_values['filelink'] );
606
- }
607
-
608
- switch ( $arguments['link'] ) {
609
- case 'permalink':
610
- $markup_values['link'] = $markup_values['pagelink'];
611
- break;
612
- case 'file':
613
- case 'full':
614
- $markup_values['link'] = $markup_values['filelink'];
615
- break;
616
- default:
617
- $markup_values['link'] = $markup_values['filelink'];
618
-
619
- /*
620
- * Check for link to specific (registered) file size
621
- */
622
- if ( array_key_exists( $arguments['link'], $sizes ) ) {
623
- $target_file = $sizes[ $arguments['link'] ]['file'];
624
- $markup_values['link'] = str_replace( $file_name, $target_file, $markup_values['filelink'] );
625
- }
626
- } // switch 'link'
627
-
628
- /*
629
- * Extract target and thumbnail fields
630
- */
631
- $match_count = preg_match_all( '#href=\'([^\']+)\' title=\'([^\']*)\'#', $markup_values['pagelink'], $matches, PREG_OFFSET_CAPTURE );
632
- if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
633
- $markup_values['pagelink_url'] = $matches[1][0][0];
634
- }
635
- else
636
- $markup_values['pagelink_url'] = '';
637
-
638
- $match_count = preg_match_all( '#href=\'([^\']+)\'#', $markup_values['filelink'], $matches, PREG_OFFSET_CAPTURE );
639
- if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
640
- $markup_values['filelink_url'] = $matches[1][0][0];
641
- }
642
- else
643
- $markup_values['filelink_url'] = '';
644
-
645
- $match_count = preg_match_all( '#href=\'([^\']+)\'#', $markup_values['link'], $matches, PREG_OFFSET_CAPTURE );
646
- if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
647
- $markup_values['link_url'] = $matches[1][0][0];
648
- }
649
- else
650
- $markup_values['link_url'] = '';
651
-
652
- $match_count = preg_match_all( '#\<a [^\>]+\>(.*)\</a\>#', $markup_values['link'], $matches, PREG_OFFSET_CAPTURE );
653
- if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
654
- $markup_values['thumbnail_content'] = $matches[1][0][0];
655
- }
656
- else
657
- $markup_values['thumbnail_content'] = '';
658
-
659
- $match_count = preg_match_all( '#img width=\"([^\"]+)\" height=\"([^\"]+)\" src=\"([^\"]+)\"#', $markup_values['link'], $matches, PREG_OFFSET_CAPTURE );
660
- if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
661
- $markup_values['thumbnail_width'] = $matches[1][0][0];
662
- $markup_values['thumbnail_height'] = $matches[2][0][0];
663
- $markup_values['thumbnail_url'] = $matches[3][0][0];
664
- }
665
- else {
666
- $markup_values['thumbnail_width'] = '';
667
- $markup_values['thumbnail_height'] = '';
668
- $markup_values['thumbnail_url'] = '';
669
- }
670
-
671
- /*
672
- * Check for Google file viewer substitution
673
- */
674
- if ( $arguments['mla_viewer'] && empty( $markup_values['thumbnail_url'] ) ) {
675
- $last_dot = strrpos( $markup_values['file'], '.' );
676
- if ( !( false === $last_dot) ) {
677
- $extension = substr( $markup_values['file'], $last_dot + 1 );
678
- if ( in_array( $extension, $arguments['mla_viewer_extensions'] ) ) {
679
- $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'] );
680
- $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'] );
681
- $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'] );
682
-
683
- if ( 'permalink' == $arguments['link'] )
684
- $markup_values['link'] = $markup_values['pagelink'];
685
- else
686
- $markup_values['link'] = $markup_values['filelink'];
687
- } // viewer extension
688
- } // has extension
689
- } // mla_viewer
690
-
691
- /*
692
- * Start of row markup
693
- */
694
- if ( $markup_values['columns'] > 0 && $i % $markup_values['columns'] == 0 )
695
- $output .= MLAData::mla_parse_template( $row_open_template, $markup_values );
696
-
697
- /*
698
- * item markup
699
- */
700
- $output .= MLAData::mla_parse_template( $item_template, $markup_values );
701
-
702
- /*
703
- * End of row markup
704
- */
705
- $i++;
706
- if ( $markup_values['columns'] > 0 && $i % $markup_values['columns'] == 0 )
707
- $output .= MLAData::mla_parse_template( $row_close_template, $markup_values );
708
- }
709
-
710
- /*
711
- * Close out partial row
712
- */
713
- if ( ! ($markup_values['columns'] > 0 && $i % $markup_values['columns'] == 0 ) )
714
- $output .= MLAData::mla_parse_template( $row_close_template, $markup_values );
715
-
716
- $output .= MLAData::mla_parse_template( $close_template, $markup_values );
717
-
718
- return $output;
719
- }
720
-
721
- /**
722
- * Parses shortcode parameters and returns the gallery objects
723
- *
724
- * @since .50
725
- *
726
- * @param int Post ID of the parent
727
- * @param array Attributes of the shortcode
728
- *
729
- * @return array List of attachments returned from WP_Query
730
- */
731
- public static function mla_get_shortcode_attachments( $post_parent, $attr ) {
732
- /*
733
- * These are the parameters for the query
734
- */
735
- $default_arguments = array(
736
- 'order' => 'ASC', // or 'DESC' or 'RAND'
737
- 'orderby' => 'menu_order ID',
738
- 'id' => NULL,
739
- 'ids' => array(),
740
- 'include' => array(),
741
- 'exclude' => array(),
742
- // MLA extensions, from WP_Query
743
- // Force 'get_children' style query
744
- 'post_parent' => NULL, // post/page ID or 'current' or 'all'
745
- // Author
746
- 'author' => NULL,
747
- 'author_name' => '',
748
- // Category
749
- 'cat' => 0,
750
- 'category_name' => '',
751
- 'category__and' => array(),
752
- 'category__in' => array(),
753
- 'category__not_in' => array(),
754
- // Tag
755
- 'tag' => '',
756
- 'tag_id' => 0,
757
- 'tag__and' => array(),
758
- 'tag__in' => array(),
759
- 'tag__not_in' => array(),
760
- 'tag_slug__and' => array(),
761
- 'tag_slug__in' => array(),
762
- // Taxonomy parameters are handled separately
763
- // {tax_slug} => 'term' | array ( 'term, 'term, ... )
764
- // 'tax_query' => ''
765
- // Post
766
- 'post_type' => 'attachment',
767
- 'post_status' => 'inherit',
768
- 'post_mime_type' => 'image',
769
- // Pagination - no default for most of these
770
- 'nopaging' => true,
771
- 'posts_per_page' => 0,
772
- 'posts_per_archive_page' => 0,
773
- 'paged' => NULL, // page number or 'current'
774
- 'offset' => NULL,
775
- // TBD Time
776
- // Custom Field
777
- 'meta_key' => '',
778
- 'meta_value' => '',
779
- 'meta_value_num' => NULL,
780
- 'meta_compare' => '',
781
- 'meta_query' => '',
782
- // Search
783
- 's' => ''
784
- );
785
-
786
- /*
787
- * Merge input arguments with defaults, then extract the query arguments.
788
- */
789
-
790
- if ( is_string( $attr ) )
791
- $attr = shortcode_parse_atts( $attr );
792
-
793
- $arguments = shortcode_atts( $default_arguments, $attr );
794
- self::$query_parameters = array();
795
-
796
- if ( 'RAND' == $arguments['order'] )
797
- $arguments['orderby'] = 'none';
798
-
799
- if ( !empty( $arguments['ids'] ) ) {
800
- // 'ids' is explicitly ordered
801
- $arguments['orderby'] = 'post__in';
802
- $arguments['include'] = $arguments['ids'];
803
- }
804
- unset( $arguments['ids'] );
805
-
806
- /*
807
- * Extract taxonomy arguments
808
- */
809
- $taxonomies = get_taxonomies( array ( 'show_ui' => 'true' ), 'names' ); // 'objects'
810
- $query_arguments = array();
811
- if ( ! empty( $attr ) ) {
812
- foreach ( $attr as $key => $value ) {
813
- if ( 'tax_query' == $key ) {
814
- if ( is_array( $value ) )
815
- $query_arguments[ $key ] = $value;
816
- else {
817
- $function = @create_function('', 'return ' . $value . ';' );
818
-
819
- if ( is_callable( $function ) )
820
- $query_arguments[ $key ] = $function();
821
- else
822
- return '<p>ERROR: invalid mla_gallery tax_query = ' . var_export( $value, true ) . '</p>';
823
- } // not array
824
- } // tax_query
825
- elseif ( array_key_exists( $key, $taxonomies ) ) {
826
- $query_arguments[ $key ] = implode(',', array_filter( array_map( 'trim', explode( ",", $value ) ) ) );
827
- } // array_key_exists
828
- } //foreach $attr
829
- } // ! empty
830
-
831
- // We're trusting author input, but let's at least make sure it looks like a valid orderby statement
832
- if ( isset( $arguments['orderby'] ) ) {
833
- $arguments['orderby'] = sanitize_sql_orderby( $arguments['orderby'] );
834
- if ( ! $arguments['orderby'] )
835
- unset( $arguments['orderby'] );
836
- }
837
-
838
- /*
839
- * $query_arguments has been initialized in the taxonomy code above.
840
- */
841
- $use_children = empty( $query_arguments );
842
- foreach ($arguments as $key => $value ) {
843
- /*
844
- * There are several "fallthru" cases in this switch statement that decide
845
- * whether or not to limit the query to children of a specific post.
846
- */
847
- $children_ok = true;
848
- switch ( $key ) {
849
- case 'post_parent':
850
- switch ( strtolower( $value ) ) {
851
- case 'all':
852
- $value = NULL;
853
- $use_children = false;
854
- break;
855
- case 'any':
856
- self::$query_parameters['post_parent'] = 'any';
857
- $value = NULL;
858
- $use_children = false;
859
- break;
860
- case 'current':
861
- $value = $post_parent;
862
- break;
863
- case 'none':
864
- self::$query_parameters['post_parent'] = 'none';
865
- $value = NULL;
866
- $use_children = false;
867
- break;
868
- }
869
- // fallthru
870
- case 'id':
871
- case 'posts_per_page':
872
- case 'posts_per_archive_page':
873
- if ( is_numeric( $value ) ) {
874
- $value = intval( $value );
875
- if ( ! empty( $value ) ) {
876
- $query_arguments[ $key ] = $value;
877
- if ( ! $children_ok )
878
- $use_children = false;
879
- }
880
- }
881
- unset( $arguments[ $key ] );
882
- break;
883
- case 'meta_value_num':
884
- $children_ok = false;
885
- // fallthru
886
- case 'offset':
887
- if ( is_numeric( $value ) ) {
888
- $query_arguments[ $key ] = intval( $value );
889
- if ( ! $children_ok )
890
- $use_children = false;
891
- }
892
- unset( $arguments[ $key ] );
893
- break;
894
- case 'paged':
895
- if ( 'current' == strtolower( $value ) )
896
- $query_arguments[ $key ] = (get_query_var('paged')) ? get_query_var('paged') : 1;
897
- elseif ( is_numeric( $value ) )
898
- $query_arguments[ $key ] = intval( $value );
899
- unset( $arguments[ $key ] );
900
- break;
901
- case 'author':
902
- case 'cat':
903
- case 'tag_id':
904
- if ( ! empty( $value ) ) {
905
- if ( is_array( $value ) )
906
- $query_arguments[ $key ] = array_filter( $value );
907
- else
908
- $query_arguments[ $key ] = array_filter( array_map( 'intval', explode( ",", $value ) ) );
909
-
910
- if ( 1 == count( $query_arguments[ $key ] ) )
911
- $query_arguments[ $key ] = $query_arguments[ $key ][0];
912
- else
913
- $query_arguments[ $key ] = implode(',', $query_arguments[ $key ] );
914
-
915
- $use_children = false;
916
- }
917
- unset( $arguments[ $key ] );
918
- break;
919
- case 'category__and':
920
- case 'category__in':
921
- case 'category__not_in':
922
- case 'tag__and':
923
- case 'tag__in':
924
- case 'tag__not_in':
925
- $children_ok = false;
926
- // fallthru
927
- case 'include':
928
- case 'exclude':
929
- if ( ! empty( $value ) ) {
930
- if ( is_array( $value ) )
931
- $query_arguments[ $key ] = array_filter( $value );
932
- else
933
- $query_arguments[ $key ] = array_filter( array_map( 'intval', explode( ",", $value ) ) );
934
-
935
- if ( ! $children_ok )
936
- $use_children = false;
937
- }
938
- unset( $arguments[ $key ] );
939
- break;
940
- case 'tag_slug__and':
941
- case 'tag_slug__in':
942
- if ( ! empty( $value ) ) {
943
- if ( is_array( $value ) )
944
- $query_arguments[ $key ] = $value;
945
- else
946
- $query_arguments[ $key ] = array_filter( array_map( 'trim', explode( ",", $value ) ) );
947
-
948
- $use_children = false;
949
- }
950
- unset( $arguments[ $key ] );
951
- break;
952
- case 'nopaging': // boolean
953
- if ( ! empty( $value ) && ( 'false' != strtolower( $value ) ) )
954
- $query_arguments[ $key ] = true;
955
- unset( $arguments[ $key ] );
956
- break;
957
- case 'author_name':
958
- case 'category_name':
959
- case 'tag':
960
- case 'meta_key':
961
- case 'meta_value':
962
- case 'meta_compare':
963
- case 's':
964
- $children_ok = false;
965
- // fallthru
966
- case 'post_type':
967
- case 'post_status':
968
- case 'post_mime_type':
969
- case 'order':
970
- case 'orderby':
971
- if ( ! empty( $value ) ) {
972
- $query_arguments[ $key ] = $value;
973
-
974
- if ( ! $children_ok )
975
- $use_children = false;
976
- }
977
- unset( $arguments[ $key ] );
978
- break;
979
- case 'meta_query':
980
- if ( ! empty( $value ) ) {
981
- if ( is_array( $value ) )
982
- $query_arguments[ $key ] = $value;
983
- else {
984
- $function = @create_function('', 'return ' . $value . ';' );
985
-
986
- if ( is_callable( $function ) )
987
- $query_arguments[ $key ] = $function();
988
- else
989
- return '<p>ERROR: invalid mla_gallery meta_query = ' . var_export( $value, true ) . '</p>';
990
- } // not array
991
-
992
- $use_children = false;
993
- }
994
- unset( $arguments[ $key ] );
995
- break;
996
- default:
997
- // ignore anything else
998
- } // switch $key
999
- } // foreach $arguments
1000
-
1001
- /*
1002
- * Decide whether to use a "get_children" style query
1003
- */
1004
- if ( $use_children && empty( $query_arguments['post_parent'] ) ) {
1005
- if ( empty( $query_arguments['id'] ) )
1006
- $query_arguments['post_parent'] = $post_parent;
1007
- else
1008
- $query_arguments['post_parent'] = $query_arguments['id'];
1009
-
1010
- unset( $query_arguments['id'] );
1011
- }
1012
-
1013
- if ( isset( $query_arguments['posts_per_page'] ) || isset( $query_arguments['posts_per_archive_page'] ) ||
1014
- isset( $query_arguments['paged'] ) || isset( $query_arguments['offset'] ) ) {
1015
- unset ( $query_arguments['nopaging'] );
1016
- }
1017
-
1018
- if ( isset( $query_arguments['orderby'] ) && ('rand' == $query_arguments['orderby'] ) )
1019
- unset ( $query_arguments['order'] );
1020
-
1021
- if ( isset( $query_arguments['order'] ) && ('rand' == $query_arguments['order'] ) )
1022
- unset ( $query_arguments['orderby'] );
1023
-
1024
- if ( isset( $query_arguments['post_mime_type'] ) && ('all' == strtolower( $query_arguments['post_mime_type'] ) ) )
1025
- unset ( $query_arguments['post_mime_type'] );
1026
-
1027
- if ( ! empty($query_arguments['include']) ) {
1028
- $incposts = wp_parse_id_list( $query_arguments['include'] );
1029
- $query_arguments['posts_per_page'] = count($incposts); // only the number of posts included
1030
- $query_arguments['post__in'] = $incposts;
1031
- } elseif ( ! empty($query_arguments['exclude']) )
1032
- $query_arguments['post__not_in'] = wp_parse_id_list( $query_arguments['exclude'] );
1033
-
1034
- $query_arguments['ignore_sticky_posts'] = true;
1035
- $query_arguments['no_found_rows'] = true;
1036
-
1037
- add_filter( 'posts_where', 'MLAShortcodes::mla_shortcode_query_posts_where_filter' );
1038
- $get_posts = new WP_Query;
1039
- $attachments = $get_posts->query($query_arguments);
1040
- remove_filter( 'posts_where', 'MLAShortcodes::mla_shortcode_query_posts_where_filter' );
1041
-
1042
- if ( self::$mla_debug ) {
1043
- self::$mla_debug_messages .= '<p><strong>mla_debug</strong> query = ' . var_export( $query_arguments, true ) . '</p>';
1044
- self::$mla_debug_messages .= '<p><strong>mla_debug</strong> request = ' . var_export( $get_posts->request, true ) . '</p>';
1045
- self::$mla_debug_messages .= '<p><strong>mla_debug</strong> query_vars = ' . var_export( $get_posts->query_vars, true ) . '</p>';
1046
- }
1047
-
1048
- return $attachments;
1049
- }
1050
-
1051
- /**
1052
- * Filters the WHERE clause for shortcode queries
1053
- *
1054
- * Captures debug information. Adds whitespace to the post_type = 'attachment'
1055
- * phrase to circumvent subsequent Role Scoper modification of the clause.
1056
- * Handles post_parent "any" and "none" cases.
1057
- * Defined as public because it's a filter.
1058
- *
1059
- * @since 0.70
1060
- *
1061
- * @param string query clause before modification
1062
- *
1063
- * @return string query clause after modification
1064
- */
1065
- public static function mla_shortcode_query_posts_where_filter( $where_clause ) {
1066
- global $table_prefix;
1067
-
1068
- if ( self::$mla_debug ) {
1069
- $old_clause = $where_clause;
1070
- self::$mla_debug_messages .= '<p><strong>mla_debug</strong> WHERE filter = ' . var_export( $where_clause, true ) . '</p>';
1071
- }
1072
-
1073
- if ( strpos( $where_clause, "post_type = 'attachment'" ) ) {
1074
- $where_clause = str_replace( "post_type = 'attachment'", "post_type = 'attachment'", $where_clause );
1075
- }
1076
-
1077
- if ( isset( self::$query_parameters['post_parent'] ) ) {
1078
- switch ( self::$query_parameters['post_parent'] ) {
1079
- case 'any':
1080
- $where_clause .= " AND {$table_prefix}posts.post_parent > 0";
1081
- break;
1082
- case 'none':
1083
- $where_clause .= " AND {$table_prefix}posts.post_parent < 1";
1084
- break;
1085
- }
1086
- }
1087
-
1088
- if ( self::$mla_debug && ( $old_clause != $where_clause ) )
1089
- self::$mla_debug_messages .= '<p><strong>mla_debug</strong> modified WHERE filter = ' . var_export( $where_clause, true ) . '</p>';
1090
-
1091
- return $where_clause;
1092
- }
1093
-
1094
- /**
1095
- * IPTC Dataset identifiers and names
1096
- *
1097
- * This array contains the identifiers and names of Datasets defined in
1098
- * the "IPTC-NAA Information Interchange Model Version No. 4.1".
1099
- *
1100
- * @since 0.90
1101
- *
1102
- * @var array
1103
- */
1104
- private static $mla_iptc_records = array(
1105
- // Envelope Record
1106
- "1#000" => "Model Version",
1107
- "1#005" => "Destination",
1108
- "1#020" => "File Format",
1109
- "1#022" => "File Format Version",
1110
- "1#030" => "Service Identifier",
1111
- "1#040" => "Envelope Number",
1112
- "1#050" => "Product ID",
1113
- "1#060" => "Envelope Priority",
1114
- "1#070" => "Date Sent",
1115
- "1#080" => "Time Sent",
1116
- "1#090" => "Coded Character Set",
1117
- "1#100" => "UNO",
1118
- "1#120" => "ARM Identifier",
1119
- "1#122" => "ARM Version",
1120
-
1121
- // Application Record
1122
- "2#000" => "Record Version",
1123
- "2#003" => "Object Type Reference",
1124
- "2#004" => "Object Attribute Reference",
1125
- "2#005" => "Object Name",
1126
- "2#007" => "Edit Status",
1127
- "2#008" => "Editorial Update",
1128
- "2#010" => "Urgency",
1129
- "2#012" => "Subject Reference",
1130
- "2#015" => "Category",
1131
- "2#020" => "Supplemental Category",
1132
- "2#022" => "Fixture Identifier",
1133
- "2#025" => "Keywords",
1134
- "2#026" => "Content Location Code",
1135
- "2#027" => "Content Location Name",
1136
- "2#030" => "Release Date",
1137
- "2#035" => "Release Time",
1138
- "2#037" => "Expiration Date",
1139
- "2#038" => "Expiration Time",
1140
- "2#040" => "Special Instructions",
1141
- "2#042" => "Action Advised",
1142
- "2#045" => "Reference Service",
1143
- "2#047" => "Reference Date",
1144
- "2#050" => "Reference Number",
1145
- "2#055" => "Date Created",
1146
- "2#060" => "Time Created",
1147
- "2#062" => "Digital Creation Date",
1148
- "2#063" => "Digital Creation Time",
1149
- "2#065" => "Originating Program",
1150
- "2#070" => "Program Version",
1151
- "2#075" => "Object Cycle",
1152
- "2#080" => "By-line",
1153
- "2#085" => "By-line Title",
1154
- "2#090" => "City",
1155
- "2#092" => "Sub-location",
1156
- "2#095" => "Province or State",
1157
- "2#100" => "Country or Primary Location Code",
1158
- "2#101" => "Country or Primary Location Name",
1159
- "2#103" => "Original Transmission Reference",
1160
- "2#105" => "Headline",
1161
- "2#110" => "Credit",
1162
- "2#115" => "Source",
1163
- "2#116" => "Copyright Notice",
1164
- "2#118" => "Contact",
1165
- "2#120" => "Caption or Abstract",
1166
- "2#122" => "Caption Writer or Editor",
1167
- "2#125" => "Rasterized Caption",
1168
- "2#130" => "Image Type",
1169
- "2#131" => "Image Orientation",
1170
- "2#135" => "Language Identifier",
1171
- "2#150" => "Audio Type",
1172
- "2#151" => "Audio Sampling Rate",
1173
- "2#152" => "Audio Sampling Resolution",
1174
- "2#153" => "Audio Duration",
1175
- "2#154" => "Audio Outcue",
1176
- "2#200" => "ObjectData Preview File Format",
1177
- "2#201" => "ObjectData Preview File Format Version",
1178
- "2#202" => "ObjectData Preview Data",
1179
-
1180
- // Pre ObjectData Descriptor Record
1181
- "7#010" => "Size Mode",
1182
- "7#020" => "Max Subfile Size",
1183
- "7#090" => "ObjectData Size Announced",
1184
- "7#095" => "Maximum ObjectData Size",
1185
-
1186
- // ObjectData Record
1187
- "8#010" => "Subfile",
1188
-
1189
- // Post ObjectData Descriptor Record
1190
- "9#010" => "Confirmed ObjectData Size"
1191
- );
1192
-
1193
- /**
1194
- * IPTC Dataset friendly name/slug and identifiers
1195
- *
1196
- * This array contains the sanitized names and identifiers of Datasets defined in
1197
- * the "IPTC-NAA Information Interchange Model Version No. 4.1".
1198
- *
1199
- * @since 0.90
1200
- *
1201
- * @var array
1202
- */
1203
- public static $mla_iptc_keys = array(
1204
- // Envelope Record
1205
- 'model-version' => '1#000',
1206
- 'destination' => '1#005',
1207
- 'file-format' => '1#020',
1208
- 'file-format-version' => '1#022',
1209
- 'service-identifier' => '1#030',
1210
- 'envelope-number' => '1#040',
1211
- 'product-id' => '1#050',
1212
- 'envelope-priority' => '1#060',
1213
- 'date-sent' => '1#070',
1214
- 'time-sent' => '1#080',
1215
- 'coded-character-set' => '1#090',
1216
- 'uno' => '1#100',
1217
- 'arm-identifier' => '1#120',
1218
- 'arm-version' => '1#122',
1219
-
1220
- // Application Record
1221
- 'record-version' => '2#000',
1222
- 'object-type-reference' => '2#003',
1223
- 'object-attribute-reference' => '2#004',
1224
- 'object-name' => '2#005',
1225
- 'edit-status' => '2#007',
1226
- 'editorial-update' => '2#008',
1227
- 'urgency' => '2#010',
1228
- 'subject-reference' => '2#012',
1229
- 'category' => '2#015',
1230
- 'supplemental-category' => '2#020',
1231
- 'fixture-identifier' => '2#022',
1232
- 'keywords' => '2#025',
1233
- 'content-location-code' => '2#026',
1234
- 'content-location-name' => '2#027',
1235
- 'release-date' => '2#030',
1236
- 'release-time' => '2#035',
1237
- 'expiration-date' => '2#037',
1238
- 'expiration-time' => '2#038',
1239
- 'special-instructions' => '2#040',
1240
- 'action-advised' => '2#042',
1241
- 'reference-service' => '2#045',
1242
- 'reference-date' => '2#047',
1243
- 'reference-number' => '2#050',
1244
- 'date-created' => '2#055',
1245
- 'time-created' => '2#060',
1246
- 'digital-creation-date' => '2#062',
1247
- 'digital-creation-time' => '2#063',
1248
- 'originating-program' => '2#065',
1249
- 'program-version' => '2#070',
1250
- 'object-cycle' => '2#075',
1251
- 'by-line' => '2#080',
1252
- 'by-line-title' => '2#085',
1253
- 'city' => '2#090',
1254
- 'sub-location' => '2#092',
1255
- 'province-or-state' => '2#095',
1256
- 'country-or-primary-location-code' => '2#100',
1257
- 'country-or-primary-location-name' => '2#101',
1258
- 'original-transmission-reference' => '2#103',
1259
- 'headline' => '2#105',
1260
- 'credit' => '2#110',
1261
- 'source' => '2#115',
1262
- 'copyright-notice' => '2#116',
1263
- 'contact' => '2#118',
1264
- 'caption-or-abstract' => '2#120',
1265
- 'caption-writer-or-editor' => '2#122',
1266
- 'rasterized-caption' => '2#125',
1267
- 'image-type' => '2#130',
1268
- 'image-orientation' => '2#131',
1269
- 'language-identifier' => '2#135',
1270
- 'audio-type' => '2#150',
1271
- 'audio-sampling-rate' => '2#151',
1272
- 'audio-sampling-resolution' => '2#152',
1273
- 'audio-duration' => '2#153',
1274
- 'audio-outcue' => '2#154',
1275
- 'objectdata-preview-file-format' => '2#200',
1276
- 'objectdata-preview-file-format-version' => '2#201',
1277
- 'objectdata-preview-data' => '2#202',
1278
-
1279
- // Pre ObjectData Descriptor Record
1280
- 'size-mode' => '7#010',
1281
- 'max-subfile-size' => '7#020',
1282
- 'objectdata-size-announced' => '7#090',
1283
- 'maximum-objectdata-size' => '7#095',
1284
-
1285
- // ObjectData Record
1286
- 'subfile' => '8#010',
1287
-
1288
- // Post ObjectData Descriptor Record
1289
- 'confirmed-objectdata-size' => '9#010'
1290
- );
1291
-
1292
- /**
1293
- * IPTC Dataset descriptions
1294
- *
1295
- * This array contains the descriptions of Datasets defined in
1296
- * the "IPTC-NAA Information Interchange Model Version No. 4.1".
1297
- *
1298
- * @since 0.90
1299
- *
1300
- * @var array
1301
- */
1302
- private static $mla_iptc_descriptions = array(
1303
- // Envelope Record
1304
- "1#000" => "2 octet binary IIM version number",
1305
- "1#005" => "Max 1024 characters of Destination (ISO routing information); repeatable",
1306
- "1#020" => "2 octet binary file format number, see IPTC-NAA V4 Appendix A",
1307
- "1#022" => "2 octet binary file format version number",
1308
- "1#030" => "Max 10 characters of Service Identifier and product",
1309
- "1#040" => "8 Character Envelope Number",
1310
- "1#050" => "Max 32 characters subset of provider's overall service; repeatable",
1311
- "1#060" => "1 numeric character of envelope handling priority (not urgency)",
1312
- "1#070" => "8 numeric characters of Date Sent by service - CCYYMMDD",
1313
- "1#080" => "11 characters of Time Sent by service - HHMMSS±HHMM",
1314
- "1#090" => "Max 32 characters of control functions, etc.",
1315
- "1#100" => "14 to 80 characters of eternal, globally unique identification for objects",
1316
- "1#120" => "2 octet binary Abstract Relationship Model Identifier",
1317
- "1#122" => "2 octet binary Abstract Relationship Model Version",
1318
-
1319
- // Application Record
1320
- "2#000" => "2 octet binary Information Interchange Model, Part II version number",
1321
- "2#003" => "3 to 67 Characters of Object Type Reference number and optional text",
1322
- "2#004" => "3 to 67 Characters of Object Attribute Reference number and optional text; repeatable",
1323
- "2#005" => "Max 64 characters of the object name or shorthand reference",
1324
- "2#007" => "Max 64 characters of the status of the objectdata",
1325
- "2#008" => "2 numeric characters of the type of update this object provides",
1326
- "2#010" => "1 numeric character of the editorial urgency of content",
1327
- "2#012" => "13 to 236 characters of a structured definition of the subject matter; repeatable",
1328
- "2#015" => "Max 3 characters of the subject of the objectdata, DEPRECATED",
1329
- "2#020" => "Max 32 characters (each) of further refinement of subject, DEPRECATED; repeatable",
1330
- "2#022" => "Max 32 characters identifying recurring, predictable content",
1331
- "2#025" => "Max 64 characters (each) of tags; repeatable",
1332
- "2#026" => "3 characters of ISO3166 country code or IPTC-assigned code; repeatable",
1333
- "2#027" => "Max 64 characters of publishable country/geographical location name; repeatable",
1334
- "2#030" => "8 numeric characters of Release Date - CCYYMMDD",
1335
- "2#035" => "11 characters of Release Time (earliest use) - HHMMSS±HHMM",
1336
- "2#037" => "8 numeric characters of Expiration Date (latest use) - CCYYMDD",
1337
- "2#038" => "11 characters of Expiration Time (latest use) - HHMMSS±HHMM",
1338
- "2#040" => "Max 256 Characters of editorial instructions, e.g., embargoes and warnings",
1339
- "2#042" => "2 numeric characters of type of action this object provides to a previous object",
1340
- "2#045" => "Max 10 characters of the Service ID (1#030) of a prior envelope; repeatable",
1341
- "2#047" => "8 numeric characters of prior envelope Reference Date (1#070) - CCYYMMDD; repeatable",
1342
- "2#050" => "8 characters of prior envelope Reference Number (1#040); repeatable",
1343
- "2#055" => "8 numeric characters of intellectual content Date Created - CCYYMMDD",
1344
- "2#060" => "11 characters of intellectual content Time Created - HHMMSS±HHMM",
1345
- "2#062" => "8 numeric characters of digital representation creation date - CCYYMMDD",
1346
- "2#063" => "11 characters of digital representation creation time - HHMMSS±HHMM",
1347
- "2#065" => "Max 32 characters of the program used to create the objectdata",
1348
- "2#070" => "Program Version - Max 10 characters of the version of the program used to create the objectdata",
1349
- "2#075" => "1 character where a=morning, p=evening, b=both",
1350
- "2#080" => "Max 32 Characters of the name of the objectdata creator, e.g., the writer, photographer; repeatable",
1351
- "2#085" => "Max 32 characters of the title of the objectdata creator; repeatable",
1352
- "2#090" => "Max 32 Characters of the city of objectdata origin",
1353
- "2#092" => "Max 32 Characters of the location within the city of objectdata origin",
1354
- "2#095" => "Max 32 Characters of the objectdata origin Province or State",
1355
- "2#100" => "3 characters of ISO3166 or IPTC-assigned code for Country of objectdata origin",
1356
- "2#101" => "Max 64 characters of publishable country/geographical location name of objectdata origin",
1357
- "2#103" => "Max 32 characters of a code representing the location of original transmission",
1358
- "2#105" => "Max 256 Characters of a publishable entry providing a synopsis of the contents of the objectdata",
1359
- "2#110" => "Max 32 Characters that identifies the provider of the objectdata (Vs the owner/creator)",
1360
- "2#115" => "Max 32 Characters that identifies the original owner of the intellectual content",
1361
- "2#116" => "Max 128 Characters that contains any necessary copyright notice",
1362
- "2#118" => "Max 128 characters that identifies the person or organisation which can provide further background information; repeatable",
1363
- "2#120" => "Max 2000 Characters of a textual description of the objectdata",
1364
- "2#122" => "Max 32 Characters that the identifies the person involved in the writing, editing or correcting the objectdata or caption/abstract; repeatable",
1365
- "2#125" => "7360 binary octets of the rasterized caption - 1 bit per pixel, 460x128-pixel image",
1366
- "2#130" => "2 characters of color composition type and information",
1367
- "2#131" => "1 alphabetic character indicating the image area layout - P=portrait, L=landscape, S=square",
1368
- "2#135" => "2 or 3 aphabetic characters containing the major national language of the object, according to the ISO 639:1988 codes",
1369
- "2#150" => "2 characters identifying monaural/stereo and exact type of audio content",
1370
- "2#151" => "6 numeric characters representing the audio sampling rate in hertz (Hz)",
1371
- "2#152" => "2 numeric characters representing the number of bits in each audio sample",
1372
- "2#153" => "6 numeric characters of the Audio Duration - HHMMSS",
1373
- "2#154" => "Max 64 characters of the content of the end of an audio objectdata",
1374
- "2#200" => "2 octet binary file format of the ObjectData Preview",
1375
- "2#201" => "2 octet binary particular version of the ObjectData Preview File Format",
1376
- "2#202" => "Max 256000 binary octets containing the ObjectData Preview data",
1377
-
1378
- // Pre ObjectData Descriptor Record
1379
- "7#010" => "1 numeric character - 0=objectdata size not known, 1=objectdata size known at beginning of transfer",
1380
- "7#020" => "4 octet binary maximum subfile dataset(s) size",
1381
- "7#090" => "4 octet binary objectdata size if known at beginning of transfer",
1382
- "7#095" => "4 octet binary largest possible objectdata size",
1383
-
1384
- // ObjectData Record
1385
- "8#010" => "Subfile DataSet containing the objectdata itself; repeatable",
1386
-
1387
- // Post ObjectData Descriptor Record
1388
- "9#010" => "4 octet binary total objectdata size"
1389
- );
1390
-
1391
- /**
1392
- * IPTC file format identifiers and descriptions
1393
- *
1394
- * This array contains the file format identifiers and descriptions defined in
1395
- * the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 1#020.
1396
- *
1397
- * @since 0.90
1398
- *
1399
- * @var array
1400
- */
1401
- private static $mla_iptc_formats = array(
1402
- 00 => "No ObjectData",
1403
- 01 => "IPTC-NAA Digital Newsphoto Parameter Record",
1404
- 02 => "IPTC7901 Recommended Message Format",
1405
- 03 => "Tagged Image File Format (Adobe/Aldus Image data)",
1406
- 04 => "Illustrator (Adobe Graphics data)",
1407
- 05 => "AppleSingle (Apple Computer Inc)",
1408
- 06 => "NAA 89-3 (ANPA 1312)",
1409
- 07 => "MacBinary II",
1410
- 08 => "IPTC Unstructured Character Oriented File Format (UCOFF)",
1411
- 09 => "United Press International ANPA 1312 variant",
1412
- 10 => "United Press International Down-Load Message",
1413
- 11 => "JPEG File Interchange (JFIF)",
1414
- 12 => "Photo-CD Image-Pac (Eastman Kodak)",
1415
- 13 => "Microsoft Bit Mapped Graphics File [*.BMP]",
1416
- 14 => "Digital Audio File [*.WAV] (Microsoft & Creative Labs)",
1417
- 15 => "Audio plus Moving Video [*.AVI] (Microsoft)",
1418
- 16 => "PC DOS/Windows Executable Files [*.COM][*.EXE]",
1419
- 17 => "Compressed Binary File [*.ZIP] (PKWare Inc)",
1420
- 18 => "Audio Interchange File Format AIFF (Apple Computer Inc)",
1421
- 19 => "RIFF Wave (Microsoft Corporation)",
1422
- 20 => "Freehand (Macromedia/Aldus)",
1423
- 21 => "Hypertext Markup Language - HTML (The Internet Society)",
1424
- 22 => "MPEG 2 Audio Layer 2 (Musicom), ISO/IEC",
1425
- 23 => "MPEG 2 Audio Layer 3, ISO/IEC",
1426
- 24 => "Portable Document File (*.PDF) Adobe",
1427
- 25 => "News Industry Text Format (NITF)",
1428
- 26 => "Tape Archive (*.TAR)",
1429
- 27 => "Tidningarnas Telegrambyrå NITF version (TTNITF DTD)",
1430
- 28 => "Ritzaus Bureau NITF version (RBNITF DTD)",
1431
- 29 => "Corel Draw [*.CDR]"
1432
- );
1433
-
1434
- /**
1435
- * IPTC image type identifiers and descriptions
1436
- *
1437
- * This array contains the image type identifiers and descriptions defined in
1438
- * the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 2#130, octet 2.
1439
- *
1440
- * @since 0.90
1441
- *
1442
- * @var array
1443
- */
1444
- private static $mla_iptc_image_types = array(
1445
- "M" => "Monochrome",
1446
- "Y" => "Yellow Component",
1447
- "M" => "Magenta Component",
1448
- "C" => "Cyan Component",
1449
- "K" => "Black Component",
1450
- "R" => "Red Component",
1451
- "G" => "Green Component",
1452
- "B" => "Blue Component",
1453
- "T" => "Text Only",
1454
- "F" => "Full colour composite, frame sequential",
1455
- "L" => "Full colour composite, line sequential",
1456
- "P" => "Full colour composite, pixel sequential",
1457
- "S" => "Full colour composite, special interleaving"
1458
- );
1459
- } // Class MLAShortcodes
1460
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/mla-objects.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 DELETED
@@ -1,80 +0,0 @@
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
- * Basic library of run-time tests.
20
- */
21
- require_once( MLA_PLUGIN_PATH . 'tests/class-mla-tests.php' );
22
-
23
- add_action( 'init', 'MLATest::initialize' );
24
-
25
- /*
26
- * Template file and database access functions.
27
- */
28
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-data.php' );
29
-
30
- add_action( 'init', 'MLAData::initialize' );
31
-
32
- /*
33
- * Custom Taxonomies and WordPress objects.
34
- */
35
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-objects.php' );
36
-
37
- add_action('init', 'MLAObjects::initialize');
38
-
39
- /*
40
- * Shortcodes
41
- */
42
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-shortcodes.php');
43
-
44
- add_action('init', 'MLAShortcodes::initialize');
45
-
46
- /*
47
- * WordPress 3.5 and later Edit Media screen additions, e.g., meta boxes
48
- */
49
- if ( version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
50
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-edit-media.php');
51
-
52
- add_action('init', 'MLAEdit::initialize');
53
- }
54
-
55
- /*
56
- * Plugin settings management
57
- */
58
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-options.php' );
59
-
60
- add_action( 'init', 'MLAOptions::initialize' );
61
-
62
- /*
63
- * Plugin settings management page
64
- */
65
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings.php' );
66
-
67
- add_action( 'init', 'MLASettings::initialize' );
68
-
69
- /*
70
- * Custom list table package that extends the core WP_List_Table class.
71
- */
72
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-list-table.php' );
73
-
74
- /*
75
- * Main program
76
- */
77
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-main.php');
78
-
79
- add_action('init', 'MLA::initialize');
80
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/mla-shortcodes.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 '&nbsp;<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 "&nbsp;&nbsp;&nbsp;&nbsp;not featured in any posts.<br>\r\n";
40
+ } else {
41
+ echo "&nbsp;&nbsp;&nbsp;&nbsp;Featured in<br>\r\n";
42
+ foreach ( $references['features'] as $feature_id => $feature ) {
43
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
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 "&nbsp;&nbsp;&nbsp;&nbsp;no inserts in any post_content.<br>\r\n";
59
+ } else {
60
+ foreach ( $references['inserts'] as $file => $inserts ) {
61
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;' . $file . " inserted in<br>\r\n";
62
+ foreach ( $inserts as $insert ) {
63
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
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 '&nbsp;&nbsp;&nbsp;&nbsp;' . $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,110 +2,73 @@
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.13
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.13
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
- 'MLAObjects' => 'class',
59
- 'MLASettings' => 'class',
60
- 'MLAShortcodes' => 'class',
61
- 'MLATest' => 'class',
62
- 'MLA_List_Table' => 'class',
63
- );
64
 
65
  /*
66
- * Check for conflicting names, i.e., already defined by some other plugin or theme
67
  */
68
- foreach ( $mla_name_conflict_candidates as $value => $type ) {
69
- switch ($type) {
70
- case 'class':
71
- if ( class_exists( $value ) )
72
- $mla_name_conflict_error_messages .= "<li>class {$value}</li>";
73
- break;
74
- case 'function':
75
- if ( function_exists( $value ) )
76
- $mla_name_conflict_error_messages .= "<li>function {$value}</li>";
77
- break;
78
- case 'constant':
79
- if ( defined( $value ) )
80
- $mla_name_conflict_error_messages .= "<li>constant {$value}</li>";
81
- break;
82
- default:
83
- } // switch $type
84
- }
85
 
86
- /**
87
- * Displays name conflict error messages at the top of the Dashboard
88
- *
89
- * @since 0.20
90
  */
91
- function mla_name_conflict_reporting_action () {
92
- global $mla_name_conflict_error_messages;
93
-
94
- 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";
95
- echo "<ul>{$mla_name_conflict_error_messages}</ul>\r\n";
96
- echo '<p>You most resolve these conflicts before this plugin can safely load.</p></div>'."\r\n";
97
- }
98
 
99
  /*
100
- * Load the plugin or display conflict message(s)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  */
102
- if ( empty( $mla_name_conflict_error_messages ) ) {
103
- require_once('includes/mla-plugin-loader.php');
104
 
105
- register_activation_hook( __FILE__, array( 'MLASettings', 'mla_activation_hook' ) );
106
- register_deactivation_hook( __FILE__, array( 'MLASettings', 'mla_deactivation_hook' ) );
107
- }
108
- else {
109
- add_action( 'admin_notices', 'mla_name_conflict_reporting_action' );
110
- }
111
- ?>
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 0.1
7
  */
8
 
9
  /*
10
  Plugin Name: Media Library Assistant
11
+ Plugin URI: hhttp://home.comcast.net/~dlingren/
12
+ Description: Provides several enhancements to the handling of images and files held in the WordPress Media Library.
13
  Author: David Lingren
14
+ Version: 0.1
15
+ Author URI: http://home.comcast.net/~dlingren/
16
  */
17
 
18
  /**
19
+ * Provides path information to the plugin root in file system format.
 
 
20
  */
21
+ define('MLA_PLUGIN_PATH', plugin_dir_path(__FILE__));
22
+
23
+ /**
24
+ * Provides path information to the plugin root in URL format.
25
+ */
26
+ define('MLA_PLUGIN_URL', plugin_dir_url(__FILE__));
27
+
28
+ if (!defined('MLA_OPTION_PREFIX'))
 
 
 
 
 
 
 
 
29
  /**
30
+ * Gives a unique prefix for plugin options; can be set in wp-config.php
31
  */
32
+ define('MLA_OPTION_PREFIX', 'mla_');
 
33
 
34
+ /*
35
+ * Template file and database access functions.
 
 
 
36
  */
37
+ require_once('includes/class-mla-data.php');
38
+
39
+ add_action('init', 'MLAData::initialize');
 
 
 
 
 
 
 
40
 
41
  /*
42
+ * Custom list table package that extends the core WP_List_Table class.
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
+ * Shortcodes
53
+ */
54
+ require_once('includes/mla-shortcodes.php');
55
+
56
+ /*
57
+ * Basic library of run-time tests.
58
+ */
59
+ require_once('tests/class-mla-tests.php');
60
+
61
+ /*
62
+ * Plugin settings and management page
63
+ */
64
+ require_once('includes/class-mla-settings.php');
65
+
66
+ add_action('init', 'MLASettings::initialize');
67
+
68
+ /*
69
+ * Main program
70
  */
71
+ require_once('includes/class-mla-main.php');
 
72
 
73
+ add_action('init', 'MLA::initialize');
74
+ ?>
 
 
 
 
 
js/mla-inline-edit-scripts.js DELETED
@@ -1,252 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
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-single-edit-scripts.js → mla-scripts.js} RENAMED
@@ -1,7 +1,9 @@
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) {
7
  var out = [];
@@ -15,20 +17,20 @@ 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,7 +58,7 @@ function array_unique_noempty(a) {
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,7 +88,7 @@ function array_unique_noempty(a) {
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,7 +157,7 @@ function array_unique_noempty(a) {
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,8 +201,8 @@ jQuery(document).ready( function($) {
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(){
 
 
1
  var tagBox;
2
 
3
+ var postL10n = {
4
+ comma: ','
5
+ }
6
+
7
  // return an array with any duplicate, whitespace or values removed
8
  function array_unique_noempty(a) {
9
  var out = [];
17
 
18
  (function($){
19
 
20
+ tagBox = {
21
+ clean : function(tags) {
22
+ var comma = postL10n.comma;
23
+ if ( ',' !== comma )
24
+ tags = tags.replace(new RegExp(comma, 'g'), ',');
25
+ tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
26
+ if ( ',' !== comma )
27
+ tags = tags.replace(/,/g, comma);
28
+ return tags;
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 = postL10n.comma,
34
  current_tags = thetags.val().split(comma), new_tags = [];
35
  delete current_tags[num];
36
 
58
 
59
  disabled = thetags.prop('disabled');
60
 
61
+ current_tags = thetags.val().split(postL10n.comma);
62
  tagchecklist.empty();
63
 
64
  $.each( current_tags, function( key, val ) {
88
  a = a || false;
89
  var tags = $('.the-tags', el),
90
  newtag = $('input.newtag', el),
91
+ comma = postL10n.comma,
92
  newtags, text;
93
 
94
  text = a ? $(a).text() : newtag.val();
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: postL10n.comma + ' ' } );
161
  });
162
 
163
  // save tags on post save/publish
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(){
js/mla-single-edit-scripts.min.js DELETED
@@ -1 +0,0 @@
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("&nbsp;").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,90 +4,62 @@
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&#45;&gt;\\WP_List_Table -->
50
  <g id="edge3" class="edge"><title>\\MLA_List_Table&#45;&gt;\\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>
4
  <!-- Generated by graphviz version 2.28.0 (20110507.0327)
5
  -->
6
  <!-- Title: G Pages: 1 -->
7
+ <svg width="352pt" height="312pt"
8
+ viewBox="0.00 0.00 352.00 312.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 308)">
10
  <title>G</title>
11
+ <polygon fill="white" stroke="white" points="-4,5 -4,-308 349,-308 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,-284 "/>
16
+ <path fill="none" stroke="gray" d="M336,-284C336,-290 330,-296 324,-296"/>
17
+ <polyline fill="none" stroke="gray" points="324,-296 220,-296 "/>
18
+ <path fill="none" stroke="gray" d="M220,-296C214,-296 208,-290 208,-284"/>
19
+ <polyline fill="none" stroke="gray" points="208,-284 208,-20 "/>
20
  <path fill="none" stroke="gray" d="M208,-20C208,-14 214,-8 220,-8"/>
21
+ <text text-anchor="middle" x="272" y="-283.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,-268 240,-268 240,-232 304,-232 304,-268"/>
27
+ <text text-anchor="middle" x="272" y="-247.2" font-family="Courier,monospace" font-size="11.00">MLAData</text>
 
 
 
 
 
 
 
28
  </a>
29
  </g>
30
  <!-- \\MLA_List_Table -->
31
+ <g id="node3" class="node"><title>\\MLA_List_Table</title>
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,-214 216.5,-214 216.5,-178 327.5,-178 327.5,-214"/>
34
+ <text text-anchor="middle" x="272" y="-193.2" font-family="Courier,monospace" font-size="11.00">MLA_List_Table</text>
35
  </a>
36
  </g>
37
  <!-- \\WP_List_Table -->
38
+ <g id="node8" class="node"><title>\\WP_List_Table</title>
39
+ <ellipse fill="none" stroke="black" cx="72" cy="-196" rx="71.4873" ry="18"/>
40
+ <text text-anchor="middle" x="72" y="-192.3" font-family="Times New Roman,serif" font-size="14.00" fill="gray">\WP_List_Table</text>
41
  </g>
42
  <!-- \\MLA_List_Table&#45;&gt;\\WP_List_Table -->
43
  <g id="edge3" class="edge"><title>\\MLA_List_Table&#45;&gt;\\WP_List_Table</title>
44
+ <path fill="none" stroke="black" d="M216.371,-196C197.091,-196 174.98,-196 153.987,-196"/>
45
+ <polygon fill="none" stroke="black" points="153.788,-192.5 143.788,-196 153.788,-199.5 153.788,-192.5"/>
46
  </g>
47
  <!-- \\MLA -->
48
+ <g id="node4" class="node"><title>\\MLA</title>
49
  <a xlink:href="includes.class-mla-main.html" xlink:title="MLA" target="_parent">
50
+ <polygon fill="none" stroke="black" points="299,-160 245,-160 245,-124 299,-124 299,-160"/>
51
+ <text text-anchor="middle" x="272" y="-139.2" font-family="Courier,monospace" font-size="11.00">MLA</text>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </a>
53
  </g>
54
  <!-- \\MLASettings -->
55
+ <g id="node5" class="node"><title>\\MLASettings</title>
56
  <a xlink:href="includes.class-mla-settings.html" xlink:title="MLASettings" target="_parent">
57
+ <polygon fill="none" stroke="black" points="317.5,-106 226.5,-106 226.5,-70 317.5,-70 317.5,-106"/>
58
+ <text text-anchor="middle" x="272" y="-85.2" font-family="Courier,monospace" font-size="11.00">MLASettings</text>
 
 
 
 
 
 
 
59
  </a>
60
  </g>
61
  <!-- \\MLATest -->
62
+ <g id="node6" class="node"><title>\\MLATest</title>
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>
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>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,10 +15,13 @@
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,24 +59,23 @@
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,20 +84,13 @@ change the meta data for a single attachment.</span><pre>_display_single_item()<
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_MEDIA_POPUP_OBJECT" title="JAVASCRIPT_MEDIA_POPUP_OBJECT :: Object name for localizing JavaScript - Add Media and related dialogs"><span class="description">Object name for localizing JavaScript - Add Media and related dialogs</span><pre>JAVASCRIPT_MEDIA_POPUP_OBJECT</pre></a></li>
88
- <li class="constant "><a href="#JAVASCRIPT_MEDIA_POPUP_SLUG" title="JAVASCRIPT_MEDIA_POPUP_SLUG :: Slug for localizing and enqueueing JavaScript - Add Media and related dialogs"><span class="description">Slug for localizing and enqueueing JavaScript - Add Media and related dialogs</span><pre>JAVASCRIPT_MEDIA_POPUP_SLUG</pre></a></li>
89
- <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>
90
- <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>
91
  <li class="constant "><a href="#MIN_PHP_VERSION" title="MIN_PHP_VERSION :: Minimum version of PHP required for this plugin"><span class="description">Minimum version of PHP required for this plugin</span><pre>MIN_PHP_VERSION</pre></a></li>
92
  <li class="constant "><a href="#MIN_WORDPRESS_VERSION" title="MIN_WORDPRESS_VERSION :: Minimum version of WordPress required for this plugin"><span class="description">Minimum version of WordPress required for this plugin</span><pre>MIN_WORDPRESS_VERSION</pre></a></li>
93
  <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>
94
- <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>
95
  <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>
96
  <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>
97
  <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>
98
- <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>
99
  <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>
100
  <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>
101
  <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>
@@ -131,12 +126,10 @@ of images and files held in the WordPress Media Library.</p>
131
  <i class="icon-custom icon-method"></i> Methods</h3>
132
  <a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
133
  <h2>Initialization function, similar to __construct()</h2>
134
- <pre>initialize() : void</pre>
135
  <div class="labels"></div>
136
  <div class="row collapse"><div class="detail-description">
137
- <p class="long_description"><p>This function contains add_action and add_filter calls
138
- to set up the Ajax handlers, enqueue JavaScript and CSS files, and
139
- set up the Assistant submenu.</p></p>
140
  <table class="table table-bordered"><tr>
141
  <th>since</th>
142
  <td>0.1</td>
@@ -145,7 +138,7 @@ set up the Assistant submenu.</p></p>
145
  </div>
146
  <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">
147
  <h2>Add contextual help tabs to all the MLA pages</h2>
148
- <pre>mla_add_help_tab() : void</pre>
149
  <div class="labels"></div>
150
  <div class="row collapse"><div class="detail-description">
151
  <p class="long_description"></p>
@@ -157,7 +150,7 @@ set up the Assistant submenu.</p></p>
157
  </div>
158
  <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">
159
  <h2>Add the "XX Entries per page" filter to the Screen Options tab</h2>
160
- <pre>mla_add_menu_options() : void</pre>
161
  <div class="labels"></div>
162
  <div class="row collapse"><div class="detail-description">
163
  <p class="long_description"></p>
@@ -169,7 +162,7 @@ set up the Assistant submenu.</p></p>
169
  </div>
170
  <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">
171
  <h2>Load the plugin's Style Sheet and Javascript files</h2>
172
- <pre>mla_admin_enqueue_scripts_action(string $page_hook) : void</pre>
173
  <div class="labels"></div>
174
  <div class="row collapse"><div class="detail-description">
175
  <p class="long_description"></p>
@@ -181,75 +174,47 @@ set up the Assistant submenu.</p></p>
181
  <div class="subelement argument">
182
  <h4>$page_hook</h4>
183
  <code>string</code><p>Name of the page being loaded</p></div>
184
- </div></div>
185
- </div>
186
- <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">
187
- <h2>Load the plugin's Ajax handler or process Edit Media update actions</h2>
188
- <pre>mla_admin_init_action() : void</pre>
189
- <div class="labels"></div>
190
- <div class="row collapse"><div class="detail-description">
191
- <p class="long_description"></p>
192
- <table class="table table-bordered"><tr>
193
- <th>since</th>
194
- <td>0.20</td>
195
- </tr></table>
196
  </div></div>
197
  </div>
198
  <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">
199
  <h2>Add the submenu pages</h2>
200
- <pre>mla_admin_menu_action() : void</pre>
201
  <div class="labels"></div>
202
  <div class="row collapse"><div class="detail-description">
203
  <p class="long_description"><p>Add a submenu page in the "Media" section,
204
- add settings page in the "Settings" section.
205
- add settings link in the Plugins section entry for MLA.</p>
206
-
207
- <p>For WordPress versions before 3.5,
208
  add submenu page(s) for attachment taxonomies,
209
- add filter to clean up taxonomy submenu labels.</p></p>
 
 
210
  <table class="table table-bordered"><tr>
211
  <th>since</th>
212
  <td>0.1</td>
213
  </tr></table>
214
  </div></div>
215
  </div>
216
- <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">
217
  <h2>Redirect to the Edit Tags/Categories page</h2>
218
- <pre>mla_edit_tax_redirect() : void</pre>
219
  <div class="labels"></div>
220
  <div class="row collapse"><div class="detail-description">
221
  <p class="long_description"><p>The custom taxonomy add/edit submenu entries go to "upload.php" by default.
222
- This filter is the only way to redirect them to the correct WordPress page.
223
- The filter is not required for WordPress 3.5 and later.</p></p>
224
  <table class="table table-bordered"><tr>
225
  <th>since</th>
226
  <td>0.1</td>
227
  </tr></table>
228
  </div></div>
229
  </div>
230
- <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">
231
- <h2>Ajax handler for inline editing (quick and bulk edit)</h2>
232
- <pre>mla_inline_edit_action() : void</pre>
233
- <div class="labels"></div>
234
- <div class="row collapse"><div class="detail-description">
235
- <p class="long_description"><p>Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php</p></p>
236
- <table class="table table-bordered"><tr>
237
- <th>since</th>
238
- <td>0.20</td>
239
- </tr></table>
240
- </div></div>
241
- </div>
242
- <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">
243
  <h2>Cleanup menus for Edit Tags/Categories page</h2>
244
- <pre>mla_parent_file_filter(array $parent_file) : string</pre>
245
  <div class="labels"></div>
246
  <div class="row collapse"><div class="detail-description">
247
- <p class="long_description"><p>For WordPress before 3.5, the submenu entries for custom taxonomies
248
- under the "Media" menu are not set up correctly by WordPress, so this
249
- function cleans them up, redirecting the request to the right WordPress
250
- page for editing/adding taxonomy terms.
251
- For WordPress 3.5 and later, the function fixes the submenu bolding when
252
- going to the Edit Media screen.</p></p>
253
  <table class="table table-bordered"><tr>
254
  <th>since</th>
255
  <td>0.1</td>
@@ -266,7 +231,7 @@ going to the Edit Media screen.</p></p>
266
  </div>
267
  <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">
268
  <h2>Render the "Assistant" subpage in the Media section, using the list_table package</h2>
269
- <pre>mla_render_admin_page() : void</pre>
270
  <div class="labels"></div>
271
  <div class="row collapse"><div class="detail-description">
272
  <p class="long_description"></p>
@@ -301,7 +266,7 @@ going to the Edit Media screen.</p></p>
301
  </div>
302
  <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">
303
  <h2>Save the "Entries per page" option set by this user</h2>
304
- <pre>mla_set_screen_option_filter(boolean $status, string $option, string $value) : string | void</pre>
305
  <div class="labels"></div>
306
  <div class="row collapse"><div class="detail-description">
307
  <p class="long_description"></p>
@@ -322,58 +287,12 @@ going to the Edit Media screen.</p></p>
322
  <code>string</code><p>New value of the option</p></div>
323
  <h3>Returns</h3>
324
  <div class="subelement response">
325
- <code>string</code><code>void</code>New value if this is our option, otherwise nothing</div>
326
- </div></div>
327
- </div>
328
- <a name="_authors_dropdown" id="_authors_dropdown"></a><div class="element clickable method private _authors_dropdown" data-toggle="collapse" data-target="._authors_dropdown .collapse">
329
- <h2>Get the edit Authors dropdown box, if user has suitable permissions</h2>
330
- <pre>_authors_dropdown(integer $author, string $name, string $class) : string | false</pre>
331
- <div class="labels"></div>
332
- <div class="row collapse"><div class="detail-description">
333
- <p class="long_description"></p>
334
- <table class="table table-bordered"><tr>
335
- <th>since</th>
336
- <td>0.20</td>
337
- </tr></table>
338
- <h3>Parameters</h3>
339
- <div class="subelement argument">
340
- <h4>$author</h4>
341
- <code>integer</code><p>Optional User ID of the current author, default 0</p></div>
342
- <div class="subelement argument">
343
- <h4>$name</h4>
344
- <code>string</code><p>Optional HTML name attribute, default 'post_author'</p>
345
- </div>
346
- <div class="subelement argument">
347
- <h4>$class</h4>
348
- <code>string</code><p>Optional HTML class attribute, default 'authors'</p>
349
- </div>
350
- <h3>Returns</h3>
351
- <div class="subelement response">
352
- <code>string</code><code>false</code>HTML markup for the dropdown field or False</div>
353
- </div></div>
354
- </div>
355
- <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">
356
- <h2>Build the hidden row templates for inline editing (quick and bulk edit)</h2>
357
- <pre>_build_inline_edit_form(object $MLAListTable) : string</pre>
358
- <div class="labels"></div>
359
- <div class="row collapse"><div class="detail-description">
360
- <p class="long_description"><p>inspired by inline_edit() in wp-admin\includes\class-wp-posts-list-table.php.</p></p>
361
- <table class="table table-bordered"><tr>
362
- <th>since</th>
363
- <td>0.20</td>
364
- </tr></table>
365
- <h3>Parameters</h3>
366
- <div class="subelement argument">
367
- <h4>$MLAListTable</h4>
368
- <code>object</code><p>MLA List Table object</p></div>
369
- <h3>Returns</h3>
370
- <div class="subelement response">
371
- <code>string</code>HTML <form> markup for hidden rows</div>
372
  </div></div>
373
  </div>
374
  <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">
375
- <h2>Get the current action selected from the bulk actions dropdown</h2>
376
- <pre>_current_bulk_action() : string | false</pre>
377
  <div class="labels"></div>
378
  <div class="row collapse"><div class="detail-description">
379
  <p class="long_description"></p>
@@ -383,11 +302,11 @@ going to the Edit Media screen.</p></p>
383
  </tr></table>
384
  <h3>Returns</h3>
385
  <div class="subelement response">
386
- <code>string</code><code>false</code>The action name or False if no action was selected</div>
387
  </div></div>
388
  </div>
389
  <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">
390
- <h2>Delete a single item permanently</h2>
391
  <pre>_delete_single_item(array $post_id) : array</pre>
392
  <div class="labels"></div>
393
  <div class="row collapse"><div class="detail-description">
@@ -399,10 +318,10 @@ going to the Edit Media screen.</p></p>
399
  <h3>Parameters</h3>
400
  <div class="subelement argument">
401
  <h4>$post_id</h4>
402
- <code>array</code><p>The form POST data</p></div>
403
  <h3>Returns</h3>
404
  <div class="subelement response">
405
- <code>array</code>success/failure message and NULL content</div>
406
  </div></div>
407
  </div>
408
  <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">
@@ -422,7 +341,7 @@ change the meta data for a single attachment.</h2>
422
  <code>int</code><p>The WordPress Post ID of the attachment item</p></div>
423
  <h3>Returns</h3>
424
  <div class="subelement response">
425
- <code>array</code>message and/or HTML content</div>
426
  </div></div>
427
  </div>
428
  <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">
@@ -441,7 +360,7 @@ change the meta data for a single attachment.</h2>
441
  <code>array</code><p>The form POST data</p></div>
442
  <h3>Returns</h3>
443
  <div class="subelement response">
444
- <code>array</code>success/failure message and NULL content</div>
445
  </div></div>
446
  </div>
447
  <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">
@@ -460,7 +379,34 @@ change the meta data for a single attachment.</h2>
460
  <code>array</code><p>The form POST data</p></div>
461
  <h3>Returns</h3>
462
  <div class="subelement response">
463
- <code>array</code>success/failure message and NULL content</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  </div></div>
465
  </div>
466
  <h3>
@@ -503,69 +449,9 @@ change the meta data for a single attachment.</h2>
503
  </tr></table>
504
  </div></div>
505
  </div>
506
- <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">
507
- <h2>Object name for localizing JavaScript - MLA List Table</h2>
508
- <pre>JAVASCRIPT_INLINE_EDIT_OBJECT : 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.20</td>
515
- </tr></table>
516
- </div></div>
517
- </div>
518
- <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">
519
- <h2>Slug for localizing and enqueueing JavaScript - MLA List Table</h2>
520
- <pre>JAVASCRIPT_INLINE_EDIT_SLUG : string</pre>
521
- <div class="labels"></div>
522
- <div class="row collapse"><div class="detail-description">
523
- <p class="long_description"></p>
524
- <table class="table table-bordered"><tr>
525
- <th>since</th>
526
- <td>0.20</td>
527
- </tr></table>
528
- </div></div>
529
- </div>
530
- <a name="JAVASCRIPT_MEDIA_POPUP_OBJECT" id="JAVASCRIPT_MEDIA_POPUP_OBJECT"> </a><div class="element clickable constant JAVASCRIPT_MEDIA_POPUP_OBJECT" data-toggle="collapse" data-target=".JAVASCRIPT_MEDIA_POPUP_OBJECT .collapse">
531
- <h2>Object name for localizing JavaScript - Add Media and related dialogs</h2>
532
- <pre>JAVASCRIPT_MEDIA_POPUP_OBJECT : string</pre>
533
- <div class="labels"></div>
534
- <div class="row collapse"><div class="detail-description">
535
- <p class="long_description"></p>
536
- <table class="table table-bordered"><tr>
537
- <th>since</th>
538
- <td>1.13</td>
539
- </tr></table>
540
- </div></div>
541
- </div>
542
- <a name="JAVASCRIPT_MEDIA_POPUP_SLUG" id="JAVASCRIPT_MEDIA_POPUP_SLUG"> </a><div class="element clickable constant JAVASCRIPT_MEDIA_POPUP_SLUG" data-toggle="collapse" data-target=".JAVASCRIPT_MEDIA_POPUP_SLUG .collapse">
543
- <h2>Slug for localizing and enqueueing JavaScript - Add Media and related dialogs</h2>
544
- <pre>JAVASCRIPT_MEDIA_POPUP_SLUG : string</pre>
545
- <div class="labels"></div>
546
- <div class="row collapse"><div class="detail-description">
547
- <p class="long_description"></p>
548
- <table class="table table-bordered"><tr>
549
- <th>since</th>
550
- <td>1.13</td>
551
- </tr></table>
552
- </div></div>
553
- </div>
554
- <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">
555
- <h2>Object name for localizing JavaScript - edit single item page</h2>
556
- <pre>JAVASCRIPT_SINGLE_EDIT_OBJECT : string</pre>
557
- <div class="labels"></div>
558
- <div class="row collapse"><div class="detail-description">
559
- <p class="long_description"></p>
560
- <table class="table table-bordered"><tr>
561
- <th>since</th>
562
- <td>0.1</td>
563
- </tr></table>
564
- </div></div>
565
- </div>
566
- <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">
567
- <h2>Slug for localizing and enqueueing JavaScript - edit single item page</h2>
568
- <pre>JAVASCRIPT_SINGLE_EDIT_SLUG : string</pre>
569
  <div class="labels"></div>
570
  <div class="row collapse"><div class="detail-description">
571
  <p class="long_description"></p>
@@ -611,18 +497,6 @@ change the meta data for a single attachment.</h2>
611
  </tr></table>
612
  </div></div>
613
  </div>
614
- <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">
615
- <h2>mla_admin_action value for mapping Custom Field metadata</h2>
616
- <pre>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP : string</pre>
617
- <div class="labels"></div>
618
- <div class="row collapse"><div class="detail-description">
619
- <p class="long_description"></p>
620
- <table class="table table-bordered"><tr>
621
- <th>since</th>
622
- <td>1.10</td>
623
- </tr></table>
624
- </div></div>
625
- </div>
626
  <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">
627
  <h2>mla_admin_action value for permanently deleting a single item</h2>
628
  <pre>MLA_ADMIN_SINGLE_DELETE : string</pre>
@@ -659,18 +533,6 @@ change the meta data for a single attachment.</h2>
659
  </tr></table>
660
  </div></div>
661
  </div>
662
- <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">
663
- <h2>mla_admin_action value for mapping IPTC/EXIF metadata</h2>
664
- <pre>MLA_ADMIN_SINGLE_MAP : string</pre>
665
- <div class="labels"></div>
666
- <div class="row collapse"><div class="detail-description">
667
- <p class="long_description"></p>
668
- <table class="table table-bordered"><tr>
669
- <th>since</th>
670
- <td>1.00</td>
671
- </tr></table>
672
- </div></div>
673
- </div>
674
  <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">
675
  <h2>mla_admin_action value for restoring a single item from the trash</h2>
676
  <pre>MLA_ADMIN_SINGLE_RESTORE : string</pre>
@@ -726,7 +588,7 @@ change the meta data for a single attachment.</h2>
726
  <div class="row"><footer class="span12">
727
  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>
728
  Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
729
- generated on 2013-02-26T09:38:18-08:00.<br></footer></div>
730
  </div>
731
  </body>
732
  </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>phpDocumentor » \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">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">
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="#mla_edit_tags_redirect" title="mla_edit_tags_redirect :: Redirect to the Edit Tags/Categories page"><span class="description">Redirect to the Edit Tags/Categories page</span><pre>mla_edit_tags_redirect()</pre></a></li>
64
+ <li class="method public "><a href="#mla_modify_parent_menu" title="mla_modify_parent_menu :: Cleanup menus for Edit Tags/Categories page"><span class="description">Cleanup menus for Edit Tags/Categories page</span><pre>mla_modify_parent_menu()</pre></a></li>
 
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="#_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>
70
+ <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>
 
 
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
  <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="#JAVASCRIPT_SLUG" title="JAVASCRIPT_SLUG :: Slug for localizing and enqueueing plugin JavaScript"><span class="description">Slug for localizing and enqueueing plugin JavaScript</span><pre>JAVASCRIPT_SLUG</pre></a></li>
 
 
 
 
 
88
  <li class="constant "><a href="#MIN_PHP_VERSION" title="MIN_PHP_VERSION :: Minimum version of PHP required for this plugin"><span class="description">Minimum version of PHP required for this plugin</span><pre>MIN_PHP_VERSION</pre></a></li>
89
  <li class="constant "><a href="#MIN_WORDPRESS_VERSION" title="MIN_WORDPRESS_VERSION :: Minimum version of WordPress required for this plugin"><span class="description">Minimum version of WordPress required for this plugin</span><pre>MIN_WORDPRESS_VERSION</pre></a></li>
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
  <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"></p>
 
 
133
  <table class="table table-bordered"><tr>
134
  <th>since</th>
135
  <td>0.1</td>
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
  </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
  </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) : \nothing</pre>
166
  <div class="labels"></div>
167
  <div class="row collapse"><div class="detail-description">
168
  <p class="long_description"></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
+ <h3>Returns</h3>
178
+ <div class="subelement response"><code>\nothing</code></div>
 
 
 
 
 
 
 
 
 
 
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="mla_edit_tags_redirect" id="mla_edit_tags_redirect"></a><div class="element clickable method public mla_edit_tags_redirect" data-toggle="collapse" data-target=".mla_edit_tags_redirect .collapse">
198
  <h2>Redirect to the Edit Tags/Categories page</h2>
199
+ <pre>mla_edit_tags_redirect() </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.</p></p>
 
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="mla_modify_parent_menu" id="mla_modify_parent_menu"></a><div class="element clickable method public mla_modify_parent_menu" data-toggle="collapse" data-target=".mla_modify_parent_menu .collapse">
 
 
 
 
 
 
 
 
 
 
 
 
211
  <h2>Cleanup menus for Edit Tags/Categories page</h2>
212
+ <pre>mla_modify_parent_menu(array $parent_file) : string</pre>
213
  <div class="labels"></div>
214
  <div class="row collapse"><div class="detail-description">
215
+ <p class="long_description"><p>The submenu entries for custom taxonomies under the "Media" menu are not set up
216
+ correctly by WordPress, so this function cleans them up, redirecting the request
217
+ to the right WordPress page for editing/adding taxonomy terms.</p></p>
 
 
 
218
  <table class="table table-bordered"><tr>
219
  <th>since</th>
220
  <td>0.1</td>
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
  </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
  <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.</h2>
295
+ <pre>_current_bulk_action() : string | bool</pre>
296
  <div class="labels"></div>
297
  <div class="row collapse"><div class="detail-description">
298
  <p class="long_description"></p>
302
  </tr></table>
303
  <h3>Returns</h3>
304
  <div class="subelement response">
305
+ <code>string</code><code>bool</code>The action name or False if no action was selected</div>
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.</h2>
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
  <h3>Parameters</h3>
319
  <div class="subelement argument">
320
  <h4>$post_id</h4>
321
+ <code>array</code><p>The form POST data.</p></div>
322
  <h3>Returns</h3>
323
  <div class="subelement response">
324
+ <code>array</code>success/failure message and null content</div>
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
  <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.</div>
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
  <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 null content</div>
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
  <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 null content</div>
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
  </tr></table>
450
  </div></div>
451
  </div>
452
+ <a name="JAVASCRIPT_SLUG" id="JAVASCRIPT_SLUG"> </a><div class="element clickable constant JAVASCRIPT_SLUG" data-toggle="collapse" data-target=".JAVASCRIPT_SLUG .collapse">
453
+ <h2>Slug for localizing and enqueueing plugin JavaScript</h2>
454
+ <pre>JAVASCRIPT_SLUG : string</pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  <div class="labels"></div>
456
  <div class="row collapse"><div class="detail-description">
457
  <p class="long_description"></p>
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
  </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
  <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 2012-08-10T14:31:50-07:00.<br></footer></div>
592
  </div>
593
  </body>
594
  </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>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,10 +15,13 @@
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,43 +56,16 @@
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,7 +79,7 @@ for a single attachment.</span><pre>mla_update_single_item()</pre></a></li>
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,116 +107,8 @@ Templates separate HTML markup from PHP code for easier maintenance and localiza
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,72 +131,29 @@ as a Featured Image or inserted in the post as an image or link.</p></p>
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,19 +165,15 @@ where "key" becomes the key part of the array.</p></p>
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,20 +189,21 @@ where "key" becomes the key part of the array.</p></p>
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,122 +213,72 @@ Modeled after wp_edit_attachments_query in wp-admin/post.php</p></p>
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,252 +286,30 @@ for a single attachment.</h2>
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,7 +319,7 @@ any further logic required to translate those values is contained in the filters
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-02-26T09:38:18-08:00.<br></footer></div>
773
  </div>
774
  </body>
775
  </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>phpDocumentor » \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">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">
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_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>
60
+ <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>
 
 
 
 
 
 
 
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."><span class="description">Expand a template, replacing place holders with their values.</span><pre>mla_parse_template()</pre></a></li>
63
+ <li class="method public "><a href="#mla_prepare_list_table_query" title="mla_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>mla_prepare_list_table_query()</pre></a></li>
64
+ <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>
65
+ <li class="method public "><a href="#mla_query_list_table_items_helper" title="mla_query_list_table_items_helper :: Adds a WHERE clause for detached items"><span class="description">Adds a WHERE clause for detached items</span><pre>mla_query_list_table_items_helper()</pre></a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  <li class="nav-header private">» Private</li>
67
+ <li class="method private "><a href="#_fetch_attachment_metadata" title="_fetch_attachment_metadata :: Fetch and filter meta data for an attachment."><span class="description">Fetch and filter meta data for an attachment.</span><pre>_fetch_attachment_metadata()</pre></a></li>
68
+ <li class="method private "><a href="#_fetch_attachment_parent_data" title="_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>_fetch_attachment_parent_data()</pre></a></li>
 
 
 
 
 
69
  </ul>
70
  </div>
71
  <div class="span8">
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.</p>
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
  </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.</h2>
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
  <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.</h2>
136
+ <pre>mla_get_attachment_by_id(int $post_id) : Null</pre>
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"><tr>
142
  <th>since</th>
143
+ <td>0.1</td>
144
  </tr></table>
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.</p></div>
 
149
  <h3>Returns</h3>
150
  <div class="subelement response">
151
+ <code>Null</code>on failure else associative array.</div>
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 $filepath) : string</pre>
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
  </tr></table>
166
  <h3>Parameters</h3>
167
  <div class="subelement argument">
168
+ <h4>$filepath</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>For files that do not contain template divider comments array For files containing template divider comments false If file does not exist NULL If file could not be loaded</div>
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.</h2>
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
  </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');</p>
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.</div>
197
  </div></div>
198
  </div>
199
+ <a name="mla_prepare_list_table_query" id="mla_prepare_list_table_query"></a><div class="element clickable method public mla_prepare_list_table_query" data-toggle="collapse" data-target=".mla_prepare_list_table_query .collapse">
200
+ <h2>Sanitize and expand query arguments from request variables.</h2>
201
+ <pre>mla_prepare_list_table_query(array $request) : array</pre>
202
  <div class="labels"></div>
203
  <div class="row collapse"><div class="detail-description">
204
+ <p class="long_description"><p>Prepare the arguments for WP_Query.
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
  <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>revised arguments suitable for WP_Query</div>
219
  </div></div>
220
  </div>
221
+ <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">
222
+ <h2>Retrieve attachment objects for list table display.</h2>
223
+ <pre>mla_query_list_table_items(array $request, string $orderby, string $order, int $offset, int $count) : array</pre>
224
  <div class="labels"></div>
225
  <div class="row collapse"><div class="detail-description">
226
+ <p class="long_description"><p>Supports prepare_items in class-mla-list-table.php
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.1</td>
231
  </tr></table>
232
  <h3>Parameters</h3>
233
  <div class="subelement argument">
234
+ <h4>$request</h4>
235
+ <code>array</code><p>query parameters from web page, usually found in $_REQUEST</p>
 
 
 
 
236
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
237
  <div class="subelement argument">
238
+ <h4>$orderby</h4>
239
+ <code>string</code><p>database column to sort by</p></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  <div class="subelement argument">
241
+ <h4>$order</h4>
242
+ <code>string</code><p>ASC or DESC</p></div>
243
  <div class="subelement argument">
244
+ <h4>$offset</h4>
245
+ <code>int</code><p>number of rows to skip over to reach desired page</p></div>
246
+ <div class="subelement argument">
247
+ <h4>$count</h4>
248
+ <code>int</code><p>number of rows on each page</p></div>
249
  <h3>Returns</h3>
250
  <div class="subelement response">
251
+ <code>array</code>attachment objects (posts) including parent data, meta data and references</div>
252
  </div></div>
253
  </div>
254
+ <a name="mla_query_list_table_items_helper" id="mla_query_list_table_items_helper"></a><div class="element clickable method public mla_query_list_table_items_helper" data-toggle="collapse" data-target=".mla_query_list_table_items_helper .collapse">
255
  <h2>Adds a WHERE clause for detached items</h2>
256
+ <pre>mla_query_list_table_items_helper(string $where) : string</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 so callers can remove it after the query</p></p>
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>$where</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="_fetch_attachment_metadata" id="_fetch_attachment_metadata"></a><div class="element clickable method private _fetch_attachment_metadata" data-toggle="collapse" data-target="._fetch_attachment_metadata .collapse">
275
+ <h2>Fetch and filter meta data for an attachment.</h2>
276
+ <pre>_fetch_attachment_metadata(int $post_id) : array</pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  <div class="labels"></div>
278
  <div class="row collapse"><div class="detail-description">
279
+ <p class="long_description"><p>Returns a filtered array of a post's meta data. Internal values beginning with '<em>'
280
+ are stripped out or converted to an 'mla</em>' equivalent. Array data is replaced with
281
+ a string containing the first array element.</p></p>
282
  <table class="table table-bordered"><tr>
283
  <th>since</th>
284
  <td>0.1</td>
286
  <h3>Parameters</h3>
287
  <div class="subelement argument">
288
  <h4>$post_id</h4>
289
+ <code>int</code><p>post ID of attachment</p></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  <h3>Returns</h3>
291
  <div class="subelement response">
292
+ <code>array</code>Meta data variables</div>
293
  </div></div>
294
  </div>
295
+ <a name="_fetch_attachment_parent_data" id="_fetch_attachment_parent_data"></a><div class="element clickable method private _fetch_attachment_parent_data" data-toggle="collapse" data-target="._fetch_attachment_parent_data .collapse">
296
+ <h2>Returns information about an attachment's parent, if found.</h2>
297
+ <pre>_fetch_attachment_parent_data(int $parent_id) : array</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>$parent_id</h4>
308
+ <code>int</code><p>post ID of attachment's parent, if any</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  </div>
 
 
 
310
  <h3>Returns</h3>
311
  <div class="subelement response">
312
+ <code>array</code>Parent information; post_date, post_title and post_type</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  </div></div>
314
  </div>
315
  </div>
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 2012-08-10T14:31:50-07:00.<br></footer></div>
323
  </div>
324
  </body>
325
  </html>
phpDocs/classes/MLAEdit.html DELETED
@@ -1,348 +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>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-02-26T09:38:18-08:00.<br></footer></div>
346
- </div>
347
- </body>
348
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
phpDocs/classes/MLAObjects.html DELETED
@@ -1,173 +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>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-02-26T09:38:18-08:00.<br></footer></div>
171
- </div>
172
- </body>
173
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
phpDocs/classes/MLAOptions.html DELETED
@@ -1,1013 +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>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-02-26T09:38:18-08: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>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,10 +15,13 @@
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,51 +56,24 @@
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,7 +87,8 @@ Each tab is defined by an array with the following elements:</span><pre>$mla_tab
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,7 +105,7 @@ Each tab is defined by an array with the following elements:</span><pre>$mla_tab
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,18 +115,6 @@ Each tab is defined by an array with the following elements:</span><pre>$mla_tab
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,7 +141,7 @@ Each tab is defined by an array with the following elements:</span><pre>$mla_tab
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,21 +151,9 @@ add settings link in the Plugins section entry for MLA.</h2>
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,283 +161,74 @@ add settings link in the Plugins section entry for MLA.</h2>
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,177 +236,59 @@ without saving the settings to the mla_option</h2>
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,7 +300,7 @@ each page load and cached for subsequent use.</p></p>
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-02-26T09:38:18-08:00.<br></footer></div>
678
  </div>
679
  </body>
680
  </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>phpDocumentor » \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">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">
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="#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>
64
+ <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>
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="#_reset_settings" title="_reset_settings :: Delete saved settings, restoring default values"><span class="description">Delete saved settings, restoring default values</span><pre>_reset_settings()</pre></a></li>
69
+ <li class="method private "><a href="#_save_settings" title="_save_settings :: Save settings to the options table"><span class="description">Save settings to the options table</span><pre>_save_settings()</pre></a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="#%24mla_options" title="$mla_options :: $mla_options defines the database options and admin page areas for setting/updating them."><span class="description">$mla_options defines the database options and admin page areas for setting/updating them.</span><pre>$mla_options</pre></a></li>
 
 
 
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."><span class="description">Provides a unique name for the settings page.</span><pre>MLA_SETTINGS_SLUG</pre></a></li>
77
  </ul>
78
  </div>
79
  <div class="span8">
87
  </li>
88
  </ul>
89
  <div href="../classes/MLASettings.html" class="element class">
90
+ <p class="short_description">Class MLA (Media Library Assistant) Settings manages the plugin option 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
  <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
  </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
  <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
  </tr></table>
152
  </div></div>
153
  </div>
154
+ <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">
155
+ <h2>Delete the stored value of a defined MLA option</h2>
156
+ <pre>mla_delete_option(string $option) : boolean</pre>
 
 
 
 
 
 
 
 
 
 
 
 
157
  <div class="labels"></div>
158
  <div class="row collapse"><div class="detail-description">
159
  <p class="long_description"></p>
161
  <th>since</th>
162
  <td>0.1</td>
163
  </tr></table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  <h3>Parameters</h3>
165
  <div class="subelement argument">
166
+ <h4>$option</h4>
167
+ <code>string</code><p>Name of the desired option</p></div>
 
 
 
 
 
168
  <h3>Returns</h3>
169
  <div class="subelement response">
170
+ <code>boolean</code>True if the option was deleted, otherwise false</div>
171
  </div></div>
172
  </div>
173
+ <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">
174
+ <h2>Return the stored value or default value of a defined MLA option</h2>
175
+ <pre>mla_get_option(string $option) : mixed</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"><tr>
 
180
  <th>since</th>
181
+ <td>0.1</td>
182
+ </tr></table>
 
 
 
 
 
183
  <h3>Parameters</h3>
184
  <div class="subelement argument">
185
+ <h4>$option</h4>
186
+ <code>string</code><p>Name of the desired option</p></div>
 
187
  <h3>Returns</h3>
188
  <div class="subelement response">
189
+ <code>mixed</code>Value(s) for the option or false if the option is not a defined MLA option</div>
190
  </div></div>
191
  </div>
192
+ <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">
193
+ <h2>Render the "Media Library Assistant" subpage in the Settings section</h2>
194
+ <pre>mla_render_settings_page() : \HTML</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>Returns</h3>
203
  <div class="subelement response">
204
+ <code>\HTML</code>markup for the settings subpage</div>
205
  </div></div>
206
  </div>
207
+ <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">
208
+ <h2>Add or update the stored value of a defined MLA option</h2>
209
+ <pre>mla_update_option(string $option, mixed $newvalue) : boolean</pre>
 
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"><tr>
 
214
  <th>since</th>
215
+ <td>0.1</td>
216
+ </tr></table>
 
 
 
 
 
217
  <h3>Parameters</h3>
218
  <div class="subelement argument">
219
+ <h4>$option</h4>
220
+ <code>string</code><p>Name of the desired option</p></div>
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>boolean</code>True if the value was changed or false if the update failed</div>
227
  </div></div>
228
  </div>
229
+ <a name="_reset_settings" id="_reset_settings"></a><div class="element clickable method private _reset_settings" data-toggle="collapse" data-target="._reset_settings .collapse">
230
  <h2>Delete saved settings, restoring default values</h2>
231
+ <pre>_reset_settings(array $template_array) : array</pre>
232
  <div class="labels"></div>
233
  <div class="row collapse"><div class="detail-description">
234
  <p class="long_description"></p>
236
  <th>since</th>
237
  <td>0.1</td>
238
  </tr></table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  <h3>Parameters</h3>
240
  <div class="subelement argument">
241
+ <h4>$template_array</h4>
242
+ <code>array</code><p>HTML template(s) for the settings page</p>
 
 
 
 
243
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  <h3>Returns</h3>
245
  <div class="subelement response">
246
+ <code>array</code>Message(s) reflecting the results of the operation.</div>
247
  </div></div>
248
  </div>
249
+ <a name="_save_settings" id="_save_settings"></a><div class="element clickable method private _save_settings" data-toggle="collapse" data-target="._save_settings .collapse">
250
+ <h2>Save settings to the options table</h2>
251
+ <pre>_save_settings(array $template_array) : array</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"><tr>
 
256
  <th>since</th>
257
  <td>0.1</td>
258
+ </tr></table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  <h3>Parameters</h3>
260
  <div class="subelement argument">
261
+ <h4>$template_array</h4>
262
+ <code>array</code><p>HTML template(s) for the settings page</p>
 
 
 
 
263
  </div>
264
  <h3>Returns</h3>
265
  <div class="subelement response">
266
+ <code>array</code>Message(s) reflecting the results of the operation.</div>
 
 
 
 
 
 
 
 
 
 
 
 
267
  </div></div>
268
  </div>
269
  <h3>
270
  <i class="icon-custom icon-property"></i> Properties</h3>
271
+ <a name="%24mla_options" id="$mla_options"> </a><div class="element clickable property private $mla_options" data-toggle="collapse" data-target=".$mla_options .collapse">
272
+ <h2>$mla_options defines the database options and admin page areas for setting/updating them.</h2>
273
+ <pre>$mla_options </pre>
 
274
  <div class="labels"></div>
275
+ <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>
 
276
 
277
+ <p>array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
278
+
279
+ <p>name => admin page label or heading text
280
+ type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea'
281
+ std => default value
282
+ help => help text
283
+ size => text size, default 40
284
+ cols => textbox columns, default 90
285
+ rows => textbox rows, default 5
286
+ options => array of radio or select option values</p></p></div></div>
 
 
 
 
 
 
 
 
 
 
 
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.</h2>
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
  <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 2012-08-10T14:31:50-07:00.<br></footer></div>
304
  </div>
305
  </body>
306
  </html>
phpDocs/classes/MLAShortcodes.html DELETED
@@ -1,305 +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>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">
61
- <i class="icon-custom icon-property"></i> Properties</li>
62
- <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>
63
- <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>
64
- <li class="nav-header private">» Private</li>
65
- <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>
66
- <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>
67
- <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>
68
- <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>
69
- <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>
70
- <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>
71
- </ul>
72
- </div>
73
- <div class="span8">
74
- <a name="%5CMLAShortcodes" id="\MLAShortcodes"></a><ul class="breadcrumb">
75
- <li>
76
- <a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
77
- </li>
78
- <li><a href="../namespaces/global.html">global</a></li>
79
- <li class="active">
80
- <span class="divider">\</span><a href="../classes/MLAShortcodes.html">MLAShortcodes</a>
81
- </li>
82
- </ul>
83
- <div href="../classes/MLAShortcodes.html" class="element class">
84
- <p class="short_description">Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users</p>
85
- <div class="details">
86
- <p class="long_description"></p>
87
- <table class="table table-bordered">
88
- <tr>
89
- <th>package</th>
90
- <td><a href="../packages/Media%20Library%20Assistant.html">Media Library Assistant</a></td>
91
- </tr>
92
- <tr>
93
- <th>since</th>
94
- <td>0.20</td>
95
- </tr>
96
- </table>
97
- <h3>
98
- <i class="icon-custom icon-method"></i> Methods</h3>
99
- <a name="initialize" id="initialize"></a><div class="element clickable method public initialize" data-toggle="collapse" data-target=".initialize .collapse">
100
- <h2>Initialization function, similar to __construct()</h2>
101
- <pre>initialize() : void</pre>
102
- <div class="labels"></div>
103
- <div class="row collapse"><div class="detail-description">
104
- <p class="long_description"></p>
105
- <table class="table table-bordered"><tr>
106
- <th>since</th>
107
- <td>0.20</td>
108
- </tr></table>
109
- </div></div>
110
- </div>
111
- <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">
112
- <h2>WordPress Shortcode; renders a complete list of all attachments and references to them</h2>
113
- <pre>mla_attachment_list_shortcode() : void</pre>
114
- <div class="labels"></div>
115
- <div class="row collapse"><div class="detail-description">
116
- <p class="long_description"></p>
117
- <table class="table table-bordered"><tr>
118
- <th>since</th>
119
- <td>0.1</td>
120
- </tr></table>
121
- </div></div>
122
- </div>
123
- <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">
124
- <h2>The MLA Gallery shortcode.</h2>
125
- <pre>mla_gallery_shortcode(array $attr) : string</pre>
126
- <div class="labels"></div>
127
- <div class="row collapse"><div class="detail-description">
128
- <p class="long_description"><p>This is a superset of the WordPress Gallery shortcode for displaying images on a post,
129
- page or custom post type. It is adapted from /wp-includes/media.php gallery_shortcode.
130
- Enhancements include many additional selection parameters and full taxonomy support.</p></p>
131
- <table class="table table-bordered"><tr>
132
- <th>since</th>
133
- <td>.50</td>
134
- </tr></table>
135
- <h3>Parameters</h3>
136
- <div class="subelement argument">
137
- <h4>$attr</h4>
138
- <code>array</code><p>Attributes of the shortcode.</p></div>
139
- <h3>Returns</h3>
140
- <div class="subelement response">
141
- <code>string</code>HTML content to display gallery.</div>
142
- </div></div>
143
- </div>
144
- <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">
145
- <h2>Parses shortcode parameters and returns the gallery objects</h2>
146
- <pre>mla_get_shortcode_attachments(int $post_parent, array $attr) : array</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>.50</td>
153
- </tr></table>
154
- <h3>Parameters</h3>
155
- <div class="subelement argument">
156
- <h4>$post_parent</h4>
157
- <code>int</code><p>Post ID of the parent</p></div>
158
- <div class="subelement argument">
159
- <h4>$attr</h4>
160
- <code>array</code><p>Attributes of the shortcode</p></div>
161
- <h3>Returns</h3>
162
- <div class="subelement response">
163
- <code>array</code>List of attachments returned from WP_Query</div>
164
- </div></div>
165
- </div>
166
- <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">
167
- <h2>Filters the WHERE clause for shortcode queries</h2>
168
- <pre>mla_shortcode_query_posts_where_filter(string $where_clause) : string</pre>
169
- <div class="labels"></div>
170
- <div class="row collapse"><div class="detail-description">
171
- <p class="long_description"><p>Captures debug information. Adds whitespace to the post_type = 'attachment'
172
- phrase to circumvent subsequent Role Scoper modification of the clause.
173
- Handles post_parent "any" and "none" cases.
174
- Defined as public because it's a filter.</p></p>
175
- <table class="table table-bordered"><tr>
176
- <th>since</th>
177
- <td>0.70</td>
178
- </tr></table>
179
- <h3>Parameters</h3>
180
- <div class="subelement argument">
181
- <h4>$where_clause</h4>
182
- <code>string</code><p>query clause before modification</p></div>
183
- <h3>Returns</h3>
184
- <div class="subelement response">
185
- <code>string</code>query clause after modification</div>
186
- </div></div>
187
- </div>
188
- <h3>
189
- <i class="icon-custom icon-property"></i> Properties</h3>
190
- <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">
191
- <h2>Accumulates debug messages</h2>
192
- <pre>$mla_debug_messages : 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>0.60</td>
199
- </tr></table>
200
- </div></div>
201
- </div>
202
- <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">
203
- <h2>IPTC Dataset friendly name/slug and identifiers</h2>
204
- <pre>$mla_iptc_keys : array</pre>
205
- <div class="labels"></div>
206
- <div class="row collapse"><div class="detail-description">
207
- <p class="long_description"><p>This array contains the sanitized names and identifiers of Datasets defined in
208
- the "IPTC-NAA Information Interchange Model Version No. 4.1".</p></p>
209
- <table class="table table-bordered"><tr>
210
- <th>since</th>
211
- <td>0.90</td>
212
- </tr></table>
213
- </div></div>
214
- </div>
215
- <a name="%24mla_debug" id="$mla_debug"> </a><div class="element clickable property private $mla_debug" data-toggle="collapse" data-target=".$mla_debug .collapse">
216
- <h2>Turn debug collection and display on or off</h2>
217
- <pre>$mla_debug : boolean</pre>
218
- <div class="labels"></div>
219
- <div class="row collapse"><div class="detail-description">
220
- <p class="long_description"></p>
221
- <table class="table table-bordered"><tr>
222
- <th>since</th>
223
- <td>0.70</td>
224
- </tr></table>
225
- </div></div>
226
- </div>
227
- <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">
228
- <h2>IPTC Dataset descriptions</h2>
229
- <pre>$mla_iptc_descriptions : array</pre>
230
- <div class="labels"></div>
231
- <div class="row collapse"><div class="detail-description">
232
- <p class="long_description"><p>This array contains the descriptions of Datasets defined in
233
- the "IPTC-NAA Information Interchange Model Version No. 4.1".</p></p>
234
- <table class="table table-bordered"><tr>
235
- <th>since</th>
236
- <td>0.90</td>
237
- </tr></table>
238
- </div></div>
239
- </div>
240
- <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">
241
- <h2>IPTC file format identifiers and descriptions</h2>
242
- <pre>$mla_iptc_formats : array</pre>
243
- <div class="labels"></div>
244
- <div class="row collapse"><div class="detail-description">
245
- <p class="long_description"><p>This array contains the file format identifiers and descriptions defined in
246
- the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 1#020.</p></p>
247
- <table class="table table-bordered"><tr>
248
- <th>since</th>
249
- <td>0.90</td>
250
- </tr></table>
251
- </div></div>
252
- </div>
253
- <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">
254
- <h2>IPTC image type identifiers and descriptions</h2>
255
- <pre>$mla_iptc_image_types : array</pre>
256
- <div class="labels"></div>
257
- <div class="row collapse"><div class="detail-description">
258
- <p class="long_description"><p>This array contains the image type identifiers and descriptions defined in
259
- the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 2#130, octet 2.</p></p>
260
- <table class="table table-bordered"><tr>
261
- <th>since</th>
262
- <td>0.90</td>
263
- </tr></table>
264
- </div></div>
265
- </div>
266
- <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">
267
- <h2>IPTC Dataset identifiers and names</h2>
268
- <pre>$mla_iptc_records : array</pre>
269
- <div class="labels"></div>
270
- <div class="row collapse"><div class="detail-description">
271
- <p class="long_description"><p>This array contains the identifiers and names of Datasets defined in
272
- the "IPTC-NAA Information Interchange Model Version No. 4.1".</p></p>
273
- <table class="table table-bordered"><tr>
274
- <th>since</th>
275
- <td>0.90</td>
276
- </tr></table>
277
- </div></div>
278
- </div>
279
- <a name="%24query_parameters" id="$query_parameters"> </a><div class="element clickable property private $query_parameters" data-toggle="collapse" data-target=".$query_parameters .collapse">
280
- <h2>WP_Query filter "parameters"</h2>
281
- <pre>$query_parameters : array</pre>
282
- <div class="labels"></div>
283
- <div class="row collapse"><div class="detail-description">
284
- <p class="long_description"><p>This array defines parameters for the query's where filter, mla_shortcode_query_posts_where_filter.
285
- The parameters are set up in the mla_get_shortcode_attachments function, and
286
- any further logic required to translate those values is contained in the filter.</p>
287
-
288
- <p>Array index values are: post_parent</p></p>
289
- <table class="table table-bordered"><tr>
290
- <th>since</th>
291
- <td>1.13</td>
292
- </tr></table>
293
- </div></div>
294
- </div>
295
- </div>
296
- </div>
297
- </div>
298
- </div>
299
- <div class="row"><footer class="span12">
300
- 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>
301
- Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
302
- generated on 2013-02-26T09:38:18-08:00.<br></footer></div>
303
- </div>
304
- </body>
305
- </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>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,10 +15,13 @@
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,12 +55,8 @@
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,21 +86,9 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
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 $plugin_name) : void</pre>
105
  <div class="labels"></div>
106
  <div class="row collapse"><div class="detail-description">
107
  <p class="long_description"></p>
@@ -117,11 +104,14 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
117
  <div class="subelement argument">
118
  <h4>$plugin_name</h4>
119
  <code>string</code><p>Name of the plugin for messaging purposes</p></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 $plugin_name) : void</pre>
125
  <div class="labels"></div>
126
  <div class="row collapse"><div class="detail-description">
127
  <p class="long_description"></p>
@@ -137,20 +127,9 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
137
  <div class="subelement argument">
138
  <h4>$plugin_name</h4>
139
  <code>string</code><p>Name of the plugin for messaging purposes</p></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,7 +139,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
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-02-26T09:38:18-08:00.<br></footer></div>
164
  </div>
165
  </body>
166
  </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>phpDocumentor » \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">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">
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
  </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, string $plugin_name) : \none</pre>
92
  <div class="labels"></div>
93
  <div class="row collapse"><div class="detail-description">
94
  <p class="long_description"></p>
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>\none</code>Exit with messaging if version is too old</div>
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, string $plugin_name) : \none</pre>
115
  <div class="labels"></div>
116
  <div class="row collapse"><div class="detail-description">
117
  <p class="long_description"></p>
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>\none</code>Exit with messaging if PHP version is too old</div>
 
 
 
 
 
 
 
 
 
 
 
133
  </div></div>
134
  </div>
135
  </div>
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 2012-08-10T14:31:50-07:00.<br></footer></div>
143
  </div>
144
  </body>
145
  </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>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,10 +15,13 @@
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,27 +64,26 @@ calls the parent constructor to set some default configs.</span><pre>__construct
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 =&gt; option_title ) with the list
82
  of bulk actions available on this table."><span class="description">Get an associative array ( option_name =&gt; 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,26 +91,23 @@ from default values if the option is not set</span><pre>get_hidden_columns()</pr
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,9 +123,9 @@ and the value is db column to sort by.</span><pre>get_sortable_columns()</pre></
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,7 +141,7 @@ and the value is db column to sort by.</span><pre>get_sortable_columns()</pre></
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,7 +219,7 @@ calls the parent constructor to set some default configs.</h2>
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,6 +271,26 @@ calls the parent constructor to set some default configs.</h2>
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,13 +333,13 @@ is given special treatment when columns are processed.</p></p>
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,26 +398,6 @@ have a specific method, so this function returns a troubleshooting message.</p><
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,66 +438,6 @@ have a specific method, so this function returns a troubleshooting message.</p><
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,15 +458,15 @@ have a specific method, so this function returns a troubleshooting message.</p><
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,9 +478,9 @@ have a specific method, so this function returns a troubleshooting message.</p><
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,9 +498,9 @@ have a specific method, so this function returns a troubleshooting message.</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,11 +539,11 @@ have a specific method, so this function returns a troubleshooting message.</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,7 +575,7 @@ of bulk actions available on this table.</h2>
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,7 +619,7 @@ if set.</p></p>
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,53 +637,9 @@ if set.</p></p>
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,9 +654,9 @@ to affect the "screen options" setup.</p></p>
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,8 +683,8 @@ is not created in time for the call from screen.php.</p></p>
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,24 +697,8 @@ $this->set_pagination_args().</p></p>
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,30 +717,33 @@ with additional entries.</p></p>
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,15 +753,12 @@ with additional entries.</p></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,6 +776,22 @@ with additional entries.</p></p>
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,10 +817,7 @@ use the special slug "cb".</p>
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,7 +825,7 @@ Custom field columns are added to this array by mla_admin_init_action.</p></p>
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,10 +833,7 @@ Custom field columns are added to this array by mla_admin_init_action.</p></p>
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,10 +851,7 @@ to sort by. Often, the key and value will be the same, but this is not always
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,7 +877,7 @@ Custom field columns are added to this array by mla_admin_init_action.</p></p>
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-02-26T09:38:18-08:00.<br></footer></div>
995
  </div>
996
  </body>
997
  </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>phpDocumentor » \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">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">
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 :: Called when the parent class can't find a method specifically built
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."><span class="description">Extra controls to be displayed between bulk actions and pagination.</span><pre>extra_tablenav()</pre></a></li>
83
  <li class="method public "><a href="#get_bulk_actions" title="get_bulk_actions :: Get an associative array ( option_name =&gt; option_title ) with the list
84
  of bulk actions available on this table."><span class="description">Get an associative array ( option_name =&gt; 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."><span class="description">This method dictates the table's columns and titles.</span><pre>get_columns()</pre></a></li>
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
  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="#mla_manage_columns" title="mla_manage_columns :: 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()</pre></a></li>
95
+ <li class="method public "><a href="#mla_manage_hidden_columns" title="mla_manage_hidden_columns :: 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()</pre></a></li>
96
+ <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>
 
 
 
 
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."><span class="description">Get mime types with one or more attachments for view preparation.</span><pre>_avail_mime_types()</pre></a></li>
 
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 hdden columns"><span class="description">Default values for hdden columns</span><pre>$default_hidden_columns</pre></a></li>
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
  </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 extends the core WP_List_Table class</p>
127
  <div class="details">
128
+ <p class="long_description"></p>
129
  <table class="table table-bordered">
130
  <tr>
131
  <th>package</th>
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
  <p class="long_description"></p>
220
  <table class="table table-bordered"><tr>
221
  <th>since</th>
222
+ <td>0.1</td>
223
  </tr></table>
224
  <h3>Parameters</h3>
225
  <div class="subelement argument">
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
  </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>Called when the parent class can't find a method specifically built
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>All our columns should have a specific method,
342
+ so this function returns a troubleshooting message.</p></p>
 
343
  <table class="table table-bordered"><tr>
344
  <th>since</th>
345
  <td>0.1</td>
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
  <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
  <code>string</code>HTML markup to be placed inside the column</div>
459
  </div></div>
460
  </div>
461
+ <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">
462
  <h2>Supply the content for a custom column</h2>
463
+ <pre>column_post_name(array $item) : string</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.1</td>
470
  </tr></table>
471
  <h3>Parameters</h3>
472
  <div class="subelement argument">
478
  <code>string</code>HTML markup to be placed inside the column</div>
479
  </div></div>
480
  </div>
481
+ <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">
482
  <h2>Supply the content for a custom column</h2>
483
+ <pre>column_post_title(array $item) : string</pre>
484
  <div class="labels"></div>
485
  <div class="row collapse"><div class="detail-description">
486
  <p class="long_description"></p>
498
  <code>string</code>HTML markup to be placed inside the column</div>
499
  </div></div>
500
  </div>
501
+ <a name="column_tags" id="column_tags"></a><div class="element clickable method public column_tags" data-toggle="collapse" data-target=".column_tags .collapse">
502
  <h2>Supply the content for a custom column</h2>
503
+ <pre>column_tags(array $item) : string</pre>
504
  <div class="labels"></div>
505
  <div class="row collapse"><div class="detail-description">
506
  <p class="long_description"></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.</h2>
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</p></p>
547
  <table class="table table-bordered"><tr>
548
  <th>since</th>
549
  <td>0.1</td>
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.</h2>
579
  <pre>get_columns() : array</pre>
580
  <div class="labels"></div>
581
  <div class="row collapse"><div class="detail-description">
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',bool)</div>
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
  <code>array</code>View information,e.g., array ( id => link )</div>
638
  </div></div>
639
  </div>
640
+ <a name="mla_manage_columns" id="mla_manage_columns"></a><div class="element clickable method public mla_manage_columns" data-toggle="collapse" data-target=".mla_manage_columns .collapse">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
641
  <h2>Handler for filter 'manage_media_page_mla-menu_columns'</h2>
642
+ <pre>mla_manage_columns() : array</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
  <code>array</code>list of table columns</div>
655
  </div></div>
656
  </div>
657
+ <a name="mla_manage_hidden_columns" id="mla_manage_hidden_columns"></a><div class="element clickable method public mla_manage_hidden_columns" data-toggle="collapse" data-target=".mla_manage_hidden_columns .collapse">
658
  <h2>Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden'</h2>
659
+ <pre>mla_manage_hidden_columns(string $result, string $option, object $user_data) : array</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
  </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.</h2>
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
  </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.</h2>
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
  <code>array</code>Mime type names</div>
718
  </div></div>
719
  </div>
720
+ <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">
721
+ <h2>Add rollover actions to exactly one of the following displayed columns:
722
+ 'ID_parent', 'title_name', 'post_title', 'post_name'</h2>
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.1</td>
730
  </tr></table>
731
  <h3>Parameters</h3>
732
  <div class="subelement argument">
733
  <h4>$item</h4>
734
+ <code>array</code><p>A singular attachment (post) object</p>
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>array</code>Names and URLs of row-level actions</div>
742
  </div></div>
743
  </div>
744
+ <a name="_count_list_table_items" id="_count_list_table_items"></a><div class="element clickable method private _count_list_table_items" data-toggle="collapse" data-target="._count_list_table_items .collapse">
745
+ <h2>Get the total number of attachment posts</h2>
746
+ <pre>_count_list_table_items(array $request) : int</pre>
 
747
  <div class="labels"></div>
748
  <div class="row collapse"><div class="detail-description">
749
  <p class="long_description"></p>
753
  </tr></table>
754
  <h3>Parameters</h3>
755
  <div class="subelement argument">
756
+ <h4>$request</h4>
757
+ <code>array</code><p>Query variables, e.g., from $_REQUEST</p>
758
  </div>
 
 
 
759
  <h3>Returns</h3>
760
  <div class="subelement response">
761
+ <code>int</code>Number of attachment posts</div>
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
  <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
 
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></p>
 
 
 
821
  <table class="table table-bordered"><tr>
822
  <th>since</th>
823
  <td>0.1</td>
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 hdden columns</h2>
829
  <pre>$default_hidden_columns : array</pre>
830
  <div class="labels"></div>
831
  <div class="row collapse"><div class="detail-description">
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></p>
 
 
 
837
  <table class="table table-bordered"><tr>
838
  <th>since</th>
839
  <td>0.1</td>
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></p>
 
 
 
855
  <table class="table table-bordered"><tr>
856
  <th>since</th>
857
  <td>0.1</td>
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 2012-08-10T14:31:50-07:00.<br></footer></div>
881
  </div>
882
  </body>
883
  </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>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,10 +15,13 @@
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,7 +65,7 @@
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-02-26T09:38:18-08:00.<br></footer></div>
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>phpDocumentor</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">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">
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/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>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,10 +15,13 @@
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,15 +71,12 @@
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-02-26T09:38:18-08:00.<br></footer></div>
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>phpDocumentor</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">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">
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 2012-08-10T14:31:50-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>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,10 +15,13 @@
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,7 +62,7 @@
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-02-26T09:38:18-08:00.<br></footer></div>
63
  </div>
64
  </body>
65
  </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>phpDocumentor</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">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">
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 2012-08-10T14:31:50-07:00.<br></footer></div>
66
  </div>
67
  </body>
68
  </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>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,10 +15,13 @@
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,7 +48,7 @@
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,7 +82,7 @@
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-02-26T09:38:18-08:00.<br></footer></div>
83
  </div>
84
  </body>
85
  </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>phpDocumentor</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">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">
48
  if Javascript is enabled.
49
  </div></noscript>
50
  <div class="hero-unit">
51
+ <h1>phpDocumentor</h1>
52
  <h2>Documentation</h2>
53
  </div>
54
  <div class="row">
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 2012-08-10T14:31:49-07:00.<br></footer></div>
86
  </div>
87
  </body>
88
  </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>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,10 +15,13 @@
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,7 +67,7 @@
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-02-26T09:38:18-08:00.<br></footer></div>
68
  </div>
69
  </body>
70
  </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>phpDocumentor</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">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">
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 2012-08-10T14:31:50-07:00.<br></footer></div>
71
  </div>
72
  </body>
73
  </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>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,10 +15,13 @@
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,15 +70,122 @@
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>
@@ -92,46 +202,18 @@ of images and files held in the WordPress Media Library.</p>
92
  <a name="MLAData" id="MLAData"></a><div class="element ajax clickable class" href="../classes/MLAData.html">
93
  <h1>MLAData<a href="../classes/MLAData.html">¶</a>
94
  </h1>
95
- <p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs</p>
96
  <div class="details collapse"></div>
97
  <a href="../classes/MLAData.html" class="more">« More »</a>
98
  </div>
99
- <a name="MLAEdit" id="MLAEdit"></a><div class="element ajax clickable class" href="../classes/MLAEdit.html">
100
- <h1>MLAEdit<a href="../classes/MLAEdit.html">¶</a>
101
- </h1>
102
- <p class="short_description">Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen</p>
103
- <div class="details collapse"></div>
104
- <a href="../classes/MLAEdit.html" class="more">« More »</a>
105
- </div>
106
- <a name="MLAObjects" id="MLAObjects"></a><div class="element ajax clickable class" href="../classes/MLAObjects.html">
107
- <h1>MLAObjects<a href="../classes/MLAObjects.html">¶</a>
108
- </h1>
109
- <p class="short_description">Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags</p>
110
- <div class="details collapse"></div>
111
- <a href="../classes/MLAObjects.html" class="more">« More »</a>
112
- </div>
113
- <a name="MLAOptions" id="MLAOptions"></a><div class="element ajax clickable class" href="../classes/MLAOptions.html">
114
- <h1>MLAOptions<a href="../classes/MLAOptions.html">¶</a>
115
- </h1>
116
- <p class="short_description">Class MLA (Media Library Assistant) Options manages the plugin option settings
117
- and provides functions to get and put them from/to WordPress option variables</p>
118
- <div class="details collapse"></div>
119
- <a href="../classes/MLAOptions.html" class="more">« More »</a>
120
- </div>
121
  <a name="MLASettings" id="MLASettings"></a><div class="element ajax clickable class" href="../classes/MLASettings.html">
122
  <h1>MLASettings<a href="../classes/MLASettings.html">¶</a>
123
  </h1>
124
- <p class="short_description">Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings</p>
 
125
  <div class="details collapse"></div>
126
  <a href="../classes/MLASettings.html" class="more">« More »</a>
127
  </div>
128
- <a name="MLAShortcodes" id="MLAShortcodes"></a><div class="element ajax clickable class" href="../classes/MLAShortcodes.html">
129
- <h1>MLAShortcodes<a href="../classes/MLAShortcodes.html">¶</a>
130
- </h1>
131
- <p class="short_description">Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users</p>
132
- <div class="details collapse"></div>
133
- <a href="../classes/MLAShortcodes.html" class="more">« More »</a>
134
- </div>
135
  <a name="MLATest" id="MLATest"></a><div class="element ajax clickable class" href="../classes/MLATest.html">
136
  <h1>MLATest<a href="../classes/MLATest.html">¶</a>
137
  </h1>
@@ -143,7 +225,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
143
  <a name="MLA_List_Table" id="MLA_List_Table"></a><div class="element ajax clickable class" href="../classes/MLA_List_Table.html">
144
  <h1>MLA_List_Table<a href="../classes/MLA_List_Table.html">¶</a>
145
  </h1>
146
- <p class="short_description">Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu</p>
147
  <div class="details collapse"></div>
148
  <a href="../classes/MLA_List_Table.html" class="more">« More »</a>
149
  </div>
@@ -173,7 +255,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
173
  <div class="row"><footer class="span12">
174
  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>
175
  Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
176
- generated on 2013-02-26T09:38:18-08:00.<br></footer></div>
177
  </div>
178
  </body>
179
  </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>phpDocumentor » 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">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">
70
  <div class="namespace-indent">
71
  <h3>
72
  <i class="icon-custom icon-function"></i> Functions</h3>
73
+ <a name="mla_attachment_category_column_filter" id="mla_attachment_category_column_filter"></a><div class="element clickable function mla_attachment_category_column_filter" data-toggle="collapse" data-target=".mla_attachment_category_column_filter .collapse">
74
+ <h2>WordPress Filter for Attachment Category "Attachments" column,
75
+ which returns a count of the attachments assigned a given category</h2>
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.1</td>
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="mla_attachment_list_shortcode" id="mla_attachment_list_shortcode"></a><div class="element clickable function mla_attachment_list_shortcode" data-toggle="collapse" data-target=".mla_attachment_list_shortcode .collapse">
120
+ <h2>WordPress Shortcode; renders a complete list of all attachments and references to them</h2>
121
+ <pre>mla_attachment_list_shortcode() : string</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>0.1</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
  <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.</p>
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 manages the plugin option 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
  <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 extends the core WP_List_Table class</p>
229
  <div class="details collapse"></div>
230
  <a href="../classes/MLA_List_Table.html" class="more">« More »</a>
231
  </div>
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 2012-08-10T14:31:50-07:00.<br></footer></div>
259
  </div>
260
  </body>
261
  </html>
phpDocs/packages/Default.html ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>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,10 +15,13 @@
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,19 +60,28 @@
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="nav-header">
62
  <i class="icon-custom icon-class"></i> Classes</li>
63
- <li><a href="#MLAData" title="Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs">MLAData</a></li>
64
- <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>
65
- <li><a href="#MLA_List_Table" title='Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu'>MLA_List_Table</a></li>
66
  <li><a href="#MLA" title="Class MLA (Media Library Assistant) provides several enhancements to the handling
67
  of images and files held in the WordPress Media Library.">MLA</a></li>
68
- <li><a href="#MLAObjects" title="Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags">MLAObjects</a></li>
69
- <li><a href="#MLAOptions" title="Class MLA (Media Library Assistant) Options manages the plugin option settings
70
- and provides functions to get and put them from/to WordPress option variables">MLAOptions</a></li>
71
- <li><a href="#MLASettings" title="Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings">MLASettings</a></li>
72
- <li><a href="#MLAShortcodes" title="Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users">MLAShortcodes</a></li>
73
  <li><a href="#MLATest" title="Class MLA (Media Library Assistant) Test provides basic run-time tests
74
  to ensure the plugin can run in the current WordPress envrionment.">MLATest</a></li>
75
  <li class="nav-header">
@@ -89,15 +101,122 @@ to ensure the plugin can run in the current WordPress envrionment.">MLATest</a><
89
  <div class="package-indent">
90
  <h3>
91
  <i class="icon-custom icon-function"></i> Functions</h3>
92
- <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">
93
- <h2>Displays name conflict error messages at the top of the Dashboard</h2>
94
- <pre>mla_name_conflict_reporting_action() </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>
@@ -114,46 +233,18 @@ of images and files held in the WordPress Media Library.</p>
114
  <a name="MLAData" id="MLAData"></a><div class="element ajax clickable class" href="../classes/MLAData.html">
115
  <h1>MLAData<a href="../classes/MLAData.html">¶</a>
116
  </h1>
117
- <p class="short_description">Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs</p>
118
  <div class="details collapse"></div>
119
  <a href="../classes/MLAData.html" class="more">« More »</a>
120
  </div>
121
- <a name="MLAEdit" id="MLAEdit"></a><div class="element ajax clickable class" href="../classes/MLAEdit.html">
122
- <h1>MLAEdit<a href="../classes/MLAEdit.html">¶</a>
123
- </h1>
124
- <p class="short_description">Class MLA (Media Library Assistant) Edit contains meta boxes for the Edit Media (advanced-form-edit.php) screen</p>
125
- <div class="details collapse"></div>
126
- <a href="../classes/MLAEdit.html" class="more">« More »</a>
127
- </div>
128
- <a name="MLAObjects" id="MLAObjects"></a><div class="element ajax clickable class" href="../classes/MLAObjects.html">
129
- <h1>MLAObjects<a href="../classes/MLAObjects.html">¶</a>
130
- </h1>
131
- <p class="short_description">Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags</p>
132
- <div class="details collapse"></div>
133
- <a href="../classes/MLAObjects.html" class="more">« More »</a>
134
- </div>
135
- <a name="MLAOptions" id="MLAOptions"></a><div class="element ajax clickable class" href="../classes/MLAOptions.html">
136
- <h1>MLAOptions<a href="../classes/MLAOptions.html">¶</a>
137
- </h1>
138
- <p class="short_description">Class MLA (Media Library Assistant) Options manages the plugin option settings
139
- and provides functions to get and put them from/to WordPress option variables</p>
140
- <div class="details collapse"></div>
141
- <a href="../classes/MLAOptions.html" class="more">« More »</a>
142
- </div>
143
  <a name="MLASettings" id="MLASettings"></a><div class="element ajax clickable class" href="../classes/MLASettings.html">
144
  <h1>MLASettings<a href="../classes/MLASettings.html">¶</a>
145
  </h1>
146
- <p class="short_description">Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings</p>
 
147
  <div class="details collapse"></div>
148
  <a href="../classes/MLASettings.html" class="more">« More »</a>
149
  </div>
150
- <a name="MLAShortcodes" id="MLAShortcodes"></a><div class="element ajax clickable class" href="../classes/MLAShortcodes.html">
151
- <h1>MLAShortcodes<a href="../classes/MLAShortcodes.html">¶</a>
152
- </h1>
153
- <p class="short_description">Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users</p>
154
- <div class="details collapse"></div>
155
- <a href="../classes/MLAShortcodes.html" class="more">« More »</a>
156
- </div>
157
  <a name="MLATest" id="MLATest"></a><div class="element ajax clickable class" href="../classes/MLATest.html">
158
  <h1>MLATest<a href="../classes/MLATest.html">¶</a>
159
  </h1>
@@ -165,7 +256,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
165
  <a name="MLA_List_Table" id="MLA_List_Table"></a><div class="element ajax clickable class" href="../classes/MLA_List_Table.html">
166
  <h1>MLA_List_Table<a href="../classes/MLA_List_Table.html">¶</a>
167
  </h1>
168
- <p class="short_description">Class MLA (Media Library Assistant) List Table implements the "Assistant" admin submenu</p>
169
  <div class="details collapse"></div>
170
  <a href="../classes/MLA_List_Table.html" class="more">« More »</a>
171
  </div>
@@ -195,7 +286,7 @@ to ensure the plugin can run in the current WordPress envrionment.</p>
195
  <div class="row"><footer class="span12">
196
  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>
197
  Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a8</a> and<br>
198
- generated on 2013-02-26T09:38:18-08:00.<br></footer></div>
199
  </div>
200
  </body>
201
  </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>phpDocumentor » 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">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">
60
  </li>
61
  <li class="nav-header">
62
  <i class="icon-custom icon-function"></i> Functions</li>
63
+ <li class="function "><a href="#mla_attachment_category_column_filter" title='mla_attachment_category_column_filter :: WordPress Filter for Attachment Category "Attachments" column,
64
+ which returns a count of the attachments assigned a given category'><span class="description">WordPress Filter for Attachment Category "Attachments" column,
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.">MLAData</a></li>
80
+ <li><a href="#MLA_List_Table" title="Class MLA (Media Library Assistant) List Table extends the core WP_List_Table class">MLA_List_Table</a></li>
 
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="#MLASettings" title="Class MLA (Media Library Assistant) Settings manages the plugin option settings
84
+ and provides the settings page to edit them.">MLASettings</a></li>
 
 
 
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
  <div class="package-indent">
102
  <h3>
103
  <i class="icon-custom icon-function"></i> Functions</h3>
104
+ <a name="mla_attachment_category_column_filter" id="mla_attachment_category_column_filter"></a><div class="element clickable function mla_attachment_category_column_filter" data-toggle="collapse" data-target=".mla_attachment_category_column_filter .collapse">
105
+ <h2>WordPress Filter for Attachment Category "Attachments" column,
106
+ which returns a count of the attachments assigned a given category</h2>
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.1</td>
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="mla_attachment_list_shortcode" id="mla_attachment_list_shortcode"></a><div class="element clickable function mla_attachment_list_shortcode" data-toggle="collapse" data-target=".mla_attachment_list_shortcode .collapse">
151
+ <h2>WordPress Shortcode; renders a complete list of all attachments and references to them</h2>
152
+ <pre>mla_attachment_list_shortcode() : string</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>0.1</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
  <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.</p>
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 manages the plugin option 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
  <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 extends the core WP_List_Table class</p>
260
  <div class="details collapse"></div>
261
  <a href="../classes/MLA_List_Table.html" class="more">« More »</a>
262
  </div>
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 2012-08-10T14:31:50-07:00.<br></footer></div>
290
  </div>
291
  </body>
292
  </html>
phpDocs/structure.xml CHANGED
@@ -1,8 +1,8 @@
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="6c63ee375dcecc7156dd32f621501a07" 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,4472 +12,1928 @@
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' =&gt; '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'] =&gt; string, ['value'] =&gt; string, ['single'] =&gt; 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 &quot;LEFT JOIN view ON post_id&quot; 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 &quot;detached&quot; 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 =&gt; 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="1744" package="Media Library Assistant">
733
- <name>_hex_dump</name>
734
- <full_name>_hex_dump</full_name>
735
- <docblock line="1733">
736
- <description><![CDATA[Format printable version of binary data]]></description>
737
  <long-description><![CDATA[]]></long-description>
738
- <tag line="1733" name="since" description="0.90"/>
739
- <tag line="1733" name="param" description="Binary data" type="string" variable="$data">
740
- <type by_reference="false">string</type>
741
- </tag>
742
- <tag line="1733" 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="1733" 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="1733" name="return" description="Printable representation of $data" type="string">
749
  <type by_reference="false">string</type>
750
  </tag>
751
  </docblock>
752
- <argument line="1744">
753
- <name>$data</name>
754
  <default><![CDATA[]]></default>
755
  <type/>
756
  </argument>
757
- <argument line="1744">
758
- <name>$limit</name>
759
- <default><![CDATA[0]]></default>
760
- <type/>
761
- </argument>
762
- <argument line="1744">
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 =&gt; 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 &lt;div&gt; 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'=&gt;'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 =&gt; 'ID_parent, 1 =&gt; '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'=&gt;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 =&gt; 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'=&gt;'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'=&gt;'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="669a4a4c8ed6a8f4e8288aa596b57739" 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.13']]></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>MIN_PHP_VERSION</name>
1985
- <full_name>MIN_PHP_VERSION</full_name>
1986
- <value><![CDATA['5.2']]></value>
1987
- <docblock line="43">
1988
- <description><![CDATA[Minimum version of PHP required for this plugin]]></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>MIN_WORDPRESS_VERSION</name>
1998
- <full_name>MIN_WORDPRESS_VERSION</full_name>
1999
- <value><![CDATA['3.3']]></value>
2000
- <docblock line="52">
2001
- <description><![CDATA[Minimum version of WordPress required for this plugin]]></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>STYLESHEET_SLUG</name>
2011
- <full_name>STYLESHEET_SLUG</full_name>
2012
- <value><![CDATA['mla-style']]></value>
2013
- <docblock line="61">
2014
- <description><![CDATA[Slug for registering and enqueueing plugin style sheet]]></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_SINGLE_EDIT_SLUG</name>
2024
- <full_name>JAVASCRIPT_SINGLE_EDIT_SLUG</full_name>
2025
- <value><![CDATA['mla-single-edit-scripts']]></value>
2026
- <docblock line="70">
2027
- <description><![CDATA[Slug for localizing and enqueueing JavaScript - edit single item page]]></description>
2028
- <long-description><![CDATA[]]></long-description>
2029
- <tag line="70" name="since" description="0.1"/>
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_SINGLE_EDIT_OBJECT</name>
2037
- <full_name>JAVASCRIPT_SINGLE_EDIT_OBJECT</full_name>
2038
- <value><![CDATA['mla_single_edit_vars']]></value>
2039
- <docblock line="79">
2040
- <description><![CDATA[Object name for localizing JavaScript - edit single item page]]></description>
2041
- <long-description><![CDATA[]]></long-description>
2042
- <tag line="79" name="since" description="0.1"/>
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>JAVASCRIPT_INLINE_EDIT_SLUG</name>
2050
- <full_name>JAVASCRIPT_INLINE_EDIT_SLUG</full_name>
2051
- <value><![CDATA['mla-inline-edit-scripts']]></value>
2052
- <docblock line="88">
2053
- <description><![CDATA[Slug for localizing and enqueueing JavaScript - MLA List Table]]></description>
2054
- <long-description><![CDATA[]]></long-description>
2055
- <tag line="88" name="since" description="0.20"/>
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>JAVASCRIPT_INLINE_EDIT_OBJECT</name>
2063
- <full_name>JAVASCRIPT_INLINE_EDIT_OBJECT</full_name>
2064
- <value><![CDATA['mla_inline_edit_vars']]></value>
2065
- <docblock line="97">
2066
- <description><![CDATA[Object name for localizing JavaScript - MLA List Table]]></description>
2067
- <long-description><![CDATA[]]></long-description>
2068
- <tag line="97" name="since" description="0.20"/>
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>JAVASCRIPT_MEDIA_POPUP_SLUG</name>
2076
- <full_name>JAVASCRIPT_MEDIA_POPUP_SLUG</full_name>
2077
- <value><![CDATA['mla-media-popup-scripts']]></value>
2078
- <docblock line="106">
2079
- <description><![CDATA[Slug for localizing and enqueueing JavaScript - Add Media and related dialogs]]></description>
2080
- <long-description><![CDATA[]]></long-description>
2081
- <tag line="106" name="since" description="1.13"/>
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>JAVASCRIPT_MEDIA_POPUP_OBJECT</name>
2089
- <full_name>JAVASCRIPT_MEDIA_POPUP_OBJECT</full_name>
2090
- <value><![CDATA['mla_media_popup_vars']]></value>
2091
- <docblock line="115">
2092
- <description><![CDATA[Object name for localizing JavaScript - Add Media and related dialogs]]></description>
2093
- <long-description><![CDATA[]]></long-description>
2094
- <tag line="115" name="since" description="1.13"/>
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>ADMIN_PAGE_SLUG</name>
2102
- <full_name>ADMIN_PAGE_SLUG</full_name>
2103
- <value><![CDATA['mla-menu']]></value>
2104
- <docblock line="124">
2105
- <description><![CDATA[Slug for adding plugin submenu]]></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_NONCE</name>
2115
- <full_name>MLA_ADMIN_NONCE</full_name>
2116
- <value><![CDATA['mla_admin']]></value>
2117
- <docblock line="133">
2118
- <description><![CDATA[Action name; uniquely identifies the nonce]]></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_DELETE</name>
2128
- <full_name>MLA_ADMIN_SINGLE_DELETE</full_name>
2129
- <value><![CDATA['single_item_delete']]></value>
2130
- <docblock line="142">
2131
- <description><![CDATA[mla_admin_action value for permanently deleting a single item]]></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_EDIT_DISPLAY</name>
2141
- <full_name>MLA_ADMIN_SINGLE_EDIT_DISPLAY</full_name>
2142
- <value><![CDATA['single_item_edit_display']]></value>
2143
- <docblock line="151">
2144
- <description><![CDATA[mla_admin_action value for displaying a single item]]></description>
2145
- <long-description><![CDATA[]]></long-description>
2146
- <tag line="151" name="since" description="0.1"/>
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_EDIT_UPDATE</name>
2154
- <full_name>MLA_ADMIN_SINGLE_EDIT_UPDATE</full_name>
2155
- <value><![CDATA['single_item_edit_update']]></value>
2156
- <docblock line="160">
2157
- <description><![CDATA[mla_admin_action value for updating a single item]]></description>
2158
- <long-description><![CDATA[]]></long-description>
2159
- <tag line="160" name="since" description="0.1"/>
2160
- <tag line="160" name="var" description="" type="string">
2161
- <type by_reference="false">string</type>
2162
- </tag>
2163
- </docblock>
2164
- </constant>
2165
- <constant namespace="global" line="176" package="Media Library Assistant">
2166
- <name>MLA_ADMIN_SINGLE_RESTORE</name>
2167
- <full_name>MLA_ADMIN_SINGLE_RESTORE</full_name>
2168
- <value><![CDATA['single_item_restore']]></value>
2169
- <docblock line="169">
2170
- <description><![CDATA[mla_admin_action value for restoring a single item from the trash]]></description>
2171
- <long-description><![CDATA[]]></long-description>
2172
- <tag line="169" name="since" description="0.1"/>
2173
- <tag line="169" name="var" description="" type="string">
2174
- <type by_reference="false">string</type>
2175
- </tag>
2176
- </docblock>
2177
- </constant>
2178
- <constant namespace="global" line="185" package="Media Library Assistant">
2179
- <name>MLA_ADMIN_SINGLE_TRASH</name>
2180
- <full_name>MLA_ADMIN_SINGLE_TRASH</full_name>
2181
- <value><![CDATA['single_item_trash']]></value>
2182
- <docblock line="178">
2183
- <description><![CDATA[mla_admin_action value for moving a single item to the trash]]></description>
2184
- <long-description><![CDATA[]]></long-description>
2185
- <tag line="178" name="since" description="0.1"/>
2186
- <tag line="178" name="var" description="" type="string">
2187
- <type by_reference="false">string</type>
2188
- </tag>
2189
- </docblock>
2190
- </constant>
2191
- <constant namespace="global" line="194" package="Media Library Assistant">
2192
- <name>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP</name>
2193
- <full_name>MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP</full_name>
2194
- <value><![CDATA['single_item_custom_field_map']]></value>
2195
- <docblock line="187">
2196
- <description><![CDATA[mla_admin_action value for mapping Custom Field metadata]]></description>
2197
- <long-description><![CDATA[]]></long-description>
2198
- <tag line="187" name="since" description="1.10"/>
2199
- <tag line="187" name="var" description="" type="string">
2200
- <type by_reference="false">string</type>
2201
- </tag>
2202
- </docblock>
2203
- </constant>
2204
- <constant namespace="global" line="203" package="Media Library Assistant">
2205
- <name>MLA_ADMIN_SINGLE_MAP</name>
2206
- <full_name>MLA_ADMIN_SINGLE_MAP</full_name>
2207
- <value><![CDATA['single_item_map']]></value>
2208
- <docblock line="196">
2209
- <description><![CDATA[mla_admin_action value for mapping IPTC/EXIF metadata]]></description>
2210
- <long-description><![CDATA[]]></long-description>
2211
- <tag line="196" name="since" description="1.00"/>
2212
- <tag line="196" name="var" description="" type="string">
2213
- <type by_reference="false">string</type>
2214
- </tag>
2215
- </docblock>
2216
- </constant>
2217
- <property final="false" static="true" visibility="private" line="212" namespace="global" package="Media Library Assistant">
2218
- <name>$page_hooks</name>
2219
- <default><![CDATA[array()]]></default>
2220
- <docblock line="205">
2221
- <description><![CDATA[Holds screen ids to match help text to corresponding screen]]></description>
2222
- <long-description><![CDATA[]]></long-description>
2223
- <tag line="205" name="since" description="0.1"/>
2224
- <tag line="205" name="var" description="" type="array">
2225
- <type by_reference="false">array</type>
2226
- </tag>
2227
- </docblock>
2228
- </property>
2229
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="225" package="Media Library Assistant">
2230
- <name>initialize</name>
2231
- <full_name>initialize</full_name>
2232
- <docblock line="214">
2233
- <description><![CDATA[Initialization function, similar to __construct()]]></description>
2234
- <long-description><![CDATA[<p>This function contains add_action and add_filter calls
2235
- to set up the Ajax handlers, enqueue JavaScript and CSS files, and
2236
- set up the Assistant submenu.</p>]]></long-description>
2237
- <tag line="214" name="since" description="0.1"/>
2238
- <tag line="214" name="return" description="" type="void">
2239
- <type by_reference="false">void</type>
2240
- </tag>
2241
- </docblock>
2242
- </method>
2243
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="244" package="Media Library Assistant">
2244
- <name>mla_admin_init_action</name>
2245
- <full_name>mla_admin_init_action</full_name>
2246
- <docblock line="237">
2247
- <description><![CDATA[Load the plugin's Ajax handler or process Edit Media update actions]]></description>
2248
- <long-description><![CDATA[]]></long-description>
2249
- <tag line="237" name="since" description="0.20"/>
2250
- <tag line="237" name="return" description="" type="void">
2251
- <type by_reference="false">void</type>
2252
- </tag>
2253
- </docblock>
2254
- </method>
2255
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="286" package="Media Library Assistant">
2256
- <name>mla_admin_enqueue_scripts_action</name>
2257
- <full_name>mla_admin_enqueue_scripts_action</full_name>
2258
- <docblock line="277">
2259
- <description><![CDATA[Load the plugin's Style Sheet and Javascript files]]></description>
2260
- <long-description><![CDATA[]]></long-description>
2261
- <tag line="277" name="since" description="0.1"/>
2262
- <tag line="277" name="param" description="Name of the page being loaded" type="string" variable="$page_hook">
2263
- <type by_reference="false">string</type>
2264
- </tag>
2265
- <tag line="277" name="return" description="" type="void">
2266
- <type by_reference="false">void</type>
2267
- </tag>
2268
- </docblock>
2269
- <argument line="286">
2270
- <name>$page_hook</name>
2271
- <default><![CDATA[]]></default>
2272
- <type/>
2273
- </argument>
2274
- </method>
2275
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="357" package="Media Library Assistant">
2276
- <name>mla_admin_menu_action</name>
2277
- <full_name>mla_admin_menu_action</full_name>
2278
- <docblock line="342">
2279
- <description><![CDATA[Add the submenu pages]]></description>
2280
- <long-description><![CDATA[<p>Add a submenu page in the "Media" section,
2281
- add settings page in the "Settings" section.
2282
- add settings link in the Plugins section entry for MLA.</p>
2283
-
2284
- <p>For WordPress versions before 3.5,
2285
- add submenu page(s) for attachment taxonomies,
2286
- add filter to clean up taxonomy submenu labels.</p>]]></long-description>
2287
- <tag line="342" name="since" description="0.1"/>
2288
- <tag line="342" name="return" description="" type="void">
2289
- <type by_reference="false">void</type>
2290
- </tag>
2291
- </docblock>
2292
- </method>
2293
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="394" package="Media Library Assistant">
2294
- <name>mla_add_menu_options</name>
2295
- <full_name>mla_add_menu_options</full_name>
2296
- <docblock line="387">
2297
- <description><![CDATA[Add the "XX Entries per page" filter to the Screen Options tab]]></description>
2298
- <long-description><![CDATA[]]></long-description>
2299
- <tag line="387" name="since" description="0.1"/>
2300
- <tag line="387" name="return" description="" type="void">
2301
- <type by_reference="false">void</type>
2302
- </tag>
2303
- </docblock>
2304
- </method>
2305
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="413" package="Media Library Assistant">
2306
- <name>mla_add_help_tab</name>
2307
- <full_name>mla_add_help_tab</full_name>
2308
- <docblock line="406">
2309
- <description><![CDATA[Add contextual help tabs to all the MLA pages]]></description>
2310
- <long-description><![CDATA[]]></long-description>
2311
- <tag line="406" name="since" description="0.1"/>
2312
- <tag line="406" name="return" description="" type="void">
2313
- <type by_reference="false">void</type>
2314
- </tag>
2315
- </docblock>
2316
- </method>
2317
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="502" package="Media Library Assistant">
2318
- <name>mla_screen_options_show_screen_filter</name>
2319
- <full_name>mla_screen_options_show_screen_filter</full_name>
2320
- <docblock line="492">
2321
- <description><![CDATA[Only show screen options on the table-list screen]]></description>
2322
- <long-description><![CDATA[]]></long-description>
2323
- <tag line="492" name="since" description="0.1"/>
2324
- <tag line="492" name="param" description="True to display &quot;Screen Options&quot;, false to suppress them" type="boolean" variable="$show_screen">
2325
- <type by_reference="false">boolean</type>
2326
- </tag>
2327
- <tag line="492" name="param" description="Name of the page being loaded" type="string" variable="$this_screen">
2328
- <type by_reference="false">string</type>
2329
- </tag>
2330
- <tag line="492" name="return" description="True to display &quot;Screen Options&quot;, false to suppress them" type="boolean">
2331
- <type by_reference="false">boolean</type>
2332
- </tag>
2333
- </docblock>
2334
- <argument line="502">
2335
- <name>$show_screen</name>
2336
- <default><![CDATA[]]></default>
2337
- <type/>
2338
- </argument>
2339
- <argument line="502">
2340
- <name>$this_screen</name>
2341
- <default><![CDATA[]]></default>
2342
- <type/>
2343
- </argument>
2344
- </method>
2345
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="520" package="Media Library Assistant">
2346
- <name>mla_set_screen_option_filter</name>
2347
- <full_name>mla_set_screen_option_filter</full_name>
2348
- <docblock line="509">
2349
- <description><![CDATA[Save the "Entries per page" option set by this user]]></description>
2350
- <long-description><![CDATA[]]></long-description>
2351
- <tag line="509" name="since" description="0.1"/>
2352
- <tag line="509" name="param" description="Unknown - always false?" type="boolean" variable="$status">
2353
- <type by_reference="false">boolean</type>
2354
- </tag>
2355
- <tag line="509" name="param" description="Name of the option being changed" type="string" variable="$option">
2356
- <type by_reference="false">string</type>
2357
- </tag>
2358
- <tag line="509" name="param" description="New value of the option" type="string" variable="$value">
2359
- <type by_reference="false">string</type>
2360
- </tag>
2361
- <tag line="509" name="return" description="New value if this is our option, otherwise nothing" type="string|void">
2362
- <type by_reference="false">string</type>
2363
- <type by_reference="false">void</type>
2364
- </tag>
2365
- </docblock>
2366
- <argument line="520">
2367
- <name>$status</name>
2368
- <default><![CDATA[]]></default>
2369
- <type/>
2370
- </argument>
2371
- <argument line="520">
2372
- <name>$option</name>
2373
- <default><![CDATA[]]></default>
2374
- <type/>
2375
- </argument>
2376
- <argument line="520">
2377
- <name>$value</name>
2378
- <default><![CDATA[]]></default>
2379
- <type/>
2380
- </argument>
2381
- </method>
2382
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="537" package="Media Library Assistant">
2383
- <name>mla_edit_tax_redirect</name>
2384
- <full_name>mla_edit_tax_redirect</full_name>
2385
- <docblock line="526">
2386
- <description><![CDATA[Redirect to the Edit Tags/Categories page]]></description>
2387
- <long-description><![CDATA[<p>The custom taxonomy add/edit submenu entries go to "upload.php" by default.
2388
- This filter is the only way to redirect them to the correct WordPress page.
2389
- The filter is not required for WordPress 3.5 and later.</p>]]></long-description>
2390
- <tag line="526" name="since" description="0.1"/>
2391
- <tag line="526" name="return" description="" type="void">
2392
- <type by_reference="false">void</type>
2393
- </tag>
2394
- </docblock>
2395
- </method>
2396
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="570" package="Media Library Assistant">
2397
- <name>mla_parent_file_filter</name>
2398
- <full_name>mla_parent_file_filter</full_name>
2399
- <docblock line="554">
2400
- <description><![CDATA[Cleanup menus for Edit Tags/Categories page]]></description>
2401
- <long-description><![CDATA[<p>For WordPress before 3.5, the submenu entries for custom taxonomies
2402
- under the "Media" menu are not set up correctly by WordPress, so this
2403
- function cleans them up, redirecting the request to the right WordPress
2404
- page for editing/adding taxonomy terms.
2405
- For WordPress 3.5 and later, the function fixes the submenu bolding when
2406
- going to the Edit Media screen.</p>]]></long-description>
2407
- <tag line="554" name="since" description="0.1"/>
2408
- <tag line="554" name="param" description="The top-level menu page" type="array" variable="$parent_file">
2409
- <type by_reference="false">array</type>
2410
- </tag>
2411
- <tag line="554" name="return" description="The updated top-level menu page" type="string">
2412
- <type by_reference="false">string</type>
2413
- </tag>
2414
- </docblock>
2415
- <argument line="570">
2416
- <name>$parent_file</name>
2417
- <default><![CDATA[]]></default>
2418
- <type/>
2419
- </argument>
2420
- </method>
2421
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="613" package="Media Library Assistant">
2422
- <name>mla_render_admin_page</name>
2423
- <full_name>mla_render_admin_page</full_name>
2424
- <docblock line="606">
2425
- <description><![CDATA[Render the "Assistant" subpage in the Media section, using the list_table package]]></description>
2426
- <long-description><![CDATA[]]></long-description>
2427
- <tag line="606" name="since" description="0.1"/>
2428
- <tag line="606" name="return" description="" type="void">
2429
- <type by_reference="false">void</type>
2430
- </tag>
2431
- </docblock>
2432
- </method>
2433
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="897" package="Media Library Assistant">
2434
- <name>mla_inline_edit_action</name>
2435
- <full_name>mla_inline_edit_action</full_name>
2436
- <docblock line="888">
2437
- <description><![CDATA[Ajax handler for inline editing (quick and bulk edit)]]></description>
2438
- <long-description><![CDATA[<p>Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php</p>]]></long-description>
2439
- <tag line="888" name="since" description="0.20"/>
2440
- <tag line="888" name="return" description="echo HTML &lt;tr&gt; markup for updated row or error message, then die()" type="void">
2441
- <type by_reference="false">void</type>
2442
- </tag>
2443
- </docblock>
2444
- </method>
2445
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="992" package="Media Library Assistant">
2446
- <name>_build_inline_edit_form</name>
2447
- <full_name>_build_inline_edit_form</full_name>
2448
- <docblock line="981">
2449
- <description><![CDATA[Build the hidden row templates for inline editing (quick and bulk edit)]]></description>
2450
- <long-description><![CDATA[<p>inspired by inline_edit() in wp-admin\includes\class-wp-posts-list-table.php.</p>]]></long-description>
2451
- <tag line="981" name="since" description="0.20"/>
2452
- <tag line="981" name="param" description="MLA List Table object" type="object" variable="$MLAListTable">
2453
- <type by_reference="false">object</type>
2454
- </tag>
2455
- <tag line="981" name="return" description="HTML &lt;form&gt; markup for hidden rows" type="string">
2456
- <type by_reference="false">string</type>
2457
- </tag>
2458
- </docblock>
2459
- <argument line="992">
2460
- <name>$MLAListTable</name>
2461
- <default><![CDATA[]]></default>
2462
- <type/>
2463
- </argument>
2464
- </method>
2465
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1149" package="Media Library Assistant">
2466
- <name>_authors_dropdown</name>
2467
- <full_name>_authors_dropdown</full_name>
2468
- <docblock line="1138">
2469
- <description><![CDATA[Get the edit Authors dropdown box, if user has suitable permissions]]></description>
2470
- <long-description><![CDATA[]]></long-description>
2471
- <tag line="1138" name="since" description="0.20"/>
2472
- <tag line="1138" name="param" description="Optional User ID of the current author, default 0" type="integer" variable="$author">
2473
- <type by_reference="false">integer</type>
2474
- </tag>
2475
- <tag line="1138" name="param" description="Optional HTML name attribute, default 'post_author'" type="string" variable="$name">
2476
- <type by_reference="false">string</type>
2477
- </tag>
2478
- <tag line="1138" name="param" description="Optional HTML class attribute, default 'authors'" type="string" variable="$class">
2479
- <type by_reference="false">string</type>
2480
- </tag>
2481
- <tag line="1138" name="return" description="HTML markup for the dropdown field or False" type="string|false">
2482
- <type by_reference="false">string</type>
2483
- <type by_reference="false">false</type>
2484
- </tag>
2485
- </docblock>
2486
- <argument line="1149">
2487
- <name>$author</name>
2488
- <default><![CDATA[0]]></default>
2489
- <type/>
2490
- </argument>
2491
- <argument line="1149">
2492
- <name>$name</name>
2493
- <default><![CDATA['post_author']]></default>
2494
- <type/>
2495
- </argument>
2496
- <argument line="1149">
2497
- <name>$class</name>
2498
- <default><![CDATA['authors']]></default>
2499
- <type/>
2500
- </argument>
2501
- </method>
2502
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1183" package="Media Library Assistant">
2503
- <name>_current_bulk_action</name>
2504
- <full_name>_current_bulk_action</full_name>
2505
- <docblock line="1176">
2506
- <description><![CDATA[Get the current action selected from the bulk actions dropdown]]></description>
2507
- <long-description><![CDATA[]]></long-description>
2508
- <tag line="1176" name="since" description="0.1"/>
2509
- <tag line="1176" name="return" description="The action name or False if no action was selected" type="string|false">
2510
- <type by_reference="false">string</type>
2511
- <type by_reference="false">false</type>
2512
- </tag>
2513
- </docblock>
2514
- </method>
2515
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1212" package="Media Library Assistant">
2516
- <name>_delete_single_item</name>
2517
- <full_name>_delete_single_item</full_name>
2518
- <docblock line="1203">
2519
- <description><![CDATA[Delete a single item permanently]]></description>
2520
- <long-description><![CDATA[]]></long-description>
2521
- <tag line="1203" name="since" description="0.1"/>
2522
- <tag line="1203" name="param" description="The form POST data" type="array" variable="$post_id">
2523
- <type by_reference="false">array</type>
2524
- </tag>
2525
- <tag line="1203" name="return" description="success/failure message and NULL content" type="array">
2526
- <type by_reference="false">array</type>
2527
- </tag>
2528
- </docblock>
2529
- <argument line="1212">
2530
- <name>$post_id</name>
2531
- <default><![CDATA[]]></default>
2532
- <type/>
2533
- </argument>
2534
- </method>
2535
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1241" package="Media Library Assistant">
2536
- <name>_display_single_item</name>
2537
- <full_name>_display_single_item</full_name>
2538
- <docblock line="1231">
2539
- <description><![CDATA[Display a single item sub page; prepare the form to
2540
- change the meta data for a single attachment.]]></description>
2541
- <long-description><![CDATA[]]></long-description>
2542
- <tag line="1231" name="since" description="0.1"/>
2543
- <tag line="1231" name="param" description="The WordPress Post ID of the attachment item" type="int" variable="$post_id">
2544
- <type by_reference="false">int</type>
2545
- </tag>
2546
- <tag line="1231" name="return" description="message and/or HTML content" type="array">
2547
- <type by_reference="false">array</type>
2548
- </tag>
2549
- </docblock>
2550
- <argument line="1241">
2551
- <name>$post_id</name>
2552
- <default><![CDATA[]]></default>
2553
- <type/>
2554
- </argument>
2555
- </method>
2556
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1481" package="Media Library Assistant">
2557
- <name>_restore_single_item</name>
2558
- <full_name>_restore_single_item</full_name>
2559
- <docblock line="1472">
2560
- <description><![CDATA[Restore a single item from the Trash]]></description>
2561
- <long-description><![CDATA[]]></long-description>
2562
- <tag line="1472" name="since" description="0.1"/>
2563
- <tag line="1472" name="param" description="The form POST data" type="array" variable="$post_id">
2564
- <type by_reference="false">array</type>
2565
- </tag>
2566
- <tag line="1472" name="return" description="success/failure message and NULL content" type="array">
2567
- <type by_reference="false">array</type>
2568
- </tag>
2569
- </docblock>
2570
- <argument line="1481">
2571
- <name>$post_id</name>
2572
- <default><![CDATA[]]></default>
2573
- <type/>
2574
- </argument>
2575
- </method>
2576
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1517" package="Media Library Assistant">
2577
- <name>_trash_single_item</name>
2578
- <full_name>_trash_single_item</full_name>
2579
- <docblock line="1508">
2580
- <description><![CDATA[Move a single item to Trash]]></description>
2581
- <long-description><![CDATA[]]></long-description>
2582
- <tag line="1508" name="since" description="0.1"/>
2583
- <tag line="1508" name="param" description="The form POST data" type="array" variable="$post_id">
2584
- <type by_reference="false">array</type>
2585
- </tag>
2586
- <tag line="1508" name="return" description="success/failure message and NULL content" type="array">
2587
- <type by_reference="false">array</type>
2588
- </tag>
2589
- </docblock>
2590
- <argument line="1517">
2591
- <name>$post_id</name>
2592
- <default><![CDATA[]]></default>
2593
- <type/>
2594
- </argument>
2595
- </method>
2596
- </class>
2597
- </file>
2598
- <file path="includes\class-mla-objects.php" hash="df30be6284bbef6a8eab604901b74c41" package="Media Library Assistant">
2599
- <docblock line="2">
2600
- <description><![CDATA[Media Library Assistant Custom Taxonomy and Post Type objects]]></description>
2601
- <long-description><![CDATA[]]></long-description>
2602
- <tag line="2" name="package" description="Media Library Assistant"/>
2603
- <tag line="2" name="since" description="0.1"/>
2604
- </docblock>
2605
- <class final="false" abstract="false" namespace="global" line="15" package="Media Library Assistant">
2606
- <extends/>
2607
- <name>MLAObjects</name>
2608
- <full_name>\MLAObjects</full_name>
2609
- <docblock line="9">
2610
- <description><![CDATA[Class MLA (Media Library Assistant) Objects defines and manages custom taxonomies for Attachment Categories and Tags]]></description>
2611
- <long-description><![CDATA[]]></long-description>
2612
- <tag line="9" name="package" description="Media Library Assistant"/>
2613
- <tag line="9" name="since" description="0.20"/>
2614
- </docblock>
2615
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="23" package="Media Library Assistant">
2616
- <name>initialize</name>
2617
- <full_name>initialize</full_name>
2618
- <docblock line="16">
2619
- <description><![CDATA[Initialization function, similar to __construct()]]></description>
2620
- <long-description><![CDATA[]]></long-description>
2621
- <tag line="16" name="since" description="0.20"/>
2622
- <tag line="16" name="return" description="" type="void">
2623
- <type by_reference="false">void</type>
2624
- </tag>
2625
- </docblock>
2626
- </method>
2627
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="34" package="Media Library Assistant">
2628
- <name>_build_taxonomies</name>
2629
- <full_name>_build_taxonomies</full_name>
2630
- <docblock line="27">
2631
- <description><![CDATA[Registers Attachment Categories and Attachment Tags custom taxonomies, adds taxonomy-related filters]]></description>
2632
- <long-description><![CDATA[]]></long-description>
2633
- <tag line="27" name="since" description="0.1"/>
2634
- <tag line="27" name="return" description="" type="void">
2635
- <type by_reference="false">void</type>
2636
- </tag>
2637
- </docblock>
2638
- </method>
2639
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="112" package="Media Library Assistant">
2640
- <name>mla_taxonomy_get_columns_filter</name>
2641
- <full_name>mla_taxonomy_get_columns_filter</full_name>
2642
- <docblock line="102">
2643
- <description><![CDATA[WordPress Filter for edit taxonomy "Attachments" column,
2644
- which replaces the "Posts" column with an equivalent "Attachments" column.]]></description>
2645
- <long-description><![CDATA[]]></long-description>
2646
- <tag line="102" name="since" description="0.30"/>
2647
- <tag line="102" name="param" description="column definitions for the edit taxonomy list table" type="array" variable="$columns">
2648
- <type by_reference="false">array</type>
2649
- </tag>
2650
- <tag line="102" name="return" description="updated column definitions for the edit taxonomy list table" type="array">
2651
- <type by_reference="false">array</type>
2652
- </tag>
2653
- </docblock>
2654
- <argument line="112">
2655
- <name>$columns</name>
2656
- <default><![CDATA[]]></default>
2657
- <type/>
2658
- </argument>
2659
- </method>
2660
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="147" package="Media Library Assistant">
2661
- <name>mla_taxonomy_column_filter</name>
2662
- <full_name>mla_taxonomy_column_filter</full_name>
2663
- <docblock line="134">
2664
- <description><![CDATA[WordPress Filter for edit taxonomy "Attachments" column,
2665
- which returns a count of the attachments assigned a given term]]></description>
2666
- <long-description><![CDATA[]]></long-description>
2667
- <tag line="134" name="since" description="0.30"/>
2668
- <tag line="134" name="param" description="current column value; always ''" type="string" variable="$place_holder">
2669
- <type by_reference="false">string</type>
2670
- </tag>
2671
- <tag line="134" name="param" description="name of the column" type="array" variable="$column_name">
2672
- <type by_reference="false">array</type>
2673
- </tag>
2674
- <tag line="134" name="param" description="ID of the term for which the count is desired" type="array" variable="$term_id">
2675
- <type by_reference="false">array</type>
2676
- </tag>
2677
- <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">
2678
- <type by_reference="false">array</type>
2679
- </tag>
2680
- </docblock>
2681
- <argument line="147">
2682
- <name>$place_holder</name>
2683
- <default><![CDATA[]]></default>
2684
- <type/>
2685
- </argument>
2686
- <argument line="147">
2687
- <name>$column_name</name>
2688
- <default><![CDATA[]]></default>
2689
- <type/>
2690
- </argument>
2691
- <argument line="147">
2692
- <name>$term_id</name>
2693
- <default><![CDATA[]]></default>
2694
- <type/>
2695
- </argument>
2696
- </method>
2697
- </class>
2698
- </file>
2699
- <file path="includes\class-mla-options.php" hash="c7c4c8d7b8e656f56a8dfcf8aa43f1e0" package="Media Library Assistant">
2700
- <docblock line="2">
2701
- <description><![CDATA[Manages the plugin option settings]]></description>
2702
- <long-description><![CDATA[]]></long-description>
2703
- <tag line="2" name="package" description="Media Library Assistant"/>
2704
- <tag line="2" name="since" description="1.00"/>
2705
- </docblock>
2706
- <class final="false" abstract="false" namespace="global" line="18" package="Media Library Assistant">
2707
- <extends/>
2708
- <name>MLAOptions</name>
2709
- <full_name>\MLAOptions</full_name>
2710
- <docblock line="9">
2711
- <description><![CDATA[Class MLA (Media Library Assistant) Options manages the plugin option settings
2712
- and provides functions to get and put them from/to WordPress option variables]]></description>
2713
- <long-description><![CDATA[<p>Separated from class MLASettings in version 1.00</p>]]></long-description>
2714
- <tag line="9" name="package" description="Media Library Assistant"/>
2715
- <tag line="9" name="since" description="1.00"/>
2716
- </docblock>
2717
- <constant namespace="global" line="22" package="Media Library Assistant">
2718
- <name>MLA_VERSION_OPTION</name>
2719
- <full_name>MLA_VERSION_OPTION</full_name>
2720
- <value><![CDATA['current_version']]></value>
2721
- <docblock line="19">
2722
- <description><![CDATA[Provides a unique name for the current version option]]></description>
2723
- <long-description><![CDATA[]]></long-description>
2724
- </docblock>
2725
- </constant>
2726
- <constant namespace="global" line="27" package="Media Library Assistant">
2727
- <name>MLA_FEATURED_IN_TUNING</name>
2728
- <full_name>MLA_FEATURED_IN_TUNING</full_name>
2729
- <value><![CDATA['featured_in_tuning']]></value>
2730
- <docblock line="24">
2731
- <description><![CDATA[Provides a unique name for a database tuning option]]></description>
2732
- <long-description><![CDATA[]]></long-description>
2733
- </docblock>
2734
- </constant>
2735
- <constant namespace="global" line="32" package="Media Library Assistant">
2736
- <name>MLA_INSERTED_IN_TUNING</name>
2737
- <full_name>MLA_INSERTED_IN_TUNING</full_name>
2738
- <value><![CDATA['inserted_in_tuning']]></value>
2739
- <docblock line="29">
2740
- <description><![CDATA[Provides a unique name for a database tuning option]]></description>
2741
- <long-description><![CDATA[]]></long-description>
2742
- </docblock>
2743
- </constant>
2744
- <constant namespace="global" line="37" package="Media Library Assistant">
2745
- <name>MLA_GALLERY_IN_TUNING</name>
2746
- <full_name>MLA_GALLERY_IN_TUNING</full_name>
2747
- <value><![CDATA['gallery_in_tuning']]></value>
2748
- <docblock line="34">
2749
- <description><![CDATA[Provides a unique name for a database tuning option]]></description>
2750
- <long-description><![CDATA[]]></long-description>
2751
- </docblock>
2752
- </constant>
2753
- <constant namespace="global" line="42" package="Media Library Assistant">
2754
- <name>MLA_MLA_GALLERY_IN_TUNING</name>
2755
- <full_name>MLA_MLA_GALLERY_IN_TUNING</full_name>
2756
- <value><![CDATA['mla_gallery_in_tuning']]></value>
2757
- <docblock line="39">
2758
- <description><![CDATA[Provides a unique name for a database tuning option]]></description>
2759
- <long-description><![CDATA[]]></long-description>
2760
- </docblock>
2761
- </constant>
2762
- <constant namespace="global" line="47" package="Media Library Assistant">
2763
- <name>MLA_NEW_CUSTOM_RULE</name>
2764
- <full_name>MLA_NEW_CUSTOM_RULE</full_name>
2765
- <value><![CDATA['__NEW RULE__']]></value>
2766
- <docblock line="44">
2767
- <description><![CDATA[Provides a unique name for the Custom Field "new rule" key]]></description>
2768
- <long-description><![CDATA[]]></long-description>
2769
- </docblock>
2770
- </constant>
2771
- <constant namespace="global" line="52" package="Media Library Assistant">
2772
- <name>MLA_NEW_CUSTOM_FIELD</name>
2773
- <full_name>MLA_NEW_CUSTOM_FIELD</full_name>
2774
- <value><![CDATA['__NEW FIELD__']]></value>
2775
- <docblock line="49">
2776
- <description><![CDATA[Provides a unique name for the Custom Field "new field" key]]></description>
2777
- <long-description><![CDATA[]]></long-description>
2778
- </docblock>
2779
- </constant>
2780
- <property final="false" static="true" visibility="public" line="63" namespace="global" package="Media Library Assistant">
2781
- <name>$process_featured_in</name>
2782
- <default><![CDATA[true]]></default>
2783
- <docblock line="54">
2784
- <description><![CDATA[Option setting for "Featured in" reporting]]></description>
2785
- <long-description><![CDATA[<p>This setting is false if the "Featured in" database access setting is "disabled", else true.</p>]]></long-description>
2786
- <tag line="54" name="since" description="1.00"/>
2787
- <tag line="54" name="var" description="" type="boolean">
2788
- <type by_reference="false">boolean</type>
2789
- </tag>
2790
- </docblock>
2791
- </property>
2792
- <property final="false" static="true" visibility="public" line="74" namespace="global" package="Media Library Assistant">
2793
- <name>$process_inserted_in</name>
2794
- <default><![CDATA[true]]></default>
2795
- <docblock line="65">
2796
- <description><![CDATA[Option setting for "Inserted in" reporting]]></description>
2797
- <long-description><![CDATA[<p>This setting is false if the "Inserted in" database access setting is "disabled", else true.</p>]]></long-description>
2798
- <tag line="65" name="since" description="1.00"/>
2799
- <tag line="65" name="var" description="" type="boolean">
2800
- <type by_reference="false">boolean</type>
2801
- </tag>
2802
- </docblock>
2803
- </property>
2804
- <property final="false" static="true" visibility="public" line="85" namespace="global" package="Media Library Assistant">
2805
- <name>$process_gallery_in</name>
2806
- <default><![CDATA[true]]></default>
2807
- <docblock line="76">
2808
- <description><![CDATA[Option setting for "Gallery in" reporting]]></description>
2809
- <long-description><![CDATA[<p>This setting is false if the "Gallery in" database access setting is "disabled", else true.</p>]]></long-description>
2810
- <tag line="76" name="since" description="1.00"/>
2811
- <tag line="76" name="var" description="" type="boolean">
2812
- <type by_reference="false">boolean</type>
2813
- </tag>
2814
- </docblock>
2815
- </property>
2816
- <property final="false" static="true" visibility="public" line="96" namespace="global" package="Media Library Assistant">
2817
- <name>$process_mla_gallery_in</name>
2818
- <default><![CDATA[true]]></default>
2819
- <docblock line="87">
2820
- <description><![CDATA[Option setting for "MLA Gallery in" reporting]]></description>
2821
- <long-description><![CDATA[<p>This setting is false if the "MLA Gallery in" database access setting is "disabled", else true.</p>]]></long-description>
2822
- <tag line="87" name="since" description="1.00"/>
2823
- <tag line="87" name="var" description="" type="boolean">
2824
- <type by_reference="false">boolean</type>
2825
- </tag>
2826
- </docblock>
2827
- </property>
2828
- <property final="false" static="true" visibility="public" line="123" namespace="global" package="Media Library Assistant">
2829
- <name>$mla_option_definitions</name>
2830
- <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>&nbsp;&nbsp;Dynamic = once every page load, Cached = once every login, Disabled = never.<br>&nbsp;&nbsp;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>&nbsp;&nbsp;Dynamic = once every page load, Cached = once every login, Disabled = never.<br>&nbsp;&nbsp;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.<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>&nbsp;&nbsp;Click Save Changes at the bottom of the screen if you change this option.<br>&nbsp;&nbsp;Does NOT affect the operation of the "Map" buttons on the bulk edit, single edit and settings screens.'), 'custom_field_mapping' => array('tab' => '', 'help' => '&nbsp;<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>&nbsp;&nbsp;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>
2831
- <docblock line="98">
2832
- <description><![CDATA[$mla_option_definitions defines the database options and admin page areas for setting/updating them.]]></description>
2833
- <long-description><![CDATA[<p>Each option is defined by an array with the following elements:</p>
2834
-
2835
- <p>array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)</p>
2836
-
2837
- <p>tab => Settings page tab id for the option
2838
- name => admin page label or heading text
2839
- type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea', 'custom', 'hidden'
2840
- std => default value
2841
- help => help text
2842
- size => text size, default 40
2843
- cols => textbox columns, default 90
2844
- rows => textbox rows, default 5
2845
- options => array of radio or select option values
2846
- texts => array of radio or select option display texts
2847
- render => rendering function for 'custom' options. Usage:
2848
- $options_list .= ['render']( 'render', $key, $value );
2849
- update => update function for 'custom' options; returns nothing. Usage:
2850
- $message = ['update']( 'update', $key, $value, $_REQUEST );
2851
- delete => delete function for 'custom' options; returns nothing. Usage:
2852
- $message = ['delete']( 'delete', $key, $value, $_REQUEST );
2853
- reset => reset function for 'custom' options; returns nothing. Usage:
2854
- $message = ['reset']( 'reset', $key, $value, $_REQUEST );</p>]]></long-description>
2855
- </docblock>
2856
- </property>
2857
- <property final="false" static="true" visibility="private" line="447" namespace="global" package="Media Library Assistant">
2858
- <name>$mla_option_templates</name>
2859
- <default><![CDATA[null]]></default>
2860
- <docblock line="440">
2861
- <description><![CDATA[Style and Markup templates]]></description>
2862
- <long-description><![CDATA[]]></long-description>
2863
- <tag line="440" name="since" description="0.80"/>
2864
- <tag line="440" name="var" description="" type="array">
2865
- <type by_reference="false">array</type>
2866
- </tag>
2867
- </docblock>
2868
- </property>
2869
- <property final="false" static="true" visibility="private" line="1364" namespace="global" package="Media Library Assistant">
2870
- <name>$custom_field_data_sources</name>
2871
- <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>
2872
- <docblock line="1357">
2873
- <description><![CDATA[Array of Data Source names for custom field mapping]]></description>
2874
- <long-description><![CDATA[]]></long-description>
2875
- <tag line="1357" name="since" description="1.10"/>
2876
- <tag line="1357" name="var" description="" type="array">
2877
- <type by_reference="false">array</type>
2878
- </tag>
2879
- </docblock>
2880
- </property>
2881
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="421" package="Media Library Assistant">
2882
- <name>initialize</name>
2883
- <full_name>initialize</full_name>
2884
- <docblock line="414">
2885
- <description><![CDATA[Initialization function, similar to __construct()]]></description>
2886
- <long-description><![CDATA[]]></long-description>
2887
- <tag line="414" name="since" description="1.00"/>
2888
- <tag line="414" name="return" description="" type="void">
2889
- <type by_reference="false">void</type>
2890
- </tag>
2891
- </docblock>
2892
- </method>
2893
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="456" package="Media Library Assistant">
2894
- <name>_load_option_templates</name>
2895
- <full_name>_load_option_templates</full_name>
2896
- <docblock line="449">
2897
- <description><![CDATA[Load style and markup templates to $mla_templates]]></description>
2898
- <long-description><![CDATA[]]></long-description>
2899
- <tag line="449" name="since" description="0.80"/>
2900
- <tag line="449" name="return" description="" type="void">
2901
- <type by_reference="false">void</type>
2902
- </tag>
2903
- </docblock>
2904
- </method>
2905
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="504" package="Media Library Assistant">
2906
- <name>mla_fetch_gallery_template</name>
2907
- <full_name>mla_fetch_gallery_template</full_name>
2908
- <docblock line="494">
2909
- <description><![CDATA[Fetch style or markup template from $mla_templates]]></description>
2910
- <long-description><![CDATA[]]></long-description>
2911
- <tag line="494" name="since" description="0.80"/>
2912
- <tag line="494" name="param" description="Template name" type="string" variable="$key">
2913
- <type by_reference="false">string</type>
2914
- </tag>
2915
- <tag line="494" name="param" description="Template type; 'style' (default) or 'markup'" type="string" variable="$type">
2916
- <type by_reference="false">string</type>
2917
- </tag>
2918
- <tag line="494" name="return" description="requested template, false if not found or null if no templates" type="string|boolean|null">
2919
- <type by_reference="false">string</type>
2920
- <type by_reference="false">boolean</type>
2921
- <type by_reference="false">null</type>
2922
- </tag>
2923
- </docblock>
2924
- <argument line="504">
2925
- <name>$key</name>
2926
- <default><![CDATA[]]></default>
2927
- <type/>
2928
- </argument>
2929
- <argument line="504">
2930
- <name>$type</name>
2931
- <default><![CDATA['style']]></default>
2932
- <type/>
2933
- </argument>
2934
- </method>
2935
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="526" package="Media Library Assistant">
2936
- <name>mla_get_style_templates</name>
2937
- <full_name>mla_get_style_templates</full_name>
2938
- <docblock line="519">
2939
- <description><![CDATA[Get ALL style templates from $mla_templates, including 'default']]></description>
2940
- <long-description><![CDATA[]]></long-description>
2941
- <tag line="519" name="since" description="0.80"/>
2942
- <tag line="519" name="return" description="name =&gt; value for all style templates or null if no templates" type="array|null">
2943
- <type by_reference="false">array</type>
2944
- <type by_reference="false">null</type>
2945
- </tag>
2946
- </docblock>
2947
- </method>
2948
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="552" package="Media Library Assistant">
2949
- <name>mla_put_style_templates</name>
2950
- <full_name>mla_put_style_templates</full_name>
2951
- <docblock line="544">
2952
- <description><![CDATA[Put user-defined style templates to $mla_templates and database]]></description>
2953
- <long-description><![CDATA[]]></long-description>
2954
- <tag line="544" name="since" description="0.80"/>
2955
- <tag line="544" name="param" description="name =&gt; value for all user-defined style templates" type="array" variable="$templates">
2956
- <type by_reference="false">array</type>
2957
- </tag>
2958
- <tag line="544" name="return" description="true if success, false if failure" type="boolean">
2959
- <type by_reference="false">boolean</type>
2960
- </tag>
2961
- </docblock>
2962
- <argument line="552">
2963
- <name>$templates</name>
2964
- <default><![CDATA[]]></default>
2965
- <type/>
2966
- </argument>
2967
- </method>
2968
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="568" package="Media Library Assistant">
2969
- <name>mla_get_markup_templates</name>
2970
- <full_name>mla_get_markup_templates</full_name>
2971
- <docblock line="561">
2972
- <description><![CDATA[Get ALL markup templates from $mla_templates, including 'default']]></description>
2973
- <long-description><![CDATA[]]></long-description>
2974
- <tag line="561" name="since" description="0.80"/>
2975
- <tag line="561" name="return" description="name =&gt; value for all markup templates or null if no templates" type="array|null">
2976
- <type by_reference="false">array</type>
2977
- <type by_reference="false">null</type>
2978
- </tag>
2979
- </docblock>
2980
- </method>
2981
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="622" package="Media Library Assistant">
2982
- <name>mla_put_markup_templates</name>
2983
- <full_name>mla_put_markup_templates</full_name>
2984
- <docblock line="614">
2985
- <description><![CDATA[Put user-defined markup templates to $mla_templates and database]]></description>
2986
- <long-description><![CDATA[]]></long-description>
2987
- <tag line="614" name="since" description="0.80"/>
2988
- <tag line="614" name="param" description="name =&gt; value for all user-defined markup templates" type="array" variable="$templates">
2989
- <type by_reference="false">array</type>
2990
- </tag>
2991
- <tag line="614" name="return" description="true if success, false if failure" type="boolean">
2992
- <type by_reference="false">boolean</type>
2993
- </tag>
2994
- </docblock>
2995
- <argument line="622">
2996
- <name>$templates</name>
2997
- <default><![CDATA[]]></default>
2998
- <type/>
2999
- </argument>
3000
- </method>
3001
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="640" package="Media Library Assistant">
3002
- <name>mla_get_option</name>
3003
- <full_name>mla_get_option</full_name>
3004
- <docblock line="631">
3005
- <description><![CDATA[Return the stored value or default value of a defined MLA option]]></description>
3006
- <long-description><![CDATA[]]></long-description>
3007
- <tag line="631" name="since" description="0.1"/>
3008
- <tag line="631" name="param" description="Name of the desired option" type="string" variable="$option">
3009
- <type by_reference="false">string</type>
3010
- </tag>
3011
- <tag line="631" name="return" description="Value(s) for the option or false if the option is not a defined MLA option" type="mixed">
3012
- <type by_reference="false">mixed</type>
3013
- </tag>
3014
- </docblock>
3015
- <argument line="640">
3016
- <name>$option</name>
3017
- <default><![CDATA[]]></default>
3018
- <type/>
3019
- </argument>
3020
- </method>
3021
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="661" package="Media Library Assistant">
3022
- <name>mla_update_option</name>
3023
- <full_name>mla_update_option</full_name>
3024
- <docblock line="651">
3025
- <description><![CDATA[Add or update the stored value of a defined MLA option]]></description>
3026
- <long-description><![CDATA[]]></long-description>
3027
- <tag line="651" name="since" description="0.1"/>
3028
- <tag line="651" name="param" description="Name of the desired option" type="string" variable="$option">
3029
- <type by_reference="false">string</type>
3030
- </tag>
3031
- <tag line="651" name="param" description="New value for the desired option" type="mixed" variable="$newvalue">
3032
- <type by_reference="false">mixed</type>
3033
- </tag>
3034
- <tag line="651" name="return" description="True if the value was changed or false if the update failed" type="boolean">
3035
- <type by_reference="false">boolean</type>
3036
- </tag>
3037
- </docblock>
3038
- <argument line="661">
3039
- <name>$option</name>
3040
- <default><![CDATA[]]></default>
3041
- <type/>
3042
- </argument>
3043
- <argument line="661">
3044
- <name>$newvalue</name>
3045
- <default><![CDATA[]]></default>
3046
- <type/>
3047
- </argument>
3048
- </method>
3049
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="677" package="Media Library Assistant">
3050
- <name>mla_delete_option</name>
3051
- <full_name>mla_delete_option</full_name>
3052
- <docblock line="668">
3053
- <description><![CDATA[Delete the stored value of a defined MLA option]]></description>
3054
- <long-description><![CDATA[]]></long-description>
3055
- <tag line="668" name="since" description="0.1"/>
3056
- <tag line="668" name="param" description="Name of the desired option" type="string" variable="$option">
3057
- <type by_reference="false">string</type>
3058
- </tag>
3059
- <tag line="668" name="return" description="True if the option was deleted, otherwise false" type="boolean">
3060
- <type by_reference="false">boolean</type>
3061
- </tag>
3062
- </docblock>
3063
- <argument line="677">
3064
- <name>$option</name>
3065
- <default><![CDATA[]]></default>
3066
- <type/>
3067
- </argument>
3068
- </method>
3069
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="698" package="Media Library Assistant">
3070
- <name>mla_taxonomy_support</name>
3071
- <full_name>mla_taxonomy_support</full_name>
3072
- <docblock line="685">
3073
- <description><![CDATA[Determine MLA support for a taxonomy, handling the special case where the
3074
- settings are being updated or reset.]]></description>
3075
- <long-description><![CDATA[]]></long-description>
3076
- <tag line="685" name="since" description="0.30"/>
3077
- <tag line="685" name="param" description="Taxonomy name, e.g., attachment_category" type="string" variable="$tax_name">
3078
- <type by_reference="false">string</type>
3079
- </tag>
3080
- <tag line="685" name="param" description="Optional. 'support' (default), 'quick-edit' or 'filter'" type="string" variable="$support_type">
3081
- <type by_reference="false">string</type>
3082
- </tag>
3083
- <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">
3084
- <type by_reference="false">boolean</type>
3085
- <type by_reference="false">string</type>
3086
- </tag>
3087
- </docblock>
3088
- <argument line="698">
3089
- <name>$tax_name</name>
3090
- <default><![CDATA[]]></default>
3091
- <type/>
3092
- </argument>
3093
- <argument line="698">
3094
- <name>$support_type</name>
3095
- <default><![CDATA['support']]></default>
3096
- <type/>
3097
- </argument>
3098
- </method>
3099
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="774" package="Media Library Assistant">
3100
- <name>mla_taxonomy_option_handler</name>
3101
- <full_name>mla_taxonomy_option_handler</full_name>
3102
- <docblock line="761">
3103
- <description><![CDATA[Render and manage taxonomy support options, e.g., Categories and Post Tags]]></description>
3104
- <long-description><![CDATA[]]></long-description>
3105
- <tag line="761" name="since" description="0.30"/>
3106
- <tag line="761" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
3107
- <tag line="761" name="param" description="'render', 'update', 'delete', or 'reset'" type="string" variable="$action">
3108
- <type by_reference="false">string</type>
3109
- </tag>
3110
- <tag line="761" name="param" description="option name, e.g., 'taxonomy_support'" type="string" variable="$key">
3111
- <type by_reference="false">string</type>
3112
- </tag>
3113
- <tag line="761" name="param" description="option parameters" type="array" variable="$value">
3114
- <type by_reference="false">array</type>
3115
- </tag>
3116
- <tag line="761" name="param" description="Optional. null (default) for 'render' else option data, e.g., $_REQUEST" type="array" variable="$args">
3117
- <type by_reference="false">array</type>
3118
- </tag>
3119
- <tag line="761" name="return" description="HTML table row markup for 'render' else message(s) reflecting the results of the operation." type="string">
3120
- <type by_reference="false">string</type>
3121
- </tag>
3122
- </docblock>
3123
- <argument line="774">
3124
- <name>$action</name>
3125
- <default><![CDATA[]]></default>
3126
- <type/>
3127
- </argument>
3128
- <argument line="774">
3129
- <name>$key</name>
3130
- <default><![CDATA[]]></default>
3131
- <type/>
3132
- </argument>
3133
- <argument line="774">
3134
- <name>$value</name>
3135
- <default><![CDATA[]]></default>
3136
- <type/>
3137
- </argument>
3138
- <argument line="774">
3139
- <name>$args</name>
3140
- <default><![CDATA[null]]></default>
3141
- <type/>
3142
- </argument>
3143
- </method>
3144
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="882" package="Media Library Assistant">
3145
- <name>mla_add_attachment_action</name>
3146
- <full_name>mla_add_attachment_action</full_name>
3147
- <docblock line="873">
3148
- <description><![CDATA[Perform ITC/EXIF mapping on just-inserted attachment]]></description>
3149
- <long-description><![CDATA[]]></long-description>
3150
- <tag line="873" name="since" description="1.00"/>
3151
- <tag line="873" name="param" description="ID of just-inserted attachment" type="integer" variable="$post_id">
3152
- <type by_reference="false">integer</type>
3153
- </tag>
3154
- <tag line="873" name="return" description="" type="void">
3155
- <type by_reference="false">void</type>
3156
- </tag>
3157
- </docblock>
3158
- <argument line="882">
3159
- <name>$post_id</name>
3160
- <default><![CDATA[]]></default>
3161
- <type/>
3162
- </argument>
3163
- </method>
3164
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="902" package="Media Library Assistant">
3165
- <name>mla_update_attachment_metadata_filter</name>
3166
- <full_name>mla_update_attachment_metadata_filter</full_name>
3167
- <docblock line="892">
3168
- <description><![CDATA[Perform Custom Field mapping on just-inserted or updated attachment]]></description>
3169
- <long-description><![CDATA[]]></long-description>
3170
- <tag line="892" name="since" description="1.10"/>
3171
- <tag line="892" name="param" description="Attachment metadata for just-inserted attachment" type="array" variable="$data">
3172
- <type by_reference="false">array</type>
3173
- </tag>
3174
- <tag line="892" name="param" description="ID of just-inserted attachment" type="integer" variable="$post_id">
3175
- <type by_reference="false">integer</type>
3176
- </tag>
3177
- <tag line="892" name="return" description="" type="void">
3178
- <type by_reference="false">void</type>
3179
- </tag>
3180
- </docblock>
3181
- <argument line="902">
3182
- <name>$data</name>
3183
- <default><![CDATA[]]></default>
3184
- <type/>
3185
- </argument>
3186
- <argument line="902">
3187
- <name>$post_id</name>
3188
- <default><![CDATA[]]></default>
3189
- <type/>
3190
- </argument>
3191
- </method>
3192
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="922" package="Media Library Assistant">
3193
- <name>mla_custom_field_option_value</name>
3194
- <full_name>mla_custom_field_option_value</full_name>
3195
- <docblock line="913">
3196
- <description><![CDATA[Fetch custom field option value given a slug]]></description>
3197
- <long-description><![CDATA[]]></long-description>
3198
- <tag line="913" name="since" description="1.10"/>
3199
- <tag line="913" name="param" description="slug, e.g., 'c_file-size' for the 'File Size' field" type="string" variable="$slug">
3200
- <type by_reference="false">string</type>
3201
- </tag>
3202
- <tag line="913" name="return" description="option value, e.g., array( 'name' =&gt; 'File Size', ... )" type="array">
3203
- <type by_reference="false">array</type>
3204
- </tag>
3205
- </docblock>
3206
- <argument line="922">
3207
- <name>$slug</name>
3208
- <default><![CDATA[]]></default>
3209
- <type/>
3210
- </argument>
3211
- </method>
3212
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="942" package="Media Library Assistant">
3213
- <name>mla_custom_field_support</name>
3214
- <full_name>mla_custom_field_support</full_name>
3215
- <docblock line="933">
3216
- <description><![CDATA[Evaluate file information for custom field mapping]]></description>
3217
- <long-description><![CDATA[]]></long-description>
3218
- <tag line="933" name="since" description="1.10"/>
3219
- <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">
3220
- <type by_reference="false">string</type>
3221
- </tag>
3222
- <tag line="933" name="return" description="default, hidden, sortable quick_edit or bulk_edit colums in appropriate format" type="array">
3223
- <type by_reference="false">array</type>
3224
- </tag>
3225
- </docblock>
3226
- <argument line="942">
3227
- <name>$support_type</name>
3228
- <default><![CDATA['default_columns']]></default>
3229
- <type/>
3230
- </argument>
3231
- </method>
3232
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="988" package="Media Library Assistant">
3233
- <name>_evaluate_file_information</name>
3234
- <full_name>_evaluate_file_information</full_name>
3235
- <docblock line="976">
3236
- <description><![CDATA[Evaluate file information for custom field mapping]]></description>
3237
- <long-description><![CDATA[]]></long-description>
3238
- <tag line="976" name="since" description="1.10"/>
3239
- <tag line="976" name="param" description="absolute path the the uploads base directory" type="string" variable="$upload_dir">
3240
- <type by_reference="false">string</type>
3241
- </tag>
3242
- <tag line="976" name="param" description="_wp_attached_file meta_value array, indexed by post_id" type="array" variable="$wp_attached_files">
3243
- <type by_reference="false">array</type>
3244
- </tag>
3245
- <tag line="976" name="param" description="_wp_attachment_metadata meta_value array, indexed by post_id" type="array" variable="$wp_attachment_metadata">
3246
- <type by_reference="false">array</type>
3247
- </tag>
3248
- <tag line="976" name="param" description="post-&gt;ID of attachment" type="integer" variable="$post_id">
3249
- <type by_reference="false">integer</type>
3250
- </tag>
3251
- <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">
3252
- <type by_reference="false">array</type>
3253
- </tag>
3254
- </docblock>
3255
- <argument line="988">
3256
- <name>$upload_dir</name>
3257
- <default><![CDATA[]]></default>
3258
- <type/>
3259
- </argument>
3260
- <argument line="988">
3261
- <name>$wp_attached_files</name>
3262
- <default><![CDATA[]]></default>
3263
- <type/>
3264
- </argument>
3265
- <argument line="988">
3266
- <name>$wp_attachment_metadata</name>
3267
- <default><![CDATA[]]></default>
3268
- <type/>
3269
- </argument>
3270
- <argument line="988">
3271
- <name>$post_id</name>
3272
- <default><![CDATA[]]></default>
3273
- <type/>
3274
- </argument>
3275
- </method>
3276
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1061" package="Media Library Assistant">
3277
- <name>_evaluate_data_source</name>
3278
- <full_name>_evaluate_data_source</full_name>
3279
- <docblock line="1048">
3280
- <description><![CDATA[Evaluate custom field mapping data source]]></description>
3281
- <long-description><![CDATA[]]></long-description>
3282
- <tag line="1048" name="since" description="1.10"/>
3283
- <tag line="1048" name="param" description="post-&gt;ID of attachment" type="integer" variable="$post_id">
3284
- <type by_reference="false">integer</type>
3285
- </tag>
3286
- <tag line="1048" 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="1048" name="param" description="data source name" type="string" variable="$data_source">
3290
- <type by_reference="false">string</type>
3291
- </tag>
3292
- <tag line="1048" name="param" description="desired results format, default 'native'" type="string" variable="$format">
3293
- <type by_reference="false">string</type>
3294
- </tag>
3295
- <tag line="1048" name="param" description="(optional) attachment_metadata, default NULL (use current postmeta database value)" type="array" variable="$attachment_metadata">
3296
- <type by_reference="false">array</type>
3297
- </tag>
3298
- <tag line="1048" name="return" description="data source value" type="string">
3299
- <type by_reference="false">string</type>
3300
- </tag>
3301
- </docblock>
3302
- <argument line="1061">
3303
- <name>$post_id</name>
3304
- <default><![CDATA[]]></default>
3305
- <type/>
3306
- </argument>
3307
- <argument line="1061">
3308
- <name>$category</name>
3309
- <default><![CDATA[]]></default>
3310
- <type/>
3311
- </argument>
3312
- <argument line="1061">
3313
- <name>$data_source</name>
3314
- <default><![CDATA[]]></default>
3315
- <type/>
3316
- </argument>
3317
- <argument line="1061">
3318
- <name>$format</name>
3319
- <default><![CDATA['native']]></default>
3320
- <type/>
3321
- </argument>
3322
- <argument line="1061">
3323
- <name>$attachment_metadata</name>
3324
- <default><![CDATA[NULL]]></default>
3325
- <type/>
3326
- </argument>
3327
- </method>
3328
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1301" package="Media Library Assistant">
3329
- <name>mla_evaluate_custom_field_mapping</name>
3330
- <full_name>mla_evaluate_custom_field_mapping</full_name>
3331
- <docblock line="1289">
3332
- <description><![CDATA[Evaluate custom field mapping updates for a post]]></description>
3333
- <long-description><![CDATA[]]></long-description>
3334
- <tag line="1289" name="since" description="1.10"/>
3335
- <tag line="1289" name="param" description="post ID to be evaluated" type="integer" variable="$post_id">
3336
- <type by_reference="false">integer</type>
3337
- </tag>
3338
- <tag line="1289" name="param" description="category/scope to evaluate against: custom_field_mapping or single_attachment_mapping" type="string" variable="$category">
3339
- <type by_reference="false">string</type>
3340
- </tag>
3341
- <tag line="1289" name="param" description="(optional) custom_field_mapping values, default NULL (use current option value)" type="array" variable="$settings">
3342
- <type by_reference="false">array</type>
3343
- </tag>
3344
- <tag line="1289" name="param" description="(optional) attachment_metadata, default NULL (use current postmeta database value)" type="array" variable="$attachment_metadata">
3345
- <type by_reference="false">array</type>
3346
- </tag>
3347
- <tag line="1289" name="return" description="Updates suitable for MLAData::mla_update_single_item, if any" type="array">
3348
- <type by_reference="false">array</type>
3349
- </tag>
3350
- </docblock>
3351
- <argument line="1301">
3352
- <name>$post_id</name>
3353
- <default><![CDATA[]]></default>
3354
- <type/>
3355
- </argument>
3356
- <argument line="1301">
3357
- <name>$category</name>
3358
- <default><![CDATA[]]></default>
3359
- <type/>
3360
- </argument>
3361
- <argument line="1301">
3362
- <name>$settings</name>
3363
- <default><![CDATA[NULL]]></default>
3364
- <type/>
3365
- </argument>
3366
- <argument line="1301">
3367
- <name>$attachment_metadata</name>
3368
- <default><![CDATA[NULL]]></default>
3369
- <type/>
3370
- </argument>
3371
- </method>
3372
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1334" package="Media Library Assistant">
3373
- <name>_compose_custom_field_option_list</name>
3374
- <full_name>_compose_custom_field_option_list</full_name>
3375
- <docblock line="1324">
3376
- <description><![CDATA[Compose a Custom Field Options list with current selection]]></description>
3377
- <long-description><![CDATA[]]></long-description>
3378
- <tag line="1324" name="since" description="1.10"/>
3379
- <tag line="1324" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
3380
- <tag line="1324" name="param" description="current selection or 'none' (default)" type="string" variable="$selection">
3381
- <type by_reference="false">string</type>
3382
- </tag>
3383
- <tag line="1324" name="return" description="HTML markup with select field options" type="string">
3384
- <type by_reference="false">string</type>
3385
- </tag>
3386
- </docblock>
3387
- <argument line="1334">
3388
- <name>$selection</name>
3389
- <default><![CDATA['none']]></default>
3390
- <type/>
3391
- </argument>
3392
- </method>
3393
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1409" package="Media Library Assistant">
3394
- <name>_compose_data_source_option_list</name>
3395
- <full_name>_compose_data_source_option_list</full_name>
3396
- <docblock line="1399">
3397
- <description><![CDATA[Compose a (Custom Field) Data Source Options list with current selection]]></description>
3398
- <long-description><![CDATA[]]></long-description>
3399
- <tag line="1399" name="since" description="1.10"/>
3400
- <tag line="1399" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
3401
- <tag line="1399" name="param" description="current selection or 'none' (default)" type="string" variable="$selection">
3402
- <type by_reference="false">string</type>
3403
- </tag>
3404
- <tag line="1399" name="return" description="HTML markup with select field options" type="string">
3405
- <type by_reference="false">string</type>
3406
- </tag>
3407
- </docblock>
3408
- <argument line="1409">
3409
- <name>$selection</name>
3410
- <default><![CDATA['none']]></default>
3411
- <type/>
3412
- </argument>
3413
- </method>
3414
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1460" package="Media Library Assistant">
3415
- <name>_update_custom_field_mapping</name>
3416
- <full_name>_update_custom_field_mapping</full_name>
3417
- <docblock line="1450">
3418
- <description><![CDATA[Update custom field mappings]]></description>
3419
- <long-description><![CDATA[]]></long-description>
3420
- <tag line="1450" name="since" description="1.10"/>
3421
- <tag line="1450" name="param" description="current custom_field_mapping values" type="array" variable="$current_values">
3422
- <type by_reference="false">array</type>
3423
- </tag>
3424
- <tag line="1450" name="param" description="new values" type="array" variable="$new_values">
3425
- <type by_reference="false">array</type>
3426
- </tag>
3427
- <tag line="1450" name="return" description="( 'message' =&gt; HTML message(s) reflecting results, 'values' =&gt; updated iptc_exif_mapping values, 'changed' =&gt; true if any changes detected else false )" type="array">
3428
- <type by_reference="false">array</type>
3429
- </tag>
3430
- </docblock>
3431
- <argument line="1460">
3432
- <name>$current_values</name>
3433
- <default><![CDATA[]]></default>
3434
- <type/>
3435
- </argument>
3436
- <argument line="1460">
3437
- <name>$new_values</name>
3438
- <default><![CDATA[]]></default>
3439
- <type/>
3440
- </argument>
3441
- </method>
3442
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1616" package="Media Library Assistant">
3443
- <name>mla_custom_field_option_handler</name>
3444
- <full_name>mla_custom_field_option_handler</full_name>
3445
- <docblock line="1603">
3446
- <description><![CDATA[Render and manage custom field mapping options]]></description>
3447
- <long-description><![CDATA[]]></long-description>
3448
- <tag line="1603" name="since" description="1.10"/>
3449
- <tag line="1603" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
3450
- <tag line="1603" name="param" description="'render', 'update', 'delete', or 'reset'" type="string" variable="$action">
3451
- <type by_reference="false">string</type>
3452
- </tag>
3453
- <tag line="1603" name="param" description="option name, e.g., 'custom_field_mapping'" type="string" variable="$key">
3454
- <type by_reference="false">string</type>
3455
- </tag>
3456
- <tag line="1603" name="param" description="option parameters" type="array" variable="$value">
3457
- <type by_reference="false">array</type>
3458
- </tag>
3459
- <tag line="1603" name="param" description="Optional. null (default) for 'render' else option data, e.g., $_REQUEST" type="array" variable="$args">
3460
- <type by_reference="false">array</type>
3461
- </tag>
3462
- <tag line="1603" name="return" description="HTML table row markup for 'render' else message(s) reflecting the results of the operation." type="string">
3463
- <type by_reference="false">string</type>
3464
- </tag>
3465
- </docblock>
3466
- <argument line="1616">
3467
- <name>$action</name>
3468
- <default><![CDATA[]]></default>
3469
- <type/>
3470
- </argument>
3471
- <argument line="1616">
3472
- <name>$key</name>
3473
- <default><![CDATA[]]></default>
3474
- <type/>
3475
- </argument>
3476
- <argument line="1616">
3477
- <name>$value</name>
3478
- <default><![CDATA[]]></default>
3479
- <type/>
3480
- </argument>
3481
- <argument line="1616">
3482
- <name>$args</name>
3483
- <default><![CDATA[null]]></default>
3484
- <type/>
3485
- </argument>
3486
- </method>
3487
- <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="1760" package="Media Library Assistant">
3488
- <name>mla_evaluate_iptc_exif_mapping</name>
3489
- <full_name>mla_evaluate_iptc_exif_mapping</full_name>
3490
- <docblock line="1749">
3491
- <description><![CDATA[Evaluate IPTC/EXIF mapping updates for a post]]></description>
3492
- <long-description><![CDATA[]]></long-description>
3493
- <tag line="1749" name="since" description="1.00"/>
3494
- <tag line="1749" name="param" description="post object with current values" type="object" variable="$post">
3495
- <type by_reference="false">object</type>
3496
- </tag>
3497
- <tag line="1749" name="param" description="category to evaluate against, e.g., iptc_exif_standard_mapping or iptc_exif_mapping" type="string" variable="$category">
3498
- <type by_reference="false">string</type>
3499
- </tag>
3500
- <tag line="1749" name="param" description="(optional) iptc_exif_mapping values, default - current option value" type="array" variable="$settings">
3501
- <type by_reference="false">array</type>
3502
- </tag>
3503
- <tag line="1749" name="return" description="Updates suitable for MLAData::mla_update_single_item, if any" type="array">
3504
- <type by_reference="false">array</type>
3505
- </tag>
3506
- </docblock>
3507
- <argument line="1760">
3508
- <name>$post</name>
3509
- <default><![CDATA[]]></default>
3510
- <type/>
3511
- </argument>
3512
- <argument line="1760">
3513
- <name>$category</name>
3514
- <default><![CDATA[]]></default>
3515
- <type/>
3516
- </argument>
3517
- <argument line="1760">
3518
- <name>$settings</name>
3519
- <default><![CDATA[NULL]]></default>
3520
- <type/>
3521
- </argument>
3522
- </method>
3523
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1913" package="Media Library Assistant">
3524
- <name>_compose_iptc_option_list</name>
3525
- <full_name>_compose_iptc_option_list</full_name>
3526
- <docblock line="1903">
3527
- <description><![CDATA[Compose an IPTC Options list with current selection]]></description>
3528
- <long-description><![CDATA[]]></long-description>
3529
- <tag line="1903" name="since" description="1.00"/>
3530
- <tag line="1903" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
3531
- <tag line="1903" name="param" description="current selection or 'none' (default)" type="string" variable="$selection">
3532
- <type by_reference="false">string</type>
3533
- </tag>
3534
- <tag line="1903" name="return" description="HTML markup with select field options" type="string">
3535
- <type by_reference="false">string</type>
3536
- </tag>
3537
- </docblock>
3538
- <argument line="1913">
3539
- <name>$selection</name>
3540
- <default><![CDATA['none']]></default>
3541
- <type/>
3542
- </argument>
3543
- </method>
3544
- <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="1946" package="Media Library Assistant">
3545
- <name>_compose_parent_option_list</name>
3546
- <full_name>_compose_parent_option_list</full_name>
3547
- <docblock line="1935">
3548
- <description><![CDATA[Compose an hierarchical taxonomy Parent options list with current selection]]></description>
3549
- <long-description><![CDATA[]]></long-description>
3550
- <tag line="1935" name="since" description="1.00"/>
3551
- <tag line="1935" name="uses" description="\global\$mla_option_templates" refers="\global\$mla_option_templates"/>
3552
- <tag line="1935" name="param" description="taxonomy slug" type="string" variable="$taxonomy">
3553
- <type by_reference="false">string</type>
3554
- </tag>
3555
- <tag line="1935" name="param" description="current selection or 0 (zero, default)" type="integer" variable="$selection">
3556
- <type by_reference="false">integer</type>
3557
- </tag>
3558
- <tag line="1935" name="return" description="HTML markup with select field options" type="string">
3559
-
1
  <?xml version="1.0" encoding="utf-8"?>
2
+ <project version="2.0.0a8" title="">
3
+ <file path="includes\class-mla-data.php" hash="60935db052ecdd01880253badc07032b" 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
+ <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="24" package="Media Library Assistant">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  <name>initialize</name>
23
  <full_name>initialize</full_name>
24
+ <docblock line="19">
25
  <description><![CDATA[Initialization function, similar to __construct()]]></description>
26
  <long-description><![CDATA[]]></long-description>
27
+ <tag line="19" name="since" description="0.1"/>
28
  </docblock>
29
  </method>
30
+ <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="44" package="Media Library Assistant">
31
  <name>mla_load_template</name>
32
  <full_name>mla_load_template</full_name>
33
+ <docblock line="28">
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="28" name="since" description="0.1"/>
39
+ <tag line="28" name="param" description="Complete path and name of the template file" type="string" variable="$filepath">
 
 
 
40
  <type by_reference="false">string</type>
41
  </tag>
42
+ <tag line="28" name="return" description="For files that do not contain template divider comments array For files containing template divider comments false If file does not exist NULL If file could not be loaded" type="string">
43
  <type by_reference="false">string</type>
 
 
 
44
  </tag>
45
  </docblock>
46
+ <argument line="44">
47
+ <name>$filepath</name>
48
  <default><![CDATA[]]></default>
49
  <type/>
50
  </argument>
 
 
 
 
 
51
  </method>
52
+ <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="86" package="Media Library Assistant">
53
  <name>mla_parse_template</name>
54
  <full_name>mla_parse_template</full_name>
55
+ <docblock line="74">
56
+ <description><![CDATA[Expand a template, replacing place holders with their values.]]></description>
57
  <long-description><![CDATA[<p>A simple parsing function for basic templating.</p>]]></long-description>
58
+ <tag line="74" name="since" description="0.1"/>
59
+ <tag line="74" name="param" description="A formatting string containing [+placeholders+]" type="string" variable="$tpl">
60
  <type by_reference="false">string</type>
61
  </tag>
62
+ <tag line="74" name="param" description="An associative array containing keys and values e.g. array('key' =&gt; 'value');" type="array" variable="$hash">
63
  <type by_reference="false">array</type>
64
  </tag>
65
+ <tag line="74" name="return" description="Placeholders corresponding to the keys of the hash will be replaced with their values." type="string">
66
  <type by_reference="false">string</type>
67
  </tag>
68
  </docblock>
69
+ <argument line="86">
70
  <name>$tpl</name>
71
  <default><![CDATA[]]></default>
72
  <type/>
73
  </argument>
74
+ <argument line="86">
75
  <name>$hash</name>
76
  <default><![CDATA[]]></default>
77
  <type/>
78
  </argument>
79
  </method>
80
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="108" package="Media Library Assistant">
81
+ <name>mla_prepare_list_table_query</name>
82
+ <full_name>mla_prepare_list_table_query</full_name>
83
+ <docblock line="95">
84
+ <description><![CDATA[Sanitize and expand query arguments from request variables.]]></description>
85
+ <long-description><![CDATA[<p>Prepare the arguments for WP_Query.
86
+ Modeled after wp_edit_attachments_query in wp-admin/post.php
87
+ NOTE: The caller must remove the 'posts_where' filter, if required.</p>]]></long-description>
88
+ <tag line="95" name="since" description="0.1"/>
89
+ <tag line="95" name="param" description="query parameters from web page, usually found in $_REQUEST" type="array" variable="$request">
 
90
  <type by_reference="false">array</type>
91
  </tag>
92
+ <tag line="95" name="return" description="revised arguments suitable for WP_Query" type="array">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  <type by_reference="false">array</type>
94
  </tag>
 
 
 
95
  </docblock>
96
+ <argument line="108">
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="192" package="Media Library Assistant">
103
  <name>mla_query_list_table_items</name>
104
  <full_name>mla_query_list_table_items</full_name>
105
+ <docblock line="176">
106
+ <description><![CDATA[Retrieve attachment objects for list table display.]]></description>
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="176" name="since" description="0.1"/>
110
+ <tag line="176" name="param" description="query parameters from web page, usually found in $_REQUEST" type="array" variable="$request">
111
  <type by_reference="false">array</type>
112
  </tag>
113
+ <tag line="176" name="param" description="database column to sort by" type="string" variable="$orderby">
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="176" name="param" description="number of rows on each page" type="int" variable="$count">
123
  <type by_reference="false">int</type>
124
  </tag>
125
+ <tag line="176" name="return" description="attachment objects (posts) including parent data, meta data and references" type="array">
126
  <type by_reference="false">array</type>
127
  </tag>
128
  </docblock>
129
+ <argument line="192">
130
  <name>$request</name>
131
  <default><![CDATA[]]></default>
132
  <type/>
133
  </argument>
134
+ <argument line="192">
135
+ <name>$orderby</name>
 
 
 
 
 
136
  <default><![CDATA[]]></default>
137
  <type/>
138
  </argument>
139
+ <argument line="192">
140
+ <name>$order</name>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  <default><![CDATA[]]></default>
142
  <type/>
143
  </argument>
144
+ <argument line="192">
145
  <name>$offset</name>
146
+ <default><![CDATA[]]></default>
147
  <type/>
148
  </argument>
149
+ <argument line="192">
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="256" package="Media Library Assistant">
156
+ <name>mla_query_list_table_items_helper</name>
157
+ <full_name>mla_query_list_table_items_helper</full_name>
158
+ <docblock line="244">
159
+ <description><![CDATA[Adds a WHERE clause for detached items]]></description>
160
+ <long-description><![CDATA[<p>Modeled after _edit_attachments_query_helper in wp-admin/post.php
161
+ Defined as public so callers can remove it after the query</p>]]></long-description>
162
+ <tag line="244" name="since" description="0.1"/>
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="244" name="return" description="query clause after &quot;detached&quot; item modification" type="string">
 
 
 
167
  <type by_reference="false">string</type>
168
  </tag>
169
  </docblock>
170
+ <argument line="256">
171
+ <name>$where</name>
 
 
 
 
 
172
  <default><![CDATA[]]></default>
173
  <type/>
174
  </argument>
175
  </method>
176
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="273" package="Media Library Assistant">
177
+ <name>mla_get_attachment_by_id</name>
178
+ <full_name>mla_get_attachment_by_id</full_name>
179
+ <docblock line="262">
180
+ <description><![CDATA[Retrieve an Attachment array given a $post_id.]]></description>
181
+ <long-description><![CDATA[<p>The (associative) array will contain every field that can be found in
182
+ the posts and postmeta tables, and all references to the attachment.</p>]]></long-description>
183
+ <tag line="262" name="since" description="0.1"/>
184
+ <tag line="262" name="param" description="The ID of the attachment post." type="int" variable="$post_id">
185
+ <type by_reference="false">int</type>
186
  </tag>
187
+ <tag line="262" name="return" description="on failure else associative array." type="Null">
188
+ <type by_reference="false">Null</type>
189
  </tag>
190
  </docblock>
191
+ <argument line="273">
192
+ <name>$post_id</name>
193
  <default><![CDATA[]]></default>
194
  <type/>
195
  </argument>
196
  </method>
197
+ <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="322" package="Media Library Assistant">
198
+ <name>mla_fetch_attachment_references</name>
199
+ <full_name>mla_fetch_attachment_references</full_name>
200
+ <docblock line="309">
201
+ <description><![CDATA[Find Featured Image and inserted image/link references to an attachment.]]></description>
202
+ <long-description><![CDATA[<p>Searches all post and page content to see if the attachment is used
203
+ as a Featured Image or inserted in the post as an image or link.</p>]]></long-description>
204
+ <tag line="309" name="since" description="0.1"/>
205
+ <tag line="309" name="param" description="post ID of attachment" type="int" variable="$ID">
206
+ <type by_reference="false">int</type>
 
 
 
207
  </tag>
208
+ <tag line="309" name="param" description="post ID of attachment's parent, if any" type="int" variable="$parent">
209
+ <type by_reference="false">int</type>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  </tag>
211
+ <tag line="309" name="return" description="Reference information; see $references array comments" type="array">
212
+ <type by_reference="false">array</type>
213
  </tag>
214
  </docblock>
215
+ <argument line="322">
216
+ <name>$ID</name>
217
  <default><![CDATA[]]></default>
218
  <type/>
219
  </argument>
220
+ <argument line="322">
221
+ <name>$parent</name>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  <default><![CDATA[]]></default>
223
  <type/>
224
  </argument>
225
  </method>
226
+ <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="447" package="Media Library Assistant">
227
+ <name>_fetch_attachment_parent_data</name>
228
+ <full_name>_fetch_attachment_parent_data</full_name>
229
+ <docblock line="438">
230
+ <description><![CDATA[Returns information about an attachment's parent, if found.]]></description>
231
  <long-description><![CDATA[]]></long-description>
232
+ <tag line="438" name="since" description="0.1"/>
233
+ <tag line="438" name="param" description="post ID of attachment's parent, if any" type="int" variable="$parent_id">
234
  <type by_reference="false">int</type>
235
  </tag>
236
+ <tag line="438" name="return" description="Parent information; post_date, post_title and post_type" type="array">
237
  <type by_reference="false">array</type>
238
  </tag>
239
  </docblock>
240
+ <argument line="447">
241
  <name>$parent_id</name>
242
  <default><![CDATA[]]></default>
243
  <type/>
244
  </argument>
245
  </method>
246
+ <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="475" package="Media Library Assistant">
247
+ <name>_fetch_attachment_metadata</name>
248
+ <full_name>_fetch_attachment_metadata</full_name>
249
+ <docblock line="462">
250
+ <description><![CDATA[Fetch and filter meta data for an attachment.]]></description>
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="462" name="since" description="0.1"/>
255
+ <tag line="462" name="param" description="post ID of attachment" type="int" variable="$post_id">
256
  <type by_reference="false">int</type>
257
  </tag>
258
+ <tag line="462" name="return" description="Meta data variables" type="array">
259
  <type by_reference="false">array</type>
260
  </tag>
261
  </docblock>
262
+ <argument line="475">
263
  <name>$post_id</name>
264
  <default><![CDATA[]]></default>
265
  <type/>
266
  </argument>
267
  </method>
268
+ </class>
269
+ </file>
270
+ <file path="includes\class-mla-list-table.php" hash="de2990753dbe8769c011752663c9b1b4" package="Media Library Assistant">
271
+ <docblock line="2">
272
+ <description><![CDATA[Media Library Assistant extended List Table class]]></description>
273
+ <long-description><![CDATA[]]></long-description>
274
+ <tag line="2" name="package" description="Media Library Assistant"/>
275
+ <tag line="2" name="since" description="0.1"/>
276
+ </docblock>
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
+ </docblock>
301
+ </property>
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
+ </docblock>
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
+ </property>
332
+ <property final="false" static="true" visibility="private" line="102" namespace="global" package="Default">
333
+ <name>$default_hidden_columns</name>
334
+ <default><![CDATA[array(0 => 'post_title', 1 => 'post_name', 2 => 'parent', 3 => 'alt_text', 4 => 'caption', 5 => 'description', 6 => 'base_file', 7 => 'date', 8 => 'author', 9 => 'attached_to', 10 => 'categories', 11 => 'tags')]]></default>
335
+ <docblock line="89">
336
+ <description><![CDATA[Default values for hdden columns]]></description>
337
+ <long-description><![CDATA[<p>This array is used when the user-level option is not set, i.e.,
338
+ the user has not altered the selection of hidden columns.</p>
339
+
340
+ <p>The value on the right-hand side must match the column slug, e.g.,
341
+ array(0 => 'ID_parent, 1 => 'title_name').</p>]]></long-description>
342
+ <tag line="89" name="since" description="0.1"/>
343
+ <tag line="89" name="var" description="" type="array">
344
+ <type by_reference="false">array</type>
 
 
 
 
 
 
345
  </tag>
346
+ </docblock>
347
+ </property>
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
+ </property>
366
+ <method final="false" abstract="false" static="true" visibility="private" namespace="global" line="162" package="Media Library Assistant">
367
+ <name>_default_hidden_columns</name>
368
+ <full_name>_default_hidden_columns</full_name>
369
+ <docblock line="155">
370
+ <description><![CDATA[Access the default list of hidden columns]]></description>
 
 
 
 
 
371
  <long-description><![CDATA[]]></long-description>
372
+ <tag line="155" name="since" description="0.1"/>
373
+ <tag line="155" name="return" description="default list of hidden columns" type="array">
374
+ <type by_reference="false">array</type>
 
 
 
375
  </tag>
376
  </docblock>
 
 
 
 
 
377
  </method>
378
+ <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="182" package="Media Library Assistant">
379
+ <name>mla_manage_hidden_columns</name>
380
+ <full_name>mla_manage_hidden_columns</full_name>
381
+ <docblock line="167">
382
+ <description><![CDATA[Handler for filter 'get_user_option_managemedia_page_mla-menucolumnshidden']]></description>
383
+ <long-description><![CDATA[<p>Required because the screen.php get_hidden_columns function only uses
384
+ the get_user_option result. Set when the file is loaded because the object
385
+ is not created in time for the call from screen.php.</p>]]></long-description>
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="167" name="param" description="'managemedia_page_mla-menucolumnshidden'" type="string" variable="$option">
 
 
 
391
  <type by_reference="false">string</type>
392
  </tag>
393
+ <tag line="167" name="param" description="WP_User object, if logged in" type="object" variable="$user_data">
394
+ <type by_reference="false">object</type>
395
  </tag>
396
+ <tag line="167" name="return" description="updated list of hidden columns" type="array">
397
+ <type by_reference="false">array</type>
398
  </tag>
399
  </docblock>
400
+ <argument line="182">
401
+ <name>$result</name>
 
 
 
 
 
402
  <default><![CDATA[]]></default>
403
  <type/>
404
  </argument>
405
+ <argument line="182">
406
+ <name>$option</name>
407
  <default><![CDATA[]]></default>
408
  <type/>
409
  </argument>
410
+ <argument line="182">
411
+ <name>$user_data</name>
412
  <default><![CDATA[]]></default>
413
  <type/>
414
  </argument>
415
  </method>
416
+ <method final="false" abstract="false" static="true" visibility="public" namespace="global" line="200" package="Media Library Assistant">
417
+ <name>mla_manage_columns</name>
418
+ <full_name>mla_manage_columns</full_name>
419
+ <docblock line="189">
420
+ <description><![CDATA[Handler for filter 'manage_media_page_mla-menu_columns']]></description>
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="205" name="since" description="0.1"/>
438
+ </docblock>
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="225" name="param" description="The name/slug of the column to be processed" type="array" variable="$column_name">
453
  <type by_reference="false">array</type>
454
  </tag>
455
+ <tag line="225" name="return" description="Text or HTML to be placed inside the column" type="string">
456
+ <type by_reference="false">string</type>
457
+ </tag>
458
  </docblock>
459
+ <argument line="236">
460
+ <name>$item</name>
461
  <default><![CDATA[]]></default>
462
  <type/>
463
  </argument>
464
+ <argument line="236">
465
+ <name>$column_name</name>
466
  <default><![CDATA[]]></default>
467
  <type/>
468
  </argument>
469
  </method>
470
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="250" package="Media Library Assistant">
471
+ <name>column_cb</name>
472
+ <full_name>column_cb</full_name>
473
+ <docblock line="241">
474
+ <description><![CDATA[Displays checkboxes for using bulk actions.]]></description>
475
+ <long-description><![CDATA[<p>The 'cb' column
476
+ is given special treatment when columns are processed.</p>]]></long-description>
477
+ <tag line="241" name="since" description="0.1"/>
478
+ <tag line="241" name="param" description="A singular attachment (post) object" type="array" variable="$item">
479
+ <type by_reference="false">array</type>
 
 
 
480
  </tag>
481
+ <tag line="241" name="return" description="HTML markup to be placed inside the column" type="string">
482
  <type by_reference="false">string</type>
483
  </tag>
484
  </docblock>
485
+ <argument line="250">
486
+ <name>$item</name>
 
 
 
 
 
487
  <default><![CDATA[]]></default>
488
  <type/>
489
  </argument>
490
  </method>
491
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="266" package="Media Library Assistant">
492
+ <name>column_icon</name>
493
+ <full_name>column_icon</full_name>
494
+ <docblock line="258">
495
+ <description><![CDATA[Supply the content for a custom column]]></description>
496
+ <long-description><![CDATA[]]></long-description>
497
+ <tag line="258" name="since" description="0.1"/>
498
+ <tag line="258" name="param" description="A singular attachment (post) object" type="array" variable="$item">
499
+ <type by_reference="false">array</type>
500
  </tag>
501
+ <tag line="258" name="return" description="HTML markup to be placed inside the column" type="string">
502
  <type by_reference="false">string</type>
503
  </tag>
 
 
 
504
  </docblock>
505
+ <argument line="266">
506
+ <name>$item</name>
507
  <default><![CDATA[]]></default>
508
  <type/>
509
  </argument>
 
 
 
 
 
510
  </method>
511
+ <method final="false" abstract="false" static="false" visibility="private" namespace="global" line="282" package="Media Library Assistant">
512
+ <name>_build_rollover_actions</name>
513
+ <full_name>_build_rollover_actions</full_name>
514
+ <docblock line="271">
515
+ <description><![CDATA[Add rollover actions to exactly one of the following displayed columns:
516
+ 'ID_parent', 'title_name', 'post_title', 'post_name']]></description>
517
  <long-description><![CDATA[]]></long-description>
518
+ <tag line="271" name="since" description="0.1"/>
519
+ <tag line="271" name="param" description="A singular attachment (post) object" type="array" variable="$item">
 
 
 
 
 
 
520
  <type by_reference="false">array</type>
521
  </tag>
522
+ <tag line="271" name="param" description="Current column name" type="string" variable="$column">
523
+ <type by_reference="false">string</type>
524
  </tag>
525
+ <tag line="271" name="return" description="Names and URLs of row-level actions" type="array">
526
  <type by_reference="false">array</type>
527
  </tag>
528
  </docblock>
529
+ <argument line="282">
530
+ <name>$item</name>
531
  <default><![CDATA[]]></default>
532
  <type/>
533
  </argument>
534
+ <argument line="282">
535
+ <name>$column</name>
536
  <default><![CDATA[]]></default>
537
  <type/>
538
  </argument>
 
 
 
 
 
 
 
 
 
 
539
  </method>
540
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="340" package="Media Library Assistant">
541
+ <name>column_ID_parent</name>
542
+ <full_name>column_ID_parent</full_name>
543
+ <docblock line="332">
544
+ <description><![CDATA[Supply the content for a custom column]]></description>
545
  <long-description><![CDATA[]]></long-description>
546
+ <tag line="332" name="since" description="0.1"/>
547
+ <tag line="332" name="param" description="A singular attachment (post) object" type="array" variable="$item">
 
 
 
548
  <type by_reference="false">array</type>
549
  </tag>
550
+ <tag line="332" name="return" description="HTML markup to be placed inside the column" type="string">
551
+ <type by_reference="false">string</type>
 
 
 
552
  </tag>
553
  </docblock>
554
+ <argument line="340">
555
+ <name>$item</name>
 
 
 
 
 
 
 
 
 
 
556
  <default><![CDATA[]]></default>
557
  <type/>
558
  </argument>
559
  </method>
560
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="358" package="Media Library Assistant">
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
  </method>
580
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="387" package="Media Library Assistant">
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="false" visibility="public" namespace="global" line="405" package="Media Library Assistant">
601
+ <name>column_post_name</name>
602
+ <full_name>column_post_name</full_name>
603
+ <docblock line="397">
604
+ <description><![CDATA[Supply the content for a custom column]]></description>
605
+ <long-description><![CDATA[]]></long-description>
606
+ <tag line="397" name="since" description="0.1"/>
607
+ <tag line="397" name="param" description="A singular attachment (post) object" type="array" variable="$item">
608
  <type by_reference="false">array</type>
609
  </tag>
610
+ <tag line="397" name="return" description="HTML markup to be placed inside the column" type="string">
611
+ <type by_reference="false">string</type>
612
  </tag>
613
  </docblock>
614
+ <argument line="405">
615
+ <name>$item</name>
616
  <default><![CDATA[]]></default>
617
  <type/>
618
  </argument>
619
  </method>
620
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="423" package="Media Library Assistant">
621
+ <name>column_parent</name>
622
+ <full_name>column_parent</full_name>
623
+ <docblock line="415">
624
+ <description><![CDATA[Supply the content for a custom column]]></description>
625
+ <long-description><![CDATA[]]></long-description>
626
+ <tag line="415" name="since" description="0.1"/>
627
+ <tag line="415" name="param" description="A singular attachment (post) object" type="array" variable="$item">
628
+ <type by_reference="false">array</type>
629
  </tag>
630
+ <tag line="415" name="return" description="HTML markup to be placed inside the column" type="string">
 
 
 
 
 
 
 
 
 
631
  <type by_reference="false">string</type>
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="false" visibility="public" namespace="global" line="435" package="Media Library Assistant">
641
+ <name>column_featured</name>
642
+ <full_name>column_featured</full_name>
643
+ <docblock line="427">
644
+ <description><![CDATA[Supply the content for a custom column]]></description>
645
+ <long-description><![CDATA[]]></long-description>
646
+ <tag line="427" name="since" description="0.1"/>
647
+ <tag line="427" name="param" description="A singular attachment (post) object" type="array" variable="$item">
648
+ <type by_reference="false">array</type>
649
+ </tag>
650
+ <tag line="427" name="return" description="HTML markup to be placed inside the column" type="string">
651
+ <type by_reference="false">string</type>
652
+ </tag>
653
+ </docblock>
654
+ <argument line="435">
655
+ <name>$item</name>
656
  <default><![CDATA[]]></default>
657
  <type/>
658
  </argument>
659
  </method>
660
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="460" package="Media Library Assistant">
661
+ <name>column_inserted</name>
662
+ <full_name>column_inserted</full_name>
663
+ <docblock line="452">
664
+ <description><![CDATA[Supply the content for a custom column]]></description>
665
  <long-description><![CDATA[]]></long-description>
666
+ <tag line="452" name="since" description="0.1"/>
667
+ <tag line="452" name="param" description="A singular attachment (post) object" type="array" variable="$item">
668
+ <type by_reference="false">array</type>
669
  </tag>
670
+ <tag line="452" name="return" description="HTML markup to be placed inside the column" type="string">
671
  <type by_reference="false">string</type>
672
  </tag>
 
 
 
673
  </docblock>
674
+ <argument line="460">
675
+ <name>$item</name>
676
  <default><![CDATA[]]></default>
677
  <type/>
678
  </argument>
679
+ </method>
680
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="489" package="Media Library Assistant">
681
+ <name>column_alt_text</name>
682
+ <full_name>column_alt_text</full_name>
683
+ <docblock line="481">
684
+ <description><![CDATA[Supply the content for a custom column]]></description>
685
+ <long-description><![CDATA[]]></long-description>
686
+ <tag line="481" name="since" description="0.1"/>
687
+ <tag line="481" name="param" description="A singular attachment (post) object" type="array" variable="$item">
688
+ <type by_reference="false">array</type>
689
+ </tag>
690
+ <tag line="481" name="return" description="HTML markup to be placed inside the column" type="string">
691
+ <type by_reference="false">string</type>
692
+ </tag>
693
+ </docblock>
694
+ <argument line="489">
695
+ <name>$item</name>
696
  <default><![CDATA[]]></default>
697
  <type/>
698
  </argument>
699
  </method>
700
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="504" package="Media Library Assistant">
701
+ <name>column_caption</name>
702
+ <full_name>column_caption</full_name>
703
+ <docblock line="496">
704
+ <description><![CDATA[Supply the content for a custom column]]></description>
705
+ <long-description><![CDATA[]]></long-description>
706
+ <tag line="496" name="since" description="0.1"/>
707
+ <tag line="496" name="param" description="A singular attachment (post) object" type="array" variable="$item">
708
+ <type by_reference="false">array</type>
709
  </tag>
710
+ <tag line="496" name="return" description="HTML markup to be placed inside the column" type="string">
711
+ <type by_reference="false">string</type>
712
  </tag>
713
  </docblock>
714
+ <argument line="504">
715
+ <name>$item</name>
716
  <default><![CDATA[]]></default>
717
  <type/>
718
  </argument>
719
  </method>
720
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="516" package="Media Library Assistant">
721
+ <name>column_description</name>
722
+ <full_name>column_description</full_name>
723
+ <docblock line="508">
724
+ <description><![CDATA[Supply the content for a custom column]]></description>
725
+ <long-description><![CDATA[]]></long-description>
726
+ <tag line="508" name="since" description="0.1"/>
727
+ <tag line="508" name="param" description="A singular attachment (post) object" type="array" variable="$item">
728
+ <type by_reference="false">array</type>
729
  </tag>
730
+ <tag line="508" name="return" description="HTML markup to be placed inside the column" type="string">
731
+ <type by_reference="false">string</type>
732
  </tag>
733
  </docblock>
734
+ <argument line="516">
735
+ <name>$item</name>
736
  <default><![CDATA[]]></default>
737
  <type/>
738
  </argument>
739
  </method>
740
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="528" package="Media Library Assistant">
741
+ <name>column_base_file</name>
742
+ <full_name>column_base_file</full_name>
743
+ <docblock line="520">
744
+ <description><![CDATA[Supply the content for a custom column]]></description>
745
+ <long-description><![CDATA[]]></long-description>
746
+ <tag line="520" name="since" description="0.1"/>
747
+ <tag line="520" name="param" description="A singular attachment (post) object" type="array" variable="$item">
748
+ <type by_reference="false">array</type>
749
  </tag>
750
+ <tag line="520" name="return" description="HTML markup to be placed inside the column" type="string">
751
+ <type by_reference="false">string</type>
752
  </tag>
753
  </docblock>
754
+ <argument line="528">
755
+ <name>$item</name>
756
  <default><![CDATA[]]></default>
757
  <type/>
758
  </argument>
759
  </method>
760
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="540" package="Media Library Assistant">
761
+ <name>column_date</name>
762
+ <full_name>column_date</full_name>
763
+ <docblock line="532">
764
+ <description><![CDATA[Supply the content for a custom column]]></description>
765
+ <long-description><![CDATA[]]></long-description>
766
+ <tag line="532" name="since" description="0.1"/>
767
+ <tag line="532" name="param" description="A singular attachment (post) object" type="array" variable="$item">
768
+ <type by_reference="false">array</type>
769
  </tag>
770
+ <tag line="532" name="return" description="HTML markup to be placed inside the column" type="string">
771
+ <type by_reference="false">string</type>
772
  </tag>
773
  </docblock>
774
+ <argument line="540">
775
+ <name>$item</name>
776
  <default><![CDATA[]]></default>
777
  <type/>
778
  </argument>
779
  </method>
780
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="569" package="Media Library Assistant">
781
+ <name>column_author</name>
782
+ <full_name>column_author</full_name>
783
+ <docblock line="561">
784
+ <description><![CDATA[Supply the content for a custom column]]></description>
785
+ <long-description><![CDATA[]]></long-description>
786
+ <tag line="561" name="since" description="0.1"/>
787
+ <tag line="561" name="param" description="A singular attachment (post) object" type="array" variable="$item">
788
+ <type by_reference="false">array</type>
789
  </tag>
790
+ <tag line="561" name="return" description="HTML markup to be placed inside the column" type="string">
791
+ <type by_reference="false">string</type>
792
  </tag>
793
  </docblock>
794
+ <argument line="569">
795
+ <name>$item</name>
796
  <default><![CDATA[]]></default>
797
  <type/>
798
  </argument>
799
  </method>
800
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="586" package="Media Library Assistant">
801
+ <name>column_attached_to</name>
802
+ <full_name>column_attached_to</full_name>
803
+ <docblock line="578">
804
+ <description><![CDATA[Supply the content for a custom column]]></description>
805
+ <long-description><![CDATA[]]></long-description>
806
+ <tag line="578" name="since" description="0.1"/>
807
+ <tag line="578" name="param" description="A singular attachment (post) object" type="array" variable="$item">
808
+ <type by_reference="false">array</type>
809
  </tag>
810
+ <tag line="578" name="return" description="HTML markup to be placed inside the column" type="string">
811
+ <type by_reference="false">string</type>
812
  </tag>
813
  </docblock>
814
+ <argument line="586">
815
+ <name>$item</name>
816
  <default><![CDATA[]]></default>
817
  <type/>
818
  </argument>
819
  </method>
820
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="613" package="Media Library Assistant">
821
+ <name>column_categories</name>
822
+ <full_name>column_categories</full_name>
823
+ <docblock line="605">
824
+ <description><![CDATA[Supply the content for a custom column]]></description>
825
+ <long-description><![CDATA[]]></long-description>
826
+ <tag line="605" name="since" description="0.1"/>
827
+ <tag line="605" name="param" description="A singular attachment (post) object" type="array" variable="$item">
828
+ <type by_reference="false">array</type>
829
  </tag>
830
+ <tag line="605" name="return" description="HTML markup to be placed inside the column" type="string">
831
+ <type by_reference="false">string</type>
832
  </tag>
833
  </docblock>
834
+ <argument line="613">
835
+ <name>$item</name>
836
  <default><![CDATA[]]></default>
837
  <type/>
838
  </argument>
839
  </method>
840
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="646" package="Media Library Assistant">
841
+ <name>column_tags</name>
842
+ <full_name>column_tags</full_name>
843
+ <docblock line="638">
844
+ <description><![CDATA[Supply the content for a custom column]]></description>
845
+ <long-description><![CDATA[]]></long-description>
846
+ <tag line="638" name="since" description="0.1"/>
847
+ <tag line="638" name="param" description="A singular attachment (post) object" type="array" variable="$item">
848
+ <type by_reference="false">array</type>
849
+ </tag>
850
+ <tag line="638" name="return" description="HTML markup to be placed inside the column" type="string">
851
+ <type by_reference="false">string</type>
852
  </tag>
853
  </docblock>
854
+ <argument line="646">
855
+ <name>$item</name>
856
  <default><![CDATA[]]></default>
857
  <type/>
858
  </argument>
859
  </method>
860
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="678" package="Media Library Assistant">
861
+ <name>get_columns</name>
862
+ <full_name>get_columns</full_name>
863
+ <docblock line="671">
864
+ <description><![CDATA[This method dictates the table's columns and titles.]]></description>
865
+ <long-description><![CDATA[]]></long-description>
866
+ <tag line="671" name="since" description="0.1"/>
867
+ <tag line="671" name="return" description="Column information: 'slugs'=&gt;'Visible Titles'" type="array">
868
+ <type by_reference="false">array</type>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
869
  </tag>
870
  </docblock>
871
+ </method>
872
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="690" package="Media Library Assistant">
873
+ <name>get_hidden_columns</name>
874
+ <full_name>get_hidden_columns</full_name>
875
+ <docblock line="682">
876
+ <description><![CDATA[Returns the list of currently hidden columns from a user option or
877
+ from default values if the option is not set]]></description>
878
+ <long-description><![CDATA[]]></long-description>
879
+ <tag line="682" name="since" description="0.1"/>
880
+ <tag line="682" name="return" description="Column information,e.g., array(0 =&gt; 'ID_parent, 1 =&gt; 'title_name')" type="array">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
881
  <type by_reference="false">array</type>
882
  </tag>
883
  </docblock>
884
  </method>
885
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="710" package="Media Library Assistant">
886
+ <name>get_sortable_columns</name>
887
+ <full_name>get_sortable_columns</full_name>
888
+ <docblock line="700">
889
+ <description><![CDATA[Returns an array where the key is the column that needs to be sortable
890
+ and the value is db column to sort by.]]></description>
891
+ <long-description><![CDATA[<p>Also notes the current sort column,
892
+ if set.</p>]]></long-description>
893
+ <tag line="700" name="since" description="0.1"/>
894
+ <tag line="700" name="return" description="Sortable column information,e.g., 'slugs'=&gt;array('data_values',bool)" type="array">
 
 
895
  <type by_reference="false">array</type>
896
  </tag>
897
  </docblock>
 
 
 
 
 
898
  </method>
899
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="737" package="Media Library Assistant">
900
+ <name>get_views</name>
901
+ <full_name>get_views</full_name>
902
+ <docblock line="729">
903
+ <description><![CDATA[Returns an associative array listing all the views that can be used with this table.]]></description>
904
+ <long-description><![CDATA[<p>These are listed across the top of the page and managed by WordPress.</p>]]></long-description>
905
+ <tag line="729" name="since" description="0.1"/>
906
+ <tag line="729" name="return" description="View information,e.g., array ( id =&gt; link )" type="array">
 
907
  <type by_reference="false">array</type>
908
  </tag>
909
  </docblock>
910
  </method>
911
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="807" package="Media Library Assistant">
912
+ <name>get_bulk_actions</name>
913
+ <full_name>get_bulk_actions</full_name>
914
+ <docblock line="799">
915
+ <description><![CDATA[Get an associative array ( option_name => option_title ) with the list
916
+ of bulk actions available on this table.]]></description>
917
  <long-description><![CDATA[]]></long-description>
918
+ <tag line="799" name="since" description="0.1"/>
919
+ <tag line="799" name="return" description="Contains all the bulk actions: 'slugs'=&gt;'Visible Titles'" type="array">
920
  <type by_reference="false">array</type>
921
  </tag>
922
  </docblock>
923
  </method>
924
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="839" package="Media Library Assistant">
925
+ <name>extra_tablenav</name>
926
+ <full_name>extra_tablenav</full_name>
927
+ <docblock line="829">
928
+ <description><![CDATA[Extra controls to be displayed between bulk actions and pagination.]]></description>
929
+ <long-description><![CDATA[<p>Modeled after class-wp-posts-list-table.php in wp-admin/includes</p>]]></long-description>
930
+ <tag line="829" name="since" description="0.1"/>
931
+ <tag line="829" name="param" description="'top' or 'bottom', i.e., above or below the table rows" type="string" variable="$which">
 
 
 
 
 
932
  <type by_reference="false">string</type>
933
  </tag>
934
+ <tag line="829" name="return" description="Contains all the bulk actions: 'slugs'=&gt;'Visible Titles'" type="array">
 
 
 
935
  <type by_reference="false">array</type>
936
  </tag>
937
  </docblock>
938
+ <argument line="839">
939
+ <name>$which</name>
 
 
 
 
 
 
 
 
 
 
940
  <default><![CDATA[]]></default>
941
  <type/>
942
  </argument>
943
  </method>
944
+ <method final="false" abstract="false" static="false" visibility="public" namespace="global" line="895" package="Media Library Assistant">
945
+ <name>prepare_items</name>
946
+ <full_name>prepare_items</full_name>
947
+ <docblock line="885">
948
+ <description><![CDATA[Prepares the list of items for displaying.]]></description>
949
+ <long-description><![CDATA[<p>This is where you prepare your data for display. This method will usually
950
+ be used to query the database, sort and filter the data, and generally
951
+ get it ready to be displayed. At a minimum, we should set $this->items and
952
+ $this->set_pagination_args().</p>]]></long-description>
953
+ <tag line="885" name="since" description="0.1"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
954
  </docblock>
955
  </method>
956
+ <method final="false" abstract="false" static="false" visibility="private" namespace="global" line="947" package="Media Library Assistant">
957
+ <name>_mime_types</name>
958
+ <full_name>_mime_types</full_name>
959
+ <docblock line="938">
960
+ <description><![CDATA[Get possible mime types for view preparation.]]></description>
961
+ <long-description><![CDATA[<p>Modeled after get_post_mime_types in wp-admin/includes/post.php,
962
+ with additional entries.</p>]]></long-description>
963
+ <tag line="938" name="since" description="0.1"/>
964
+ <tag line="938" name="return" description="Mime type names and HTML markup for views" type="array">
 
 
 
 
965
  <type by_reference="false">array</type>
966
  </tag>
 
 
 
967
  </docblock>
 
 
 
 
 
 
 
 
 
 
968
  </method>
969
+ <method final="false" abstract="false" static="false" visibility="private" namespace="global" line="1024" package="Media Library Assistant">
970
+ <name>_avail_mime_types</name>
971
+ <full_name>_avail_mime_types</full_name>
972
+ <docblock line="1013">
973
+ <description><![CDATA[Get mime types with one or more attachments for view preparation.]]></description>
974
+ <long-description><![CDATA[<p>Modeled after get_available_post_mime_types in wp-admin/includes/post.php,
975
+ with additional entries.</p>]]></long-description>
976
+ <tag line="1013" name="since" description="0.1"/>
977
+ <tag line="1013" name="param" description="Number of posts for each mime type" type="array" variable="$num_posts">
978
  <type by_reference="false">array</type>
979
  </tag>
980
+ <tag line="1013" name="return" description="Mime type names" type="array">
981
+ <type by_reference="false">array</type>
982
  </tag>
983
  </docblock>
984
+ <argument line="1024">
985
+ <name>$num_posts</name>
986
  <default><![CDATA[]]></default>
987
  <type/>
988
  </argument>
989
  </method>
990
+ <method final="false" abstract="false" static="false" visibility="private" namespace="global" line="1044" package="Media Library Assistant">
991
+ <name>_count_list_table_items</name>
992
+ <full_name>_count_list_table_items</full_name>
993
+ <docblock line="1035">
994
+ <description><![CDATA[Get the total number of attachment posts]]></description>
995
  <long-description><![CDATA[]]></long-description>
996
+ <tag line="1035" name="since" description="0.1"/>
997
+ <tag line="1035" name="param" description="Query variables, e.g., from $_REQUEST" type="array" variable="$request">
998
  <type by_reference="false">array</type>
999
  </tag>
1000
+ <tag line="1035" name="return" description="Number of attachment posts" type="int">
1001
+ <type by_reference="false">int</type>
1002
  </tag>
1003
  </docblock>
1004
+ <argument line="1044">
1005
+ <name>$request</name>
1006
  <default><![CDATA[]]></default>
1007
  <type/>
1008
  </argument>
1009
  </method>
1010
+ </class>
1011
+ </file>
1012
+ <file path="includes\class-mla-main.php" hash="d0d57226b843629e79c5dad42b0b880a" package="Media Library Assistant">
1013
+ <docblock line="2">
1014
+ <description><![CDATA[Top-level functions for the Media Library Assistant]]></description>
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="25" name="since" description="0.1"/>
1041
+ <tag line="25" name="var" description="" type="string">
 
 
 
1042
  <type by_reference="false">string</type>
1043
  </tag>
 
 
 
1044
  </docblock>
1045
+ </constant>
1046
+ <constant namespace="global" line="41" package="Media Library Assistant">
1047
+ <name>CURRENT_MLA_VERSION</name>
1048
+ <full_name>CURRENT_MLA_VERSION</full_name>
1049
+ <value><![CDATA['0.1']]></value>
1050
+ <docblock line="34">
1051
+ <description><![CDATA[Current version number]]></description>
 
 
 
 
 
 
 
 
 
1052
  <long-description><![CDATA[]]></long-description>
1053
+ <tag line="34" name="since" description="0.1"/>
1054
+ <tag line="34" name="var" description="" type="string">
 
 
 
1055
  <type by_reference="false">string</type>
1056
  </tag>
1057
  </docblock>
1058
+ </constant>
1059
+ <constant namespace="global" line="50" package="Media Library Assistant">
1060
+ <name>MIN_PHP_VERSION</name>
1061
+ <full_name>MIN_PHP_VERSION</full_name>
1062
+ <value><![CDATA['5.2']]></value>
1063
+ <docblock line="43">
1064
+ <description><![CDATA[Minimum version of PHP required for this plugin]]></description>
 
 
 
 
1065
  <long-description><![CDATA[]]></long-description>
1066
+ <tag line="43" name="since" description="0.1"/>
1067
+ <tag line="43" name="var" description="" type="string">
 
 
 
1068
  <type by_reference="false">string</type>
1069
  </tag>
1070
  </docblock>
1071
+ </constant>
1072
+ <constant namespace="global" line="59" package="Media Library Assistant">
1073
+ <name>MIN_WORDPRESS_VERSION</name>
1074
+ <full_name>MIN_WORDPRESS_VERSION</full_name>
1075
+ <value><![CDATA['3.3.0']]></value>
1076
+ <docblock line="52">
1077
+ <description><![CDATA[Minimum version of WordPress required for this plugin]]></description>
 
 
 
 
1078
  <long-description><![CDATA[]]></long-description>
1079
+ <tag line="52" name="since" description="0.1"/>
1080
+ <tag line="52" name="var" description="" type="string">
 
 
 
1081
  <type by_reference="false">string</type>
1082
  </tag>
1083
  </docblock>