Click here to Skip to main content
13,089,400 members (60,236 online)
Click here to Skip to main content

Stats

86.6K views
1.1K downloads
52 bookmarked
Posted 29 May 2012

Extending WordPress with C# Plugins

, 30 May 2012
This article describes how to extend WordPress with plugins written in C# and shows very first C# plugin for this system.
@* Generator : Template TypeVisibility : Internal *@
@inherits PhpRazorTemplateBase<ContentWatchdog>
@using System.Web
@using Devsense.WordPress.Plugins.ContentWatchdog

<div class="wrap">
    <h2>@Strings.PluginName</h2>
    <form action="@HttpContext.Current.Request.RawUrl" method="post">

        <table class="form-table">
            <tr valign="top">
                <th scope="row">
                    <label for="Email">@Strings.EmailAddress</label>
                </th>
                <td>
                    <input id="Email" name="Email" type="text" value="@Model.Email" />
                    <br />
                    @Strings.EmailDescription
                </td>
            </tr>
            <tr valign="top">
                <th scope="row">
                    <label for="WatchContent">@Strings.WatchContent</label>
                </th>
                <td>
                    <input @(Model.WatchContent ? "checked=\"checked\"" : String.Empty) id="WatchContent" name="WatchContent" type="checkbox" value="true" />
                </td>
            </tr>
            <tr valign="top">
                <th scope="row">
                    <label for="MatchWholeWord">@Strings.MatchWholeWord</label>
                </th>
                <td>
                    <input @(Model.MatchWholeWord ? "checked=\"checked\"" : String.Empty) id="MatchWholeWord" name="MatchWholeWord" type="checkbox" value="true" />
                </td>
            </tr>
            <tr valign="top">
                <th scope="row">
                    <label for="BadWordsString">@Strings.BadWords</label>
                </th>
                <td>
                    <textarea cols="45" id="BadWordsString" name="BadWordsString" rows="5">@Model.BadWordsString</textarea>
                    <br />
                    @Strings.BadWordsDescription
                </td>
            </tr>
        </table>
        <p class="submit">
            <input type="submit" name="Submit" value="Save Changes" />
        </p>

    </form>
</div>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0

Share

About the Author

Miloslav Beno
Software Developer DEVSENSE s.r.o
Czech Republic Czech Republic
Miloslav is software developer of open-source PHP compiler & runtime for .NET/Mono called Phalanger and PHP Tools for Visual Studio. He's graduated at Faculty of Mathematics and Physics at Charles University in Prague. Beside of compilers and dynamic languages he is also interested in semantic web technologies. Available on twitter @miloslavbeno

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170813.1 | Last Updated 30 May 2012
Article Copyright 2012 by Miloslav Beno
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid