Custom Text in Media Uploader in a Theme Options Page

This is a short version of what I do in one of my plugins. I copied this behavior from the plugin Advanced Custom Fields (some versions ago, donnow how it proceeds now). 1) When calling the thickbox, add a custom query var (mtt_type in this case): tb_show(‘{$mtt_title}’, ‘media-upload.php?type=image&mtt_type=image&TB_iframe=true’); 2) Print scripts in media-upload.php to modify … Read more

Upload a custom csv file, read contents and delete that file

Enable upload of CSV files, which are not in the default allowed files (see here) Hook into add_attachment action hook to detect when the desired file is uploaded Do whatever you need to do using that hook, then trigger wp_delete_attachment once the file has been processed. Depending on what you want to do, it may … Read more

How to upload prc file type?

This article explains a method in which you can add a file type to the list of allowed file types. Copy and paste the following code into your functions.php: add_filter(‘upload_mimes’, ‘custom_upload_mimes’); function custom_upload_mimes ( $existing_mimes=array() ) { // add your extension to the array $existing_mimes[‘prc’] = ‘application/x-mobipocket-ebook’; // add as many as you like // … Read more

Control resizing of uploaded images

Why not set your own image sizes from within your theme in functions.php? add_image_size( ‘some-image-size-name’, 500, 300 ); Then you can call that size you want from your template. <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> Links Add image size: http://codex.wordpress.org/Function_Reference/add_image_size get post thumbnail: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)