* Description: Twitter tools.
* Version: 0.1
* Author: Petr Cibulka
* Author URI: http://cibulka.me/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
namespace Cibulka\Plugin\Social;

if (!defined('ABSPATH')) {
    die;
}
// =========================================================================
// DIC
// =========================================================================
$dic = new \Cibulka\Plugin\Base\Dic\DIC();
// Twitter
// -----------------------------------------------------------------
$dic['Twitter'] = $dic->factory(function (array $args) use($dic) {
    $config = new \Cibulka\Plugin\Base\Config\Config();
    $oauth = new \Abraham\TwitterOAuth\TwitterOAuth(CIB_TWITTER_CONSUMER, CIB_TWITTER_CONSUMER_S, CIB_TWITTER_ACCESS, CIB_TWITTER_ACCESS_S);
    $oauth->ssl_verifypeer = true;
    $twitter = new Get\Twitter($oauth, $args);
    return $twitter;
});
// Last.fm
// -----------------------------------------------------------------
$dic['Last_FM'] = $dic->factory(function () {
    $lf_api = LASTFM_API_KEY;
    $lf_api_s = LASTFM_API_S;
    $lastfm = new \Dandelionmood\LastFm\LastFm($lf_api, $lf_api_s);
* Description: Theme utilities.
* Version: 0.1
* Author: Petr Cibulka
* Author URI: http://cibulka.me/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
namespace Cibulka\Plugin\Theme;

if (!defined('ABSPATH')) {
    die;
}
// =========================================================================
// DIC
// =========================================================================
$dic = new \Cibulka\Plugin\Base\Dic\DIC();
// -----------------------------------------------------------------
// INIT
// -----------------------------------------------------------------
$dic['init_template_wrapper'] = function () {
    add_filter('template_include', array(__NAMESPACE__ . '\\Template\\TemplateWrapper', 'init'), 99);
};
$dic['init_search_url'] = function ($page_slug) {
    add_action('template_redirect', function () use($page_slug) {
        if (is_search() && !empty($_GET['s'])) {
            wp_redirect(home_url("/search/") . urlencode(get_query_var('s')));
            exit;
        }
    });
};
$dic['init_wp_title'] = function ($callback = null) use($dic) {