forked from beezwax/WP-Publish-to-Apple-News
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathclass-layout.php
46 lines (41 loc) · 1.02 KB
/
class-layout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Publish to Apple News: \Apple_Exporter\Builders\Layout class
*
* @package Apple_News
* @subpackage Apple_Exporter\Builders
*/
namespace Apple_Exporter\Builders;
/**
* Manage the article layout.
*
* @since 0.4.0
*/
class Layout extends Builder {
/**
* Build the layout
*
* @return array
* @access protected
*/
protected function build() {
// Get information about the currently loaded theme.
$theme = \Apple_Exporter\Theme::get_used();
/**
* Modifies the layout settings from the Apple News formatting options.
*
* @param array $layout Layout settings.
* @param int $post_id The ID of the post.
*/
return apply_filters(
'apple_news_layout',
[
'columns' => intval( $theme->get_layout_columns() ),
'width' => intval( $theme->get_value( 'layout_width' ) ),
'margin' => intval( $theme->get_value( 'layout_margin' ) ), // Defaults to 100.
'gutter' => intval( $theme->get_value( 'layout_gutter' ) ), // Defaults to 20.
],
$this->content_id()
);
}
}