• Resolved nicegamer7

    (@nicegamer7)


    Is it possible to pass multiple attachment-specific parameters to an alternate shortcode, and as content as well?

    For example
    [mla_gallery attachment_category="the-cat" numberposts=1 mla_alt_shortcode="alt" mla_alt_ids_name="source" mla_alt_ids_value="{+filelink_url+}" thumb="{+fileurl+}" type="thumb"]{+title+}[/mla_gallery]

    Is there any way to make the above substitutions work?

Viewing 1 replies (of 1 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for an interesting question.

    There are no features in the current MLA version along these lines. In the specific case you propose, with exactly one item passed to the alternate shortcode, a solution is possible. In the general case of multiple items it doesn’t make sense.

    After giving it some thought the best solution I can think of would be to create an intermediate shortcode to perform the substitutions. You would use MLA to find the ID value of the item you want and pass that along to some new shortcode, e.g., “my substitute”. That new shortcode would use the ids= parameter to identify the item you want and populate the other parameters. You can use MLA’s MLAShortcodes::mla_get_data_source() function to process the values you need. The new shortcode can be added to your theme’s functions.php file or packaged in a small custom plugin.

    I am marking this topic resolved, but if that solution would work for you and you need more specific guidance, post an update and let me know. Thanks for your interest in MLA.

Viewing 1 replies (of 1 total)

The topic ‘Multiple Attributes for Alternate Shortcode’ is closed to new replies.