anttiviljami / wp-pdf-templates

Add PDF templates to your WordPress theme
https://wordpress.org/plugins/wp-pdf-templates
GNU General Public License v3.0
42 stars 18 forks source link

convert FETCH_COOKIES requests to use curl for better authentication support #3

Closed gtrout closed 8 years ago

gtrout commented 9 years ago

The original file_get_contents method wasn't passing all the cookies needed to render private/authenticated content. I tried converting it to use curl and it worked, so here are my changes for your consideration.

Credit to stackoverflow user PiTheNumber for the curl example I started with (http://stackoverflow.com/a/23907823/3735757).

anttiviljami commented 9 years ago

Thanks for the PR! I'll look into this and test it on a couple of sites that use FETCH_COOKIES.

anttiviljami commented 9 years ago

Could you also fix the code style to match WordPress.org PHP Coding standards?

https://make.wordpress.org/core/handbook/coding-standards/php/

... with the exception of the indentation tab rule. Tabs should be 2 spaces for better readability, thanks ! :)

gtrout commented 9 years ago

I've pushed a commit that detabs the code.

anttiviljami commented 9 years ago

Thanks ! Can you just fix https://make.wordpress.org/core/handbook/coding-standards/php/#brace-style as well?

gtrout commented 9 years ago

Definitely! Hanging braces like that are fugly. Fixed.

anttiviljami commented 9 years ago

@gtrout: Any updates regarding my previous questions?

gtrout commented 9 years ago

Sorry, haven't had time to get back to this. I will try to make some changes in the next week or so.

On May 17, 2015, at 05:35, Antti Kuosmanen notifications@github.com wrote:

@gtrout: Any updates regarding my previous questions?

— Reply to this email directly or view it on GitHub.