More information coming soon, but in the meantime, please note that the following familiar functions are available:
- add_action() / do_action()
- add_filter() / apply_filters()
In addition, for this first release, we have also bundled 3 "mu-plugins" to in order to show what is possible:
- download_counter - add the Media ID for your ZIP file and let GridFS handle the storage, serving and tracking of downloads.
This plugin adds a widget to the default theme sidebar.
- default_header - add the Media ID for your image file and let GridFS handle the storage, serving and viewing of images.
This plugin allows you to control the image in the default theme header.
- analytics_footer - simple plugin for adding Google Analytics tracking code to the footer.
The difference between "mp-content/mu-plugins" and "mp-content/plugins" is that mu (Must-Use) plugins will automatically be activated and included, where as other plugins will need to be manually activated, which is not yet possible... :-)
For a quick run-down of the last-minute addition of a basic options framework for MongoPress, the magic of options is accomplished through the following functions:
- add_action('the_place_you_want_to_run_the_plugin_by_hook_name','the_name_of_your_new_function_to_run');
- add_action('mp_content_block_content_article_< REPLACE WITH NAME OF PLUGIN >','this_is_the_only_way_to_add_plugin_options_and_must_follow_this_exact_format',1,5);
Dig into the example currently included in core, which will alter be refined as our options API becomes more matured.
These filters can be accessed with the following options:
- apply_filters('mp_admin_meta_charset',$default_meta_charset,$perma);
- apply_filters('mp_admin_meta_description',$default_meta_description,$perma);
- apply_filters('mp_admin_meta_author',$default_meta_author,$perma);
- apply_filters('mp_logo_login',$image_url');
- apply_filters('mp_html_class',$class);
- apply_filters('mp_html_lang',$lang);
- apply_filters('mp_page_title',$title);
- apply_filters('mp_get_content',$content,$this_mongo_id);
- apply_filters('mp_article_excerpt',$excerpt);
- apply_filters('mp_article_title',$title);
- apply_filters('mp_article_content',$content);
- apply_filters('mp_content_block_content_'.$type.'_'.$id',$content,$type,$id,$class,$href);
- apply_filters('mp_content_block_content_'.$type.'_'.$class',$content,$type,$id,$class,$href);
- apply_filters('mp_content_block_content',$content,$type,$id,$class,$href);
- apply_filters('mp_admin_js_to_load',$default_scripts);
- apply_filters('mp_theme_js_to_load',$default_scripts);
- apply_filters('mp_attributes',$attributes,$file_name,$tag_type,$url,$id,$classes);
These action hooks have the following options:
- do_action('mp_footer');
- do_action('mp_header');
- do_action('mp_admin_header_start');
- do_action('mp_admin_header_end');
- do_action('mp_before_admin_footer');
- do_action('mp_after_admin_footer');
- do_action('mp_login_form_start',$is_logged_in);
- do_action('mp_login_form_end',$is_logged_in);
- do_action('mp_default_sidebar_top');
- do_action('mp_default_sidebar_bottom');
- do_action('mp_before_block_'.$type.'_'.$class,$type,$id,$class,$content');
- do_action('mp_before_block_'.$type.'_'.$id,$type,$id,$class,$content');
- do_action('mp_after_block_'.$class,$type,$id,$class,$content');
- do_action('mp_after_block_'.$id,$type,$id,$class,$content');
Now that MongoPress is out in the wild, we will be adding more hooks and filters as required and or requested...