Files
piratepoet/lib/Settings/Pages.php
Jonathan Labreuille 34c237ce8e Load/Save settings
- renamed all settings with dot syntax
- refactored Menu->settings()
- changed schema of settings table to allow longer setting name and value
- added getAll() static method on Setting Model to fetch all settings (with proper unserialize of value)
2015-10-15 14:22:27 +02:00

23 lines
465 B
PHP

<?php
namespace MailPoet\Settings;
class Pages {
static function getAll() {
$mailpoet_pages = get_posts(array(
'post_type' => 'mailpoet_page'
));
$pages = array_merge($mailpoet_pages, get_pages());
foreach($pages as $key => $page) {
$page = (array)$page;
$page['preview_url'] = get_permalink($page['ID']);
$page['edit_url'] = get_edit_post_link($page['ID']);
$pages[$key] = $page;
}
return $pages;
}
}