File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/post-content.php.tar
var/www/vhosts/uyarreklam.com.tr/httpdocs/wp-includes/blocks/post-content.php 0000644 00000004106 15153273645 0023604 0 ustar 00 <?php
/**
* Server-side rendering of the `core/post-content` block.
*
* @package WordPress
*/
/**
* Renders the `core/post-content` block on the server.
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
* @return string Returns the filtered post content of the current post.
*/
function render_block_core_post_content( $attributes, $content, $block ) {
static $seen_ids = array();
if ( ! isset( $block->context['postId'] ) ) {
return '';
}
$post_id = $block->context['postId'];
if ( isset( $seen_ids[ $post_id ] ) ) {
// WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
// is set in `wp_debug_mode()`.
$is_debug = WP_DEBUG && WP_DEBUG_DISPLAY;
return $is_debug ?
// translators: Visible only in the front end, this warning takes the place of a faulty block.
__( '[block rendering halted]' ) :
'';
}
$seen_ids[ $post_id ] = true;
// When inside the main loop, we want to use queried object
// so that `the_preview` for the current post can apply.
// We force this behavior by omitting the third argument (post ID) from the `get_the_content`.
$content = get_the_content();
// Check for nextpage to display page links for paginated posts.
if ( has_block( 'core/nextpage' ) ) {
$content .= wp_link_pages( array( 'echo' => 0 ) );
}
/** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
unset( $seen_ids[ $post_id ] );
if ( empty( $content ) ) {
return '';
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) );
return (
'<div ' . $wrapper_attributes . '>' .
$content .
'</div>'
);
}
/**
* Registers the `core/post-content` block on the server.
*/
function register_block_core_post_content() {
register_block_type_from_metadata(
__DIR__ . '/post-content',
array(
'render_callback' => 'render_block_core_post_content',
)
);
}
add_action( 'init', 'register_block_core_post_content' );
vhosts/uyarreklam.com.tr/httpdocs/wp-content/plugins/sayfa-olusturucu/inc/widgets/post-content.php 0000644 00000004140 15154240731 0031334 0 ustar 00 var/www <?php
/**
* Widget for displaying content from a post
*
* Class SiteOrigin_Panels_Widgets_PostContent
*/
class SiteOrigin_Panels_Widgets_PostContent extends WP_Widget {
function __construct() {
parent::__construct(
'siteorigin-panels-post-content',
__( 'Post Content', 'siteorigin-panels' ),
array(
'description' => __( 'Displays content from the current post.', 'siteorigin-panels' ),
)
);
}
function widget( $args, $instance ) {
if( is_admin() ) return;
echo $args['before_widget'];
$content = apply_filters('siteorigin_panels_widget_post_content', $this->default_content($instance['type']));
echo $content;
echo $args['after_widget'];
}
/**
* The default content for post types
* @param $type
* @return string
*/
function default_content($type){
global $post;
if(empty($post)) return;
switch($type) {
case 'title' :
return '<h1 class="entry-title">' . $post->post_title . '</h1>';
case 'content' :
return '<div class="entry-content">' . wpautop($post->post_content) . '</div>';
case 'featured' :
if(!has_post_thumbnail()) return '';
return '<div class="featured-image">' . get_the_post_thumbnail($post->ID) . '</div>';
default :
return '';
}
}
function update($new, $old){
return $new;
}
function form( $instance ) {
$instance = wp_parse_args($instance, array(
'type' => 'content',
));
$types = apply_filters('siteorigin_panels_widget_post_content_types', array(
'' => __('None', 'siteorigin-panels'),
'title' => __('Title', 'siteorigin-panels'),
'featured' => __('Featured Image', 'siteorigin-panels'),
));
?>
<p>
<label for="<?php echo $this->get_field_id( 'type' ) ?>"><?php _e( 'Display Content', 'siteorigin-panels' ) ?></label>
<select id="<?php echo $this->get_field_id( 'type' ) ?>" name="<?php echo $this->get_field_name( 'type' ) ?>">
<?php foreach ($types as $type_id => $title) : ?>
<option value="<?php echo esc_attr($type_id) ?>" <?php selected($type_id, $instance['type']) ?>><?php echo esc_html($title) ?></option>
<?php endforeach ?>
</select>
</p>
<?php
}
}