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

    (@dglingren)

    Thanks for an interesting question. The safest way to get the ID list is to write a small function of your own, make it a shortcode and then use the [mla_gallery] mla_alt_shortcode parameter to compose the list you want and capture the ID values. Here is some code you can adapt to your application:

    function capture_ids_values( $attr ) {
    global $ids;
    
    $ids = $attr['ids'];
    }
    add_shortcode( 'capture_ids', 'capture_ids_values' );
    
    function get_mla_gallery_ids() {
    global $ids;
    
    do_shortcode( '[mla_gallery attachment_category="my category" mla_alt_shortcode="capture_ids"]' );
    
    return $ids;
    }

    There are many ways to improve and expand on this code, but it illustrates the basic technique.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter olimax

    (@olimax)

    Hi David
    That’s certainly a curious solution but I shall give it a go
    Thank you very much
    and of course thank you for such an essential tool

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get the IDs from a category’ is closed to new replies.