PHP Class Themosis\View\Loop

Show file Open project: themosis/framework

Public Methods

Method Description
author ( ) : string Get the author of the current post.
authorMeta ( string $field = '', integer $user_id ) : string Get author meta.
category ( integer $id ) : array Get the categories of the current post.
content ( string $more_text = null, boolean $strip_teaser = false ) : string Get the content of the current post.
date ( string $d = '', integer | WP_Post $post = null ) : string Get the date of the current post.
excerpt ( integer | WP_Post $post = null ) : string Get the excerpt of the current post.
id ( ) : integer Get the id of the current post.
link ( integer | WP_Post $post, boolean $leavename = false ) : string Get the permalink of the current post.
nextPage ( string $label = null, integer $max_page ) : string Return the next link html anchor tag for post entries.
paginate ( array $args = [] ) : string | array Return a pagination for any type of loops.
postClass ( string | array $class = '', integer | WP_Post $post_id = null ) : string Add the classes for a given post.
previousPage ( string $label = null ) : string | void Return the previous link html anchor tag for post entries.
tags ( integer $id ) : array Get the tags of the current post.
terms ( string $taxonomy, $post ) : array | false | WP_Error Get the terms (custom taxonomies) of the current post.
thumbnail ( $size = 'post-thumbnail', $attr = '', $post = null ) : string Get the post thumbnail of the current post.
thumbnailUrl ( string | array $size = null, boolean $icon = false ) : null | string Get thumbnail url of current post.
title ( integer | WP_post $post ) : string Get the title of the current post.

Method Details

author() public method

Get the author of the current post.
public author ( ) : string
return string The author of the current post.

authorMeta() public method

Get author meta.
public authorMeta ( string $field = '', integer $user_id ) : string
$field string User field name.
$user_id integer The user ID.
return string

category() public method

Get the categories of the current post.
public category ( integer $id ) : array
$id integer The post ID.
return array The categories of the current post.

content() public method

Get the content of the current post.
public content ( string $more_text = null, boolean $strip_teaser = false ) : string
$more_text string Content to show when there is more text.
$strip_teaser boolean Strip teaser content before the more text.
return string The content of the current post.

date() public method

Get the date of the current post.
public date ( string $d = '', integer | WP_Post $post = null ) : string
$d string Date format.
$post integer | WP_Post The post ID or WP_Post object
return string The date of the current post.

excerpt() public method

Get the excerpt of the current post.
public excerpt ( integer | WP_Post $post = null ) : string
$post integer | WP_Post
return string The excerpt of the current post.

id() public method

Get the id of the current post.
public id ( ) : integer
return integer The ID of the current post.

nextPage() public method

Return the next link html anchor tag for post entries.
public nextPage ( string $label = null, integer $max_page ) : string
$label string Link content
$max_page integer Max pages in current query.
return string

paginate() public method

Return a pagination for any type of loops.
See also: https://developer.wordpress.org/reference/functions/paginate_links/
public paginate ( array $args = [] ) : string | array
$args array
return string | array

postClass() public method

Add the classes for a given post.
Author: Guriev Eugen
public postClass ( string | array $class = '', integer | WP_Post $post_id = null ) : string
$class string | array One or more classes to add to the post class list.
$post_id integer | WP_Post The post ID or the post object.
return string

previousPage() public method

Return the previous link html anchor tag for post entries.
public previousPage ( string $label = null ) : string | void
$label string Link content
return string | void

tags() public method

Get the tags of the current post.
public tags ( integer $id ) : array
$id integer The post ID
return array The tags of the current post.

terms() public method

Get the terms (custom taxonomies) of the current post.
See also: https://codex.wordpress.org/Function_Reference/get_the_terms
public terms ( string $taxonomy, $post ) : array | false | WP_Error
$taxonomy string The custom taxonomy slug.
return array | false | WP_Error

thumbnail() public method

Get the post thumbnail of the current post.
public thumbnail ( $size = 'post-thumbnail', $attr = '', $post = null ) : string
return string The thumbnail of the current post.

thumbnailUrl() public method

Get thumbnail url of current post.
public thumbnailUrl ( string | array $size = null, boolean $icon = false ) : null | string
$size string | array The size of the current post thumbnail.
$icon boolean
return null | string

title() public method

Get the title of the current post.
public title ( integer | WP_post $post ) : string
$post integer | WP_post The post ID or \WP_Post object
return string The title of the current post.