Pressbooks\Taxonomy::insertTerms PHP Метод

insertTerms() статический публичный Метод

Insert Front Matter, Back Matter terms and Chapter Terms
static public insertTerms ( )
    static function insertTerms()
    {
        // Front Matter
        wp_insert_term('Abstract', 'front-matter-type', array('slug' => 'abstracts'));
        wp_insert_term('Acknowledgements', 'front-matter-type', array('slug' => 'acknowledgements'));
        wp_insert_term('Before Title Page', 'front-matter-type', array('slug' => 'before-title'));
        wp_insert_term('Chronology, Timeline', 'front-matter-type', array('slug' => 'chronology-timeline'));
        wp_insert_term('Dedication', 'front-matter-type', array('slug' => 'dedication'));
        wp_insert_term('Disclaimer', 'front-matter-type', array('slug' => 'disclaimer'));
        wp_insert_term('Epigraph', 'front-matter-type', array('slug' => 'epigraph'));
        wp_insert_term('Foreword', 'front-matter-type', array('slug' => 'foreword'));
        wp_insert_term('Genealogy, Family Tree', 'front-matter-type', array('slug' => 'genealogy-family-tree'));
        wp_insert_term('Image credits', 'front-matter-type', array('slug' => 'image-credits'));
        wp_insert_term('Introduction', 'front-matter-type', array('slug' => 'introduction'));
        wp_insert_term('List of Abbreviations', 'front-matter-type', array('slug' => 'list-of-abbreviations'));
        wp_insert_term('List of Characters', 'front-matter-type', array('slug' => 'list-of-characters'));
        wp_insert_term('List of Illustrations', 'front-matter-type', array('slug' => 'list-of-illustrations'));
        wp_insert_term('List of Tables', 'front-matter-type', array('slug' => 'list-of-tables'));
        wp_insert_term('Miscellaneous', 'front-matter-type', array('slug' => 'miscellaneous'));
        wp_insert_term('Other Books by Author', 'front-matter-type', array('slug' => 'other-books'));
        wp_insert_term('Preface', 'front-matter-type', array('slug' => 'preface'));
        wp_insert_term('Prologue', 'front-matter-type', array('slug' => 'prologue'));
        wp_insert_term('Recommended citation', 'front-matter-type', array('slug' => 'recommended-citation'));
        wp_insert_term('Title Page', 'front-matter-type', array('slug' => 'title-page'));
        // Back Matter
        wp_insert_term('About the Author', 'back-matter-type', array('slug' => 'about-the-author'));
        wp_insert_term('About the Publisher', 'back-matter-type', array('slug' => 'about-the-publisher'));
        wp_insert_term('Acknowledgements', 'back-matter-type', array('slug' => 'acknowledgements'));
        wp_insert_term('Afterword', 'back-matter-type', array('slug' => 'afterword'));
        wp_insert_term('Appendix', 'back-matter-type', array('slug' => 'appendix'));
        wp_insert_term("Author's Note", 'back-matter-type', array('slug' => 'authors-note'));
        wp_insert_term('Back of Book Ad', 'back-matter-type', array('slug' => 'back-of-book-ad'));
        wp_insert_term('Bibliography', 'back-matter-type', array('slug' => 'bibliography'));
        wp_insert_term('Biographical Note', 'back-matter-type', array('slug' => 'biographical-note'));
        wp_insert_term('Colophon', 'back-matter-type', array('slug' => 'colophon'));
        wp_insert_term('Conclusion', 'back-matter-type', array('slug' => 'conclusion'));
        wp_insert_term('Credits', 'back-matter-type', array('slug' => 'credits'));
        wp_insert_term('Dedication', 'back-matter-type', array('slug' => 'dedication'));
        wp_insert_term('Epilogue', 'back-matter-type', array('slug' => 'epilogue'));
        wp_insert_term('Glossary', 'back-matter-type', array('slug' => 'glossary'));
        wp_insert_term('Index', 'back-matter-type', array('slug' => 'index'));
        wp_insert_term('Miscellaneous', 'back-matter-type', array('slug' => 'miscellaneous'));
        wp_insert_term('Notes', 'back-matter-type', array('slug' => 'notes'));
        wp_insert_term('Other Books by Author', 'back-matter-type', array('slug' => 'other-books'));
        wp_insert_term('Permissions', 'back-matter-type', array('slug' => 'permissions'));
        wp_insert_term('Reading Group Guide', 'back-matter-type', array('slug' => 'reading-group-guide'));
        wp_insert_term('Resources', 'back-matter-type', array('slug', 'resources'));
        wp_insert_term('Sources', 'back-matter-type', array('slug' => 'sources'));
        wp_insert_term('Suggested Reading', 'back-matter-type', array('slug' => 'suggested-reading'));
        // Chapter
        wp_insert_term('Standard', 'chapter-type', array('slug' => 'standard'));
        wp_insert_term('Numberless', 'chapter-type', array('slug' => 'numberless'));
    }

Usage Example

Пример #1
0
 /**
  * Upgrade metadata.
  *
  * @param int $version
  */
 function upgrade($version)
 {
     if ($version < 1) {
         // Upgrade from version 0 (closed source service) to version 1 (initial open source offering)
         $this->upgradeEcommerce();
         $this->upgradeBookInformation();
         $this->upgradeBook();
     }
     if ($version < 3) {
         $this->upgradeCustomCss();
     }
     if ($version < 4) {
         $this->fixDoubleSlashBug();
     }
     if ($version < 5) {
         $this->changeDefaultBookCover();
     }
     if ($version < 6 || $version < 7) {
         $this->makeThumbnailsForBookCover();
     }
     if ($version < 8) {
         $this->resetLandingPage();
     }
     if ($version < 10) {
         \Pressbooks\Taxonomy::insertTerms();
         flush_rewrite_rules(false);
     }
 }
All Usage Examples Of Pressbooks\Taxonomy::insertTerms