CData Python Connector for WordPress

Build 24.0.9060

Pages

Create, update, delete, and query Wordpress Pages.

Table Specific Information

Select

The connector uses the WordPress API to process supported filters. The connector processes other filters client-side within the connector. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause inconsistent data. For example, the following queries are processed server side.

SELECT * FROM Pages WHERE Id IN (1, 2)
SELECT * FROM Pages WHERE Author IN ('1', '23')
SELECT * FROM Pages WHERE Parent IN (0, 2)
SELECT * FROM Pages WHERE Status = 'Publish'
SELECT * FROM Pages WHERE MenuOrder = 1
SELECT * FROM Pages WHERE Date > '2018-02-02T02:02:23'
SELECT * FROM Pages WHERE Date < '2018-02-02T02:02:23'
SELECT * FROM Pages ORDER BY Id
Also, ordering by Author, Title, Date, Modified, Parent, MenuOrder, is handled by the WordPress API.

Insert and Update

To insert a page, it's enough to specify one of the fields below:

INSERT INTO Pages (Title, Content, Status) VALUES ('A title', 'Some content here', 'publish')

To update a page you must specify the following column: Id.

UPDATE Pages SET Status = 'draft', Content = 'Updated content', Title = 'Updated title' WHERE Id = '12345'
Other fields that you can use on INSERT and UPDATE queries are: Date, DateGMT, Status, Parent, Title, Content, Author, MediaId, CommentStatus, PingStatus, MenuOrder.

Delete

To delete a page you must specify the following column: Id.

DELETE FROM Pages WHERE Id = '12345'

Columns

Name Type ReadOnly Description
Id [KEY] Integer True

Unique identifier for the object.

Author Integer False

The ID for the author of the object.

Title String False

The title for the object.

Date Datetime False

The date the object was published, in the site's timezone.

DateGMT Datetime False

The date the object was published, as GMT.

Link String True

URL to the object.

Modified Datetime True

The date the object was last modified, in the site's timezone.

ModifiedGMT Datetime True

The date the object was last modified, as GMT.

Status String False

A named status for the object. One of: publish, future, draft, pending, private.

The allowed values are publish, future, draft, pending, private.

Type String True

Type of Post for the object.

Parent Integer False

The ID for the parent of the object.

Content String False

The content for the object.

MediaId Integer False

The ID of the featured media for the object.

CommentStatus String False

Whether or not comments are open on the object.

PingStatus String False

Whether or not the object can be pinged.

MenuOrder Integer False

The order of the object in relation to other object of its type.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060