All Projects → abrudtkuhl → Wordpresssharp

abrudtkuhl / Wordpresssharp

Licence: gpl-3.0
A C# client to to interact with the WordPress XML-RPC API

Projects that are alternatives of or similar to Wordpresssharp

Flutter wordpress
Flutter WordPress API
Stars: ✭ 155 (+59.79%)
Mutual labels:  wordpress-api, wordpress
Wp Api Angular
Angular (>=2) services for WordPress WP-API(v2) or WP >= 4.7 (natively supports WP-API)
Stars: ✭ 266 (+174.23%)
Mutual labels:  wordpress-api, wordpress
Kasia
🎩 A React Redux toolset for the WordPress API
Stars: ✭ 219 (+125.77%)
Mutual labels:  wordpress-api, wordpress
Ember Wordpress
The bridge between Ember.js and Wordpress
Stars: ✭ 94 (-3.09%)
Mutual labels:  wordpress-api, wordpress
Ultimate Fields
The plugin for custom fields in WordPress
Stars: ✭ 39 (-59.79%)
Mutual labels:  wordpress-api, wordpress
Google Docs Add On
Publish to WordPress from Google Docs
Stars: ✭ 140 (+44.33%)
Mutual labels:  wordpress-api, wordpress
Wp Api React
This boilerplate will help you use React JS with Wordpress REST API.
Stars: ✭ 255 (+162.89%)
Mutual labels:  wordpress-api, wordpress
Create React Wptheme
Create modern, React-enabled WordPress themes with a single command.
Stars: ✭ 252 (+159.79%)
Mutual labels:  wordpress-api, wordpress
Wordprismic
Utility to import existing Wordpress blogs into the Prismic.io content platform
Stars: ✭ 25 (-74.23%)
Mutual labels:  wordpress-api, wordpress
Intervention
WordPress plugin to configure wp-admin and application state using a single config file.
Stars: ✭ 481 (+395.88%)
Mutual labels:  wordpress-api, wordpress
Restsplain
WordPress REST API documentation generator
Stars: ✭ 126 (+29.9%)
Mutual labels:  wordpress-api, wordpress
Better Rest Endpoints
A WordPress plugin that serves up slimmer WP Rest API endpoints.
Stars: ✭ 56 (-42.27%)
Mutual labels:  wordpress-api, wordpress
Frontpress
⚡️ A full front-end AngularJS template for WordPress Rest API.
Stars: ✭ 109 (+12.37%)
Mutual labels:  wordpress-api, wordpress
Live Composer Page Builder
Free page builder plugin for WordPress http://livecomposerplugin.com
Stars: ✭ 143 (+47.42%)
Mutual labels:  wordpress-api, wordpress
Nextjs Wordpress Starter
WebDevStudios Next.js WordPress Starter
Stars: ✭ 104 (+7.22%)
Mutual labels:  wordpress-api, wordpress
Tony
An Elegant WordPress Theme Based on ✌️Vue.js | 基于 Vue.js 的简洁一般强大的 WordPress 单栏博客主题
Stars: ✭ 462 (+376.29%)
Mutual labels:  wordpress-api, wordpress
Hybrid
[I don't have time to work on this anymore. Use at your own risk] Build WordPress based PWA, iOS, Android & Windows phones apps in minutes!
Stars: ✭ 1,026 (+957.73%)
Mutual labels:  wordpress-api, wordpress
Headless Wp
A demo repo for Headless WordPress
Stars: ✭ 89 (-8.25%)
Mutual labels:  wordpress-api, wordpress
Wooshop
A Wocommerce Based React Native App for IOS and Android over GraphQL
Stars: ✭ 92 (-5.15%)
Mutual labels:  wordpress
Searchwp Live Ajax Search
[WordPress Plugin] Enhance your search forms with live search (utilizes SearchWP if installed)
Stars: ✭ 91 (-6.19%)
Mutual labels:  wordpress

WordPressSharp

A C# client to interact with the WordPress XML-RPC API

Install

I'm working on a Nuget package once I'm done mapping all the WP XML-RPC endpoints.

In the meantime, you'll have to clone, build, and add the DLL the ole fashioned way

Config

Use your config file to for configuration settings:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<appSettings>
		<add key="WordPressUsername" value="" />
		<add key="WordPressPassword" value="" />
		<add key="WordPressBaseUrl" value="" />
		<add key="WordPressBlogId" value="" />
	</appSettings>
</configuration>

As an alternative you can use the WordPressSiteConfig class to store configuration settings.

Examples

Create Post

using (var client = new WordPressClient()) 
{
    var post = new Post
    {
        PostType = "post",
        Title = "My Awesome Post",
        Content = "<p>This is the content</p>",
        PublishDateTime = DateTime.Now
    };

    var id = Convert.ToInt32(client.NewPost(post));
}

Create Post Tag

using (var client = new WordPressClient())
{
    var termId = client.NewTerm(new Term
    {
        Name = "term test",
        Description = "term description",
        Slug = "term_test",
        Taxonomy = "post_tag"
    });
}

Add feature image

You can add a feature image by using the Data.CreateFromUrl or Data.CreateFromFilePath:

string url = "https://unsplash.imgix.net/photo-1423683249427-8ca22bd873e0";
using (var client = new WordPressClient()) 
{
    var post = new Post
    {
        PostType = "post",
        Title = "New photo from Unsplash",
        Content = "<p>Check out this new picture from Unsplash.</p>",
        PublishDateTime = DateTime.Now
    };
    
    var featureImage = Data.CreateFromUrl(url);
    post.FeaturedImageId = client.UploadFile(featureImage).Id;

    var id = Convert.ToInt32(client.NewPost(post));
}

Tutorials

How to publish a post or page

Dependencies

XML-RPC.net

Resources

WordPress XML-RPC API

Notes

Inspired by the POSSIBLE.WordPress.XmlRpcClient by markeverard

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].