--------------------------------------------------------------------------------
/src/components/atoms/title.php:
--------------------------------------------------------------------------------
1 | [
9 | 'itemprop' => 'name',
10 | ],
11 | 'link' => '', // Custom link or 'post' to link to the post directly
12 | 'tag' => 'h1',
13 | 'title' => get_the_title(),
14 | 'schema' => true // If microdata is rendered or not. Also removes schematic attributes
15 | ] );
16 |
17 | if( ! $atom['schema'] ) {
18 | unset($atom['attributes']['itemprop']);
19 | }
20 |
21 | // Custom link to a post
22 | $atom['link'] = $atom['link'] == 'post' ? esc_url( get_permalink() ) : esc_url( $atom['link'] );
23 |
24 | $attributes = MakeitWorkPress\WP_Components\Build::attributes($atom['attributes']); ?>
25 |
26 | < >
27 |
28 | itemprop="url" title="">
29 |
30 |
31 |
32 |
33 |
34 | >
--------------------------------------------------------------------------------
/src/components/atoms/type.php:
--------------------------------------------------------------------------------
1 | '',
9 | 'type' => get_post_type()
10 | ] );
11 |
12 | // Return if we do not have a type
13 | if( ! $atom['type'] )
14 | return;
15 |
16 | // Format our label
17 | if( ! $atom['name'] ) {
18 | $postObject = get_post_type_object( $atom['type'] );
19 | $atom['name'] = $postObject->labels->singular_name;
20 | }
21 |
22 | $attributes = MakeitWorkPress\WP_Components\Build::attributes($atom['attributes']); ?>
23 |
24 |
>
25 |
26 |
--------------------------------------------------------------------------------
/src/components/atoms/video.php:
--------------------------------------------------------------------------------
1 | 'video_height', 'videoWidth' => 'video_width']);
8 |
9 | // Atom values
10 | $atom = MakeitWorkPress\WP_Components\Build::multi_parse_args( $atom, [
11 | 'attributes' => [
12 | 'itemprop' => 'video'
13 | ],
14 | 'date' => '', // The schematic data for a video
15 | 'description' => '', // The schematic description for the video
16 | 'name' => '', // The schematic name for the video
17 | 'placer' => 'atom-video-placer', // Our container class for the video, uses the 56.25% padding rule to make the video responsive
18 | 'schema' => true, // If microdata is rendered or not. Also removes schematic attributes
19 | 'thumbnail' => '', // The schematic thumbnail url for the video
20 | 'video' => '', // Expects an embed code for a video object or a video html tag or a src
21 | 'video_height' => '' , // A custom height for the video
22 | 'video_width' => '' // A custom width for the video
23 | ] );
24 |
25 | // Return if we do not have a video
26 | if( ! $atom['video'] ) {
27 | return;
28 | }
29 |
30 | // Format our video if it's just an url
31 | if( strpos($atom['video'], 'http') === 0 ) {
32 | $height = $atom['video_height'] ? ' height="' . intval($atom['video_height']) . '"' : '';
33 | $width = $atom['video_width'] ? ' width="' . intval($atom['video_width']) . '"' : '';
34 | $atom['video'] = do_shortcode('[video src="' . $atom['video'] . '"' . $height . $width . ']');
35 | $atom['placer'] = 'atom-video-wp';
36 | }
37 |
38 | if( ! $atom['schema'] ) {
39 | unset($atom['attributes']['itemprop']);
40 | }
41 |
42 | $attributes = MakeitWorkPress\WP_Components\Build::attributes($atom['attributes']); ?>
43 |
44 |