Plugin Directory

Changeset 3095389

Timestamp:
05/30/2024 11:02:26 PM (2 months ago)
Author:
dglingren
Message:

Fix handling of str_replace braces in [mla_gallery].

Location:
media-library-assistant/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • media-library-assistant/trunk/includes/class-mla-core.php

    r3093550 r3095389  
    3131     * @var string
    3232     */
    33     const MLA_DEVELOPMENT_VERSION = '20240527';
     33    const MLA_DEVELOPMENT_VERSION = '202405';
    3434
    3535    /**
  • media-library-assistant/trunk/includes/class-mla-data.php

    r3024830 r3095389  
    14871487        foreach ($placeholders as $key => $value ) {
    14881488            // Braces in the key must become brackets for template parsing
     1489
    14891490            $key = str_replace( '{', '[', str_replace( '}', ']', $key ) );
    1490             if ( isset( $markup_values[ $key ] ) ) {
     1491            if ( isset( $markup_values[ $key ] ) ) {
    14911492                continue;
    14921493            }
     
    15081509                    }
    15091510
    1510                     $markup_values[ $key ] = self::mla_find_array_element( $value['value'], $item_metadata, $value['option'] );
     1511                    $markup_values[ $key ] = self::mla_find_array_element( $value['value'], $item_metadata, $value['option'] );
    15111512                    break;
    15121513                case 'query':
    15131514                    if ( isset( $query ) && isset( $query[ $value['value'] ] ) ) {
    1514                         $markup_values[ $key ] = $query[ $value['value'] ];
     1515                        $markup_values[ $key ] = $query[ $value['value'] ];
    15151516                    } else {
    1516                         $markup_values[ $key ] = '';
     1517                        $markup_values[ $key ] = '';
    15171518                    }
    15181519
     
    15541555                    } // is_array
    15551556
    1556                     $markup_values[ $key ] = $text;
     1557                    $markup_values[ $key ] = $text;
    15571558                    break;
    15581559                case 'terms':
     
    15611562                       
    15621563                        if ( false !== $text ) {
    1563                             $markup_values[ $key ] = $text;
     1564                            $markup_values[ $key ] = $text;
    15641565                        }
    15651566                    }
     
    15731574                       
    15741575                        if ( false !== $text ) {
    1575                             $markup_values[ $key ] = $text;
     1576                            $markup_values[ $key ] = $text;
    15761577                        }
    15771578                    }
     
    15851586                       
    15861587                        if ( false !== $text ) {
    1587                             $markup_values[ $key ] = $text;
     1588                            $markup_values[ $key ] = $text;
    15881589                        }
    15891590                    }
     
    15921593                case 'custom':
    15931594                    if ( 0 < $post_id ) {
    1594                         $markup_values[ $key ] = self::_expand_custom_field( $value, $post_id );
     1595                        $markup_values[ $key ] = self::_expand_custom_field( $value, $post_id );
    15951596                    }
    15961597
     
    16001601                   
    16011602                    if ( 0 < $page_id ) {
    1602                         $markup_values[ $key ] = self::_expand_custom_field( $value, $page_id );
     1603                        $markup_values[ $key ] = self::_expand_custom_field( $value, $page_id );
    16031604                    }
    16041605
     
    16081609                   
    16091610                    if ( 0 < $parent_id ) {
    1610                         $markup_values[ $key ] = self::_expand_custom_field( $value, $parent_id );
     1611                        $markup_values[ $key ] = self::_expand_custom_field( $value, $parent_id );
    16111612                    }
    16121613
     
    16211622                    }
    16221623
    1623                     $markup_values[ $key ] = self::mla_iptc_metadata_value( $value['value'], $attachment_metadata, $value['option'], $keep_existing );
     1624                    $markup_values[ $key ] = self::mla_iptc_metadata_value( $value['value'], $attachment_metadata, $value['option'], $keep_existing );
    16241625                    break;
    16251626                case 'exif':
     
    16341635                    $record = self::mla_exif_metadata_value( $value['value'], $attachment_metadata, $value['option'], $keep_existing );
    16351636                    if ( is_array( $record ) ) {
    1636                         $markup_values[ $key ] = self::_process_field_level_array( $record, $value['option'], $keep_existing );
     1637                        $markup_values[ $key ] = self::_process_field_level_array( $record, $value['option'], $keep_existing );
    16371638                    } else {
    1638                         $markup_values[ $key ] = $record;
     1639                        $markup_values[ $key ] = $record;
    16391640                    }
    16401641
     
    16491650                    }
    16501651
    1651                     $markup_values[ $key ] = self::mla_xmp_metadata_value( $value['value'], $attachment_metadata['mla_xmp_metadata'], $value['option'], $keep_existing );
     1652                    $markup_values[ $key ] = self::mla_xmp_metadata_value( $value['value'], $attachment_metadata['mla_xmp_metadata'], $value['option'], $keep_existing );
    16521653                    break;
    16531654                case 'id3':
     
    16601661                    }
    16611662
    1662                     $markup_values[ $key ] = self::mla_id3_metadata_value( $value['value'], $id3_metadata, $value['option'], $keep_existing );
     1663                    $markup_values[ $key ] = self::mla_id3_metadata_value( $value['value'], $id3_metadata, $value['option'], $keep_existing );
    16631664                    break;
    16641665                case 'pdf':
     
    16731674                    $record = self::mla_pdf_metadata_value( $value['value'], $attachment_metadata );
    16741675                    if ( is_array( $record ) ) {
    1675                         $markup_values[ $key ] = self::_process_field_level_array( $record, $value['option'], $keep_existing );
     1676                        $markup_values[ $key ] = self::_process_field_level_array( $record, $value['option'], $keep_existing );
    16761677                    } else {
    1677                         $markup_values[ $key ] = $record;
     1678                        $markup_values[ $key ] = $record;
    16781679                    }
    16791680
     
    16881689                    }
    16891690
    1690                     $markup_values[ $key ] = self::mla_png_metadata_value( $value['value'], $attachment_metadata['mla_png_metadata'], $value['option'], $keep_existing );
     1691                    $markup_values[ $key ] = self::mla_png_metadata_value( $value['value'], $attachment_metadata['mla_png_metadata'], $value['option'], $keep_existing );
    16911692                    break;
    16921693                case 'mso':
     
    16991700                    }
    17001701
    1701                     $markup_values[ $key ] = self::mla_mso_metadata_value( $value['value'], $attachment_metadata['mla_mso_metadata'], $value['option'], $keep_existing );
     1702                    $markup_values[ $key ] = self::mla_mso_metadata_value( $value['value'], $attachment_metadata['mla_mso_metadata'], $value['option'], $keep_existing );
    17021703                    break;
    17031704                case 'matches':
    1704                     $markup_values[ $key ] = isset( MLAData::$regex_matches[ $value['value'] ] ) ? MLAData::$regex_matches[ $value['value'] ] : '';
     1705                    $markup_values[ $key ] = isset( MLAData::$regex_matches[ $value['value'] ] ) ? MLAData::$regex_matches[ $value['value'] ] : '';
    17051706                    break;
    17061707                case '':
     
    17151716                            'option' => $value['option'] ); // single, export, text for array values, e.g., alt_text
    17161717
    1717                         $markup_values[ $key ] = MLAShortcodes::mla_get_data_source( $post_id, 'single_attachment_mapping', $data_value );
     1718                        $markup_values[ $key ] = MLAShortcodes::mla_get_data_source( $post_id, 'single_attachment_mapping', $data_value );
    17181719                    } elseif ( isset( $markup_values[ $value['value'] ] ) ) {
    17191720                        // A standard element can have a format modifier, e.g., commas, attr
    1720                         $markup_values[ $key ] = $markup_values[ $value['value'] ];
     1721                        $markup_values[ $key ] = $markup_values[ $value['value'] ];
    17211722                    } else {
    17221723                        $custom_value = apply_filters( 'mla_expand_custom_data_source', NULL, $key, $candidate, $value, $query, $markup_values, $post_id, $keep_existing, $default_option );
    17231724                        if ( !is_null( $custom_value ) ) {
    1724                             $markup_values[ $key ] = $custom_value;
     1725                            $markup_values[ $key ] = $custom_value;
    17251726                        }
    17261727                    }
     
    17301731                    $custom_value = apply_filters( 'mla_expand_custom_prefix', NULL, $key, $value, $query, $markup_values, $post_id, $keep_existing, $default_option );
    17311732                    if ( !is_null( $custom_value ) ) {
    1732                         $markup_values[ $key ] = $custom_value;
     1733                        $markup_values[ $key ] = $custom_value;
    17331734                    }
    17341735            } // switch
    17351736
    1736             if ( isset( $markup_values[ $key ] ) ) {
    1737                 $markup_values[ $key ] = self::mla_apply_field_level_format( $markup_values[ $key ], $value );
    1738             } // isset( $markup_values[ $key ] )
     1737            if ( isset( $markup_values[ $key ] ) ) {
     1738                $markup_values[ $key ], $value );
     1739            } // isset( $markup_values[ $key ] )
    17391740        } // foreach placeholder
    17401741
  • media-library-assistant/trunk/index.php

    r3093550 r3095389  
    1616Plugin Name: Media Library Assistant
    1717Plugin URI: http://davidlingren.com/#two
    18 Description: 20240527 Enhances the Media Library; powerful [mla_gallery] [mla_tag_cloud] [mla_term_list], taxonomy support, IPTC/EXIF/XMP/PDF processing, bulk/quick edit.
     18Description: 202405 Enhances the Media Library; powerful [mla_gallery] [mla_tag_cloud] [mla_term_list], taxonomy support, IPTC/EXIF/XMP/PDF processing, bulk/quick edit.
    1919Version: 3.16
    2020Requires at least: 4.1
  • media-library-assistant/trunk/readme.txt

    r3093550 r3095389  
    189189
    190190= 3.17 =
     191
    191192* Fix: For the Media Manager Modal (popup) Window, the Enter key now triggers the MLA Enhanced Search Media function.
    192193* Fix: When the Elementor page editor is active, buttons on the "Insert Media" popup window are now sized correctly.
Note: See TracChangeset for help on using the changeset viewer.