add_filter('meta_content', 'wptexturize');
add_filter('meta_content', 'convert_smilies');
add_filter('meta_content', 'convert_chars');
add_filter('meta_content', 'wpautop');
add_filter('meta_content', 'shortcode_unautop');
add_filter('meta_content', 'prepend_attachment');
$unformatted_content = get_post_meta($post->ID, '_specifications', true);
$formatted_content = apply_filters('meta_content', $unformatted_content);
echo $formatted_content;
function add_shortcode_button() {
echo '<a href="#" id="add_shortcode_button" class="button"> <span class="dashicons dashicons-editor-code" style="padding-top: 4px; padding-right: 4px;"></span> My Shortcode</a>';
}
function include_shortcode_button_files() {
wp_enqueue_script('shortcode_js', get_template_directory_uri() . '/shortcodes.js', array('jquery'), '1.0', true);
wp_enqueue_style('shortcode_css', get_template_directory_uri() . '/shortcodes.css', false, '1.0');
}
if ( current_user_can('edit_posts') && current_user_can('edit_pages') ) {
add_action('media_buttons', 'add_shortcode_button', 15);
add_action('wp_enqueue_media', 'include_shortcode_button_files');
}
function shortcode_popup() {
?>
<div id="shortcode_window"> Bla Bla Bla... </div>
<?php
}
add_action( 'admin_footer', 'shortcode_popup' );
jQuery(document).ready(function($) {
$("#add_shortcode_button").click(function() {
$("#shortcode_window").show();
});
});
#shortcode_window {
display: none;
}
function getShortcodeOutput() {
ob_start();
echo "some text1\n";
echo "some text2\n";
echo "some text3\n";
echo "some text4\n";
$result = ob_get_contents();
ob_end_clean();
return $result;
}
function getShortcodeOutput() {
$result = "";
$result .= "some text1\n";
$result .= "some text2\n";
$result .= "some text3\n";
$result .= "some text4\n";
return $result;
}
function shortcodeSliderInit($atts) {
$result = '';
extract(shortcode_atts(array(
'name' => '',
'slideshow' => 0,
'animation' => 'fade',
'controlnav' => 0,
'randomize' => 0
), $atts));
if (!$name) { return FALSE; }
$slider = ale_sliders_get_slider($name);
if (!$slider) { return FALSE; }
$slider_id = sanitize_title('ale-slider-' . $slider['slug'] . '-' . wp_generate_password(5, false));
$result .= '<div id="' . $slider_id . '" class="ale-slider-slides">';
$result .= '<div class="owl-carousel owl-theme">';
foreach ($slider['slides'] as $slide) {
if ($slide['image']) {
if ($slide['url']) {
$result .= '<a href="' . $slide['url'] . '" class="swipebox">';
}
$result .= '<img src="' . $slide['image'] . '" alt="' . $slide['title'] . '" />';
if ($slide['url']) {
$result .= '</a>';
}
}
}
$result .= '</div>';
$result .= '</div>';
return $result;
}
public function save_metabox($post_id) {
$this->save_metabox1( $post_id );
$this->save_metabox2( $post_id );
$this->save_metabox3( $post_id );
}
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array( 'post_type' => 'blog', 'posts_per_page' => 1, 'paged' => $paged );
$loop = new WP_Query( $args );
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="col-md-4">
<div class="blog-item_box">
<div class="blog-item_img-box"><img src="<?php the_field('img_blog-item') ?>" alt=""></div>
<div class="blog-item_title"><?php the_content(); ?></div>
<div class="blog-item_info"><?php the_excerpt(); ?></div><a class="blog-item_details-info" href="<?php the_permalink(); ?>">Узнать подробнее</a>
</div>
</div>
<?php endwhile; ?>
<?php the_posts_pagination(); ?>
get_posts(array(
'meta_key' => 'xxx_key',
'meta_value' => 'Брянская область'
));
get_posts(array(
'meta_query' => array(
array(
'key' => 'ххх_key',
'value' => array('Брянская область', 'Московская область'),
'compare' => 'IN'
)
)
));