Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Change %ext% output to lowercase or add new %extlc% wildcard #163

Open
vtamm opened this issue Jul 13, 2016 · 0 comments
Open

Change %ext% output to lowercase or add new %extlc% wildcard #163

vtamm opened this issue Jul 13, 2016 · 0 comments

Comments

@vtamm
Copy link

vtamm commented Jul 13, 2016

I wanted to use the %ext% wildcard to include the document icons in my custom list like so:

<img src="'.get_site_url().'/wp-content/plugins/delightful-downloads/assets/icons/%ext%.png">

However this doesn't work since the extension is converted to uppercase when replacing %ext% on this line.

There's currently no way of outputting the file extension in lowercase. Since the output of %ext% can very easily be converted to uppercase using CSS, I would like to suggest either getting rid of strtoupper() on the referenced line above, or that a new %extlc% wildcard is added:

// file extension lowercase
if ( strpos( $string, '%extlc%' ) !== false ) {
    $value = dedo_get_file_ext( get_post_meta( $id, '_dedo_file_url', true ) );
    $string = str_replace( '%extlc%', $value, $string );
}

Whichever way you prefer, just let me know if you want me to send a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant