芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/js_composer/include/autoload/vc-single-image.php
checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie(); $image_id = (int) vc_post_param( 'content' ); $params = vc_post_param( 'params' ); $post_id = (int) vc_post_param( 'post_id' ); $img_size = vc_post_param( 'size' ); $img = ''; if ( ! empty( $params['source'] ) ) { $source = $params['source']; } else { $source = 'media_library'; } switch ( $source ) { case 'media_library': case 'featured_image': if ( 'featured_image' === $source ) { if ( $post_id && has_post_thumbnail( $post_id ) ) { $img_id = get_post_thumbnail_id( $post_id ); } else { $img_id = 0; } } else { $img_id = preg_replace( '/[^\d]/', '', $image_id ); } if ( ! $img_size ) { $img_size = 'thumbnail'; } if ( $img_id ) { $img = wp_get_attachment_image_src( $img_id, $img_size ); if ( $img ) { $img = $img[0]; } } break; case 'external_link': if ( ! empty( $params['custom_src'] ) ) { $img = $params['custom_src']; } break; } echo esc_url( $img ); die(); }