Title: Hook to overwrite shortcode
Last modified: December 3, 2018

---

# Hook to overwrite shortcode

 *  Resolved [xsonic](https://wordpress.org/support/users/xsonic/)
 * (@xsonic)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hook-to-overwrite-shortcode/)
 * Awesome Plugin, thanks a lot.
 * But why all the unnecessary HTML in the shortcode? A div, p and an a-tag with
   bootstrap classes.
 * A filter or hook to create custom HTML output would be awesome, as in my case
   I need inline links.
 * Please consider this for upcoming updates, as it’s such a great plugin.
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Lana Codes](https://wordpress.org/support/users/lanacodes/)
 * (@lanacodes)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hook-to-overwrite-shortcode/#post-10940688)
 * You can query the download URL with the following function:
    `lana_downloads_manager_get_download_url(
   $post_id)`
 * where post_id is the download post id.
 * if you need more help, please feel free to contact us.
 *  Plugin Author [Lana Codes](https://wordpress.org/support/users/lanacodes/)
 * (@lanacodes)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hook-to-overwrite-shortcode/#post-10941599)
 * Or at the download post type you see two values:
    Permalink: {url} Download Permalink:{
   download url}
 * Use “Download permalink” at the link:
    `<a href="{download url}">Download</a>`
 *  Thread Starter [xsonic](https://wordpress.org/support/users/xsonic/)
 * (@xsonic)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hook-to-overwrite-shortcode/#post-10944770)
 * Thanks a lot for the quick response.
 * While this _get_download_url-function comes in handy, and creating a custom shortcode
   with it works flawless, I wouldn’t be able to use your “insert Shortcode” button
   in the editor anymore.
 * I’d really appreciate a simple filter hook:
    `return apply_filters('lana_download_shortcode',
   $output, $atts);`
 *  Plugin Author [Lana Codes](https://wordpress.org/support/users/lanacodes/)
 * (@lanacodes)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hook-to-overwrite-shortcode/#post-10944853)
 * For this case, there is a simpler solution:
 *     ```
       function lana_download_modified_shortcode( $atts ) {
       	// modified shortcode...
       }
   
       remove_shortcode( 'lana_download' );
       add_shortcode( 'lana_download', 'lana_download_modified_shortcode' );
       ```
   
 * So remove default shortcode and add modified shortcode function.
 * Note:
    The filter would not have too much use because you would overwrite the
   full shortcode anyway. The filter is useful if you want to rewrite part of the
   operation. Therefore removal and new addition are more logical in this case. 
   But this is just a developer’s comment.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Hook to overwrite shortcode’ is closed to new replies.

 * ![](https://ps.w.org/lana-downloads-manager/assets/icon-128x128.jpg?rev=1512693)
 * [Lana Downloads Manager](https://wordpress.org/plugins/lana-downloads-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lana-downloads-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lana-downloads-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/lana-downloads-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lana-downloads-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lana-downloads-manager/reviews/)

 * 4 replies
 * 0 participants
 * Last reply from: [Lana Codes](https://wordpress.org/support/users/lanacodes/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/hook-to-overwrite-shortcode/#post-10944853)
 * Status: resolved