Example #1
0
function get_head_template()
{
    ?>
<head>
    <meta charset="UTF-8">
    <title>KENYANKE</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" type="text/css" href="<?php 
    echo get_template_directory_uri();
    ?>
/sanitize.css">
    <link rel="stylesheet" type="text/css" href="<?php 
    echo get_template_directory_uri();
    ?>
/style.css">
    <!-- Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-67612178-1', 'auto');
      ga('send', 'pageview');

    </script>
    <?php 
    wp_head();
    ?>
</head>

<?php 
}
/**
 * Email header for hooking scripts and stylesheet for admin
 * 
 * @return void
 */
function wcng_email_header()
{
    if (wcng_current_user_can_edit_newsletter()) {
        wp_head();
    }
    do_action('wcng_email_header');
}
 public function wordpressAction(Request $request)
 {
     $this->get('wordpress.loader')->load();
     $this->get('wordpress.loader')->loadPostInWordpressFromRequest($request);
     remove_theme_support('custom-header');
     remove_action('wp_head', 'wp_enqueue_scripts', 1);
     remove_action('wp_head', 'feed_links', 2);
     remove_action('wp_head', 'feed_links_extra', 3);
     remove_action('wp_head', 'rsd_link');
     remove_action('wp_head', 'wlwmanifest_link');
     remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
     remove_action('wp_head', 'locale_stylesheet');
     remove_action('wp_head', 'noindex', 1);
     remove_action('wp_head', 'wp_print_styles', 8);
     remove_action('wp_head', 'wp_print_head_scripts', 9);
     remove_action('wp_head', 'wp_generator');
     remove_action('wp_head', 'rel_canonical');
     remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
     ob_start();
     @wp_head();
     $head = ob_get_clean();
     ob_start();
     $content = dynamic_sidebar('sidebar-2');
     $side = ob_get_clean();
     ob_start();
     the_content();
     $content = ob_get_clean();
     $post = array('content' => $content);
     return $this->render($this->container->getParameter('wordpress.template'), array('post' => $post));
 }
 function get_rendered_item()
 {
     $item_id = explode('-', $_REQUEST['id']);
     if (count($item_id) == 2) {
         global $wp_query;
         query_posts('page_id=' . $item_id[0]);
         query_posts(array('p' => $item_id[0], 'post_type' => $item_id[1]));
         ob_start();
         wp_head();
         $header = ob_get_contents();
         ob_end_clean();
         ob_start();
         include RHC_PATH . 'templates/calendar-single-post.php';
         $content = ob_get_contents();
         ob_end_clean();
         ob_start();
         wp_footer();
         $footer = ob_get_contents();
         ob_end_clean();
         $response = (object) array('R' => 'OK', 'MSG' => '', 'DATA' => array('body' => $content, 'footer' => $footer));
         die(json_encode($response));
     } else {
         die(json_encode(array('R' => 'ERR', 'MSG' => __('Invalid item id', 'rhc'))));
     }
 }
Example #5
0
/**
 * do before show content ajax
 */
function hw_ajax_before_content()
{
    $allow_head = isset($_REQUEST['include_head']) && $_REQUEST['include_head'] ? true : false;
    //call wp_head()
    if ($allow_head) {
        wp_head();
    }
}
Example #6
0
 public function wp_head()
 {
     if (is_singular() && get_option('thread_comments')) {
         wp_enqueue_script("comment-reply");
     }
     wp_head();
     do_action("pe_theme_wp_head");
 }
 public function renderPage($templateName, $templateVars = false)
 {
     echo $this->render('header', ChesterWPCoreDataHelpers::getBlogInfoData());
     wp_head();
     echo $this->render('header_close', array('siteTitleHTML' => self::renderSiteTitle()));
     echo $this->render($templateName, $templateVars);
     wp_footer();
     echo $this->render('footer');
 }
Example #8
0
 /**
  * Test that the emoji.json URL is passed.
  */
 function test_json_url_is_passed()
 {
     $post_id = $this->factory->post->create();
     $this->go_to(get_permalink($post_id));
     ob_start();
     wp_head();
     $head = ob_get_clean();
     $this->assertEquals(1, preg_match("/emoji_url: '[^']*emoji.json'/", $head));
 }
Example #9
0
 public function get_header()
 {
     // get the closing tag of the html head
     $pos = strpos($this->_header, '</head>');
     // echo the header and 'inject' the wp_head hook
     echo substr($this->_header, 0, $pos);
     wp_head();
     echo substr($this->_header, $pos);
 }
Example #10
0
function wptouch_head()
{
    if (is_single()) {
        add_action('wp_head', 'wptouch_canonical_link');
        remove_action('wp_head', 'rel_canonical');
    }
    do_action('wptouch_pre_head');
    wp_head();
    do_action('wptouch_post_head');
}
function tna_wp_head()
{
    ob_start();
    wp_head();
    $wp_head = ob_get_contents();
    ob_end_clean();
    global $pre_path;
    $wp_head = str_replace(site_url(), 'http://www.nationalarchives.gov.uk' . $pre_path, $wp_head);
    echo $wp_head;
}
Example #12
0
    /**
     * Generate Clink countdown page when is needed 
     */
    function clink_page_generator()
    {
        global $clink_url;
        global $post_id;
        $clink_powered_by_text = get_option('clink_powered_by_text');
        $clink_countdown_duration = get_option('clink_countdown_duration');
        if (!is_numeric($clink_countdown_duration) or empty($clink_countdown_duration)) {
            $clink_countdown_duration = 10;
        }
        ?>
		<!DOCTYPE html>
		<html>
			<head>
				<?php 
        echo '<title>' . get_the_title($post_id) . ' - ' . get_bloginfo('name') . '</title>';
        echo '<meta name="robots" content="noindex,nofollow"/>';
        wp_head();
        echo "<script>\n\t\t\t\t\t\tvar countdown_duration =" . $clink_countdown_duration . ";\n\t\t\t\t\t\tvar redirect_target_url ='" . $clink_url . "';\t\t\t\t\t\t\n\t\t\t\t\t</script>";
        ?>
			</head>
			<body <?php 
        body_class(get_bloginfo('language'));
        ?>
 <?php 
        if (is_rtl()) {
            echo 'dir="rtl"';
        }
        ?>
> 
				<div class="clink-page">
					<div class="container">
						<div class="clink-box">
							<p><?php 
        _e('You will redirect to the destination link In a moment', 'aryan-themes');
        ?>
</p>
							<div id="countdown"></div>
							<p class="problem"><?php 
        printf(__('If the page does not redirect automatically, click on <a href="%s">this link</a>', 'aryan-themes'), $clink_url);
        ?>
</p>
						</div>
					</div>
					<?php 
        if ($clink_powered_by_text === "1") {
            echo '<div class="aryan-themes"><p>';
            printf(__('Powered By <a href="%s">Aryan Themes</a>', 'aryan-themes'), 'http://aryanthemes.com');
            echo '</p></div>';
        }
        ?>
				</div>
			</body>
		</html>
	<?php 
    }
Example #13
0
function wptouch_core_header_enqueue()
{
    $version = get_bloginfo('version');
    if (!bnc_wptouch_is_exclusive()) {
        wp_enqueue_script('wptouch-core', '' . compat_get_plugin_url('wptouch') . '/themes/core/core.js', array('jquery'), '1.9');
        wp_head();
    } elseif (bnc_wptouch_is_exclusive()) {
        echo "<script src='" . get_bloginfo('wpurl') . "/wp-includes/js/jquery/jquery.js' type='text/javascript' charset='utf-8'></script>\n";
        echo "<script src='" . compat_get_plugin_url('wptouch') . "/themes/core/core.js' type='text/javascript' charset='utf-8'></script>\n";
    }
}
Example #14
0
function dite_zoom_shortcode($arg)
{
    global $wpdb, $post;
    wp_enqueue_script('jquery');
    wp_deregister_script('jquery-zoom');
    wp_enqueue_script('jquery-zoom', dite_zoom_pluginurl('js') . '/jquery.jqzoom-core.js');
    wp_enqueue_style('jquery-zoom', dite_zoom_pluginurl('css') . '/jquery.jqzoom.css');
    wp_head();
    $id = $arg['id'];
    include_once dite_zoom_pluginpath() . '/views/shortcode.php';
}
Example #15
0
 /**
  * Print head + template + footer
  *
  * @param string $templateName Template name to print
  * @param array $templateVars Parameters to template
  */
 public function renderPage($templateName, $templateVars = [])
 {
     // HEAD
     ob_start();
     wp_head();
     $wpHead = ob_get_clean();
     // FOOTER
     ob_start();
     wp_footer();
     $wpFooter = ob_get_clean();
     return $this->render($templateName, array_merge($templateVars, ['wp_head' => $wpHead, 'wp_footer' => $wpFooter]));
 }
 protected function process_edit_post_data($post_data)
 {
     foreach ($this->form_fields as $field) {
         $ok = $this->player->set($field->name, $field->value);
     }
     if (!count($this->form_error_fields)) {
         $this->player->save();
         wp_redirect($this->page_url(array('player_saved' => $this->player->get_id())));
         exit;
     } else {
         wp_head();
     }
 }
Example #17
0
function bizz_html_header()
{
    global $post;
    echo apply_filters('bizz_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">') . "\n";
    #filter
    ?>

<html xmlns="http://www.w3.org/1999/xhtml" <?php 
    language_attributes();
    ?>
>
<?php 
    // HEAD
    echo "<head" . apply_filters('bizz_head_profile', ' profile="http://gmpg.org/xfn/11"') . ">\n";
    #filter
    echo '<meta http-equiv="Content-Type" content="' . get_bloginfo('html_type') . '; charset=' . get_bloginfo('charset') . '" />' . "\n";
    #wp
    if (!is_admin()) {
        if (is_singular() && comments_open() && get_option('thread_comments') == 1) {
            wp_enqueue_script('comment-reply');
        }
    }
    #wp
    do_action('bizz_head_before');
    #hook
    do_action('bizz_head_title');
    #hook
    do_action('bizz_head_meta');
    #hook
    do_action('bizz_head_stylesheets');
    #hook
    do_action('bizz_head_links');
    #hook
    do_action('bizz_head_scripts');
    #hook
    wp_head();
    #wp #hook
    do_action('bizz_head_after');
    #hook
    echo '<link rel="pingback" href="' . get_bloginfo('pingback_url') . '" />' . "\n";
    #wp
    echo "</head>\n";
    #END <head> tag
    // BODY
    echo "<body " . apply_filters('bizz_body_class', 'class="' . implode(' ', get_body_class()) . '"') . ">\n";
    #filter
    do_action('bizz_body_after');
    #hook
    do_action('bizz_head_grid');
    #hook
}
    /**
     * The template for displaying <head> stuffs.
     *
     *
     * @package Customizr
     * @since Customizr 3.0
     */
    function tc_display_head()
    {
        ?>
		<head>
		    <meta charset="<?php 
        bloginfo('charset');
        ?>
" />
		    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
		    <title><?php 
        wp_title('|', true, 'right');
        ?>
</title>
		    <meta name="viewport" content="width=device-width, initial-scale=1.0">
		    <link rel="profile" href="http://gmpg.org/xfn/11" />
		    <?php 
        /* We add some JavaScript to pages with the comment form
         * to support sites with threaded comments (when in use).
         */
        if (is_singular() && get_option('thread_comments')) {
            wp_enqueue_script('comment-reply');
        }
        ?>

		  <!-- Favicon -->
		    <?php 
        do_action('__favicon');
        ?>
		    <link rel="pingback" href="<?php 
        bloginfo('pingback_url');
        ?>
" />
		   
		   <!-- Icons font support for IE6-7 -->
		    <!--[if lt IE 8]>
		      <script src="<?php 
        echo TC_BASE_URL;
        ?>
inc/css/fonts/lte-ie7.js"></script>
		    <![endif]-->
		    <?php 
        /* Always have wp_head() just before the closing </head>
         * tag of your theme, or you will break many plugins, which
         * generally use this hook to add elements to <head> such
         * as styles, scripts, and meta tags.
         */
        wp_head();
        ?>
		</head>
		<?php 
    }
Example #19
0
/**
 * Get standard HTML head for user in header.php
 * This function is needed if header.php is used in child themes
 */
function pl_standard_head($content)
{
    ?>
<!DOCTYPE html>
<html class="no-js" <?php 
    language_attributes();
    do_action('the_html_tag');
    ?>
>
    <head>
      <meta http-equiv="Content-Type" content="<?php 
    bloginfo('html_type');
    ?>
; charset=<?php 
    bloginfo('charset');
    ?>
" />
      <?php 
    printf(apply_filters('pl_xfn', '<link rel="profile" href="http://gmpg.org/xfn/11" />' . "\n      "));
    printf(apply_filters('pl_mobile_viewport', '<meta name="viewport" content="width=device-width, initial-scale=1">' . "\n"));
    ?>
      <?php 
    wp_head();
    ?>
    </head>
    <body <?php 
    body_class(pl_scheme_class('site_scheme'));
    ?>
><?php 
    pl_hook('pagelines_before_site');
    ?>
      <div id="site" class="site-wrap" ><?php 
    pl_hook('pagelines_before_page');
    ?>
        <div  class="site-wrap-pad"><?php 
    pl_hook('pagelines_site_wrap');
    ?>
            <div id="page" class="page-wrap"><?php 
    pl_hook('pagelines_page');
    ?>
                <div class="page-wrap-pad"><?php 
    pl_hook('pagelines_before_main');
    ?>

                <?php 
    echo $content;
    ?>

<?php 
}
 public function ajax_render_shortcode()
 {
     if (isset($_GET['shortcode'])) {
         $shortcode = urldecode($_GET['shortcode']);
         echo '<html><head>';
         wp_head();
         echo '</head><body><div class="wrapper">';
         echo do_shortcode($shortcode);
         echo '</div></body>';
         #wp_footer();
         echo '</html>';
     }
     exit;
 }
        /**
         * Displays what is inside the head html tag. Includes the wp_head() hook.
         *
         *
         * @package Customizr
         * @since Customizr 3.0
         */
        function tc_head_display()
        {
            ob_start();
            ?>
				<head>
				    <meta charset="<?php 
            bloginfo('charset');
            ?>
" />
				    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
				    <title><?php 
            wp_title('|', true, 'right');
            ?>
</title>
				    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
				    <link rel="profile" href="http://gmpg.org/xfn/11" />
				    <link rel="pingback" href="<?php 
            bloginfo('pingback_url');
            ?>
" />
				   
				   <!-- Icons font support for IE6-7  -->
				    <!--[if lt IE 8]>
				      <script src="<?php 
            echo TC_BASE_URL;
            ?>
inc/assets/css/fonts/lte-ie7.js"></script>
				    <![endif]-->
				    <?php 
            wp_head();
            ?>
				    <!--Icons size hack for IE8 and less -->
				    <!--[if lt IE 9]>
				      <link href="<?php 
            echo TC_BASE_URL;
            ?>
inc/assets/css/fonts/ie8-hacks.css" rel="stylesheet" type="text/css"/>
				    <![endif]-->
				</head>
				<?php 
            $html = ob_get_contents();
            if ($html) {
                ob_end_clean();
            }
            echo apply_filters('tc_head_display', $html);
        }
Example #22
0
function q21_head_elements_close()
{
    ?>
	<link rel="icon" href="<?php 
    echo Q21_IMG_URL;
    ?>
/favicon.ico" />
	<link rel="apple-touch-icon" href="<?php 
    echo Q21_IMG_URL;
    ?>
/apple-touch-icon.png" />
	<?php 
    wp_head();
    ?>
	</head>
<?php 
}
Example #23
0
function cgp_genesis_header()
{
    do_action('genesis_doctype');
    do_action('genesis_title');
    do_action('genesis_meta');
    wp_head();
    //* we need this for plugins
    ?>
 </head>
 <?php 
    genesis_markup(array('html5' => '<body %s>', 'xhtml' => sprintf('<body class="%s">', implode(' ', get_body_class())), 'context' => 'body'));
    do_action('genesis_before');
    genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="wrap">', 'context' => 'site-container'));
    do_action('genesis_before_header');
    do_action('genesis_header');
    do_action('genesis_after_header');
    genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="inner">', 'context' => 'content-wrapper'));
    genesis_structural_wrap('content-wrapper');
}
function formcraft_basic_redirect_to_form_page()
{
    global $fcb_meta, $forms_table, $wpdb;
    if (formcraft_basic_check_form_page()) {
        $form_id = formcraft_basic_check_form_page();
        if (formcraft_basic_check_form_page_access($form_id)) {
            add_action('wp_head', 'formcraft_basic_wp_head');
            wp_head();
            $qry = $wpdb->get_var("SELECT html FROM {$forms_table} WHERE id='{$form_id}'");
            echo "<style>html{margin-top:0px!important;}</style><div id='form-cover' class='formcraft-css' style='padding: 50px 15px'>";
            if (strpos($_SERVER["REQUEST_URI"], '?preview=true')) {
                echo "<span class='form-preview'>" . __('Preview Mode', 'formcraft_basic') . "</span>";
            }
            echo stripslashes($qry);
            echo "</div>";
            die;
        }
    }
}
    /**
     * Displays what is inside the head html tag. Includes the wp_head() hook.
     *
     *
     * @package Customizr
     * @since Customizr 3.0
     */
    function tc_head_display()
    {
        ?>
		<head>
		    <meta charset="<?php 
        bloginfo('charset');
        ?>
" />
		    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
		    <title><?php 
        wp_title('|', true, 'right');
        ?>
</title>
		    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		    <meta name="p:domain_verify" content="9e3d4bbb35b25a121ffe031e7784ca40"/>
		    <link rel="profile" href="http://gmpg.org/xfn/11" />
		    <link rel="pingback" href="<?php 
        bloginfo('pingback_url');
        ?>
" />
		   
		   <!-- Icons font support for IE6-7  -->
		    <!--[if lt IE 8]>
		      <script src="<?php 
        echo TC_BASE_URL;
        ?>
inc/css/fonts/lte-ie7.js"></script>
		    <![endif]-->
		    <?php 
        wp_head();
        ?>
		    <!--Icons size hack for IE8 and less -->
		    <!--[if lt IE 9]>
		      <link href="<?php 
        echo TC_BASE_URL;
        ?>
inc/css/fonts/ie8-hacks.css" rel="stylesheet" type="text/css"/>
		    <![endif]-->
		   <link rel="stylesheet" type="text/css" href="/wp-content/plugins/wonderplugin-lightbox/wonderpluginlightbox.css" />
		</head>
		<?php 
    }
Example #26
0
 function build()
 {
     $head = new thesis_head();
     $head->title();
     $head->meta();
     $head->conditional_styles();
     $head->stylesheets();
     $head->links();
     $head->scripts();
     echo "<head " . apply_filters('thesis_head_profile', 'profile="http://gmpg.org/xfn/11"') . ">\n";
     #filter
     echo '<meta http-equiv="Content-Type" content="' . get_bloginfo('html_type') . '; charset=' . get_bloginfo('charset') . '" />' . "\n";
     #wp
     $head->output();
     wp_head();
     #hook #wp
     echo "</head>\n";
     $head->add_ons();
     // this is bogus and will disappear once I get this all figured out
 }
 function process_render($callback, $callback_arg)
 {
     global $wp_scripts, $wp_styles;
     // initial scripts & styles (to subtract)
     ob_start();
     wp_head();
     wp_footer();
     ob_end_clean();
     $initial_scripts = $wp_scripts->done;
     $initial_styles = $wp_styles->done;
     // actually render the shortcode, get the result, and do the resource loading again so we can subtract..
     ob_start();
     wp_head();
     ob_end_clean();
     $result = call_user_func($callback, $callback_arg);
     ob_start();
     wp_footer();
     ob_end_clean();
     // find the difference (the new resource files)
     $loaded_scripts = array_diff($wp_scripts->done, $initial_scripts);
     $loaded_styles = array_diff($wp_styles->done, $initial_styles);
     return array('result' => $result, 'loaded_scripts' => $loaded_scripts, 'loaded_styles' => $loaded_styles);
 }
 /**
  * Tests for site icon
  * @test
  */
 function site_icon()
 {
     update_option('wfb_favicon', 'path/to/favicon.png');
     update_option('wfb_apple_icon', 'path/to/apple_icon.png');
     // go to page and force fire wp_head()
     ob_start();
     $this->go_to(get_permalink($this->post_ids[0]));
     do_action('get_header');
     wp_head();
     $header = ob_get_clean();
     $this->assertSame(1, preg_match('#<link rel="Shortcut Icon" type="image/x-icon" href="//path/to/favicon.png" />#', $header));
     $this->assertSame(1, preg_match('#<link rel="apple-touch-icon" href="//path/to/apple_icon.png" />#', $header));
     if (function_exists('has_site_icon')) {
         update_option('site_icon', $this->attachment_id);
         // go to page and force fire wp_head()
         ob_start();
         $this->go_to(get_permalink($this->post_ids[0]));
         do_action('get_header');
         wp_head();
         $header = ob_get_clean();
         $this->assertSame(0, preg_match('#<link rel="Shortcut Icon" type="image/x-icon" href="//path/to/favicon.png" />#', $header));
         $this->assertSame(0, preg_match('#<link rel="apple-touch-icon" href="//path/to/apple_icon.png" />#', $header));
     }
 }
Example #29
0
?>
>
<head>
<meta charset="<?php 
bloginfo('charset');
?>
">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
">

<?php 
wp_head();
?>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>

<body <?php 
body_class();
?>
>
<div id="page" class="site">
	<a class="skip-link screen-reader-text" href="#content"><?php 
esc_html_e('Skip to content', 'wda-theme');
?>
</a>

	<header id="masthead" class="site-header" role="banner">
Example #30
0
 /**
  * Return an array of recent posts
  */
 public static function get_posts()
 {
     $is_page = false;
     // Apply our 'since' parameter
     function o2_filter_posts_where($where = '')
     {
         global $o2_since, $wpdb;
         if (!$o2_since) {
             return $where;
         }
         $holdoff = 3;
         // seconds - gives time for posts to "bake" (e.g. if meta is added after post insertion or update)
         $since = date('Y-m-d H:i:s', $o2_since);
         // start of range
         $until = date('Y-m-d H:i:s', time() - $holdoff);
         // end of range
         $where .= $wpdb->prepare(" AND post_modified_gmt > %s AND post_modified_gmt < %s", $since, $until);
         return $where;
     }
     // Add filters to posts query
     add_filter('posts_where', 'o2_filter_posts_where');
     // Post stati
     $post_stati = array('publish', 'trash');
     if (current_user_can('read_private_posts')) {
         array_push($post_stati, 'private');
     }
     // Override post stati on $args as read is unauthenticated
     $args = array();
     if (isset($_REQUEST['queryVars'])) {
         $args = $_REQUEST['queryVars'];
     }
     $args['post_status'] = $post_stati;
     $defaults = array('post_type' => 'post', 'post_status' => $post_stati, 'posts_per_page' => 20, 'ignore_sticky_posts' => true, 'suppress_filters' => false);
     $query_args = wp_parse_args($args, $defaults);
     // If we are on a page, change the query post_type to page, otherwise
     // we will get no data (and updates to pages will not be sent to polling
     // clients on that page) [using an array of post and page doesn't work either]
     if (isset($query_args['pagename'])) {
         $query_args['post_type'] = 'page';
     }
     // Filter for plugins
     $query_args = apply_filters('o2_get_posts_query_args', $query_args);
     // Run the query for posts
     $GLOBALS['wp_the_query'] = $GLOBALS['wp_query'] = new WP_Query($query_args);
     // Set as is_home() to ensure that plugin filters run on the_content()
     $GLOBALS['wp_query']->is_home = true;
     // Remove filters from query
     remove_filter('pre_option_posts_per_rss', 'o2_posts_per_rss');
     remove_filter('posts_where', 'o2_filter_posts_where');
     $posts = array();
     // Run through The Loop
     global $post;
     if (have_posts()) {
         ob_start();
         wp_head();
         ob_end_clean();
         while (have_posts()) {
             the_post();
             if (self::is_ok_to_add($post)) {
                 $posts[] = $post;
             }
         }
         ob_start();
         wp_footer();
         ob_end_clean();
     } else {
         if (0 != intval($_REQUEST['postId'])) {
             /*
              * If WP_Query returned no posts and if currently on a single page, then
              * query the postID and check if it has been trashed. This is workaround
              * for the ticket below.
              *
              * @todo Remove second query with get_post when the below ticket is addressed.
              * https://core.trac.wordpress.org/ticket/29167
              */
             $post = get_post(intval($_REQUEST['postId']));
             if ('trash' == $post->post_status) {
                 if (self::is_ok_to_add($post)) {
                     $posts[] = $post;
                 }
             }
         }
     }
     return $posts;
 }