File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/shortcode.php.tar
var/www/vhosts/uyarreklam.com.tr/httpdocs/wp-includes/blocks/shortcode.php 0000644 00000001271 15153261304 0023126 0 ustar 00 <?php
/**
* Server-side rendering of the `core/shortcode` block.
*
* @package WordPress
*/
/**
* Performs wpautop() on the shortcode block content.
*
* @param array $attributes The block attributes.
* @param string $content The block content.
*
* @return string Returns the block content.
*/
function render_block_core_shortcode( $attributes, $content ) {
return wpautop( $content );
}
/**
* Registers the `core/shortcode` block on server.
*/
function register_block_core_shortcode() {
register_block_type_from_metadata(
__DIR__ . '/shortcode',
array(
'render_callback' => 'render_block_core_shortcode',
)
);
}
add_action( 'init', 'register_block_core_shortcode' );
www/vhosts/uyarreklam.com.tr/httpdocs/wp-content/plugins/so-widgets-bundle/base/inc/shortcode.php 0000644 00000005004 15154627731 0030147 0 ustar 00 var <?php
/**
* A simple shortcode that just renders a widget.
*
* @param string $content
*
* @return string
*/
function siteorigin_widget_shortcode( $attr, $content = '' ) {
$attr = shortcode_atts( array(
'class' => false,
'id' => '',
), $attr, 'panels_widget' );
$attr['class'] = html_entity_decode( $attr['class'] );
global $wp_widget_factory;
if ( ! empty( $attr['class'] ) && isset( $wp_widget_factory->widgets[ $attr['class'] ] ) ) {
$the_widget = $wp_widget_factory->widgets[ $attr['class'] ];
// Parse the value of the shortcode
preg_match( '/value="(.*?)"/', trim( $content ), $matches );
if ( ! empty( $matches[1] ) ) {
$data = json_decode( html_entity_decode( $matches[1] ), true );
}
$widget_args = ! empty( $data['args'] ) ? $data['args'] : array();
$widget_instance = ! empty( $data['instance'] ) ? $data['instance'] : array();
$widget_args = siteorigin_widget_shortcode_escape_widget_data( $widget_args );
$widget_instance = siteorigin_widget_shortcode_escape_widget_data( $widget_instance );
$widget_args = wp_parse_args( array(
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
), $widget_args );
ob_start();
$the_widget->widget( $widget_args, $widget_instance );
return ob_get_clean();
}
}
function siteorigin_widget_shortcode_escape_widget_data( $data ) {
try {
$escaped_data = array();
foreach ( $data as $key => $value ) {
if ( is_array( $value ) ) {
$escaped_data[ $key ] = siteorigin_widget_shortcode_escape_widget_data( $value );
} else {
$escaped_data[ $key ] = esc_html( $value );
}
}
return $escaped_data;
} catch (Exception $e) {
// There was an error, return empty array.
return array();
}
}
function siteorigin_widget_shortcode_register() {
global $shortcode_tags;
// Only load this as a fallback if Page Builder hasn't already registered it.
if ( empty( $shortcode_tags['siteorigin_widget'] ) ) {
add_shortcode( 'siteorigin_widget', 'siteorigin_widget_shortcode' );
}
}
add_action( 'plugins_loaded', 'siteorigin_widget_shortcode_register', 15 );
/**
* Tell Page Builder we'll be using the custom siteorigin_widget shortcode
*
* @return string
*/
function siteorigin_widget_shortcode_panels_cache_shortcode( $shortcode, $widget ) {
if ( is_a( $widget, 'SiteOrigin_Widget' ) ) {
$shortcode = 'siteorigin_widget';
}
return $shortcode;
}
add_filter( 'siteorigin_panels_cache_shortcode', 'siteorigin_widget_shortcode_panels_cache_shortcode', 10, 2 );