How to associate media with a post?

If you want to give the users some course material to download, you could simply “Add Media” or “Upload ZIP” into the “Course” content section. Also if you want only people who start a “Course” to have the course material then you could place the Course material files in the content of the “Unit” post … Read more

How do I display image files as links?

There’s no such “non-coding newbie”-bulk-thing for the process. You have to do that for each of the image, when you are uploading the image to the site and/or post/page. On the right panel of the media upload pane, change “Link To” to “Custom URL” and put the URL (whatever you like – internal or external) … Read more

Run filter if only it was run from specific admin page ( ‘upload_dir’ changed )

Adding filter: add_filter( ‘upload_dir’, ‘change_upload_dir’, 10, 1 ); Function content: function change_upload_dir($param) { // Check for REFER $actual_page = $_SERVER[‘HTTP_REFERER’]; parse_str( parse_url($actual_page, PHP_URL_QUERY), $query_array ); if ( strpos($actual_page, ‘plugin_name.php’) ) { $mydir=”/customdir”; $param[‘path’] = $param[‘basedir’] . $mydir; } return $param; } Hope this will help Other ideas, based not on HTTP_REFERER, are appreciated 🙂