Title: Insert dynamic default content?
Last modified: August 20, 2016

---

# Insert dynamic default content?

 *  Resolved [jcyin](https://wordpress.org/support/users/jcyin-1/)
 * (@jcyin-1)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/insert-dynamic-default-content/)
 * Following up from this post [http://wordpress.org/support/topic/pre-filled-post-contents?replies=2](http://wordpress.org/support/topic/pre-filled-post-contents?replies=2)
 * I currently have this as the default content which is added to each post created
   by this plugin
 *     ```
       add_filter( 'afip_new_post_content', 'diww_default_post_content' );
       function diww_default_post_content() {
           $content = "<iframe src= ></iframe>";
           return $content;
       }
       ```
   
 * Currently I’m manually adding in the iframe src for each post. I currently have
   a php array with a list of URL’s. I would like to incrementally add a new URL
   to the src from my array each time a new post is created.
 * Is this possible? If so does the current plugin work like a loop and allows a
   counter to increment? How would something like this be achieved?
 * e.g.
 * URL[0] -> Post[0]
 * URL[1] -> Post[1]
 * URL[2] -> Post[2]
 * and so on.
 * Thanks, great plugin btw. Works amazing! 🙂
 * [http://wordpress.org/extend/plugins/automatic-featured-image-posts/](http://wordpress.org/extend/plugins/automatic-featured-image-posts/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jeremy Felt](https://wordpress.org/support/users/jeremyfelt/)
 * (@jeremyfelt)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/insert-dynamic-default-content/#post-3445627)
 * Hey [@jcyin](https://wordpress.org/support/users/jcyin/), glad you like the plugin.
 * Automatic Featured Image Posts is hooked into `add_attachment` to do most of 
   its work. While it doesn’t have its own specific loop to hook into, it is part
   of the greater loop that is created when uploading multiple images.
 * You could probably keep track of the incrementing URL through your own variable
   outside of your filter in PHP or by building an array of URLs in advance and 
   then removing one from the array each time it is used in your filter.
 * Hope that helps!

Viewing 1 replies (of 1 total)

The topic ‘Insert dynamic default content?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/automatic-featured-image-posts_a5c0de.
   svg)
 * [Automatic Featured Image Posts](https://wordpress.org/plugins/automatic-featured-image-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/automatic-featured-image-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/automatic-featured-image-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/automatic-featured-image-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/automatic-featured-image-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/automatic-featured-image-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jeremy Felt](https://wordpress.org/support/users/jeremyfelt/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/insert-dynamic-default-content/#post-3445627)
 * Status: resolved