hyunsupul / aesop-core

Open-sourced suite of components that empower interactive storytelling in WordPress.
http://aesopstoryengine.com
GNU General Public License v2.0
244 stars 56 forks source link

load aesop in custom admin page #144

Closed da1nonly closed 10 years ago

da1nonly commented 10 years ago

hi is there a hook to add custom list where aesop should load in admin i.e i want to add admin.php to $aesop_generator_includes_pages . i can hardcoded it in class-aesop-core-admin.php but ideally i wanted a hook so that the plugin can be updated while having the custom modification.

da1nonly commented 10 years ago

on a side note checkout https://www.zenhub.io/ , will help improve github userbility

bearded-avenger commented 10 years ago

Added a filter for this. Pass an array of pages. Here's adding admin. Let us know how you go about.

add_filter('aesop_generator_loads_on', 'my_array');
function my_array(){
    $array = array('admin.php', 'post.php', 'edit.php', 'post-new.php', 'index.php');
    return $array;
}
da1nonly commented 10 years ago

i have added the code but it was not working, it looks like the values are hardcoded in for now i just manual to the array and it works.

$aesop_generator_includes_pages = array( 'post.php', 'edit.php', 'post-new.php', 'index.php', 'admin.php' );

bearded-avenger commented 10 years ago

This is in the dev branch. And the values are not hardcoded. https://github.com/bearded-avenger/aesop-core/commit/ffe71b585de412a8b3ee922467c40cac1677c4e0