automatic PDF invoice with FPDF in PHP (creating Plugin)

You need to load WordPress before using wp functions, use this just after the <?php tag: require( ‘<<DIR>>/wp-load.php’ ); where <<DIR>> is the path to the main wordpress folder (in your case something like ../../../, add double dots as needed to navigate up the plugins and wp-content hierarchy NOTE: direct linking outside you control zone … Read more

TCPDF get_post_meta outside the loop

I’ve got it fixed: I needed to add the wp-load file that contains all the WP-functions include(‘../../../../../wp-load.php’); global $post; $id = $_GET[‘id’]; $content_post = get_post($id); $content = $content_post->post_content; $content = apply_filters(‘the_content’, $content); $content = str_replace(‘]]>’, ‘]]&gt;’, $content); Now the content loads in the PDF

Attach pdf file to custom post type

Here this is my code which i used in my wordpress site in custom post type for adding the pdf to the post and its work for me try to change its and use it. Hope it will help function add_custom_meta_boxes() { add_meta_box(‘wp_custom_attachment’, ‘Hotel Brochure’, ‘wp_custom_attachment’, ‘hotel_post’, ‘normal’, ‘high’); } add_action(‘add_meta_boxes’, ‘add_custom_meta_boxes’); function wp_custom_attachment() { … Read more

How to create thumbnails for PDF uploads?

If I’m not totally mistaken, the code you have given on your update won’t work, because the file/mime type pdf isn’t supported by the WP_image_editor class called by wp_get_image_editor(). Creating a thumbnail from a uploaded pdf file can be achieved though. Below code gives you a insight in a possibility how to do it, I … Read more

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