Thanks for your question, which is a variation on an earlier support topic:
Featued Image (Post_thumbnail)
The “Random Featured Image” example plugin is available in the Settings/Media Library Assistant Documentation tab. To install the example plugin, navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. You will see a table that lists all the example plugins and gives you a “one-click” action for installing them. Type “random” in the text box and click “Search Plugins” to filter the table. You are looking for “Random Featured Image” example plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and activate it as you would any other plugin.
The basic approach is straightforward: 1) define a custom shortcode that accepts a list of IDs and processes it, and 2) use the do_shortcode
function to execute an [mla_gallery]
shortcode that generates the IDs and passes them to your custom shortcode. Here’s the code from the example plugin:
if ( self::USE_SHORTCODE ) {
add_shortcode( 'random_featured_image', 'RandomFeaturedImage::random_featured_image_shortcode' );
do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" orderby=rand posts_per_page=1 mla_alt_shortcode=random_featured_image rfi_post_id="%3$d"]', $taxonomy, $chosen_name, $post_ID ) );
remove_shortcode( 'random_featured_image' );
} else {
The example plugin hooks the save_post
action to get its parameters. You will have to figure out how to get parameters from your vue.js
application in some other way.
That gives you one approach that should meet your needs. If you need more specific guidance, any additional details about your application will be very helpful. I will leave this topic unresolved until I hear back from you. Thanks for your interest in the plugin.