\WordpressImportService
Synopsis
class WordpressImportService
extends Object
{
- // members
- private static array $options = ;
- public WordpressDatabase $_db = NULL;
- public string $_content_set_callback = 'setSiteTreeContent';
- public string $_content_get_callback = 'getSiteTreeContent';
- public array $_classes_using_elemental = ;
- public array $_classes_using_wordpress_extension = ;
- public integer $root_parent_id = 0;
- // methods
- public SS_List applyWordpressFilter()
- public boolean writeAndPublishRecord()
- public void importPostsAsPages()
- public void importPages()
- public void importGravityForms()
- public void importAttachmentsAsFiles()
- public void updatePagesBasedOnHierarchy()
- public void importEvents_MyEventOn_Step1()
- public void importEvents_MyEventOn_Step2()
- public SiteTree getByLink()
- public string getAssetURL()
- public void getOption()
- public void fixPostContentURLs()
- public void updatePagesBasedOnNavMenu()
- public void setHomepageToWordpressPageAndDeleteCurrentHomePage()
- public void __construct()
- public WordpressImportService setDatabase()
- public WordpressDatabase getDatabase()
- public WordpressImportService setContentCallbacks()
- public void setContentOnRecord()
- public string getContentFromRecord()
- public void setSiteTreeContent()
- public string getSiteTreeContent()
- public boolean setElementalContent()
- public string|boolean getElementalContent()
- public void logFunctionStart()
- public void logFunctionEnd()
- public void log()
- public void log_error_handler()
- public WordpressDatabase setupDefaultDatabaseIfNull()
Hierarchy
Extends
- Object
Tasks
Line | Task |
---|---|
400 | (Jake): make $directory use relative to the SS/basedir rather than full filepath |
786 | (Jake): Allow for setting a manual siteurl with configs that takes precedence |
Members
private
- $options
—
string
Override wp_options in the config.
public
- $_classes_using_elemental — array
- $_classes_using_wordpress_extension — array
- $_content_get_callback
—
string
The function to call on 'getContentFromRecord'. - $_content_set_callback
—
string
The function to call on 'setContentOnRecord'. - $_db — WordpressDatabase
-
$root_parent_id
The root parent ID, this can be changed so that pages are put underneath Multisite/Subsite/etc objects when they belong at the top level
Methods
public
- __construct()
- applyWordpressFilter() — Apply the filter to get Wordpress imported items by.
- fixPostContentURLs()
- getAssetURL() — Get the asset URL (Not calling File::getURL() as CDNContent module may break the URL I want to return)
- getByLink() — Basically works like SiteTree::get_by_link but is capable of accounting for Multisites.
- getContentFromRecord()
- getDatabase()
- getElementalContent()
- getOption() — Get an option from the 'wp_options' table.
- getSiteTreeContent()
- importAttachmentsAsFiles()
- importEvents_MyEventOn_Step1() — Import events created with: http://www.myeventon.com/ into a 'CalendarEvent' Page type from Unclecheese's "Event Calendar" module
- importEvents_MyEventOn_Step2() — Import events created with: http://www.myeventon.com/ into a 'CalendarEvent' Page type from Unclecheese's "Event Calendar" module
- importGravityForms() — Import Gravity Form as User Defined Form
- importPages() — Import all Wordpress 'page' post_type items as Silverstripe pages.
- importPostsAsPages() — Import Wordpress post data as Silverstripe pages.
- log()
- logFunctionEnd()
- logFunctionStart()
- log_error_handler() — Custom error handler so that 'user_error' underneath the 'log' function just prints like everything else.
- setContentCallbacks() — Set the function to call on 'setContentOnRecord'.
- setContentOnRecord() — Set the $Content
- setDatabase()
- setElementalContent() — Write an ElementContent block with $Content.
- setHomepageToWordpressPageAndDeleteCurrentHomePage()
- setSiteTreeContent()
- setupDefaultDatabaseIfNull()
- updatePagesBasedOnHierarchy() — Update all pages to have the same parents they have in Wordpress.
- writeAndPublishRecord() — Write and publish a record