1. Go to this page and download the library: Download raicem/wefg library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
raicem / wefg example snippets
use Raicem\WEFG\Post;
use Raicem\WEFG\SiteSettings;
use Raicem\WEFG\WXRFile;
$settings = new SiteSettings(
link: 'https://example.com',
title: 'My Site',
description: 'A WordPress site',
language: 'en-US'
);
$wxr = new WXRFile($settings);
$wxr->addPost(new Post(
title: 'Hello World',
content: '<p>Welcome to my site.</p>',
excerpt: 'A welcome post',
authorLogin: 'admin',
publishDate: '2024-01-01 12:00:00',
slug: 'hello-world'
));
$wxr->save('export.xml');