Method |
Description |
|
__construct ( array $attributes = [] ) |
|
|
__get ( string $key ) : string |
Magic method to return the meta data like the post original fields. |
|
addShortcode ( string $tag, function $function ) |
Add a shortcode handler |
|
attachment ( ) : Illuminate\Database\Eloquent\Collection |
Get attachment. |
|
author ( ) : Illuminate\Database\Eloquent\Collection |
Author relationship. |
|
clearRegisteredPostTypes ( ) |
Clears any registered post types |
|
comments ( ) : Illuminate\Database\Eloquent\Collection |
Comments relationship. |
|
fields ( ) |
|
|
getAcfAttribute ( ) : Corcel\Acf\AdvancedCustomFields |
|
|
getAuthorIdAttribute ( ) : integer |
Gets the author id attribute. |
|
getContentAttribute ( ) : string |
Gets the content attribute. |
|
getCreatedAtAttribute ( ) : date |
Gets the created at attribute. |
|
getExcerptAttribute ( ) : string |
Gets the excerpt attribute. |
|
getFormat ( ) : boolean | string |
Get the post format, like the WP get_post_format() function |
|
getImageAttribute ( ) : string |
Gets the featured image if any
Looks in meta the _thumbnail_id field. |
|
getKeywordsAttribute ( ) : array |
Gets the keywords as array. |
|
getKeywordsStrAttribute ( ) : string |
Gets the keywords as string. |
|
getMainCategoryAttribute ( ) : string |
Gets the first term of the first taxonomy found. |
|
getMimeTypeAttribute ( ) : string |
Gets the mime type attribute. |
|
getParentIdAttribute ( ) : integer |
Gets the parent id attribute. |
|
getSlugAttribute ( ) : string |
Gets the slug attribute. |
|
getStatusAttribute ( ) : string |
Gets the status attribute. |
|
getTermsAttribute ( ) : array |
Gets all the terms arranged taxonomy => terms[]. |
|
getTitleAttribute ( ) : string |
Gets the title attribute. |
|
getTypeAttribute ( ) : string |
Gets the type attribute. |
|
getUpdatedAtAttribute ( ) : date |
Gets the updated at attribute. |
|
getUrlAttribute ( ) : string |
Gets the url attribute. |
|
hasTerm ( string $taxonomy, string $term ) : boolean |
Whether the post contains the term or not. |
|
meta ( ) : Corcel\PostMetaCollection |
Meta data relationship. |
|
newFromBuilder ( array $attributes = [], null $connection = null ) : mixed |
Overrides default behaviour by instantiating class based on the $attributes->post_type value |
|
newQuery ( boolean $excludeDeleted = true ) : Corcel\PostBuilder |
Overriding newQuery() to the custom PostBuilder with some interesting methods. |
|
parent ( ) : Corcel\Post |
Parent post. |
|
registerPostType ( string $name, string $class ) |
Register your Post Type classes here to have them be instantiated instead of the standard Post model |
|
removeShortcode ( string $tag ) |
Removes a shortcode handler |
|
revision ( ) : Illuminate\Database\Eloquent\Collection |
Get revisions from post. |
|
save ( array $options = [] ) |
|
|
scopeHasMeta ( $query, $meta, null $value = null ) : Illuminate\Database\Eloquent\Collection |
Meta filter scope. |
|
stripShortcodes ( string $content ) : string |
Process the shortcodes |
|
taxonomies ( ) : Illuminate\Database\Eloquent\Collection |
Taxonomy relationship. |
|
thumbnail ( ) |
Return the post thumbnail |
|