Hooks & Filters

ASE is loaded with hooks, filters, and more. All are documented in great detail below.

Theme Compatibility

Find out what you need to get your theme or framework compatible with ASE.

ASE on Github

Code is hosted on Github, where you can create bug reports, and pull requests.

Developer Docs

Basic Docs

Overview

In order to get the most out of this plugin as a theme developer, it’s recommended to read through the following to gain a better understanding of just how ASE works.

At the most basic level, ASE lets users insert components that display HTML markup. A select few of these components have basic CSS applied to them, so that they will be presentable within most WordPress themes. However, most are void of markup, letting you be free to build, and not battle with overriding CSS.

Themes are responsible for how the components look. ASE is responsible for how they function. In other words, ASE gives you the engine and the pieces of a car. It’s up to you to decide how to put them together.

This method gives near 100% freedom for WordPress theme developers. However this also means that, in order to really get the most out of Aesop, you kinda have to know WordPress, and at least how to build a WordPress theme. If not, don’t worry, we’ve got plenty of themes for you to choose from, should you not want to build your own.

For theme developers, we’ve made it really easy to completely remove the CSS all together, as well as completely override the components by pasting the entire function into your child themes functions.php (better yet, an aesop-components.php file would be more appropriate). And with over 60 filters and actions, you’ll be hard-pressed to find something you can’t do with Aesop. And if you can, we want to hear about it.

Helpful Links

http://aesopstoryengine.com/the-story-panel/
http://aesopstoryengine.com/content-first/

Theme Implementation

Aesop gets along with most themes. If it can display a shortcode, chances are, it can display Aesop story components properly.

Problematic Themes

Origami
FUSE

Example Theme

Aesop Example Story Theme at Github:
https://github.com/AesopInteractive/aesop-story-theme

Note: There is another example theme at the following location. But it’s no longer updated:
https://github.com/bearded-avenger/aesop-sample-theme


Deactivate Styles

Using a define you can deactivate the css file in Aesop from loading.

  1. define(‘AI_CORE_UNSTYLED’,true);
define('AI_CORE_UNSTYLED',true);

Deactivate or Activate Extended CSS Support

With Aesop Story Engine 1.0.9, we’ve included an option that will load additional CSS styles in an effort to make Aesop Story Engine compatible with more themes out of the box. If you want your theme to properly display Aesop Story Engine components, this section is for you. By default, the extended styles for all components are loaded. You can specify aesop-component-style to control this behavior.

  1. $components = array();
  2. add_theme_support(‘aesop-component-styles’, $components );
$components = array();
add_theme_support('aesop-component-styles', $components );

In the above code, no components are specified in the array. $components is an empty array. This effectively deactivates extended CSS support.

You can selectively activate extended styles for the components. For example, let’s say that you want additional CSS loaded for the parallax, image, and quote components. You would simply place this code snippet in either your theme’s functions.php file, or in a plugin such as Code Snippets.

  1. add_theme_support( "aesop-component-styles", array( "parallax", "image", "quote" ) );
add_theme_support( "aesop-component-styles", array( "parallax", "image", "quote" ) );

Or, if you want to explicitly load CSS for all Aesop components, you can use the following code:

  1. add_theme_support( "aesop-component-styles", array( "parallax", "image", "quote", "gallery", "content", "video", "audio", "collection", "chapter", "document", "character", "map", "timeline" ) );
add_theme_support( "aesop-component-styles", array( "parallax", "image", "quote", "gallery", "content", "video", "audio", "collection", "chapter", "document", "character", "map", "timeline" ) );

Tip A few lines of CSS will get you full-width Aesop Story Engine components in Genesis. Just paste this code into a third party WordPress CSS plugin like Simple Custom CSS.


Utilizing Full-width Feature

The components in Aesop are really designed to be full-width. When building your theme, apply the theme content width to the paragraph elements. This way the components can run full-width. Each component has it’s own width option built-in. If the user chooses “content” as the width option in any component, the class .aesop-content is applied. It’s recommended to set your site’s width into this class.

Here’s an example:

  1. p,
  2. .aesop-content {
  3. width:100%;
  4. max-width:960px;
  5. margin:0 auto;
  6. }
p,
.aesop-content {
width:100%;
max-width:960px;
margin:0 auto;
}

Here’s an article explaining the approach:
http://aesopstoryengine.com/content-first/


Overriding Components

All components are pluggable. Copy the entire shortcode function (including if statement) of whichever component you want to modify, and paste it into your themes functions.php file. It will now use yours instead.


Changing Default Parameters

You can change default parametes using aesop_avail_components filter. Here is an example code that changes the default values for background and text colors for the Quote component. To study the names of the parameters, study the source code: /admin/include/available.php

  1. function new_defaults( $shortcodes ) {
  2.     $shortcodes[‘quote’][‘atts’][‘background’][‘default’] = ‘#FFFFFF';
  3.     $shortcodes[‘quote’][‘atts’][‘text’][‘default’] = ‘#000000′;
  4.     return $shortcodes;
  5. }
  6. add_filter( ‘aesop_avail_components’,   ‘new_defaults’ );
function new_defaults( $shortcodes ) {
    $shortcodes['quote']['atts']['background']['default'] = '#FFFFFF';
    $shortcodes['quote']['atts']['text']['default'] = '#000000';
    return $shortcodes;
}
add_filter( 'aesop_avail_components',   'new_defaults' );

Responsive Videos

Aesop loads FitVids, so as long as the plugin is activated, you can make any video embed responsive by wrapping it within a container with the class .aesop-video-container


Timeline & Chapter Component Integrations

These two components will not function properly without the the following hook and container classes.

1. Right after the opening body tag, in your WordPress theme template, add the following hook. Aesop uses this hook to inject markup.

Pre 1.0.5

  1. do_action(‘aesop_inside_body_top’);
do_action('aesop_inside_body_top');

1.0.5+

  1. do_action(‘ase_theme_body_inside_top’);
do_action('ase_theme_body_inside_top');

2. Add this CSS class to your article/container div that holds the actual post.

  1. .aesop-entry-content
.aesop-entry-content

3. If you are utilizing the Chapter Component, you have two options. Add the class below to wherever you would like the chapter navigation to be placed, or, use a filter (aesop_chapter_nav_container in Filters below) to specify your own.

  1. .aesop-entry-header
.aesop-entry-header

Universal Aesop Theme Hooks

Aesop add-ons and Themes are entirely modular. This means that all of the add-ons work with all of our themes. Each of our themes also shares the same sets of hooks. Having this setup allows users to easily switch themes without losing content, or modifications, and without having to setup everything again within the theme.

Every Aesop theme includes 99% of these hooks.

  1. Body
  2. ase_theme_body_before
  3. ase_theme_body_inside_top
  4. ase_theme_body_inside_bottom
  5. ase_theme_body_after
  6.  
  7. Header
  8. ase_theme_header_before
  9. ase_theme_header_inside_top
  10. ase_theme_header_inside_bottom
  11. ase_theme_header_after
  12.  
  13. Sidebars
  14. ase_theme_sb_before
  15. ase_theme_sb_inside_top
  16. ase_theme_sb_inside_bottom
  17. ase_theme_sb_after
  18.  
  19. Posts
  20. ase_theme_post_before
  21. ase_theme_post_inside_top
  22. ase_theme_post_inside_bottom
  23. ase_theme_post_after
Body
ase_theme_body_before
ase_theme_body_inside_top
ase_theme_body_inside_bottom
ase_theme_body_after

Header
ase_theme_header_before
ase_theme_header_inside_top
ase_theme_header_inside_bottom
ase_theme_header_after

Sidebars
ase_theme_sb_before
ase_theme_sb_inside_top
ase_theme_sb_inside_bottom
ase_theme_sb_after

Posts
ase_theme_post_before
ase_theme_post_inside_top
ase_theme_post_inside_bottom
ase_theme_post_after

Hooks

All components with the exception of chapter and timeline have a minimum of four standard hooks. Some components may have more than these standard four, so refer to the hooks documentation below for more on those specific hooks.

Base Hooks

aesop_inside_body_top

This hook is implemented by themes, and is used by the timeline component to insert the navigation.

Component Hooks

The four standard hooks are as follows. Hooks are denoted in double brackets.

{{ aesop_COMPONENTNAME_before }}
{{ aesop_COMPONENTNAME_inside_top }}
{{ aesop_COMPONENTNAME_inside_bottom }}
{{ aesop_COMPONENTNAME_after }}


Image Component Hooks
  1. {{ aesop_image_before }}
  2.  
  3. <section class="aesop-component aesop-image-component">{{ aesop_image_inside_top }}<figure class="aesop-content">
  4. <div class="aesop-image-component-image aesop-component-align-ALIGN aesop-image-component-caption-CAPTIONPOSITION">
  5. <div class="aesop-image-component-image aesop-component-align-ALIGN aesop-image-component-caption-CAPTIONPOSITION">{{ aesop_image_inner_inside_top }}
  6. // only drawn if lightbox is on
  7. <p class="aesop-img-enlarge"><i class="aesopicon aesopicon-search-plus"></i> Enlarge</p>
  8. <img style="width: IMGWIDTH;" src="IMG" alt="IMGALT" />
  9.  
  10. </div>
  11. </div>
  12. <figcaption class="aesop-image-component-caption">
  13. CAPTION
  14. // only drawn if captioncredit is filled out</figcaption>
  15. <div class="aesop-image-component-image aesop-component-align-ALIGN aesop-image-component-caption-CAPTIONPOSITION">
  16.  
  17.  
  18. <p class="aesop-cap-cred">CREDIT</p>
  19. {{ aesop_image_inner_inside_bottom }}
  20.  
  21. </div>
  22. </figure>{{ aesop_image_inside_bottom }}
  23.  
  24. </section>{{ aesop_image_after }}
{{ aesop_image_before }}

<section class="aesop-component aesop-image-component">{{ aesop_image_inside_top }}<figure class="aesop-content">
<div class="aesop-image-component-image aesop-component-align-ALIGN aesop-image-component-caption-CAPTIONPOSITION">
<div class="aesop-image-component-image aesop-component-align-ALIGN aesop-image-component-caption-CAPTIONPOSITION">{{ aesop_image_inner_inside_top }}
// only drawn if lightbox is on
<p class="aesop-img-enlarge"><i class="aesopicon aesopicon-search-plus"></i> Enlarge</p>
<img style="width: IMGWIDTH;" src="IMG" alt="IMGALT" />

</div>
</div>
<figcaption class="aesop-image-component-caption">
CAPTION
// only drawn if captioncredit is filled out</figcaption>
<div class="aesop-image-component-image aesop-component-align-ALIGN aesop-image-component-caption-CAPTIONPOSITION">

 
<p class="aesop-cap-cred">CREDIT</p>
{{ aesop_image_inner_inside_bottom }}

</div>
</figure>{{ aesop_image_inside_bottom }}

</section>{{ aesop_image_after }}

Character Component Hooks
  1. {{ aesop_character_before }}
  2.  
  3. <aside class="aesop-character-component">{{ aesop_character_inside_top }}
  4. <div class="aesop-character-inner aesop-content ">
  5. <div class="aesop-character-float aesop-character-ALIGN">{{ aesop_character_inner_inside_top }}
  6. <span class="aesop-character-title">%s</span>
  7. <img class="aesop-character-avatar" src="IMG" alt="IMGALT" />
  8. <div class="aesop-character-text">CONTENT</div>
  9. <p class="aesop-character-cap">CAPTION</p>
  10. {{ aesop_character_inner_inside_bottom }}
  11.  
  12. </div>
  13. </div>
  14. {{ aesop_character_inside_bottom }}
  15.  
  16. </aside>{{ aesop_character_after }}
{{ aesop_character_before }}

<aside class="aesop-character-component">{{ aesop_character_inside_top }}
<div class="aesop-character-inner aesop-content ">
<div class="aesop-character-float aesop-character-ALIGN">{{ aesop_character_inner_inside_top }}
<span class="aesop-character-title">%s</span>
<img class="aesop-character-avatar" src="IMG" alt="IMGALT" />
<div class="aesop-character-text">CONTENT</div>
<p class="aesop-character-cap">CAPTION</p>
{{ aesop_character_inner_inside_bottom }}

</div>
</div>
{{ aesop_character_inside_bottom }}

</aside>{{ aesop_character_after }}

Quote Component Hooks
  1. {{ aesop_quote_before }}
  2.  
  3. <section id="aesop-quote-component-HASH" class="aesop-component aesop-quote-component WIDTH">{{ aesop_quote_inside_top }}
  4. <blockquote>CONTENT</blockquote>
  5. {{ aesop_quote_inside_bottom }}
  6.  
  7. </section>{{ aesop_quote_after }}
{{ aesop_quote_before }}

<section id="aesop-quote-component-HASH" class="aesop-component aesop-quote-component WIDTH">{{ aesop_quote_inside_top }}
<blockquote>CONTENT</blockquote>
{{ aesop_quote_inside_bottom }}

</section>{{ aesop_quote_after }}

Content Component Hooks
  1. {{ aesop_cbox_before }}
  2.  
  3. <section class="aesop-component aesop-content-component">{{ aesop_cbox_inside_top }}
  4. <div id="aesop-content-component-HASH" class="TYPECLASS">{{ aesop_cbox_content_inside_top }}
  5. <div class="aesop-content-comp-inner">CONTENT</div>
  6. {{ aesop_cbox_content_inside_bottom }}
  7.  
  8. </div>
  9. {{ aesop_cbox_inside_bottom }}
  10.  
  11. </section>{{ aesop_cbox_after }}
{{ aesop_cbox_before }}

<section class="aesop-component aesop-content-component">{{ aesop_cbox_inside_top }}
<div id="aesop-content-component-HASH" class="TYPECLASS">{{ aesop_cbox_content_inside_top }}
<div class="aesop-content-comp-inner">CONTENT</div>
{{ aesop_cbox_content_inside_bottom }}

</div>
{{ aesop_cbox_inside_bottom }}

</section>{{ aesop_cbox_after }}

Chapter Heading Hooks
  1. {{ aesop_chapter_before }}
  2.  
  3. // if video is bg type
  4.  
  5. <section id="chapter-hash-HASH" class="aesop-article-chapter-wrap default-cover aesop-video-chapter aesop-component">{{ aesop_chapter_inside_top }}
  6. <div class="aesop-article-chapter clearfix" style="height: auto;"><span class="aesop-chapter-title">LABEL</span>
  7. <h2 class="aesop-cover-title">TITLE<small>SUBTITLE</small></h2>
  8. <div class="video-container">
  9.  
  10.  
  11. </div>
  12. </div>
  13. {{ aesop_chapter_inside_bottom }}
  14.  
  15. </section>// else if img is bg type
  16.  
  17. <section id="chapter-hash-HASH" class="aesop-article-chapter-wrap default-cover aesop-component">{{ aesop_chapter_inside_top }}
  18. <div class="aesop-article-chapter clearfix" style="background: url(‘IMG’) center center; background-size: cover;"><span class="aesop-chapter-title">LABEL</span>
  19. <h2 class="aesop-cover-title">TITLE<small>SUBTITLE</small></h2>
  20. </div>
  21. {{ aesop_chapter_inside_bottom }}
  22.  
  23. </section>{{ aesop_chapter_after }}
{{ aesop_chapter_before }}

// if video is bg type

<section id="chapter-hash-HASH" class="aesop-article-chapter-wrap default-cover aesop-video-chapter aesop-component">{{ aesop_chapter_inside_top }}
<div class="aesop-article-chapter clearfix" style="height: auto;"><span class="aesop-chapter-title">LABEL</span>
<h2 class="aesop-cover-title">TITLE<small>SUBTITLE</small></h2>
<div class="video-container">

IMG

</div>
</div>
{{ aesop_chapter_inside_bottom }}

</section>// else if img is bg type

<section id="chapter-hash-HASH" class="aesop-article-chapter-wrap default-cover aesop-component">{{ aesop_chapter_inside_top }}
<div class="aesop-article-chapter clearfix" style="background: url('IMG') center center; background-size: cover;"><span class="aesop-chapter-title">LABEL</span>
<h2 class="aesop-cover-title">TITLE<small>SUBTITLE</small></h2>
</div>
{{ aesop_chapter_inside_bottom }}

</section>{{ aesop_chapter_after }}

Parallax Component Hooks
  1. {{ aesop_parallax_before }}
  2.  
  3. <section class="aesop-character-component">{{ aesop_parallax_inside_top }}
  4. <figure class="aesop-parallax-sc aesop-parallax-sc-HASH" style="height: HEIGHT;">{{ aesop_parallax_inner_inside_top }}
  5. <div class="aesop-parallax-sc-floater floater-FLOATERPOSITION">FLOATERMEDIA</div>
  6. <figcaption class="aesop-parallax-sc-caption-wrap CAPTIONPOSITION">
  7. CAPTION
  8. </figcaption>
  9. // drawn if lightbox is on
  10. <a class="aesop-lb-link swipebox" title="CAPTION" href="IMGPATH" rel="lightbox">
  11. <i class="aesopicon aesopicon-search-plus"></i>
  12. </a>
  13. {{ aesop_parallax_inner_inside_bottom }}
  14. <div class="aesop-parallax-sc-img %s"></div>
  15. </figure>{{ aesop_parallax_inside_bottom }}
  16.  
  17. </section>{{ aesop_parallax_after }}
{{ aesop_parallax_before }}

<section class="aesop-character-component">{{ aesop_parallax_inside_top }}
<figure class="aesop-parallax-sc aesop-parallax-sc-HASH" style="height: HEIGHT;">{{ aesop_parallax_inner_inside_top }}
<div class="aesop-parallax-sc-floater floater-FLOATERPOSITION">FLOATERMEDIA</div>
<figcaption class="aesop-parallax-sc-caption-wrap CAPTIONPOSITION">
CAPTION
</figcaption>
// drawn if lightbox is on
<a class="aesop-lb-link swipebox" title="CAPTION" href="IMGPATH" rel="lightbox">
<i class="aesopicon aesopicon-search-plus"></i>
</a>
{{ aesop_parallax_inner_inside_bottom }}
<div class="aesop-parallax-sc-img %s"></div>
</figure>{{ aesop_parallax_inside_bottom }}

</section>{{ aesop_parallax_after }}

Audio Component Hooks
  1. {{ aesop_audio_before }}
  2.  
  3. <aside class="aesop-component aesop-audio-component">{{ aesop_audio_inside_top }}echo wp_audio_shortcode( SRC );{{ aesop_audio_inside_bottom }}
  4.  
  5. </aside>{{ aesop_audio_after }}
{{ aesop_audio_before }}

<aside class="aesop-component aesop-audio-component">{{ aesop_audio_inside_top }}echo wp_audio_shortcode( SRC );{{ aesop_audio_inside_bottom }}

</aside>{{ aesop_audio_after }}

Video Component Hooks
  1. {{ aesop_video_before }}
  2.  
  3. <section class="aesop-component aesop-video-component">{{ aesop_video_inside_top }}
  4. <div class="aesop-video-container aesop-video-container-HASH aesop-component-align-ALIGN SRC">VIDEO IFRAME</div>
  5. <div class="aesop-video-component-caption aesop-component-align-ALIGN">CAPTION</div>
  6. {{ aesop_video_inside_bottom }}
  7.  
  8. </section>{{ aesop_video_after }}
{{ aesop_video_before }}

<section class="aesop-component aesop-video-component">{{ aesop_video_inside_top }}
<div class="aesop-video-container aesop-video-container-HASH aesop-component-align-ALIGN SRC">VIDEO IFRAME</div>
<div class="aesop-video-component-caption aesop-component-align-ALIGN">CAPTION</div>
{{ aesop_video_inside_bottom }}

</section>{{ aesop_video_after }}

Map Component Hooks
  1. {{ aesop_map_before }}
  2.  
  3. <section class="aesop-component aesop-map-component"></section>{{ aesop_map_after }}
{{ aesop_map_before }}

<section class="aesop-component aesop-map-component"></section>{{ aesop_map_after }}

Timeline Component Hooks
  1. {{ aesop_timeline_before }}
  2. <h2 class="aesop-timeline-stop">NUM</h2>
  3. {{ aesop_timeline_before }}
{{ aesop_timeline_before }}
<h2 class="aesop-timeline-stop">NUM</h2>
{{ aesop_timeline_before }}

Document Component Hooks
  1. {{ aesop_document_before }}
  2.  
  3. <aside class="aesop-document-component aesop-content">{{ aesop_document_inside_top }}<a class="aesop-doc-reveal-HASH" href="#">document
  4. CAPTION</a>
  5. <div id="aesop-doc-collapse-HASH" class="aesop-content" style="display: none;">SRC</div>
  6. {{ aesop_document_inside_bottom }}
  7.  
  8. </aside>{{ aesop_document_after }}
{{ aesop_document_before }}

<aside class="aesop-document-component aesop-content">{{ aesop_document_inside_top }}<a class="aesop-doc-reveal-HASH" href="#">document
CAPTION</a>
<div id="aesop-doc-collapse-HASH" class="aesop-content" style="display: none;">SRC</div>
{{ aesop_document_inside_bottom }}

</aside>{{ aesop_document_after }}

Gallery Component Hooks
  1. {{ aesop_gallery_before, ID , TYPE }}
  2.  
  3. <section class="aesop-component aesop-gallery-component aesop-A_TYPE-gallery-wrap">{{ aesop_gallery_inside_top, ID , TYPE }}//thumb gallery
  4. <div id="aesop-thumb-gallery-ID" class="fotorama"><img src="SRC" alt="ALT" data-caption="CAPTION" /></div>
  5. // grid gallery
  6. <div id="aesop-grid-gallery-ID" class="aesop-grid-gallery aesop-grid-gallery"><img src="SRC" alt="ALT" /></div>
  7. // stacked gallery
  8. <div class="aesop-stacked-img" style="background-image: url(‘SRC’); background-size: cover;">
  9. <div class="aesop-stacked-caption">CAPTION</div>
  10. </div>
  11. // sequenced gallery
  12.  
  13. <figure class="aesop-sequence-img-wrap"><img class="aesop-sequence-img" src="IMG" alt="ALT" />
  14. // if caption is present
  15. <figcaption class="aesop-content aesop-component-caption aesop-sequence-caption">CAPTION</figcaption></figure>// if gallery has a caption
  16. <p class="aesop-component-caption">CAPTION</p>
  17. {{ aesop_gallery_inside_bottom, ID , TYPE }}
  18.  
  19. </section>{{ aesop_gallery_after, ID , TYPE }}
{{ aesop_gallery_before, ID , TYPE }}

<section class="aesop-component aesop-gallery-component aesop-A_TYPE-gallery-wrap">{{ aesop_gallery_inside_top, ID , TYPE }}//thumb gallery
<div id="aesop-thumb-gallery-ID" class="fotorama"><img src="SRC" alt="ALT" data-caption="CAPTION" /></div>
// grid gallery
<div id="aesop-grid-gallery-ID" class="aesop-grid-gallery aesop-grid-gallery"><img src="SRC" alt="ALT" /></div>
// stacked gallery
<div class="aesop-stacked-img" style="background-image: url('SRC'); background-size: cover;">
<div class="aesop-stacked-caption">CAPTION</div>
</div>
// sequenced gallery

<figure class="aesop-sequence-img-wrap"><img class="aesop-sequence-img" src="IMG" alt="ALT" />
// if caption is present
<figcaption class="aesop-content aesop-component-caption aesop-sequence-caption">CAPTION</figcaption></figure>// if gallery has a caption
<p class="aesop-component-caption">CAPTION</p>
{{ aesop_gallery_inside_bottom, ID , TYPE }}

</section>{{ aesop_gallery_after, ID , TYPE }}

Collections Component Hooks
  1. {{ aesop_collection_before }}
  2.  
  3. <section class="aesop-story-collection">{{ aesop_collection_inside_top }}// only drawn if title is filled out
  4. <h4 class="aesop-story-collection-title">TITLE</h4>
  5. <div id="aesop-collection-HASH" class="aesop-collection-grid clearfix">
  6. <div class="aesop-collection-item">
  7. <div class="aesop-collection-item-inner">
  8. <h2 class="aesop-collection-entry-title">TITLE</h2>
  9. <p class="aesop-collection-meta">Written by AUTHOR</p>
  10.  
  11. <div class="aesop-collection-item-excerpt">EXCERPT</div>
  12. </div>
  13. </div>
  14. </div>
  15. {{ aesop_collection_inside_bottom }}
  16.  
  17. </section>{{ aesop_collection_after }}
{{ aesop_collection_before }}

<section class="aesop-story-collection">{{ aesop_collection_inside_top }}// only drawn if title is filled out
<h4 class="aesop-story-collection-title">TITLE</h4>
<div id="aesop-collection-HASH" class="aesop-collection-grid clearfix">
<div class="aesop-collection-item">
<div class="aesop-collection-item-inner">
<h2 class="aesop-collection-entry-title">TITLE</h2>
<p class="aesop-collection-meta">Written by AUTHOR</p>

<div class="aesop-collection-item-excerpt">EXCERPT</div>
</div>
</div>
</div>
{{ aesop_collection_inside_bottom }}

</section>{{ aesop_collection_after }}

Filters

ASE currently has 34 filters and 63 hooks to change everything from scroll offsets, to adding custom css classes. This list is updated weekly.

Updated 05.04.14.

Galleries

ai_galleries

Filter the arguments for the galleries post type.

aesop_gallery_query

Filter the ASE gallery component query.

aesop_grid_gallery_spacing

Filter the default distance between the grid gallery items.

Video

aesop_video_defaults

Filter the default video attribtues.

Character

aesop_character_defaults

Default character attributes.

Collection

aesop_collection_defaults

Default collection component attributes.

aaesop_collection_query

Filter the WordPress query that pulls the category stories.

aaesop_splash_query

Filter the WordPress query that pulls the categories when in Splash mode.

Document

aesop_document_defaults

Default attributes for document component.

aesop_document_output

Filter or modify the markup of the document component.

Chapter

aesop_chapter_defaults

Default chapter attributes.

aesop_chapter_scroll_offset

Filter or change the offset scroll distance of a Chapter marker when clicked. Here’s an example:

  1. add_filter("aesop_chapter_scroll_offset","myaddchapteroffset");
  2. function myaddchapteroffset(){
  3. return 100;
  4. }
add_filter("aesop_chapter_scroll_offset","myaddchapteroffset");
function myaddchapteroffset(){
return 100;
}

aesop_chapter_scroll_container

Filter the css class of the parent article div used for capturing scroll-headings.

aesop_chapter_nav_container

Filter the css class of the div used to insert the chapter navigation elements.

Image

aesop_image_defaults

Filters the default image attributes.

Map

aesop_map_defaults

Filters the default map attributes.

aesop_map_meta_location

Filters the location where the map meta will be shown in admin.

aesop_map_tile_provider

Filter or change the provider for map tiles. Ref Github

  1. add_filter("aesop_map_tile_provider","test_map_filter", 10, 2);
  2. function test_map_filter($provider, $postid) {
  3. if(2211 == $postid) {
  4. $provider = "stamen-toner";
  5. } else {
  6. $provider = "mapbox";
  7. }
  8. return $provider;
  9.  
  10. }
add_filter("aesop_map_tile_provider","test_map_filter", 10, 2);
function test_map_filter($provider, $postid) {
if(2211 == $postid) {
$provider = "stamen-toner";
} else {
$provider = "mapbox";
}
return $provider;

}

Parallax

aesop_parallax_defaults

Filters the default parallax component attributes.

Quote

aesop_quote_defaults

Filter the default quote component attributes.

aesop_quote_size_unit

Filter the unit of size used for the blockquote.

Timeline

aesop_timeline_defaults

Filters the default component attributes.

aesop_timeline_output

Filters the output of the timeline heading.

aesop_timeline_scroll_offset

Filter the offset scroll distance when a Timeline marker is clicked.

aesop_timeline_scroll_container

Filter the css class of the parent article div used for capturing scroll-headings.

Video

aesop_video_defaults

Filters the default video attributes.

Misc Filters

aesop_avail_components

Filters the list of included components.

ai_activation_notification

Filters the activation message.

ai_deactivation_error_message

Filters the text for the deactivation error message.

aesop_generator_button

Filters the markup for the button used to trigger the component modal popup in admin.

aesop_COMPONENTNAME_component_classes

Use this filter to add custom CSS classes to any component. Here’s an example of how to add two classes, red and blue, to the quote component.

  1. add_filter("aesop_quote_component_classes","myaddclasses");
  2. function myaddclasses(){
  3. return "red blue";
  4. }
add_filter("aesop_quote_component_classes","myaddclasses");
function myaddclasses(){
return "red blue";
}

Helpers

New shortcode added in Aesop 1.0.4 that allows site owners to center content. Due to the way Aesop themes function (width applied to div elements and not div), some 3rd party items like Jetpack sharing may fall outside of the container. Wrapping those items in this shortcode will center it in your Aesop theme.

aesop_component_exists($component);

New function added in Aesop 1.0.6 that detects whether or not a component exist in the page content. Simply pass the name of the component as a string.

Add-on API

Aesop Story Engine 1.1 introduces version 0.9 of the add-on API that allows for the creation of custom story components. If you know how to write a shortcode, then you’ll know how to build add-ons.

You can find a sample add-on on Github here.

Option Types

ASE API Version 0.9 has a few option types to utilize within the generator.

  • select – dropdown select menu accepts array of options or helper function
  • text – standard text area
  • text_small – small text area
  • text_area – large text area
  • media_upload – allows user to choose from media library
  • color – produces color picker

Option Helpers

ASE API Version 0.9 has a few helper option types. These are used within your option array (mostly select dropdowns). The posts helper, for example, pulls in all posts for the user to select with the dropdown. The value is the postid. See here for an examples of how these are implemented.

aesop_option_get_posts($type)

Retrieve all posts. Default type is ‘post’. S

aesop_option_get_categories($type)

Retrieve all categories by type. Default type is ‘post’.

aesop_option_counter($count)

Used to build a counter dropdown where the value is the integer. Default count is 10.