Title: short code
Last modified: August 31, 2016

---

# short code

 *  Resolved [gordo019](https://wordpress.org/support/users/gordo019/)
 * (@gordo019)
 * [10 years ago](https://wordpress.org/support/topic/short-code-89/)
 * I am using your plugin, but would like the content editors not to have to insert
   the short code each use. How can I do this automatically by code?
 * [https://wordpress.org/plugins/edd-download-images/](https://wordpress.org/plugins/edd-download-images/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [gordo019](https://wordpress.org/support/users/gordo019/)
 * (@gordo019)
 * [10 years ago](https://wordpress.org/support/topic/short-code-89/#post-7422807)
 * Add this to functions.php…
 * function my_shortcode_to_a_post( $content ) {
    global $post; if( ! $post instanceof
   WP_Post ) return $content;
 *  switch( $post->post_type ) {
    case ‘download’: return $content . ‘[edd_download_images]’;
   default: return $content; } }
 * add_filter( ‘the_content’, ‘my_shortcode_to_a_post’ );

Viewing 1 replies (of 1 total)

The topic ‘short code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/edd-download-images_ffffff.svg)
 * [EDD Download Images](https://wordpress.org/plugins/edd-download-images/)
 * [Support Threads](https://wordpress.org/support/plugin/edd-download-images/)
 * [Active Topics](https://wordpress.org/support/plugin/edd-download-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/edd-download-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/edd-download-images/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [gordo019](https://wordpress.org/support/users/gordo019/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/short-code-89/#post-7422807)
 * Status: resolved