Tag Info

Hot answers tagged

4

WP sanitize_file_name() function doesn't handle those characters by default. You can add filter and sanitize those to avoid encoding issues. function mamaduka_sanitize_file_name( $filename ) { $filename = strtr($filename, ...


1

I presume you've fixed this already but (in a blatant attempt to snaffle the bounty and) as mentioned in the comments there's a simple fix, in your myplugin_meta_box_callback() function change the line $mime_types = array( 'application/pdf' ); to $mime_types = 'application/pdf'; The library.type option to wp.media expects a string (which can ...


1

Sounds like you need something like: add_filter('upload_mimes', function ( $mimes = array() ) { $mimes['mobi'] = 'application/x-mobipocket-ebook'; $mimes['epub'] = 'application/epub+zip'; return $mimes; } ); to support the uploads, but you might have to adjust the mime types to your needs.


1

I figured this out. For anyone facing the same issue, I ended up using this code instead: function hi_customization_options( $wp_customize ) { $wp_customize->add_section( 'landing_page_image', array( 'title' => 'Landing Page Image', 'priority' => 35, ) ); $wp_customize->add_setting( ...


1

There isn't much point to distinguishing admin-ajax.php since it's essentially same file with same logic running for many many purposes. You are passing action data and hooking into respective action. So action is your identifier. If you are reusing same action and need to further differentiate — just pass more data with your GET/POST request and check for ...



Only top voted, non community-wiki answers of a minimum length are eligible