-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
334 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.2.4 | ||
1.2.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* 3rd argument is the priority, higher means executed first | ||
* 4rth argument is number of arguments the function can accept | ||
**/ | ||
|
||
add_action('epfl_card_action', 'renderCard', 10, 4); | ||
|
||
function renderCard ($title, $text, $link, $image) { | ||
|
||
if (is_admin()) { | ||
|
||
// render placeholder for backend editor | ||
set_query_var('epfl_placeholder_title', 'Card'); | ||
get_template_part('shortcodes/placeholder'); | ||
|
||
} else { | ||
|
||
set_query_var('epfl_card_title', $title); | ||
set_query_var('epfl_card_text', $text); | ||
set_query_var('epfl_card_link', $link); | ||
set_query_var('epfl_card_image', $image); | ||
get_template_part('shortcodes/epfl_card/view'); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
$title = get_query_var('epfl_card_title'); | ||
$text = get_query_var('epfl_card_text'); | ||
$link = get_query_var('epfl_card_link'); | ||
$image = get_query_var('epfl_card_image'); | ||
?> | ||
|
||
<a href="<?php echo $link; ?>" class="card link-trapeze-horizontal"> | ||
<?php if ($image): ?> | ||
<picture class="card-img-top"> | ||
<img src="<?php echo $image; ?>" class="img-fluid" title="<?php echo $title; ?>" alt="<?php echo $title; ?>" /> | ||
</picture> | ||
<?php endif ?> | ||
<div class="card-body"> | ||
<h3 class="card-title"><?php echo $title; ?></h3> | ||
<p><?php echo $text; ?></p> | ||
</div> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/** | ||
* 3rd argument is the priority, higher means executed first | ||
* 4rth argument is number of arguments the function can accept | ||
**/ | ||
|
||
add_action('epfl_cover_action', 'renderCover', 10, 2); | ||
|
||
function renderCover ($image, $description) { | ||
|
||
if (is_admin()) { | ||
|
||
// render placeholder for backend editor | ||
set_query_var('epfl_placeholder_title', 'Cover'); | ||
get_template_part('shortcodes/placeholder'); | ||
|
||
} else { | ||
|
||
// render for frontend | ||
set_query_var('epfl_cover_image', $image); | ||
set_query_var('epfl_cover_description', $description); | ||
get_template_part('shortcodes/epfl_cover/view'); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
$description = get_query_var('epfl_cover_description'); | ||
$image = get_query_var('epfl_cover_image'); | ||
?> | ||
|
||
<div class="container"> | ||
<figure class="cover"> | ||
<picture> | ||
<img src="<?php echo $image; ?>" class="img-fluid" alt="<?php echo $description; ?>"> | ||
</picture> | ||
<figcaption> | ||
<button | ||
aria-hidden="true" | ||
type="button" | ||
class="btn-circle" | ||
data-toggle="popover" | ||
data-content="<?php echo $description; ?>" | ||
> | ||
<svg class="icon" aria-hidden="true"><use xlink:href="#icon-info"></use></svg> | ||
<svg class="icon icon-rotate-90" aria-hidden="true"><use xlink:href="#icon-chevron-right"></use></svg> | ||
</button> | ||
<p class="sr-only"><?php echo $description; ?></p> | ||
</figcaption> | ||
</figure> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* 3rd argument is the priority, higher means executed first | ||
* 4rth argument is number of arguments the function can accept | ||
**/ | ||
|
||
add_action('epfl_links_group_action', 'renderLinksGroup', 10, 1); | ||
|
||
function renderLinksGroup ($args) { | ||
|
||
if (is_admin()) { | ||
|
||
// render placeholder for backend editor | ||
set_query_var('epfl_placeholder_title', 'Links group'); | ||
get_template_part('shortcodes/placeholder'); | ||
|
||
} else { | ||
|
||
set_query_var('epfl_links_group_main_url', $args['main_url']); | ||
set_query_var('epfl_links_group_title', $args['title']); | ||
|
||
unset($args['main_url']); | ||
unset($args['title']); | ||
|
||
$links = []; | ||
foreach ($args as $key => $value) { | ||
$field_key = substr($key, -1); | ||
$field_name = substr($key, 0, -1); | ||
$links[$field_key][$field_name] = $value; | ||
} | ||
set_query_var('epfl_links_group_links', $links); | ||
|
||
get_template_part('shortcodes/epfl_links_group/view'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
$links = get_query_var('epfl_links_group_links'); | ||
$main_url = get_query_var('epfl_links_group_main_url'); | ||
$title = get_query_var('epfl_links_group_title'); | ||
$is_links_teaser = ("" !== $main_url); | ||
?> | ||
<div class="links-group <?php if ($is_links_teaser):?>links-group-teaser<?php endif; ?>"> | ||
<h5 id="links-group-title"> | ||
<?php if($is_links_teaser): ?> | ||
<a class="link-pretty" href="<?php echo $main_url; ?>"><?php echo $title; ?></a> | ||
<?php else: ?> | ||
<?php echo $title; ?> | ||
<?php endif; ?> | ||
</h5> | ||
<nav | ||
class="nav flex-column flex-wrap align-items-start" | ||
role="navigation" | ||
aria-labelledby="links-group-title" | ||
> | ||
<?php foreach($links as $link): ?> | ||
<a class="nav-link link-pretty" href="<?php echo $link['url']; ?>"><?php echo $link['label']; ?></a> | ||
<?php endforeach ?> | ||
</nav> | ||
</div> |
Oops, something went wrong.