.arrowchat-clickable-area{padding:5px 5px 5px 5px;} .arrowchat-clickable-area:hover{display:block;width:100%;background-color:#3d6f99;padding5px 5px 5px 5px;} .arrowchat-clickable-area a:link,.arrowchat-clickable-area a:visited{color:#333;text-decoration:none;} .arrowchat-clickable-area a:active,.arrowchat-clickable-area a:hover{color:#fff;text-decoration:none;}');echo get_option('arwcht_hooks_head_admin'); echo get_option('arwcht_hooks_head_ubiquitous');echo ("
");}
/**
* Echoes whatever the user wants in the admin footer.
*/
function arwcht_hooks_footer_admin() { echo get_option('arwcht_hooks_footer_admin'); echo get_option('arwcht_hooks_footer_ubiquitous'); }
/**
* The hooks options page
*/
function arwcht_hooks_options_page() {
// implode the config option keys for use in the page_options hidden field
$plugin_options = implode(',', array_keys(arwcht_hooks_get_default_options()));
?>
$v) {
register_setting('arwcht-hooks-options', $k);
}
}
/**
* Adds admin nav.
*/
function arwcht_hooks_admin() {
add_options_page('Arrowchat', 'Arrowchat', 'edit_files', __FILE__, 'arwcht_hooks_options_page');
}
/**
* Adds settings link in the plugin listing.
*/
function arwcht_hooks_filter_plugin_actions($links, $file){
static $this_plugin;
if( !$this_plugin ) $this_plugin = plugin_basename(__FILE__);
if( $file == $this_plugin ){
$settings_link = '' . __('Settings') . '';
$links = array_merge( array($settings_link), $links); // before other links
}
return $links;
}
/**
* Install this plugin
*/
function arwcht_hooks_install() {
// add any new options, leaving old values untouched
$opts = arwcht_hooks_get_default_options();
foreach($opts as $k=>$v) {
if (get_option($k) === FALSE) {
add_option($k, $v);
}
}
}
/**
* Uninstall this plugin
*/
function arwcht_hooks_uninstall() {
// remove options
$opts = arwcht_hooks_get_default_options();
foreach($opts as $k=>$v) {
delete_option($k);
}
}
/**
* Default options.
*/
function arwcht_hooks_get_default_options() {
$opts = array(
'arwcht_hooks_version' => $arwcht_hooks_version,
'arwcht_hooks_head' => '',
'arwcht_hooks_footer' => '',
'arwcht_hooks_head_admin' => '',
'arwcht_hooks_footer_admin' => '',
'arwcht_hooks_head_ubiquitous' => '',
'arwcht_hooks_footer_ubiquitous' => ''
);
return $opts;
}
// install / uninstall
register_activation_hook(__FILE__,'arwcht_hooks_install');
register_deactivation_hook(__FILE__, 'arwcht_hooks_uninstall');
// admin stuff
add_action('admin_init', 'arwcht_hooks_init');
add_action('admin_menu', 'arwcht_hooks_admin');
add_filter('plugin_action_links', 'arwcht_hooks_filter_plugin_actions', 10, 2);
// do the work of this plugin!
add_action('wp_head', 'arwcht_hooks_head');
add_action('wp_footer', 'arwcht_hooks_footer');
add_action('admin_head', 'arwcht_hooks_head_admin');
add_action('admin_footer', 'arwcht_hooks_footer_admin');
?>