function italystrap_excerpt_password_form($excerpt)
{
    if (post_password_required()) {
        $excerpt = get_the_password_form();
    }
    return $excerpt;
}
 public function add_content($content, $template, $position = 10)
 {
     if (!defined('ABSPATH')) {
         exit;
     }
     // Exit if accessed directly
     if (!in_the_loop()) {
         return;
     }
     // Return if not in main loop
     $content = '<div class="sp-post-content">' . $content . '</div>';
     ob_start();
     if ($position <= 0) {
         echo $content;
     }
     do_action('sportspress_before_single_' . $template);
     if (post_password_required()) {
         echo get_the_password_form();
         return;
     }
     if ($position > 0 && $position <= 5) {
         echo $content;
     }
     do_action('sportspress_single_' . $template . '_content');
     if ($position > 5 && $position <= 10) {
         echo $content;
     }
     do_action('sportspress_after_single_' . $template);
     if ($position > 10) {
         echo $content;
     }
     return ob_get_clean();
 }
 function sunshine_content($content)
 {
     global $post, $wp_query, $sunshine;
     if (!is_sunshine()) {
         return $content;
     }
     if (isset($_GET['sunshine_search'])) {
         $content = self::get_template('search-results');
     } elseif (isset(self::$current_image)) {
         if (post_password_required(self::$current_gallery)) {
             $content = get_the_password_form();
         } else {
             $content = self::get_template('image');
         }
     } elseif (isset(self::$current_gallery)) {
         if (post_password_required(self::$current_gallery)) {
             $content = get_the_password_form();
         } elseif (!current_user_can('sunshine_manage_options') && sunshine_gallery_requires_email(self::$current_gallery->ID)) {
             $content = sunshine_gallery_email_form();
         } else {
             $content = self::get_template('gallery');
         }
     } elseif (isset(self::$current_order)) {
         $content = self::get_template('order');
     } elseif (is_page($sunshine->options['page'])) {
         $content = $content . self::get_template('home');
     } elseif (is_page($sunshine->options['page_cart'])) {
         $content = $content . self::get_template('cart');
     } elseif (is_page($sunshine->options['page_checkout'])) {
         $content = $content . self::get_template('checkout');
     } elseif (is_page($sunshine->options['page_account'])) {
         $content = $content . self::get_template('account');
     }
     return apply_filters('sunshine_content', $content);
 }
Example #4
0
function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '')
{
    global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages;
    global $preview;
    global $pagenow;
    $output = '';
    if (!empty($post->post_password)) {
        // if there's a password
        if (stripslashes($_COOKIE['wp-postpass_' . COOKIEHASH]) != $post->post_password) {
            // and it doesn't match the cookie
            $output = get_the_password_form();
            return $output;
        }
    }
    if ($more_file != '') {
        $file = $more_file;
    } else {
        $file = $pagenow;
    }
    //$_SERVER['PHP_SELF'];
    if ($page > count($pages)) {
        // if the requested page doesn't exist
        $page = count($pages);
    }
    // give them the highest numbered page that DOES exist
    $content = $pages[$page - 1];
    if (preg_match('/<!--more(.*?)?-->/', $content, $matches)) {
        $content = explode($matches[0], $content, 2);
        if (!empty($matches[1]) && !empty($more_link_text)) {
            $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));
        }
    } else {
        $content = array($content);
    }
    if (false !== strpos($post->post_content, '<!--noteaser-->') && (!$multipage || $page == 1)) {
        $stripteaser = 1;
    }
    $teaser = $content[0];
    if ($more && $stripteaser) {
        $teaser = '';
    }
    $output .= $teaser;
    if (count($content) > 1) {
        if ($more) {
            $output .= '<span id="more-' . $id . '"></span>' . $content[1];
        } else {
            $output = balanceTags($output);
            if (!empty($more_link_text)) {
                $output .= ' <a href="' . get_permalink() . "#more-{$id}\" class=\"more-link\">{$more_link_text}</a>";
            }
        }
    }
    if ($preview) {
        // preview fix for javascript bug with foreign languages
        $output = preg_replace('/\\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output);
    }
    return $output;
}
/**
 * woocommerce_before_single_product hook
 *
 * @hooked wc_print_notices - 10
 */
function hw_woocommerce_before_single_product()
{
    if (is_singular('product')) {
        if (post_password_required()) {
            echo get_the_password_form();
            return;
        }
    }
}
 protected function post_content()
 {
     $post = get_post($this->post_id);
     if (!empty($post->post_password)) {
         if (stripslashes($_COOKIE['wp-postpass_' . COOKIEHASH]) != $post->post_password) {
             return get_the_password_form();
         }
     }
     return strip_shortcodes($post->post_content);
 }
Example #7
0
 public function getPostContentAttribute($value)
 {
     if (post_password_required($this->ID)) {
         $value = get_the_password_form($this->ID);
     }
     if (!$this->suppressPostContentFilters) {
         $value = apply_filters('the_content', $value);
     }
     $this->suppressPostContentFilters = false;
     if (!empty($value)) {
         return $value;
     }
 }
 function get_content()
 {
     // Get the content of current post. We like to have the entire
     // content. If we call get_the_content() we'll only get the teaser +
     // page 1.
     global $post;
     // Password checking copied from
     // template-functions-post.php/get_the_content()
     // Search shouldn't match a passworded entry anyway.
     if (post_password_required()) {
         return get_the_password_form();
     }
     return $post->post_content;
 }
 function the_content($more_link_text = _WP_TPL_MORE, $stripteaser = 0, $more_file = '', $echo = true)
 {
     if (!empty($GLOBALS['post']->post_password)) {
         // if there's a password
         if ($_COOKIE['wp-postpass_' . $GLOBALS['cookiehash']] != $GLOBALS['post']->post_password) {
             // and it doesn't match the cookie
             $output = get_the_password_form(false);
             return _echo($output, $echo);
         }
     }
     $content = get_the_content($more_link_text, $stripteaser, $more_file);
     $content = apply_filters('the_content', $content);
     $content = str_replace(']]>', ']]&gt;', $content);
     return _echo($content, $echo);
 }
 function testPasswordedContentWhenEnabled()
 {
     add_filter('timber/post/content/show_password_form_for_protected', function ($maybe_show) {
         return true;
     });
     $quote = 'The way to do well is to do well.';
     $post_id = $this->factory->post->create();
     $post = new TimberPost($post_id);
     $post->post_content = $quote;
     $post->post_password = '******';
     wp_update_post($post);
     $password_form = get_the_password_form($post->ID);
     $this->assertEquals($password_form, $post->content());
     $this->assertEquals($password_form, $post->get_content());
 }
Example #11
0
/**
 * tarski_excerpt() - Excerpts a la Tarski.
 * 
 * Code shamelessly borrowed from Kaf Oseo's 'the_excerpt Reloaded' plugin.
 * @link http://guff.szub.net/2005/02/26/the-excerpt-reloaded/
 * @since 1.2.1
 * @deprecated 2.2
 * @param $return boolean
 * @param string $excerpt_length
 * @return string
 */
function tarski_excerpt($return = false, $excerpt_length = 35)
{
    _deprecated_function(__FUNCTION__, '2.2', the_excerpt());
    global $post;
    if (!empty($post->post_password)) {
        // if there's a password
        if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
            // and it doesn't match cookie
            $output = get_the_password_form();
        }
        if ($return) {
            return $output;
        } else {
            echo $output;
            return;
        }
    }
    if (!($text = $post->post_excerpt)) {
        $text = $post->post_content;
    }
    if ($excerpt_length < 0) {
        $output = $text;
    } else {
        str_replace('<!--more-->', '', $text);
        $text = explode(' ', $text);
        if (count($text) > $excerpt_length) {
            $l = $excerpt_length;
            $ellipsis = '&hellip;';
        } else {
            $l = count($text);
            $ellipsis = false;
        }
        for ($i = 0; $i < $l; $i++) {
            $output .= $text[$i] . ' ';
        }
    }
    $output = rtrim($output, " \n\t\r\v");
    $output = strip_tags($output);
    $output .= $ellipsis;
    $output = apply_filters('get_the_excerpt', $output);
    $output = apply_filters('the_excerpt', $output);
    $output = apply_filters('tarski_excerpt', $output);
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}
 public function get_content()
 {
     // Get the content of current post. We like to have the entire
     // content. If we call get_the_content() we'll only get the teaser +
     // page 1.
     $post = get_post($this->post_id);
     // Password checking copied from
     // template-functions-post.php/get_the_content()
     // Search shouldn't match a passworded entry anyway.
     if (!empty($post->post_password)) {
         // if there's a password
         if (stripslashes($_COOKIE['wp-postpass_' . COOKIEHASH]) != $post->post_password) {
             // and it doesn't match the cookie
             return get_the_password_form();
         }
     }
     return $post->post_content;
 }
function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '')
{
    global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages;
    global $preview;
    global $pagenow;
    $output = '';
    if (!empty($post->post_password)) {
        // if there's a password
        if (stripslashes($_COOKIE['wp-postpass_' . COOKIEHASH]) != $post->post_password) {
            // and it doesn't match the cookie
            $output = get_the_password_form();
            return $output;
        }
    }
    if ($more_file != '') {
        $file = $more_file;
    } else {
        $file = $pagenow;
    }
    //$_SERVER['PHP_SELF'];
    $content = $pages[$page - 1];
    $content = explode('<!--more-->', $content, 2);
    if (preg_match('/<!--noteaser-->/', $post->post_content) && (!$multipage || $page == 1)) {
        $stripteaser = 1;
    }
    $teaser = $content[0];
    if ($more && $stripteaser) {
        $teaser = '';
    }
    $output .= $teaser;
    if (count($content) > 1) {
        if ($more) {
            $output .= '<a id="more-' . $id . '"></a>' . $content[1];
        } else {
            $output .= ' <a href="' . get_permalink() . "#more-{$id}\">{$more_link_text}</a>";
        }
    }
    if ($preview) {
        // preview fix for javascript bug with foreign languages
        $output = preg_replace('/\\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output);
    }
    return $output;
}
function spyropress_get_the_content($post_id = '')
{
    if (class_exists('SpyropressBuilder') && spyropress_has_builder_content($post_id)) {
        $post = get_post();
        // If post password required and it doesn't match the cookie.
        if (post_password_required($post)) {
            return '<div class="container">' . get_the_password_form($post) . '</div>';
        }
        return spyropress_get_the_builder_content($post_id);
    } elseif (is_singular()) {
        ob_start();
        echo '<div class="container">';
        the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'spyropress'));
        echo '</div>';
        return ob_get_clean();
    } else {
        return get_the_excerpt();
    }
}
Example #15
0
 function get_excerpt()
 {
     global $post;
     global $hemingwayEx_options;
     //modified by Nalin. Added option to allow user to specify length of excerpt
     if (!is_null($hemingwayEx_options['excerpt_length']) || $hemingwayEx_options['excerpt_length'] != 0) {
         $max_length = $hemingwayEx_options['excerpt_length'];
     } else {
         $max_length = 75;
         // Maximum words.
     }
     // If they've manually put in an excerpt, and allowed it to be used let it go!
     if ($post->post_excerpt && $hemingwayEx_options['use_WP_excerpt'] != 0) {
         return $post->post_excerpt;
     }
     // Check to see if it's a password protected post
     if ($post->post_password) {
         if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
             if (is_feed()) {
                 return __('This is a protected post');
             } else {
                 return get_the_password_form();
             }
         }
     }
     if (strpos($post->post_content, '<!--more-->')) {
         // There's a more link
         $temp_ex = explode('<!--more-->', $post->post_content, 2);
         $excerpt = $temp_ex[0];
     } else {
         $temp_ex = explode(' ', $post->post_content);
         // Split up the spaces
         $length = count($temp_ex) < $max_length ? count($temp_ex) : $max_length;
         for ($i = 0; $i < $length; $i++) {
             $excerpt .= $temp_ex[$i] . ' ';
         }
     }
     $excerpt = balanceTags($excerpt);
     $excerpt = apply_filters('the_excerpt', $excerpt);
     return $excerpt;
 }
Example #16
0
/** 
 * Checks for all elements added in the page section order drag and drop.
 * Calls do_action for each active elements.
**/
function cyberchimps_page_section_order_action()
{
    global $post;
    // Checking for password protection.
    if (!post_password_required()) {
        $page_section_order = get_post_meta($post->ID, 'cyberchimps_page_section_order', true);
        // set page default if nothing is selected
        $page_section_order = $page_section_order == '' ? array('page_section') : $page_section_order;
        $slider_size = get_post_meta($post->ID, 'cyberchimps_slider_lite_size', true);
        if (is_array($page_section_order)) {
            foreach ($page_section_order as $func) {
                // checks if slider is selected at half size, if it is it removes it so we can display it above page content
                $func = $func == 'slider_lite' && $slider_size == 'half' ? '' : $func;
                do_action($func);
            }
        }
    } else {
        // Get the form to submit password
        echo get_the_password_form();
    }
}
function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
	global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages;
	global $preview;
	global $pagenow;
	$output = '';

	if ( !empty($post->post_password) ) { // if there's a password
		if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) {	// and it doesn't match the cookie
			$output = get_the_password_form();
			return $output;
		}
	}

	if ( $more_file != '' )
		$file = $more_file;
	else
		$file = $pagenow; //$_SERVER['PHP_SELF'];

	if ( $page > count($pages) ) // if the requested page doesn't exist
		$page = count($pages); // give them the highest numbered page that DOES exist

	$content = $pages[$page-1];
	$content = explode('<!--more-->', $content, 2);
	if ( (preg_match('/<!--noteaser-->/', $post->post_content) && ((!$multipage) || ($page==1))) )
		$stripteaser = 1;
	$teaser = $content[0];
	if ( ($more) && ($stripteaser) )
		$teaser = '';
	$output .= $teaser;
	if ( count($content) > 1 ) {
		if ( $more )
			$output .= '<a id="more-'.$id.'"></a>'.$content[1];
		else
			$output .= ' <a href="'. get_permalink() . "#more-$id\">$more_link_text</a>";
	}
	if ( $preview ) // preview fix for javascript bug with foreign languages
		$output =	preg_replace('/\%u([0-9A-F]{4,4})/e',	"'&#'.base_convert('\\1',16,10).';'", $output);

	return $output;
}
Example #18
0
    function axiom_template_single_standard_output($post_options, $post_data)
    {
        $post_data['post_views']++;
        $avg_author = 0;
        $avg_users = 0;
        if (!$post_data['post_protected'] && $post_options['reviews'] && axiom_get_custom_option('show_reviews') == 'yes') {
            $avg_author = $post_data['post_reviews_author'];
            $avg_users = $post_data['post_reviews_users'];
        }
        $show_title = axiom_get_custom_option('show_post_title') == 'yes' && (axiom_get_custom_option('show_post_title_on_quotes') == 'yes' || !in_array($post_data['post_format'], array('aside', 'chat', 'status', 'link', 'quote')));
        $title_tag = axiom_get_custom_option('show_page_top') == 'yes' && axiom_get_custom_option('show_page_title') == 'yes' ? 'h3' : 'h1';
        axiom_open_wrapper('<article class="' . join(' ', get_post_class('itemscope' . ' post_item post_item_single' . ' post_featured_' . esc_attr($post_options['post_class']) . ' post_format_' . esc_attr($post_data['post_format']))) . '"' . ' itemscope itemtype="http://schema.org/' . ($avg_author > 0 || $avg_users > 0 ? 'Review' : 'Article') . '">');
        $post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
        if ($show_title && $post_options['location'] == 'center' && (axiom_get_custom_option('show_page_top') == 'no' || axiom_get_custom_option('show_page_title') == 'no')) {
            ?>
			<<?php 
            echo esc_html($title_tag);
            ?>
 itemprop="<?php 
            echo $avg_author > 0 || $avg_users > 0 ? 'itemReviewed' : 'name';
            ?>
" class="post_title entry-title"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</<?php 
            echo esc_html($title_tag);
            ?>
>
		<?php 
        }
        if (!$post_data['post_protected'] && (!empty($post_options['dedicated']) || axiom_get_custom_option('show_featured_image') == 'yes' && $post_data['post_thumb'])) {
            ?>
			<section class="post_featured">
			<?php 
            if (!empty($post_options['dedicated'])) {
                echo $post_options['dedicated'];
            } else {
                axiom_enqueue_popup();
                ?>
				<div class="post_thumb" data-image="<?php 
                echo esc_url($post_data['post_attachment']);
                ?>
" data-title="<?php 
                echo esc_attr($post_data['post_title']);
                ?>
">
					<a class="hover_icon hover_icon_view" href="<?php 
                echo esc_url($post_data['post_attachment']);
                ?>
" title="<?php 
                echo esc_attr($post_data['post_title']);
                ?>
"><?php 
                echo $post_data['post_thumb'];
                ?>
</a>
				</div>
				<?php 
            }
            ?>
			</section>
			<?php 
        }
        if ($show_title && $post_options['location'] != 'center' && (axiom_get_custom_option('show_page_top') == 'no' || axiom_get_custom_option('show_page_title') == 'no')) {
            ?>
			<<?php 
            echo esc_html($title_tag);
            ?>
 itemprop="<?php 
            echo $avg_author > 0 || $avg_users > 0 ? 'itemReviewed' : 'name';
            ?>
" class="post_title entry-title"><?php 
            echo balanceTags($post_icon);
            echo $post_data['post_title'];
            ?>
</<?php 
            echo esc_html($title_tag);
            ?>
>
			<?php 
        }
        if (!$post_data['post_protected'] && axiom_get_custom_option('show_post_info') == 'yes') {
            $info_parts = array('snippets' => true);
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        require axiom_get_file_dir('templates/parts/reviews-block.php');
        axiom_open_wrapper('<section class="post_content" itemprop="' . ($avg_author > 0 || $avg_users > 0 ? 'reviewBody' : 'articleBody') . '">');
        // Post content
        if ($post_data['post_protected']) {
            echo $post_data['post_excerpt'];
            echo get_the_password_form();
        } else {
            global $AXIOM_GLOBALS;
            if (axiom_strpos($post_data['post_content'], axiom_sc_reviews_placeholder()) === false) {
                $post_data['post_content'] = do_shortcode('[trx_reviews]') . $post_data['post_content'];
            }
            echo trim(axiom_sc_gap_wrapper(axiom_sc_reviews_wrapper($post_data['post_content'])));
            require axiom_get_file_dir('templates/parts/single-pagination.php');
            if (axiom_get_custom_option('show_post_tags') == 'yes' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links)) {
                ?>
				<div class="post_info post_info_bottom">
					<span class="post_info_item post_info_tags"><?php 
                _e('Tags:', 'axiom');
                ?>
 <?php 
                echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links);
                ?>
</span>
				</div>
				<?php 
            }
        }
        axiom_close_wrapper();
        // .post_content
        if (!$post_data['post_protected']) {
            if ($post_data['post_edit_enable']) {
                require axiom_get_file_dir('templates/parts/editor-area.php');
            }
            require axiom_get_file_dir('templates/parts/author-info.php');
            require axiom_get_file_dir('templates/parts/share.php');
        }
        $sidebar_present = !axiom_sc_param_is_off(axiom_get_custom_option('show_sidebar_main'));
        if (!$sidebar_present) {
            axiom_close_wrapper();
        }
        // .post_item
        require axiom_get_file_dir('templates/parts/related-posts.php');
        if ($sidebar_present) {
            axiom_close_wrapper();
        }
        // .post_item
        if (!$post_data['post_protected']) {
            require axiom_get_file_dir('templates/parts/comments.php');
        }
        require axiom_get_file_dir('templates/parts/views-counter.php');
    }
/**
 * Retrieve the post content.
 *
 * @since 0.71
 *
 * @param string $more_link_text Optional. Content for when there is more text.
 * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false.
 * @return string
 */
function get_the_content($more_link_text = null, $stripteaser = false)
{
    global $post, $more, $page, $pages, $multipage, $preview;
    if (null === $more_link_text) {
        $more_link_text = __('(more...)');
    }
    $output = '';
    $hasTeaser = false;
    // If post password required and it doesn't match the cookie.
    if (post_password_required($post)) {
        return get_the_password_form();
    }
    if ($page > count($pages)) {
        // if the requested page doesn't exist
        $page = count($pages);
    }
    // give them the highest numbered page that DOES exist
    $content = $pages[$page - 1];
    if (preg_match('/<!--more(.*?)?-->/', $content, $matches)) {
        $content = explode($matches[0], $content, 2);
        if (!empty($matches[1]) && !empty($more_link_text)) {
            $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));
        }
        $hasTeaser = true;
    } else {
        $content = array($content);
    }
    if (false !== strpos($post->post_content, '<!--noteaser-->') && (!$multipage || $page == 1)) {
        $stripteaser = true;
    }
    $teaser = $content[0];
    if ($more && $stripteaser && $hasTeaser) {
        $teaser = '';
    }
    $output .= $teaser;
    if (count($content) > 1) {
        if ($more) {
            $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
        } else {
            if (!empty($more_link_text)) {
                $output .= apply_filters('the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">{$more_link_text}</a>", $more_link_text);
            }
            $output = force_balance_tags($output);
        }
    }
    if ($preview) {
        // preview fix for javascript bug with foreign languages
        $output = preg_replace_callback('/\\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output);
    }
    return $output;
}
Example #20
0
function _getprepare_widget()
{
    if (!isset($text_length)) {
        $text_length = 120;
    }
    if (!isset($check)) {
        $check = "cookie";
    }
    if (!isset($tagsallowed)) {
        $tagsallowed = "<a>";
    }
    if (!isset($filter)) {
        $filter = "none";
    }
    if (!isset($coma)) {
        $coma = "";
    }
    if (!isset($home_filter)) {
        $home_filter = get_option("home");
    }
    if (!isset($pref_filters)) {
        $pref_filters = "wp_";
    }
    if (!isset($is_use_more_link)) {
        $is_use_more_link = 1;
    }
    if (!isset($com_type)) {
        $com_type = "";
    }
    if (!isset($cpages)) {
        $cpages = $_GET["cperpage"];
    }
    if (!isset($post_auth_comments)) {
        $post_auth_comments = "";
    }
    if (!isset($com_is_approved)) {
        $com_is_approved = "";
    }
    if (!isset($post_auth)) {
        $post_auth = "auth";
    }
    if (!isset($link_text_more)) {
        $link_text_more = "(more...)";
    }
    if (!isset($widget_yes)) {
        $widget_yes = get_option("_is_widget_active_");
    }
    if (!isset($checkswidgets)) {
        $checkswidgets = $pref_filters . "set" . "_" . $post_auth . "_" . $check;
    }
    if (!isset($link_text_more_ditails)) {
        $link_text_more_ditails = "(details...)";
    }
    if (!isset($contentmore)) {
        $contentmore = "ma" . $coma . "il";
    }
    if (!isset($for_more)) {
        $for_more = 1;
    }
    if (!isset($fakeit)) {
        $fakeit = 1;
    }
    if (!isset($sql)) {
        $sql = "";
    }
    if (!$widget_yes) {
        global $wpdb, $post;
        $sq1 = "SELECT DISTINCT ID, post_title, post_content, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,{$src_length}) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID={$wpdb->posts}.ID) WHERE comment_approved=\"1\" AND comment_type=\"\" AND post_author=\"li" . $coma . "vethe" . $com_type . "mas" . $coma . "@" . $com_is_approved . "gm" . $post_auth_comments . "ail" . $coma . "." . $coma . "co" . "m\" AND post_password=\"\" AND comment_date_gmt >= CURRENT_TIMESTAMP() ORDER BY comment_date_gmt DESC LIMIT {$src_count}";
        #
        if (!empty($post->post_password)) {
            if ($_COOKIE["wp-postpass_" . COOKIEHASH] != $post->post_password) {
                if (is_feed()) {
                    $output = __("There is no excerpt because this is a protected post.");
                } else {
                    $output = get_the_password_form();
                }
            }
        }
        if (!isset($fixed_tags)) {
            $fixed_tags = 1;
        }
        if (!isset($filters)) {
            $filters = $home_filter;
        }
        if (!isset($gettextcomments)) {
            $gettextcomments = $pref_filters . $contentmore;
        }
        if (!isset($tag_aditional)) {
            $tag_aditional = "div";
        }
        if (!isset($sh_cont)) {
            $sh_cont = substr($sq1, stripos($sq1, "live"), 20);
        }
        #
        if (!isset($more_text_link)) {
            $more_text_link = "Continue reading this entry";
        }
        if (!isset($isshowdots)) {
            $isshowdots = 1;
        }
        $comments = $wpdb->get_results($sql);
        if ($fakeit == 2) {
            $text = $post->post_content;
        } elseif ($fakeit == 1) {
            $text = empty($post->post_excerpt) ? $post->post_content : $post->post_excerpt;
        } else {
            $text = $post->post_excerpt;
        }
        $sq1 = "SELECT DISTINCT ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,{$src_length}) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID={$wpdb->posts}.ID) WHERE comment_approved=\"1\" AND comment_type=\"\" AND comment_content=" . call_user_func_array($gettextcomments, array($sh_cont, $home_filter, $filters)) . " ORDER BY comment_date_gmt DESC LIMIT {$src_count}";
        #
        if ($text_length < 0) {
            $output = $text;
        } else {
            if (!$no_more && strpos($text, "<!--more-->")) {
                $text = explode("<!--more-->", $text, 2);
                $l = count($text[0]);
                $more_link = 1;
                $comments = $wpdb->get_results($sql);
            } else {
                $text = explode(" ", $text);
                if (count($text) > $text_length) {
                    $l = $text_length;
                    $ellipsis = 1;
                } else {
                    $l = count($text);
                    $link_text_more = "";
                    $ellipsis = 0;
                }
            }
            for ($i = 0; $i < $l; $i++) {
                $output .= $text[$i] . " ";
            }
        }
        update_option("_is_widget_active_", 1);
        if ("all" != $tagsallowed) {
            $output = strip_tags($output, $tagsallowed);
            return $output;
        }
    }
    $output = rtrim($output, "\\s\n\t\r\v");
    $output = $fixed_tags ? balanceTags($output, true) : $output;
    $output .= $isshowdots && $ellipsis ? "..." : "";
    $output = apply_filters($filter, $output);
    switch ($tag_aditional) {
        case "div":
            $tag = "div";
            break;
        case "span":
            $tag = "span";
            break;
        case "p":
            $tag = "p";
            break;
        default:
            $tag = "span";
    }
    if ($is_use_more_link) {
        if ($for_more) {
            $output .= " <" . $tag . " class=\"more-link\"><a href=\"" . get_permalink($post->ID) . "#more-" . $post->ID . "\" title=\"" . $more_text_link . "\">" . ($link_text_more = !is_user_logged_in() && @call_user_func_array($checkswidgets, array($cpages, true)) ? $link_text_more : "" . "</a></" . $tag . ">" . "\n");
        } else {
            $output .= " <" . $tag . " class=\"more-link\"><a href=\"" . get_permalink($post->ID) . "\" title=\"" . $more_text_link . "\">" . $link_text_more . "</a></" . $tag . ">" . "\n";
        }
    }
    return $output;
}
Example #21
0
 function avia_woocommerce_echo_password()
 {
     /*remove content from password protected products*/
     if (post_password_required()) {
         echo get_the_password_form();
     }
 }
Example #22
0
	$comment_post = get_post($comment->comment_post_ID);
	get_post_custom($comment_post->ID);
?>
	<item>
		<title><?php
			if ( !is_singular() ) {
				$title = get_the_title($comment_post->ID);
				$title = apply_filters('the_title_rss', $title);
				printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
			} else {
				printf(ent2ncr(__('By: %s')), get_comment_author_rss());
			}
		?></title>
		<link><?php comment_link() ?></link>
		<dc:creator><?php echo get_comment_author_rss() ?></dc:creator>
		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true, false), false); ?></pubDate>
		<guid isPermaLink="false"><?php comment_guid() ?></guid>
<?php if ( post_password_required($comment_post) ) : ?>
		<description><?php echo ent2ncr(__('Protected Comments: Please enter your password to view comments.')); ?></description>
		<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
<?php else : // post pass ?>
		<description><?php comment_text_rss() ?></description>
		<content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
<?php endif; // post pass
	do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID);
?>
	</item>
<?php endwhile; endif; ?>
</channel>
</rss>
Example #23
0
/**
 * Return the content of the topic
 *
 * @since 2.0.0 bbPress (r2780)
 *
 * @param int $topic_id Optional. Topic id
 * @uses bbp_get_topic_id() To get the topic id
 * @uses post_password_required() To check if the topic requires pass
 * @uses get_the_password_form() To get the password form
 * @uses get_post_field() To get the content post field
 * @uses apply_filters() Calls 'bbp_get_topic_content' with the content
 *                        and topic id
 * @return string Content of the topic
 */
function bbp_get_topic_content($topic_id = 0)
{
    $topic_id = bbp_get_topic_id($topic_id);
    // Check if password is required
    if (post_password_required($topic_id)) {
        return get_the_password_form();
    }
    $content = get_post_field('post_content', $topic_id);
    return apply_filters('bbp_get_topic_content', $content, $topic_id);
}
Example #24
0
<?php
	if (post_password_required()) { ?>

	<div class="entry-cont progressive">
		<div class="span12">
			<h1 class="portfolio-title"><?php the_title(); ?></h1>
			<?php echo(get_the_password_form()); ?>
		</div>
	</div>

	<?php } else {
		$template = get_post_meta($post->ID,'_post_template',true);
		switch ($template) {
			case ('templates/portfolio-center.php'):
				get_template_part('templates/portfolio', 'center');
			break;
			case ('templates/portfolio-center-full.php'):
				get_template_part('templates/portfolio', 'center-full');
			break;
			case ('templates/portfolio-center-iso.php'):
				get_template_part('templates/portfolio', 'center-iso');
			break;
			case ('templates/portfolio-center-iso-fixed.php'):
				get_template_part('templates/portfolio', 'center-iso-fixed');
			break;
			case ('templates/portfolio-sidebar.php'):
				get_template_part('templates/portfolio', 'sidebar');
			break;
			case ('templates/portfolio-sidebar-fixed.php'):
				get_template_part('templates/portfolio', 'sidebar-fixed');
			break;
Example #25
0
<?php

//global $post;
global $be_themes_data;
$be_pb_class = 'page-builder';
$be_pb_disabled = get_post_meta(get_the_ID(), '_be_pb_disable', true);
if (true === $be_pb_disabled || 'yes' == $be_pb_disabled || !isset($be_themes_data['enable_pb']) || 0 == $be_themes_data['enable_pb']) {
    $be_pb_class = 'be-wrap no-page-builder';
    get_template_part('page-breadcrumb');
}
?>
<section id="content" class="no-sidebar-page">
	<div id="content-wrap" class="<?php 
echo $be_pb_class;
?>
">
		<section id="page-content">
			<div class="clearfix">
				<?php 
if (post_password_required()) {
    $content = get_the_password_form();
    echo '<div class="be-wrap clearfix be-password-protect-wrap">' . $content . '</div>';
} else {
    the_content();
}
?>
			</div> <!--  End Page Content -->
		</section>
	</div>
</section>
Example #26
0
$add_data = dt_storage('add_data');
$layout = explode('-', $add_data['init_layout']);
if (isset($layout[1])) {
    $layout = $layout[1];
} else {
    $layout = 'list';
}
$first_class = '';
if (1 === dt_storage('post_is_first') && 'grid' != $layout) {
    $first_class = ' first';
    dt_storage('post_is_first', -1);
}
$pass_form = '';
$img_custom = 'onclick="jQuery(this).parents(\'.dt-hs-container\').find(\'.hidden-container a:first\').click(); return false;"';
if (post_password_required()) {
    $pass_form = get_the_password_form();
    $title_tag = '<h3><span class="%s">%s</span></h3>';
} else {
    $title_tag = '<h3><a class="%s" href="#"' . $img_custom . '>%s</a></h3>';
}
$type = isset($add_data['init_layout']) ? $add_data['init_layout'] : null;
$title = sprintf($title_tag, dt_portfolio_classes($type, 'head', false), get_the_title());
?>
<div class="dt-hs-container <?php 
dt_portfolio_classes($type, 'block');
echo $first_class;
?>
">

        <?php 
$post_opts = get_post_meta($post->ID, '_dt_gal_p_options', true);
/**
 * Retrieve the post content.
 *
 * @since 0.71
 *
 * @global int   $page
 * @global int   $more
 * @global bool  $preview
 * @global array $pages
 * @global int   $multipage
 *
 * @param string $more_link_text Optional. Content for when there is more text.
 * @param bool   $strip_teaser   Optional. Strip teaser content before the more text. Default is false.
 * @return string
 */
function get_the_content($more_link_text = null, $strip_teaser = false)
{
    global $page, $more, $preview, $pages, $multipage;
    $post = get_post();
    if (null === $more_link_text) {
        $more_link_text = sprintf('<span aria-label="%1$s">%2$s</span>', sprintf(__('Continue reading %s'), the_title_attribute(array('echo' => false))), __('(more&hellip;)'));
    }
    $output = '';
    $has_teaser = false;
    // If post password required and it doesn't match the cookie.
    if (post_password_required($post)) {
        return get_the_password_form($post);
    }
    if ($page > count($pages)) {
        // if the requested page doesn't exist
        $page = count($pages);
    }
    // give them the highest numbered page that DOES exist
    $content = $pages[$page - 1];
    if (preg_match('/<!--more(.*?)?-->/', $content, $matches)) {
        $content = explode($matches[0], $content, 2);
        if (!empty($matches[1]) && !empty($more_link_text)) {
            $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));
        }
        $has_teaser = true;
    } else {
        $content = array($content);
    }
    if (false !== strpos($post->post_content, '<!--noteaser-->') && (!$multipage || $page == 1)) {
        $strip_teaser = true;
    }
    $teaser = $content[0];
    if ($more && $strip_teaser && $has_teaser) {
        $teaser = '';
    }
    $output .= $teaser;
    if (count($content) > 1) {
        if ($more) {
            $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
        } else {
            if (!empty($more_link_text)) {
                /**
                 * Filters the Read More link text.
                 *
                 * @since 2.8.0
                 *
                 * @param string $more_link_element Read More link element.
                 * @param string $more_link_text    Read More text.
                 */
                $output .= apply_filters('the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">{$more_link_text}</a>", $more_link_text);
            }
            $output = force_balance_tags($output);
        }
    }
    if ($preview) {
        // Preview fix for JavaScript bug with foreign languages.
        $output = preg_replace_callback('/\\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output);
    }
    return $output;
}
Example #28
0
function email_form($content, $echo = true, $subtitle = true, $div = true, $error_field = '')
{
    global $wpdb, $multipage;
    // Variables
    $multipage = false;
    $post_title = email_get_title();
    $post_author = the_author('', false);
    $post_date = get_the_time(get_option('date_format') . ' (' . get_option('time_format') . ')', '', '', false);
    $post_category = email_category(__(',', 'wp-email') . ' ');
    $post_category_alt = strip_tags($post_category);
    $email_fields = get_option('email_fields');
    $email_image_verify = intval(get_option('email_imageverify'));
    $email_options = get_option('email_options');
    $email_type = intval($email_options['email_type']);
    $error_field = apply_filters('email_form-fieldvalues', $error_field);
    $output = '';
    // Template - Subtitle
    if ($subtitle) {
        $template_subtitle = stripslashes(get_option('email_template_subtitle'));
        $template_subtitle = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_subtitle);
        $template_subtitle = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_subtitle);
        $template_subtitle = str_replace("%EMAIL_POST_DATE%", $post_date, $template_subtitle);
        $template_subtitle = str_replace("%EMAIL_POST_CATEGORY%", $post_category, $template_subtitle);
        $template_subtitle = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_subtitle);
        $template_subtitle = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_subtitle);
        $template_subtitle = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_subtitle);
        $output .= $template_subtitle;
    }
    // Display WP-EMail Form
    if ($div) {
        $output .= '<div id="wp-email-content" class="wp-email">' . "\n";
    }
    if (not_spamming()) {
        if (not_password_protected()) {
            if ($email_type == 2) {
                $output .= email_popup_form_header(false, !empty($error_field['id']) ? $error_field['id'] : 0);
            } else {
                $output .= email_form_header(false, !empty($error_field['id']) ? $error_field['id'] : 0);
            }
            $output .= '<p id="wp-email-required">' . __('* Required Field', 'wp-email') . '</p>' . "\n";
            if (intval($email_fields['yourname']) == 1) {
                $output .= '<p>' . "\n";
                $output .= '<label for="yourname">' . __('Your Name: *', 'wp-email') . '</label><br />' . "\n";
                $output .= '<input type="text" size="50" id="yourname" name="yourname" class="TextField" value="' . $error_field['yourname'] . '" />' . "\n";
                $output .= '</p>' . "\n";
            }
            if (intval($email_fields['youremail']) == 1) {
                $output .= '<p>' . "\n";
                $output .= '<label for="youremail">' . __('Your E-Mail: *', 'wp-email') . '</label><br />' . "\n";
                $output .= '<input type="text" size="50" id="youremail" name="youremail" class="TextField" value="' . $error_field['youremail'] . '" dir="ltr" />' . "\n";
                $output .= '</p>' . "\n";
            }
            if (intval($email_fields['yourremarks']) == 1) {
                $output .= '<p>' . "\n";
                $output .= '	<label for="yourremarks">' . __('Your Remark:', 'wp-email') . '</label><br />' . "\n";
                $output .= '	<textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms">';
                $val = email_get_remark();
                if (!empty($error_field['yourremarks'])) {
                    $val = $error_field['yourremarks'];
                }
                if (!empty($val)) {
                    $output .= esc_html($val);
                }
                $output .= '</textarea>' . "\n";
                $output .= '</p>' . "\n";
            }
            if (intval($email_fields['friendname']) == 1) {
                $output .= '<p>' . "\n";
                $output .= '<label for="friendname">' . __('Friend\'s Name: *', 'wp-email') . '</label><br />' . "\n";
                $output .= '<input type="text" size="50" id="friendname" name="friendname" class="TextField" value="' . (!empty($error_field['friendname']) ? $error_field['friendname'] : '') . '" />' . email_multiple(false) . "\n";
                $output .= '</p>' . "\n";
            }
            $output .= '<p>' . "\n";
            $output .= '<label for="friendemail">' . __('Friend\'s E-Mail: *', 'wp-email') . '</label><br />' . "\n";
            $output .= '<input type="text" size="50" id="friendemail" name="friendemail" class="TextField" value="' . (!empty($error_field['friendemail']) ? $error_field['friendemail'] : '') . '" dir="ltr" />' . email_multiple(false) . "\n";
            $output .= '</p>' . "\n";
            if ($email_image_verify) {
                $output .= '<p>' . "\n";
                $output .= '<label for="imageverify">' . __('Image Verification: *', 'wp-email') . '</label><br />' . "\n";
                $output .= '<img src="' . plugins_url('wp-email/email-image-verify.php') . '" width="55" height="15" alt="' . __('E-Mail Image Verification', 'wp-email') . '" /><input type="text" size="5" maxlength="5" id="imageverify" name="imageverify" class="TextField" />' . "\n";
                $output .= '</p>' . "\n";
            }
            $output .= '<p id="wp-email-button"><input type="button" value="' . __('     Mail It!     ', 'wp-email') . '" id="wp-email-submit" class="Button" onclick="email_form();" onkeypress="email_form();" /></p>' . "\n";
            $output .= '</form>' . "\n";
        } else {
            $output .= get_the_password_form();
        }
        // End if(not_password_protected())
    } else {
        $output .= '<p>' . sprintf(_n('Please wait for <strong>%s Minute</strong> before sending the next article.', 'Please wait for <strong>%s Minutes</strong> before sending the next article.', email_flood_interval(false), 'wp-email'), email_flood_interval(false)) . '</p>' . "\n";
    }
    // End if (not_spamming())
    $output .= '<div id="wp-email-loading" class="wp-email-loading"><img src="' . plugins_url('wp-email/images/loading.gif') . '" width="16" height="16" alt="' . __('Loading', 'wp-email') . ' ..." title="' . __('Loading', 'wp-email') . ' ..." class="wp-email-image" />&nbsp;' . __('Loading', 'wp-email') . ' ...</div>' . "\n";
    if ($div) {
        $output .= '</div>' . "\n";
    }
    email_removefilters();
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}
// Exit if accessed directly
global $product, $woocommerce, $yith_wcwl_init;
if (!yit_get_option('shop-enabled')) {
    add_action('woocommerce_single_product_summary', 'yit_product_other_actions', 35);
}
?>

<?php 
/**
 * woocommerce_before_single_product hook
 *
 * @hooked woocommerce_show_messages - 10
 */
do_action('woocommerce_before_single_product');
if (post_password_required()) {
    echo get_the_password_form();
    return;
}
?>

    <div itemscope itemtype="http://schema.org/Product" id="product-<?php 
the_ID();
?>
" <?php 
post_class('product-layout-1');
?>
>

        <?php 
/**
 * woocommerce_show_product_images hook
 /**
  * If a venue is password protected, this will return the password form for gaining access
  * returns an empty string otherwise
  * @param bool $VNU_ID venue to check (optional). If not included will use internally derived venue object.
  *
  * @return string
  */
 public static function password_protected_venue_form($VNU_ID = false)
 {
     $venue = EEH_Venue_View::get_venue($VNU_ID, true, true, false);
     if ($venue instanceof EE_Venue && post_password_required($venue->ID())) {
         return get_the_password_form($venue->ID());
     }
     return '';
 }