• Resolved rwdrummond

    (@rwdrummondcoxnet)


    Hi, I’ve been using the plugin for awhile, but wanted to replace the default top-level “downloads” with a custom label. So I added a “Label” attribute to the shortcode in index.php. Here is the code in case you or anyone else would like to use it.

    Original code:
    $subdir_path = '<strong>'.__('path', 'm1dll').':</strong> <a href="' . get_permalink(get_the_ID()) . '">'.__('downloads', 'm1dll').'</a>';

    Modified code:

    if (strlen($atts['label']) > 0) {
      $subdir_path = '<strong>'.__('path', 'm1dll').':</strong> <a href="' . get_permalink(get_the_ID()) . '">'.__($atts['label'], 'm1dll').'</a>';
      } else {
    $subdir_path = '<strong>'.__('path', 'm1dll').':</strong> <a href="' . get_permalink(get_the_ID()) . '">'.__('downloads', 'm1dll').'</a>';
    }

    Usage example:
    [m1dll path="wp-content/uploads/il-doclib" label="IL Document Library" ]

    https://wordpress.org/plugins/m1downloadlist/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author maennchen1.de

    (@maennchen1de)

    Hi!
    Thank you!
    I’ll implement this in the feature version.

    Thread Starter rwdrummond

    (@rwdrummondcoxnet)

    You’re welcome! Thank you for a great, simple plugin!

    Plugin Author maennchen1.de

    (@maennchen1de)

    It’s my pleasure!
    Your feature is now public in version 0.6.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘New Feature Suggestion – Custom Top-Level Label’ is closed to new replies.