コード例 #1
0
        public void Configure(IWpApp app)
        {
            //
            // Dashboard:
            //

            // add information into Right Now section
            app.DashboardRightNow(GetDashboardRightNow);

            // do not allow editing of .php files:
            app.AddFilter("editable_extensions", new Func <IList, IList>(editable_extensions =>
            {
                editable_extensions.Remove("php");
                return(editable_extensions);
            }));

            // TODO: "install_plugins_upload" to customize upload plugin form
            // TODO: filter query_plugins

            //
            // Blogs:
            //

            // alter generator metadata
            app.AddFilter("get_the_generator_xhtml", new Func <string>(() => GeneratorHtml));
            // add analytics
        }
コード例 #2
0
 /// <summary>
 /// Invoked by PHP plugin implementation (peachpie-api.php) to bridge into .NET.
 /// </summary>
 public virtual void AppStarted(IWpApp app)
 {
     // activate plugins:
     foreach (var plugin in _plugins)
     {
         plugin.Configure(app);
     }
 }
コード例 #3
0
        /// <summary>
        /// Invoked by PHP plugin implementation (peachpie-api.php) to bridge into .NET.
        /// </summary>
        public virtual void AppStarted(IWpApp app)
        {
            // user plugins:
            foreach (var plugin in _plugins)
            {
                plugin.Configure(app);
            }

            // builtin plugins:
            Internal.PeachpieWpPlugin.Instance.Configure(app);
        }
コード例 #4
0
        void IWpPlugin.Configure(IWpApp app)
        {
            Action updated = () =>
            {
                // existing cache records get invalidated
                LastPostUpdate = DateTime.UtcNow;
            };

            app.AddFilter("save_post", updated);
            app.AddFilter("wp_insert_comment", updated);
            // edit_comment
            // trashed_comment(comment id, comment)
            // spammed_comment
        }
コード例 #5
0
 /// <summary>
 /// Hooks onto <c>rightnow_end</c> action to provide additional content to the dashboard summary box.
 /// </summary>
 public static void DashboardRightNow(this IWpApp app, Func <string> htmlgetter) => app.AddFilter("rightnow_end", new Action(() => app.Echo(htmlgetter())));
コード例 #6
0
 /// <summary>
 /// Registers <c>the_permalink</c> filter.
 /// </summary>
 public static void FilterPermalink(this IWpApp app, the_permalink_filter filter) => app.AddFilter("the_permalink", filter);
コード例 #7
0
 /// <summary>
 /// Registers <c>the_title</c> filter.
 /// </summary>
 public static void FilterTitle(this IWpApp app, the_title_filter filter) => app.AddFilter("the_title", filter);
コード例 #8
0
 /// <summary>
 /// Registers <c>the_content</c> filter.
 /// </summary>
 public static void FilterContent(this IWpApp app, the_content_filter filter) => app.AddFilter("the_content", filter);