GRAYBYTE WORDPRESS FILE MANAGER6018

Server IP : 162.213.255.40 / Your IP : 216.73.216.6
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/plugins/optinmonster/OMAPI/WPForms/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/plugins/optinmonster/OMAPI/WPForms//RestApi.php
<?php
/**
 * WPForms API routes for usage in WP's RestApi.
 *
 * @since 2.9.0
 *
 * @author  Eduardo Nakatsuka
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Rest Api class.
 *
 * @since 2.9.0
 */
class OMAPI_WPForms_RestApi extends OMAPI_BaseRestApi {

	/**
	 * The OMAPI_WPForms instance.
	 *
	 * @since 2.8.0
	 *
	 * @var OMAPI_WPForms
	 */
	public $wpforms;

	/**
	 * Constructor
	 *
	 * @since 2.13.0
	 *
	 * @param OMAPI_WPForms $wpforms
	 */
	public function __construct( OMAPI_WPForms $wpforms ) {
		$this->wpforms = $wpforms;
		parent::__construct();
	}

	/**
	 * Registers the Rest API routes for WPForms
	 *
	 * @since 2.9.0
	 *
	 * @return void
	 */
	public function register_rest_routes() {
		register_rest_route(
			$this->namespace,
			'wpforms/forms',
			array(
				'methods'             => WP_REST_Server::READABLE,
				'permission_callback' => array( $this, 'logged_in_or_has_api_key' ),
				'callback'            => array( $this, 'forms' ),
			)
		);
	}

	/**
	 * Handles getting WPForms forms.
	 *
	 * Route: GET omapp/v1/woocommerce/forms
	 *
	 * @since 2.9.0
	 *
	 * @param WP_REST_Request $request The REST Request.
	 *
	 * @return WP_REST_Response The API Response
	 * @throws Exception If plugin action fails.
	 */
	public function forms() {
		try {
			return new WP_REST_Response(
				$this->wpforms->get_forms_array(),
				200
			);
		} catch ( Exception $e ) {
			return $this->exception_to_response( $e );
		}
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 15:03:58
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:29
hellrfbn / hellrfbn
0644
RestApi.php
1.446 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Save.php
2.138 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF