/* Plugin Name: Word Exporter Plugin URI: https://www.example.com/word-exporter Description: Export WordPress posts to Word document using Aspose.Words for Cloud API. Version: 1.0.0 Author: John Doe Author URI: https://www.example.com License: GPL2 */ require_once plugin_dir_path(__FILE__) . '/aspose-words-cloud-php/vendor/autoload.php'; use Aspose\Words\Cloud\Api\WordsApi; use Aspose\Words\Cloud\Model\Requests\SaveAsRequest; $words_api = new WordsApi(getenv('6d4292c1-6517-43c0-af06-6d07be7015ee'), getenv('1d7c12cf62b22c417fd45bb92cd8ce8c')); function word_exporter_shortcode() { $output = ''; if (isset($_POST['post_id'])) { $post_id = sanitize_text_field($_POST['post_id']); $post = get_post($post_id); if ($post) { $output .= '

Exporting post "' . $post->post_title . '"...

'; $request = new SaveAsRequest(array( 'name' => $post->post_name . '.docx', 'save_options_data' => array( 'save_format' => 'docx', 'pretty_format' => true ) )); $result = $words_api->saveAs(new \Aspose\Words\Cloud\Model\SaveAsRequest($request, $post_id, null, null, null, null, null, null)); if ($result) { $output .= '

Post exported successfully. Download

'; } else { $output .= '

Error exporting post. Please try again.

'; } } else { $output .= '

Post not found.

'; } } $output .= '
'; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; return $output; } add_shortcode('word-exporter', 'word_exporter_shortcode'); Curatedweb | Site-Wide Activity https://ngedemo.com/curatedweb/activity/ Activity feed for the entire site. Wed, 29 Mar 2023 01:42:41 +0000 https://buddypress.org/?v= en-US 30 hourly 2 ae0af4840b23209c32af7f2d0ee35d59 adnan.doc posted an update: @arslandawood , Hi Arslan https://ngedemo.com/curatedweb/activity/p/7/ Sat, 13 Nov 2021 23:10:36 +0000 @arslandawood , Hi Arslan

]]>
1
c7d9c6a19042a154f8d0d3afdaf3abd2 Arslan Dawood posted an update: Hi everyone, glad to be here https://ngedemo.com/curatedweb/activity/p/6/ Sat, 13 Nov 2021 23:02:06 +0000 Hi everyone, glad to be here

]]>
0
bfedf1ac86f35fa77bb3949d2eac5729 Arslan Dawood changed their profile picture https://ngedemo.com/curatedweb/activity/p/5/ Sat, 13 Nov 2021 23:00:50 +0000 0 7bc3979dee6170cfbd26b0ac92656596 adnan.doc changed their profile picture https://ngedemo.com/curatedweb/activity/p/3/ Sat, 13 Nov 2021 22:53:41 +0000 0 47c2c0ef8a23b67771e62166dc1185cc adnan.doc posted an update: Hello and welcome to NGE GEZA, so happy to see you all. https://ngedemo.com/curatedweb/activity/p/2/ Sat, 13 Nov 2021 22:51:01 +0000 Hello and welcome to NGE GEZA, so happy to see you all.

]]>
0