daverage
Forum Replies Created
-
Forum: Plugins
In reply to: wp_remote_get to upload image corrupts – local fiel alternative?Hah, done it again – after hours of searching find the answer straight after posting here!!
function save_first_image(){ global $post, $posts; $image_url = catch_that_image(); $post_id = $post -> post_id; $upload_dir = wp_upload_dir(); $image_data = file_get_contents($image_url); $filename = basename($image_url); if(wp_mkdir_p($upload_dir['path'])) $file = $upload_dir['path'] . '/' . $filename; else $file = $upload_dir['basedir'] . '/' . $filename; file_put_contents($file, $image_data); $wp_filetype = wp_check_filetype($filename, null ); $attachment = array( 'post_mime_type' => $wp_filetype['type'], 'post_title' => sanitize_file_name($filename), 'post_content' => '', 'post_status' => 'inherit' ); $attach_id = wp_insert_attachment( $attachment, $file, $post_id ); require_once(ABSPATH . 'wp-admin/includes/image.php'); $attach_data = wp_generate_attachment_metadata( $attach_id, $file ); wp_update_attachment_metadata( $attach_id, $attach_data ); set_post_thumbnail( $post_id, $attach_id ); }
Forum: Plugins
In reply to: Looping through post_category and getting category namesThank you!!! That worked first time!!!
Forum: Plugins
In reply to: Looping through post_category and getting category namesThanks.
I get this
array(1) { [12]=> string(2) “12” }
Sorry, I am very new to PHP!!!
Forum: Plugins
In reply to: [W3 Total Cache] [Plugin: W3 Total Cache] Defer JavaScript ParsingHi.
I was wondering if anyone ever got a copy of W3TC with javascript defer built in?
Thanks
Here is a link to an image of what is happening. As I say, before wp 3.5 it was fine.
I also have w3 total cache set to use a local CDN (if that makes a difference)
Don’t think pro is the answer. I have been using it for about 10 months and this has never been an issue.
Forum: Alpha/Beta/RC
In reply to: Add Media and Featured Image buttons not workingNo idea about suhosin. Work use a proxy with various over the top filters. As I say, 3.4.2 worked fine, just started with 3.5 ?? as soon as I am no longer in the proxy it works fine!!
Forum: Alpha/Beta/RC
In reply to: Add Media and Featured Image buttons not workingThanks. I have done that and refreshed caches etc. but no joy.
I have nailed it down further. When I load the page editor (for instance) and follow the network calls in chrome, I get told the following has a bad gateway (502) However, you can go straight to it!
https://marczewski.me.uk/wp-admin/load-styles.php?c=0&dir=ltr&load=wp-jquery-ui-dialog&ver=3.5-RC4
Forum: Alpha/Beta/RC
In reply to: Add Media and Featured Image buttons not workingI think it is a work firewall thing. I have a feeling we block cross domain scripting in some way. Same pc, same browser through our proxy and I get the error. Turn of proxy, tether to my phone and it works first time.
It isn’t the cdn as I totally switched that off and it definitely only started after the 3.5 install ??
Forum: Alpha/Beta/RC
In reply to: Add Media and Featured Image buttons not workingOk, gets a little strange now. I ran it from home and it works. Run it from work and I get the following
Uncaught TypeError: Cannot call method ‘replace’ of undefined load-scripts.php:407
The comes from // Underscore.js 1.4.1
The only thing that has changed of late (a big thing) is the fact I am now using w3 total cache to host files on a CDN subdomain.
So, I removed the JS files from the CDN and at work, still the same problem. Is there something new that is doing some kind of cross domain call from javascript?
However, not sure why this would work from home and not at work – any help would be very appreciated!!
Forum: Alpha/Beta/RC
In reply to: Add Media and Featured Image buttons not workingSeems to just be the images dialogue that wont popup. Was fine on 3,42