방금 Wordpress 3.5로 업데이트되었지만 코드의 일부가 손상되었습니다 : AJAX를 통해 갤러리와 함께 특정 게시물을로드하는 PHP 파일이 있습니다. 게시물은 [갤러리] 단축 코드가 포함되어Wordpress 3.5 : 이미지가 포함 된 갤러리가 작동하지 않습니다.
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('../../../../wp-load.php');
$id = $_POST['id'];
// query post with this identifier
query_posts('meta_key=identifier&meta_value='.$id);
if (have_posts()) :
while (have_posts()) : the_post();
// add content
$content = apply_filters('the_content', get_the_content());
echo '<div class="content-inner">'.$content.'</div>';
endwhile;
endif;
?>
: 같은
코드가 보인다.
remove_shortcode('gallery');
add_shortcode('gallery', 'parse_gallery_shortcode');
function parse_gallery_shortcode($atts) {
global $post;
extract(shortcode_atts(array(
'orderby' => 'menu_order ASC, ID ASC',
'id' => $post->ID,
'itemtag' => 'dl',
'icontag' => 'dt',
'captiontag' => 'dd',
'columns' => 3,
'size' => 'full',
'link' => 'file'
), $atts));
$args = array(
'post_type' => 'attachment',
'post_parent' => $id,
'numberposts' => -1,
'orderby' => $orderby
);
$images = get_posts($args);
print_r($images);
}
이 아약스로드 사람과 내 사이트의 다른 모든 갤러리와 함께 작동하지만,하지 :이 코드를 사용하여 내 자신의 워드 프레스 갤러리를 구축했습니다. 그리고 그것은 Wordpress 3.4와 함께 작업했습니다.
간과 한 Wordpress 3.5의 변경 사항이 있습니까?