HEX
Server: Apache
System: Linux webm014.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: circuix (152771)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/circuix/www/wp-content/themes/estore/inc/helpers.php
<?php
/**
 * eStore helper function
 *
 * @package ThemeGrill
 * @subpackage eStore
 * @since 1.4.2
 */


if ( ! function_exists( 'estore_get_post_id' ) ) :
	/**
	 * Store the post ids.
	 *
	 * Since blog page takes the first post as its id,
	 * here we are storing the id of the post and for the blog page,
	 * storing its value via getting the specific page id through:
	 * `get_option( 'page_for_posts' )`
	 *
	 * @return false|int|mixed|string|void
	 */
	function estore_get_post_id() {

		$post_id        = '';
		$page_for_posts = get_option( 'page_for_posts' );

		// For single post and pages.
		if ( is_singular() ) {
			$post_id = get_the_ID();
		} // For the blog page.
		elseif ( is_home() && $page_for_posts ) {
			$post_id = $page_for_posts;
		}

		// Return the post ID.
		return $post_id;

	}
endif;

if ( ! function_exists( 'estore_post_thumbnail' ) ) :
	/**
	 * Displays post thumbnail.
	 */
	function estore_post_thumbnail() {

		if ( has_post_thumbnail() ) {
			$title_attribute     = esc_attr( get_the_title() );
			$thumb_id            = get_post_thumbnail_id( get_the_ID() );
			$img_altr            = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );
			$img_alt             = ! empty( $img_altr ) ? $img_altr : $title_attribute;
			$post_thumbnail_attr = array(
				'alt'   => esc_attr( $img_alt ),
				'title' => esc_attr( $title_attribute ),
			);

			the_post_thumbnail( 'estore-slider', $post_thumbnail_attr );
		}

	}
endif;