????JFIF??x?x????'
| Server IP : 172.67.174.47 / Your IP : 216.73.216.87 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /././home/tempvsty/pontiacques.org/wp-content/plugins/give/src/TestData/Factories/ |
Upload File : |
<?php
namespace Give\TestData\Factories;
use Give\TestData\Framework\Factory;
/**
* Class PageFactory
* @package Give\TestData\Factories
*/
class PageFactory extends Factory
{
/**
* Donor definition
*
* @since 1.0.0
* @return array
*/
public function definition()
{
return [
'post_title' => 'GiveWP Demonstration page',
'post_content' => $this->getContent(),
'post_status' => 'publish',
'post_author' => $this->randomAuthor(),
'post_type' => 'page',
];
}
/**
* Page content
*
* @since 1.0.0
* @return string
*/
public function getContent()
{
$giveShortcodes = $this->getGiveShortcodes();
$content = '';
foreach ($giveShortcodes as $shortcode) {
$content .= "<h3>[{$shortcode}]</h3>";
$content .= "[{$shortcode}]";
}
return $content;
}
/**
* Get GiveWP shortcodes
*
* @return array
*/
private function getGiveShortcodes()
{
$shortcodes = [];
foreach ($GLOBALS['shortcode_tags'] as $shortcode => $action) {
if (false !== strpos($shortcode, 'give_')) {
$shortcodes[] = $shortcode;
}
}
return $shortcodes;
}
}