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 | |
/* | |
This is a sample application designed to demonstrate how to add an additional custom field to a backend editor. | |
The example provided adds a "Dress Code" field to the existing event editor in LiveWhale. To add a custom field to the news editor, for example, follow the same example but change all references from events to news below. | |
*/ |
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
<script type="text/javascript" language="javascript"> | |
$(document).ready(function() { | |
//indicate the class or id to apply the dotdotdot function | |
$(".events_summary").dotdotdot({ | |
//configuration goes here | |
ellipsis: '... ', | |
wrap: 'word' | |
}); | |
}); | |
</script> |
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
<style type="text/css"> | |
/* Use the height attribute on the targetting class or id, | |
to determine where to shorten the content */ | |
.events_summary{height: 100px;} | |
</style> |
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 | |
$_LW->REGISTERED_APPS['custom_events']=array( | |
'title'=>'Custom Events', | |
'handlers'=>array('onOutput') | |
); | |
class LiveWhaleApplicationCustomEvents{ | |
public function onOutput($buffer){ |
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
public function onTabs($tabs) { // configures tabs | |
global $_LW; | |
if (@$_SESSION['livewhale']['manage']['grouptitle']!='Public'){ | |
$tabs['mytab']=array('MyTab','https://link-to-your-application.edu',0,0,0); // add tab | |
} | |
return $tabs; | |
} |
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
//The custom app below redirects files tagged as "private" to a .htaccess protected directory | |
<?php | |
$_LW->REGISTERED_APPS['protect_files']=array( | |
'title'=>'Protect Files', | |
'handlers'=>array('onLoad') | |
); | |
class LiveWhaleApplicationProtectFiles { |
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
SetEnvIfNoCase Request_URI "^/authenticated-directory/*" SECURED | |
# enforce auth if SECURED=1 | |
AuthType Basic | |
AuthName "Login Required" | |
AuthUserFile /path/to/.htpasswd | |
Require valid-user | |
Order allow,deny | |
Allow from all | |
Deny from env=SECURED |
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 | |
$_LW->REGISTERED_APPS['resize_images'] = array( // configure this application module | |
'title' => 'Resize Images', | |
'handlers' => array('onLoad') | |
); | |
class LiveWhaleApplicationResizeImages { | |
public function onLoad() { // on frontend request |
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
// Calendar (3 events): Show three LiveWhale Calendar events in a horizontal row | |
// Below is the resulting code, which you can roll into the master functions.php if you want it to apply to all themes in a multisite site. | |
register_field_group(array ( | |
'id' => 'acf_calendar-3-events', | |
'title' => 'Calendar (3 events)', | |
'fields' => array ( | |
array ( | |
'key' => 'field_53d14e3d55dba', | |
'label' => 'Show events?', |
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 | |
/** | |
* The template used for displaying an inline list of events. Used in side columns on landing page templates, mostly. | |
* | |
* | |
* @package bsu2014 | |
*/ | |
if( get_field('show_event_list') ) : |
OlderNewer