|
|
@ -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')); |
|
|
|