Last active
August 29, 2015 14:18
-
-
Save afragen/be66c2dab3e5b0bc881c to your computer and use it in GitHub Desktop.
Fix for danishmaritimedays.com
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
<?php | |
use Fragen\Category_Colors; | |
add_action( 'plugins_loaded', 'teccc_load_options_class', 20 ); | |
function teccc_load_options_class() { | |
if ( class_exists( '\\Fragen\\Category_Colors\\Main' ) ) { | |
new Category_Colors_Options(); | |
} | |
} | |
class Category_Colors_Options { | |
public function __construct() { | |
add_filter( 'teccc_legend_html', array( $this, 'add_to_legend_html' ) ); | |
$this->hide_extra_categories(); | |
} | |
public function add_legend_explanation( $html ) { | |
echo '<div class="legend-explanation"> To focus on events from only one of these categories, just click on the relevant label. </div>' . $html; | |
} | |
public function hide_extra_categories() { | |
teccc_ignore_slug( 'fully-booked', 'leveraging-new-technologies-and-innovation', 'maritime-growth-areas-of-the-future', 'maritime-security', 'meeting-the-transportation-infrastructure-needs-of-the-future', 'social', 'sustainable-growth', 'unlocking-growth-in-the-emerging-economies', 'workforce-of-the-future' ); | |
} | |
public function add_to_legend_html( $html ) { | |
echo $html . dmd_show_extra_legend_items(); | |
} | |
public function dmd_show_extra_legend_items() { | |
?> | |
<ul> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/fully-booked/">Fully booked</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/leveraging-new-technologies-and-innovation/">Leveraging New Technologies and Innovation</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/maritime-growth-areas-of-the-future/">Maritime Growth Areas of the Future</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/maritime-security/">Maritime Security</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/meeting-the-transportation-infrastructure-needs-of-the-future/">Meeting the Transportation Infrastructure Needs of the Future</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/social/">Social</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/sustainable-growth/">Sustainable Growth</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/unlocking-growth-in-the-emerging-economies/">Unlocking Growth in the Emerging Economies</a> | |
</li> | |
<li> | |
<a href="http://www.danishmaritimedays.com/events/category/workforce-of-the-future/">Workforce of the Future</a> | |
</li> | |
</ul> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment