コード例 #1
0
 public static void DashboardWidget(this WpApp app, string widget_id, string widget_name, Action <TextWriter> htmlwriter)
 {
     app.AddFilter(
         "wp_dashboard_setup",
         new Action(() => app.Context.Call("wp_add_dashboard_widget",
                                           (PhpValue)widget_id, (PhpValue)widget_name, PhpValue.FromClass(new Action(() => htmlwriter(app.Context.Output))))));
 }
コード例 #2
0
 public static void Footer(this WpApp app, Action <TextWriter> callback, long priority = 100)
 {
     app.AddFilter("wp_footer", new Action(() =>
     {
         callback(app.Context.Output);
     }), priority);
 }
コード例 #3
0
 public static void AddAjaxAction(this WpApp app, string action, Func <string> callback)
 {
     app.AddFilter("wp_ajax_" + action, new Action(() =>
     {
         app.Context.Echo(callback());
         app.Context.Call("wp_die");
     }));
 }
コード例 #4
0
 public static void DashboardRightNow(this WpApp app, Action <TextWriter> htmlwriter)
 {
     app.AddFilter(
         "rightnow_end",
         new Action <Context>(ctx => htmlwriter(ctx.Output)));
 }
コード例 #5
0
 public static void FilterPermalink(this WpApp app, the_permalink_filter filter) => app.AddFilter("the_permalink", filter);
コード例 #6
0
 public static void FilterTitle(this WpApp app, the_title_filter filter) => app.AddFilter("the_title", filter);
コード例 #7
0
 public static void FilterContent(this WpApp app, the_content_filter filter) => app.AddFilter("the_content", filter);
コード例 #8
0
 public static void AdminNotices(this WpApp app, Func <string> callback)
 {
     app.AddFilter("admin_notices", new Action(() => app.Context.Echo(callback())));
 }
コード例 #9
0
 public static void AdminMenu(this WpApp app, Action action) => app.AddFilter("admin_menu", action);
コード例 #10
0
 public static void OnAdminInit(this WpApp app, Action action) => app.AddFilter("admin_init", action);