Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Commit

Permalink
added way to specify extra head html from kohana. eg meta, scripts, css.
Browse files Browse the repository at this point in the history
  • Loading branch information
mclin authored and kerkness committed Dec 15, 2009
1 parent b296687 commit c081d40
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions kohana-for-wordpress.php
Expand Up @@ -17,7 +17,7 @@
register_deactivation_hook( 'kohana-for-wordpress/kohana-for-wordpress.php', 'kohana_deactivate' );
add_action('admin_menu', 'kohana_register_admin_menu');
add_action('widgets_init', create_function('', 'return register_widget("KohanaWidget");'));

add_action('wp_head', 'kohana_wp_head');

/**
* Register Filters
Expand Down Expand Up @@ -56,7 +56,15 @@ function kohana_page_template_filter($template) {
return $template;
}


/**
* print any extra_head html that has been assigned to the Kohana request.
*/
function kohana_wp_head() {
global $wp;
if (is_kohana_request() AND $wp->kohana->extra_head) {
print $wp->kohana->extra_head;
}
}

/**
* If plugin has already been set up
Expand Down Expand Up @@ -552,6 +560,9 @@ function kohana_page_request($kr)
if( $req->title ){
$wp->kohana->title = $req->title;
}
if( $req->extra_head ){
$wp->kohana->extra_head = $req->extra_head;
}
return $req->response;
}

Expand Down

0 comments on commit c081d40

Please sign in to comment.