- 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)
23 lines
465 B
PHP
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;
|
|
}
|
|
} |