PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Helpers
<?php namespace WilokeListingTools\Framework\Helpers; use WilokeListingTools\Frontend\User; class AbstractSkeleton { protected $aAtts; /** * @var $post \WP_Post */ protected $post; protected $postID; protected $postType; protected $aCache; protected $galleryPreviewSize = 'medium'; protected function setCache($key, $val): void { $this->aCache[$this->postID.$key] = $val; } protected function setGalleryPreviewSize($size): void { $this->galleryPreviewSize = $size; } /** * @return array */ protected function getGallery(): array { $aItems = GetSettings::getPostMeta($this->postID, 'gallery'); return GalleryHelper::gallerySkeleton($aItems, $this->galleryPreviewSize); } protected function getOGallery(): array { return $this->getGallery(); } protected function getCache($key) { return isset($this->aCache[$this->postID.$key]) ? $this->aCache[$this->postID.$key] : null; } protected function getMenuOrder(): int { return abs($this->post->menu_order); } /** * @param $postID */ public function setPostID($postID): void { $this->postID = abs($postID); } protected function setPostType(): void { $this->postType = $this->post->post_type; } /** * @param $post */ public function setPost($post): void { $this->post = $post; $this->setPostType(); $this->setPostID($post->ID); } protected function getPostTitle(): String { return $this->post->post_title; } /** * @return string */ protected function getTitle(): String { return $this->getPostTitle(); } protected function getPostContent(): String { return do_shortcode($this->post->post_content); } protected function getContent(): String { return $this->getPostContent(); } /** * @return string */ protected function getPermalink(): ?string { return get_permalink($this->postID); } protected function getParentID(): ?int { if ($postID = $this->getCache('parentID')) { return $postID; } $val = abs(wp_get_post_parent_id($this->post)); $this->setCache('parentID', $val); return $val; } protected function getID(): ?int { return abs($this->post->ID); } protected function getPostID(): ?int { return abs($this->post->ID); } /** * @return int|null */ protected function getAuthorID(): ?int { return abs($this->post->post_author); } protected function getPostType(): ?string { return $this->post->post_type; } protected function getPostAuthor(): ?int { return abs($this->post->post_author); } protected function getCountShared(): int { return abs(GetSettings::getPostMeta($this->postID, 'count_shared')); } protected function getIsAuthor(): string { return $this->post->post_author == get_current_user_id() ? 'yes' : 'no'; } protected function getPostDate(): ?string { return date_i18n(get_option('date_format'), strtotime($this->post->post_date)); } protected function getDate(): ?string { return $this->getPostDate(); } protected function getPostLink(): ?string { return $this->getPermalink(); } protected function getLink(): ?string { return $this->getPermalink(); } /** * @param $aPluck * * @return array */ public function pluck($aPluck): array { $aItems = []; if (!empty($aPluck)) { foreach ($aPluck as $pluck) { $funcName = 'get'.ucfirst($pluck); if (is_callable([$this, $funcName])) { $aItems[$pluck] = $this->$funcName(); } } } return $aItems; } }
[+]
..
[-] SearchFieldSkeleton.php
[edit]
[-] FileSystem.php
[edit]
[-] Response.php
[edit]
[-] GetWilokeSubmission.php
[edit]
[-] AbstractSkeleton.php
[edit]
[-] InheritCMB2Styles.php
[edit]
[-] ReviewSkeleton.php
[edit]
[-] RestaurantMenu.php
[edit]
[-] WooCommerce.php
[edit]
[-] MapHelpers.php
[edit]
[-] .DS_Store
[edit]
[-] Message.php
[edit]
[-] GetSettings.php
[edit]
[-] QueryHelper.php
[edit]
[+]
Collection
[-] Inc.php
[edit]
[-] UserSkeleton.php
[edit]
[-] Firebase.php
[edit]
[-] Repository.php
[edit]
[-] DebugStatus.php
[edit]
[-] MapFactory.php
[edit]
[-] SetSettings.php
[edit]
[-] AddListingFieldSkeleton.php
[edit]
[-] VideoHelper.php
[edit]
[-] SearchFormSkeleton.php
[edit]
[-] PostSkeleton.php
[edit]
[-] KCHelpers.php
[edit]
[-] ProductSkeleton.php
[edit]
[-] QRCodeGenerator.php
[edit]
[-] HTML.php
[edit]
[-] Time.php
[edit]
[-] PlanHelper.php
[edit]
[-] SemanticUi.php
[edit]
[-] AjaxMsg.php
[edit]
[-] Logger.php
[edit]
[-] Cookie.php
[edit]
[-] Validation.php
[edit]
[-] GalleryHelper.php
[edit]
[-] AuthorSkeleton.php
[edit]
[-] General.php
[edit]
[-] Submission.php
[edit]
[-] TermSetting.php
[edit]