PHP 클래스 Pressbooks\Book

파일 보기 프로젝트 열기: pressbooks/pressbooks 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$fixDupeSlugs array This can happen if a post is 'draft', 'pending', or 'auto-draft'

공개 메소드들

메소드 설명
__construct ( )
consolidatePost ( integer $pid, WP_Post $post ) : boolean Ensures this chapter/part/front matter has a "menu_order" when it is saved
deleteBookObjectCache ( ) Delete the Book Object cache(s)
deletePost ( integer $pid ) : boolean Put a Part/Chapter/Front Matter/Back Matter in the trash
get ( string $what = 'next' ) : string Fetch next, previous or first post
getBookContents ( ) : array Returns an array representing the entire structure of a book, in correct order, with a maximum amount of fields. Data is raw and must be post-processed.
getBookInformation ( $id = '' ) : array Returns book information in a useful, string only, format. Data is converted to HTML.
getBookStructure ( string $id = '' ) : array Returns an array representing the entire structure of a book, in correct order, with a minimum amount of fields. Data is raw and must be post-processed.
getFirst ( ) : string Select the very first post in a book. May be a chapter or a front matter post
getSubsections ( $id ) : array | false Returns an array of subsections in front matter, back matter, or chapters.
isBook ( ) : boolean Check if the current blog_id is considered a "book"
tagSubsections ( string $content, $id ) : string Returns chapter, front or back matter content with section ID and classes added.
updateBackMatter ( ) WP_Ajax hook. Updates the menu_order field associated with a back matter post after reordering it
updateChapter ( ) WP_Ajax hook. Updates the menu_order field associated with a chapter post after reordering it and update its associated part, if necessary
updateExportOptions ( ) WP_Ajax hook. Updates a post's "export" setting (export post into book or not)
updateFrontMatter ( ) WP_Ajax hook. Updates the menu_order field associated with a front matter post after reordering it
updateGlobalPrivacyOptions ( ) WP_Ajax hook. Updates a post's privacy setting (whether the post is published or privately published)
updatePrivacyOptions ( ) WP_Ajax hook. Updates a post's privacy setting (whether the post is published or privately published)
updateShowTitleOptions ( ) WP_Ajax hook. Updates a post's "show title" setting (show title in exports or not)

보호된 메소드들

메소드 설명
fixSlug ( string $old_post_name ) : string Fix empty slugs and Fix duplicate slugs.

메소드 상세

__construct() 공개 메소드

public __construct ( )

consolidatePost() 정적인 공개 메소드

Ensures this chapter/part/front matter has a "menu_order" when it is saved
static public consolidatePost ( integer $pid, WP_Post $post ) : boolean
$pid integer Post ID
$post WP_Post Post
리턴 boolean

deleteBookObjectCache() 정적인 공개 메소드

Delete the Book Object cache(s)
static public deleteBookObjectCache ( )

deletePost() 정적인 공개 메소드

Put a Part/Chapter/Front Matter/Back Matter in the trash
static public deletePost ( integer $pid ) : boolean
$pid integer
리턴 boolean

fixSlug() 보호된 정적인 메소드

This can happen if a post is 'draft', 'pending', or 'auto-draft'
protected static fixSlug ( string $old_post_name ) : string
$old_post_name string
리턴 string

get() 정적인 공개 메소드

Fetch next, previous or first post
static public get ( string $what = 'next' ) : string
$what string prev, next or first
리턴 string URL of requested post

getBookContents() 정적인 공개 메소드

Returns an array representing the entire structure of a book, in correct order, with a maximum amount of fields. Data is raw and must be post-processed.
또한 보기: bottom of this file for more info
static public getBookContents ( ) : array
리턴 array

getBookInformation() 정적인 공개 메소드

Returns book information in a useful, string only, format. Data is converted to HTML.
static public getBookInformation ( $id = '' ) : array
리턴 array

getBookStructure() 정적인 공개 메소드

Returns an array representing the entire structure of a book, in correct order, with a minimum amount of fields. Data is raw and must be post-processed.
또한 보기: bottom of this file for more info
static public getBookStructure ( string $id = '' ) : array
$id string
리턴 array

getFirst() 정적인 공개 메소드

Select the very first post in a book. May be a chapter or a front matter post
static public getFirst ( ) : string
리턴 string permalink of the first post

getSubsections() 정적인 공개 메소드

Returns an array of subsections in front matter, back matter, or chapters.
static public getSubsections ( $id ) : array | false
$id
리턴 array | false

isBook() 정적인 공개 메소드

Check if the current blog_id is considered a "book"
static public isBook ( ) : boolean
리턴 boolean

tagSubsections() 정적인 공개 메소드

Returns chapter, front or back matter content with section ID and classes added.
static public tagSubsections ( string $content, $id ) : string
$content string
리턴 string

updateBackMatter() 정적인 공개 메소드

WP_Ajax hook. Updates the menu_order field associated with a back matter post after reordering it
static public updateBackMatter ( )

updateChapter() 정적인 공개 메소드

WP_Ajax hook. Updates the menu_order field associated with a chapter post after reordering it and update its associated part, if necessary
static public updateChapter ( )

updateExportOptions() 정적인 공개 메소드

WP_Ajax hook. Updates a post's "export" setting (export post into book or not)
static public updateExportOptions ( )

updateFrontMatter() 정적인 공개 메소드

WP_Ajax hook. Updates the menu_order field associated with a front matter post after reordering it
static public updateFrontMatter ( )

updateGlobalPrivacyOptions() 정적인 공개 메소드

WP_Ajax hook. Updates a post's privacy setting (whether the post is published or privately published)
static public updateGlobalPrivacyOptions ( )

updatePrivacyOptions() 정적인 공개 메소드

WP_Ajax hook. Updates a post's privacy setting (whether the post is published or privately published)
static public updatePrivacyOptions ( )

updateShowTitleOptions() 정적인 공개 메소드

WP_Ajax hook. Updates a post's "show title" setting (show title in exports or not)
static public updateShowTitleOptions ( )

프로퍼티 상세

$fixDupeSlugs 정적으로 공개적으로 프로퍼티

This can happen if a post is 'draft', 'pending', or 'auto-draft'
또한 보기: wp_unique_post_slug()
static public array $fixDupeSlugs
리턴 array