: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @package Themify Builder Pro
* @link https://themify.me/
class Tbp_Dynamic_Item_PostImageAttachments extends Tbp_Dynamic_Item {
function get_category() {
return array( 'gallery' );
return __( 'Post Image Attachments', 'tbp' );
function get_value( $args = array() ) {
$args = wp_parse_args( $args, array(
'post_id' => Tbp_Utils::get_actual_viewing_post_id(),
if ( $post = get_post( $args['post_id'] ) ) {
$attachments = get_posts( array(
'post_type' => 'attachment',
'ignore_sticky_posts'=>true,
'post_parent' => $post->ID,
'exclude' => get_post_thumbnail_id( $post->ID )
$ids = wp_list_pluck( $attachments, 'ID' );
return '[gallery ids="' . implode( ',', $ids ) . '"]';
'label' => __( 'Post ID', 'tbp' ),
'help' => __( 'Leave empty to get the data from current post in the loop.', 'tbp' ),