-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Simple walk throughs for building a theme and a plugin in C# #84
Comments
Thats a good idea, we should definitely provide documentation on C# plugins. For now, we have a sample plugin at https://github.com/iolevel/peachpie-wordpress/tree/master/app/Plugins or at
|
Awesome. I tested the sample yesterday and was able to get the ShortcodePlugin to work, however I could not get it to be displayed in the list of installed plugins. In PHP we usually set some info /*
Plugin Name: My Plugin
Plugin URI:
Description:
Version: 0.0.1
Author: Theo Taylor | TAYLOR'D Technologies
Author URI: http://taylord.tech/
License:
*/ Not so sure how to get that done in C#, I am working through the examples tho so whatever I figure out I can post. Another good set of snippets would be simple filters and actions |
Here is an example of a plugin that changes all of the post titles using PeachPied.WordPress.Standard;
namespace WPTest.Plugins
{
class CustomTitlePlugin : IWpPlugin
{
public void Configure(WpApp app)
{
app.AddFilter("the_title", new CustomTitle(() => "This is a custom title"));
}
private delegate string CustomTitle();
}
} |
@Theo-Taylor nice! we'll be working on a C# plugin doc soon. btw there is predefined public void Configure(WpApp app) {
app.FilterTitle((title, postid) => "This is a custom title"));
} We're aware that the plugin is not listed in WP dashboard. It is because the plugin is loaded statically, as a must-use plugin. |
@jakubmisek awesome! Really looking forward to it To the plugin not being listing - Ah gotcha, at first I was confused cause I didn't know if the plugin was working since it isn't listed but I understand Keep us posted on the docs! I'm thinking about doing a tutorial series on wpdotnet development, completely in C# and including things like the WP REST API. Since .NET Core has React and Angular support I think this will be a new and fantastic way to build and deploy websites |
"Keep us posted on the docs! I'm thinking about doing a tutorial series on wpdotnet development, completely in C# and including things like the WP REST API. Since .NET Core has React and Angular support I think this will be a new and fantastic way to build and deploy websites" Did you ever do that?.. would be super interested in using .Net Core with WP with a frontend in React, |
Description
Just looking for a simple guide to start building in C#, willing to assist with putting together the walk through but will need your assistance.
The text was updated successfully, but these errors were encountered: