PHP 클래스 Pressbooks\Metadata

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

공개 프로퍼티들

프로퍼티 타입 설명
$currentVersion integer The value for option: pressbooks_metadata_version
$upgradeCheckboxes array We need to upgrade these for compatibility with custom_metdata().

공개 메소드들

메소드 설명
__construct ( )
changeDefaultBookCover ( ) Change default book cover from PNG to JPG
fixDoubleSlashBug ( ) Fix a double slash bug by reactivating theme with new settings.
getDeprecatedComparisonTable ( string $table, boolean $new_as_keys = false ) : array
getLicenseXml ( string $type, string $copyright_holder, string $src_url, string $title, $lang = '' ) : string Takes a known string from metadata, builds a url to hit an api which returns an xml response
getMetaPost ( ) : WP_Post | boolean Returns the latest "metadata" post. There should be only one per book.
getMetaPostMetadata ( ) : array Return metadata attached to the latest "metadata" post.
getMicrodataElements ( ) : string Returns an html blob of microdata elements based on what is set in 'Book Information'
getMidByKey ( integer $post_id, string $meta_key ) : integer | boolean Return a database ID for a given meta key.
getSeoMetaElements ( ) : string Returns an html blob of meta elements based on what is set in 'Book Information'
getWebLicenseHtml ( SimpleXMLElement $response ) : string Returns an HTML blob if given an XML object
makeThumbnailsForBookCover ( ) Generate thumbnails for a user uploaded cover
resetLandingPage ( ) Fix broken landing page
upgrade ( integer $version ) Upgrade metadata.
upgradeBook ( ) Upgrade book metadata.
upgradeBookInformation ( ) Upgrade book information.
upgradeCustomCss ( ) Upgrade Custom CSS types.
upgradeEcommerce ( ) Upgrade Ecommerce metadata

메소드 상세

__construct() 공개 메소드

public __construct ( )

changeDefaultBookCover() 공개 메소드

Change default book cover from PNG to JPG

fixDoubleSlashBug() 공개 메소드

Fix a double slash bug by reactivating theme with new settings.
또한 보기: Pressbooks\Pressbooks::registerThemeDirectories
public fixDoubleSlashBug ( )

getDeprecatedComparisonTable() 공개 메소드

사용 중단:
public getDeprecatedComparisonTable ( string $table, boolean $new_as_keys = false ) : array
$table string
$new_as_keys boolean
리턴 array

getLicenseXml() 정적인 공개 메소드

Takes a known string from metadata, builds a url to hit an api which returns an xml response
또한 보기: https://api.creativecommons.org/docs/readme_15.html
static public getLicenseXml ( string $type, string $copyright_holder, string $src_url, string $title, $lang = '' ) : string
$type string license type
$copyright_holder string of the page
$src_url string of the page
$title string of the page
리턴 string $xml response

getMetaPost() 공개 메소드

Returns the latest "metadata" post. There should be only one per book.
public getMetaPost ( ) : WP_Post | boolean
리턴 WP_Post | boolean

getMetaPostMetadata() 공개 메소드

Return metadata attached to the latest "metadata" post.
public getMetaPostMetadata ( ) : array
리턴 array

getMicrodataElements() 정적인 공개 메소드

Returns an html blob of microdata elements based on what is set in 'Book Information'
static public getMicrodataElements ( ) : string
리턴 string

getMidByKey() 공개 메소드

Return a database ID for a given meta key.
public getMidByKey ( integer $post_id, string $meta_key ) : integer | boolean
$post_id integer
$meta_key string
리턴 integer | boolean

getSeoMetaElements() 정적인 공개 메소드

Returns an html blob of meta elements based on what is set in 'Book Information'
static public getSeoMetaElements ( ) : string
리턴 string

getWebLicenseHtml() 정적인 공개 메소드

Returns an HTML blob if given an XML object
static public getWebLicenseHtml ( SimpleXMLElement $response ) : string
$response SimpleXMLElement
리턴 string $html blob of copyright information

makeThumbnailsForBookCover() 공개 메소드

Generate thumbnails for a user uploaded cover

resetLandingPage() 공개 메소드

Fix broken landing page
public resetLandingPage ( )

upgrade() 공개 메소드

Upgrade metadata.
public upgrade ( integer $version )
$version integer

upgradeBook() 공개 메소드

Upgrade book metadata.
public upgradeBook ( )

upgradeBookInformation() 공개 메소드

Upgrade book information.

upgradeCustomCss() 공개 메소드

Upgrade Custom CSS types.
또한 보기: Pressbooks\Activation::wpmuActivate
public upgradeCustomCss ( )

upgradeEcommerce() 공개 메소드

Upgrade Ecommerce metadata
public upgradeEcommerce ( )

프로퍼티 상세

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

The value for option: pressbooks_metadata_version
또한 보기: upgrade()
static public int $currentVersion
리턴 integer

$upgradeCheckboxes 공개적으로 프로퍼티

We need to upgrade these for compatibility with custom_metdata().
public array $upgradeCheckboxes
리턴 array