: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Display template content
* @param object $second_query Query object.
function prtfl_get_content( $second_query ) {
global $post, $prtfl_options;
$request = $second_query->request;
$count_portfolio_row_block = 0;
$prtfl_widht = 99 / $prtfl_options['custom_portfolio_row_count'];
if ( ! empty( $post ) && ! empty( $post->post_content ) ) {
$page_content = $post->post_content;
if ( function_exists( 'mltlngg_the_content_filter' ) ) {
$page_content = mltlngg_the_content_filter( $page_content );
/* dublicate filter 'the_content' - as we couldnt use it */
if ( function_exists( 'wptexturize' ) ) {
$page_content = wptexturize( $page_content );
if ( function_exists( 'convert_smilies' ) ) {
$page_content = convert_smilies( $page_content );
if ( function_exists( 'wpautop' ) ) {
$page_content = wpautop( $page_content );
if ( function_exists( 'shortcode_unautop' ) ) {
$page_content = shortcode_unautop( $page_content );
if ( function_exists( 'prepend_attachment' ) ) {
$page_content = prepend_attachment( $page_content );
if ( function_exists( 'wp_filter_content_tags' ) ) {
$page_content = wp_filter_content_tags( $page_content );
} elseif ( function_exists( 'wp_make_content_images_responsive' ) ) {
$page_content = wp_make_content_images_responsive( $page_content );
if ( function_exists( 'do_shortcode' ) ) {
$page_content = do_shortcode( $page_content );
<div class="portfolio_content entry-content">
<div class="entry"><?php echo wp_kses_post( $page_content ); ?></div>
if ( $second_query->have_posts() ) {
while ( $second_query->have_posts() ) {
$second_query->the_post();
if ( 0 === $count_portfolio_row_block % $prtfl_options['custom_portfolio_row_count'] ) {
<div class="portfolio_row_count">
<div id="portfolio_row_count_block" class="portfolio_row_count_block" style="width: <?php echo esc_attr( $prtfl_widht ); ?>%">
<div class="portfolio_content<?php echo in_array( get_stylesheet(), array( 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentynineteen', 'twentytwenty' ) ) ? esc_attr( ' entry-content' ) : ''; ?>">
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $post_thumbnail_id, $prtfl_options['image_size_album'] );
$post_meta = get_post_meta( $post->ID, 'prtfl_information', true );
$short_descr = isset( $post_meta['_prtfl_short_descr'] ) ? $post_meta['_prtfl_short_descr'] : '';
if ( empty( $short_descr ) ) {
$short_descr = get_the_excerpt();
$title = get_the_title();
$title = '(' . __( 'No title', 'portfolio' ) . ')';
$permalink = get_permalink();
if ( ! empty( $image[0] ) ) {
/* get width and height for image_size_album */
if ( 'portfolio-thumb' !== $prtfl_options['image_size_album'] ) {
$width = absint( get_option( $prtfl_options['image_size_album'] . '_size_w' ) );
$height = absint( get_option( $prtfl_options['image_size_album'] . '_size_h' ) );
$width = $prtfl_options['custom_size_px']['portfolio-thumb'][0];
$height = $prtfl_options['custom_size_px']['portfolio-thumb'][1];
$image_alt = get_post_meta( $post_thumbnail_id, '_wp_attachment_image_alt', true );
<div class="portfolio_thumb">
<a rel="bookmark" href="<?php echo esc_url( $permalink ); ?>" title="<?php echo esc_html( $title ); ?>">
<img src="<?php echo esc_url( $image[0] ); ?>" alt="<?php echo esc_html( $image_alt ); ?>" <?php echo isset( $width ) ? 'width="' . esc_attr( $width ) . '"' : ''; ?> <?php echo isset( $height ) ? 'height="' . esc_attr( $height ) . '"' : ''; ?>
style="<?php echo isset( $width ) ? 'width:' . esc_attr( $width ) . 'px;' : ''; ?> <?php echo isset( $height ) ? 'height:' . esc_attr( $height ) . 'px;' : ''; ?>" />
</div><!-- .portfolio_thumb -->
<div class="portfolio_short_content">
<a href="<?php echo esc_url( $permalink ); ?>" rel="bookmark"><?php echo wp_kses_post( $title ); ?></a>
</div><!-- .item_title -->
$date_compl = isset( $post_meta['_prtfl_date_compl'] ) ? $post_meta['_prtfl_date_compl'] : '';
if ( 1 === absint( $prtfl_options['date_additional_field'] ) && ! empty( $date_compl ) ) {
<span class="lable"><?php echo '<b>' . wp_kses_post( $prtfl_options['date_text_field'] ) . '</b>'; ?></span> <?php echo wp_kses_post( $date_compl ); ?>
$user_id = get_current_user_id();
$link = isset( $post_meta['_prtfl_link'] ) ? $post_meta['_prtfl_link'] : '';
if ( 1 === absint( $prtfl_options['link_additional_field'] ) && ! empty( $link ) ) {
if ( false !== wp_parse_url( $link ) ) {
if ( ( 0 === $user_id && 0 === absint( $prtfl_options['link_additional_field_for_non_registered'] ) ) || 0 !== $user_id ) {
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $prtfl_options['link_text_field'] ) . '</b>'; ?></span> <a href="<?php echo esc_url( $link ); ?>"><?php echo esc_url( $link ); ?></a></p>
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $prtfl_options['link_text_field'] ) . '</b>'; ?></span> <?php echo esc_url( $link ); ?></p>
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $prtfl_options['link_text_field'] ) . '</b>'; ?></span> <?php echo esc_url( $link ); ?></p>
if ( 1 === absint( $prtfl_options['shrdescription_additional_field'] ) ) {
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $prtfl_options['shrdescription_text_field'] ) . '</b>'; ?></span> <?php echo wp_kses_post( $short_descr ); ?></p>
</div><!-- .portfolio_short_content -->
<div class="entry_footer">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php esc_html_e( 'Read more', 'portfolio' ); ?></a>
</div><!-- .read_more -->
$terms = wp_get_object_terms( $post->ID, 'portfolio_technologies' );
if ( 1 === absint( $prtfl_options['technologies_additional_field'] ) && ! is_wp_error( $terms ) ) {
if ( is_array( $terms ) && 0 < count( $terms ) ) {
<div class="portfolio_terms">
if ( isset( $prtfl_options['technologies_text_field'] ) ) {
echo '<b>' . esc_html( $prtfl_options['technologies_text_field'] ) . ' </b>';}
foreach ( $terms as $term ) {
$links[] = '<a href="' . get_term_link( $term->slug, 'portfolio_technologies' ) . '" title="' . sprintf( esc_html__( 'View all projects in %s' ), $term->name ) . '">' . $term->name . '</a>';
echo wp_kses_post( implode( ', ', $links ) );
</div><!-- .portfolio_terms -->
</div><!-- .entry_footer -->
</div><!-- .portfolio_content -->
<?php if ( ( $count_portfolio_row_block % $prtfl_options['custom_portfolio_row_count'] ) === ( $prtfl_options['custom_portfolio_row_count'] - 1 ) ) { ?>
<div class="clear"></div>
</div><!-- .portfolio_row_count -->
$count_portfolio_row_block++;
if ( 0 !== $count_portfolio_row_block % $prtfl_options['custom_portfolio_row_count'] ) {
<div class="clear"></div>
if ( ! function_exists( 'prtfl_post_get_content' ) ) {
* Display post template content
function prtfl_post_get_content() {
global $post, $prtfl_options;
<article class="portfolio_content entry-content">
$portfolio_options = get_option( 'prtfl_options' );
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $post_thumbnail_id, $prtfl_options['image_size_album'] );
$post_meta = get_post_meta( $post->ID, 'prtfl_information', true );
if ( ! empty( $image[0] ) ) {
$image_large = wp_get_attachment_image_src( $post_thumbnail_id, 'large' );
$image_desc = get_post( $post_thumbnail_id );
$image_desc = $image_desc->post_content;
/* get width and height for image_size_album */
if ( 'portfolio-thumb' !== $prtfl_options['image_size_album'] ) {
$width = absint( get_option( $prtfl_options['image_size_album'] . '_size_w' ) );
$height = absint( get_option( $prtfl_options['image_size_album'] . '_size_h' ) );
$width = $prtfl_options['custom_size_px']['portfolio-thumb'][0];
$height = $prtfl_options['custom_size_px']['portfolio-thumb'][1];
$image_alt = get_post_meta( $post_thumbnail_id, '_wp_attachment_image_alt', true );
<div class="portfolio_thumb">
<a class="lightbox" data-fancybox="portfolio_fancybox" href="<?php echo esc_url( $image_large[0] ); ?>" title="<?php echo wp_kses_post( $image_desc ); ?>">
<img src="<?php echo esc_url( $image[0] ); ?>" alt="<?php echo esc_html( $image_alt ); ?>"
echo 'width="' . esc_attr( $width ) . '"';
echo 'height="' . esc_attr( $height ) . '"';
</div><!-- .portfolio_thumb -->
<div class="portfolio_short_content">
$date_compl = isset( $post_meta['_prtfl_date_compl'] ) ? $post_meta['_prtfl_date_compl'] : '';
if ( 1 === absint( $portfolio_options['date_additional_field'] ) && ! empty( $date_compl ) ) {
<span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['date_text_field'] ) . '</b>'; ?></span> <?php echo wp_kses_post( $date_compl ); ?>
$user_id = get_current_user_id();
$link = isset( $post_meta['_prtfl_link'] ) ? $post_meta['_prtfl_link'] : '';
if ( 1 === absint( $portfolio_options['link_additional_field'] ) && ! empty( $link ) ) {
if ( false !== wp_parse_url( $link ) ) {
<?php if ( ( 0 === $user_id && 0 === absint( $portfolio_options['link_additional_field_for_non_registered'] ) ) || 0 !== $user_id ) { ?>
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['link_text_field'] ) . '</b>'; ?></span> <a href="<?php echo esc_url( $link ); ?>"><?php echo esc_url( $link ); ?></a></p>
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['link_text_field'] ) . '</b>'; ?></span> <?php echo esc_url( $link ); ?></p>
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['link_text_field'] ) . '</b>'; ?></span> <?php echo esc_url( $link ); ?></p>
if ( 1 === absint( $portfolio_options['description_additional_field'] ) ) {
remove_filter( 'the_content', 'pdfprnt_content' );
$full_descr = '' !== $post->post_content ? apply_filters( 'the_content', $post->post_content ) : '';
add_filter( 'the_content', 'pdfprnt_content' );
if ( empty( $full_descr ) ) {
$full_descr = isset( $post_meta['_prtfl_short_descr'] ) ? $post_meta['_prtfl_short_descr'] : '';
if ( function_exists( 'mltlngg_the_content_filter' ) ) {
$full_descr = mltlngg_the_content_filter( $full_descr );
/* dublicate filter 'the_content' - as we couldnt use it */
if ( function_exists( 'wptexturize' ) ) {
$full_descr = wptexturize( $full_descr );
if ( function_exists( 'convert_smilies' ) ) {
$full_descr = convert_smilies( $full_descr );
if ( function_exists( 'wpautop' ) ) {
$full_descr = wpautop( $full_descr );
if ( function_exists( 'shortcode_unautop' ) ) {
$full_descr = shortcode_unautop( $full_descr );
if ( function_exists( 'prepend_attachment' ) ) {
$full_descr = prepend_attachment( $full_descr );
if ( function_exists( 'wp_filter_content_tags' ) ) {
$full_descr = wp_filter_content_tags( $full_descr );
} elseif ( function_exists( 'wp_make_content_images_responsive' ) ) {
$full_descr = wp_make_content_images_responsive( $full_descr );
if ( function_exists( 'do_shortcode' ) ) {
$full_descr = do_shortcode( $full_descr );
if ( ! empty( $full_descr ) ) {
<div style = "clear: both;"><span class="lable"><?php echo '<b>' . wp_kses_post( $prtfl_options['description_text_field'] ) . '</b>'; ?></span> <?php echo wp_kses_post( $full_descr ); ?></div>
if ( 0 !== $user_id || 0 === absint( $portfolio_options['svn_additional_field_for_non_logged'] ) ) {
$svn = isset( $post_meta['_prtfl_svn'] ) ? $post_meta['_prtfl_svn'] : '';
if ( 1 === absint( $portfolio_options['svn_additional_field'] ) && ! empty( $svn ) ) {
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['svn_text_field'] ) . '</b>'; ?></span> <?php echo esc_url( $svn ); ?></p>
$executors_profile = wp_get_object_terms( $post->ID, 'portfolio_executor_profile' );
if ( 1 === absint( $portfolio_options['executor_additional_field'] ) && ! empty( $executors_profile ) ) {
<p><span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['executor_text_field'] ) . '</b>'; ?></span>
foreach ( $executors_profile as $profile ) {
<a href="<?php echo esc_url( get_term_link( $profile->slug, 'portfolio_executor_profile' ) ); ?>" title="<?php echo wp_kses_post( $profile->name ); ?> profile" target="_blank"><?php echo wp_kses_post( $profile->name ); ?></a>
</div><!-- .portfolio_short_content -->
<div class="portfolio_images_block" data-columns="<?php echo esc_attr( $portfolio_options['custom_image_row_count'] ); ?>">
if ( metadata_exists( 'post', $post->ID, '_prtfl_images' ) ) {
$array_post_thumbnail_id = array_filter( explode( ',', get_post_meta( $post->ID, '_prtfl_images', true ) ) );
/* Compatibility with old plugin version 2.37 */
'post_parent' => $post->ID,
'post_type' => 'attachment',
'post_mime_type' => 'image',
'orderby' => 'menu_order',
'exclude' => $post_thumbnail_id,
$array_post_thumbnail_id = get_children( $args );
$count_element = count( $array_post_thumbnail_id );
foreach ( $array_post_thumbnail_id as $key => $value ) {
$image = wp_get_attachment_image_src( $value, $prtfl_options['image_size_photo'] );
$image_large = wp_get_attachment_image_src( $value, 'large' );
$image_alt = get_post_meta( $value, '_wp_attachment_image_alt', true );
$image_title = get_post_meta( $value, '_wp_attachment_image_title', true );
$image_desc = get_post( $value );
$image_desc = $image_desc->post_content;
/* get width and height for image_size_photo */
if ( 'portfolio-photo-thumb' !== $prtfl_options['image_size_photo'] ) {
$width = absint( get_option( $prtfl_options['image_size_photo'] . '_size_w' ) );
$height = absint( get_option( $prtfl_options['image_size_photo'] . '_size_h' ) );
$width = $prtfl_options['custom_size_px']['portfolio-photo-thumb'][0];
$height = $prtfl_options['custom_size_px']['portfolio-photo-thumb'][1];
<span class="lable"><?php echo '<b>' . wp_kses_post( $portfolio_options['screenshot_text_field'] ) . '</b>'; ?></span>
<div class="portfolio_images_rows">
<div class="portfolio_images_gallery">
<a class="lightbox" data-fancybox="portfolio_fancybox" href="<?php echo esc_url( $image_large[0] ); ?>" title="<?php echo esc_html( $image_desc ); ?>">
<img src="<?php echo esc_url( $image[0] ); ?>" alt="<?php echo esc_html( $image_alt ); ?>" <?php echo isset( $width ) ? 'width="' . esc_attr( $width ) . '"' : ''; ?> <?php echo isset( $height ) ? 'height="' . esc_attr( $height ) . '"' : ''; ?>
style="<?php echo isset( $width ) ? 'width:' . esc_attr( $width ) . 'px;' : ''; ?> <?php echo isset( $height ) ? 'height:' . esc_attr( $height ) . 'px;' : ''; ?>" />
<br /><?php echo wp_kses_post( $image_title ); ?>
<?php if ( 0 === ( $key + 1 ) % $portfolio_options['custom_image_row_count'] && 0 !== $key && $key + 1 !== $count_element ) { ?>
</div><!-- .portfolio_images_rows -->
<div class="portfolio_images_rows">
if ( 0 < $count_element ) {
</div><!-- .portfolio_images_rows -->
</div><!-- .portfolio_images_block -->
<div class="entry_footer entry-footer">
$terms = wp_get_object_terms( $post->ID, 'portfolio_technologies' );
if ( 1 === absint( $portfolio_options['technologies_additional_field'] ) && ! ( empty( $terms ) || is_wp_error( $terms ) ) ) {
if ( is_array( $terms ) && 0 < count( $terms ) ) {
<div class="portfolio_terms">
if ( isset( $portfolio_options['technologies_text_field'] ) ) {
echo '<b>' . wp_kses_post( $portfolio_options['technologies_text_field'] ) . ' </b>';}
foreach ( $terms as $term ) {
$links[] = '<a href="' . esc_url( get_term_link( $term->slug, 'portfolio_technologies' ) ) . '" title="' . sprintf( esc_html__( 'View all projects in %s' ), $term->name ) . '">' . esc_html( $term->name ) . '</a>';
echo wp_kses_post( implode( ', ', $links ) );
</div><!-- .portfolio_terms -->
</div><!-- .entry_footer .entry-footer -->
$content = ob_get_contents();
echo wp_kses_post( $content );
</article><!-- .portfolio_content -->
if ( ! function_exists( 'prtfl_pro_pagination' ) ) {
* This function prints pagination for portfolio post type template
* @param object $second_query Query object.
* @param array $args Link to args.
function prtfl_pro_pagination( $second_query, &$args ) {
global $wp_query, $prtfl_options;
$count_all_albums = $second_query->found_posts;
$request = $wp_query->request;
$per_page = $args['posts_per_page'];
$pages = intval( $count_all_albums / $per_page );
if ( $count_all_albums % $per_page > 0 ) {
<div class='clear'></div>
<div id="portfolio_pagenation">
<div class="<?php echo 'twentynineteen' === get_stylesheet() ? esc_attr( 'nav-links' ) : ''; ?>">
if ( 2 < $paged && $paged > $range + 1 && $showitems < $pages ) {
echo "<a href='" . esc_url( get_pagenum_link( 1 ) ) . "'>«</a>";
if ( 1 < $paged && $showitems < $pages ) {
echo "<a href='" . esc_url( get_pagenum_link( $paged - 1 ) ) . "'>‹</a>";
for ( $i = 1; $i <= $pages; $i++ ) {
if ( 1 !== $pages && ( ! ( $i >= $paged + $range + 1 || $i <= $paged - $range - 1 ) || $pages <= $showitems ) ) {
echo ( $paged === $i ) ? "<span class='current'>" . esc_html( $i ) . '</span>' : "<a href='" . esc_url( get_pagenum_link( $i ) ) . "' class='inactive' >" . esc_html( $i ) . '</a>';
if ( $paged < $pages && $showitems < $pages ) {
echo "<a href='" . esc_url( get_pagenum_link( $paged + 1 ) ) . "'>›</a>";
if ( $paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages ) {
echo "<a href='" . esc_url( get_pagenum_link( $pages ) ) . "'>»</a>";
<div class='clear'></div>
</div><!-- .pagination -->
if ( function_exists( 'pgntn_display_pagination' ) ) {
pgntn_display_pagination( 'custom', $second_query );}
</div><!-- #portfolio_pagenation -->
if ( ! function_exists( 'prtfl_shortcode_button_content' ) ) {
* @param string $content Shortcode content.
function prtfl_shortcode_button_content( $content ) {
<div id="prtfl" style="display:none;">
<input type="number" value="3" min="0" max="1000" name="prtfl_display_count" id="prtfl_display_count" class="small-text" />
<?php esc_html_e( 'The number of portfolio projects to display', 'portfolio' ); ?>