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)
This commit is contained in:
23
lib/Settings/Pages.php
Normal file
23
lib/Settings/Pages.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user