PHP Class Themosis\View\Loop

Afficher le fichier Open project: themosis/framework

Méthodes publiques

Méthode 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 méthode

Get the author of the current post.
public author ( ) : string
Résultat string The author of the current post.

authorMeta() public méthode

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

category() public méthode

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

content() public méthode

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.
Résultat string The content of the current post.

date() public méthode

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
Résultat string The date of the current post.

excerpt() public méthode

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

id() public méthode

Get the id of the current post.
public id ( ) : integer
Résultat integer The ID of the current post.

nextPage() public méthode

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.
Résultat string

paginate() public méthode

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
Résultat string | array

postClass() public méthode

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.
Résultat string

previousPage() public méthode

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

tags() public méthode

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

terms() public méthode

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.
Résultat array | false | WP_Error

thumbnail() public méthode

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

thumbnailUrl() public méthode

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
Résultat null | string

title() public méthode

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
Résultat string The title of the current post.