Browse Source

Fix controller.

pull/11/head
Ned Zimmerman 7 years ago
parent
commit
98e5b9e6fc
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 25
      app/controllers/FrontPage.php

25
app/controllers/FrontPage.php

@ -19,31 +19,6 @@ class FrontPage extends Controller
return 1; return 1;
} }
public function blocks()
{
$blocks = [];
for ($i = 1; $i < 5; $i++) {
$block = [];
$title = get_option("pb_front_page_block_${i}_title");
$content = get_option("pb_front_page_block_${i}_content");
$button_title = get_option("pb_front_page_block_${i}_button_title");
$button_url = get_option("pb_front_page_block_${i}_button_url");
if ($title) {
$block['title'] = $title;
}
if ($content) {
$block['content'] = wpautop($content);
}
if ($button_title && $button_url) {
$block['button_title'] = $button_title;
$block['button_url'] = $button_url;
}
$blocks[] = $block;
}
return $blocks;
}
public function totalPages() public function totalPages()
{ {
$books = wp_remote_get(network_home_url('/wp-json/pressbooks/v2/books?per_page=3')); $books = wp_remote_get(network_home_url('/wp-json/pressbooks/v2/books?per_page=3'));

Loading…
Cancel
Save