/home/vianto5/cititower.mx/wp-content/plugins/wpforms/src/Pro/Integrations/Gutenberg
NameSizeModeActions
FormSelector.php46270644editdlrm
RestApi.php21880644editdlrm
StockPhotos.php69330644editdlrm
ThemesData.php25960644editdlrm
Edit: /home/vianto5/cititower.mx/wp-content/plugins/wpforms/src/Pro/Integrations/Gutenberg/RestApi.php (2188B)
stock_photos_obj = $stock_photos_obj; parent::__construct( $form_selector_obj, $themes_data_obj ); } /** * Register API routes for Gutenberg block. * * @since 1.8.8 */ public function register_api_routes() { parent::register_api_routes(); register_rest_route( self::ROUTE_NAMESPACE, '/stock-photos/install/', [ 'methods' => 'POST', 'callback' => [ $this, 'install_stock_photos' ], 'permission_callback' => [ $this, 'admin_permissions_check' ], ] ); } /** * Save custom themes. * * @since 1.8.8 * * @param WP_REST_Request $request Request object. * * @return WP_REST_Response */ public function install_stock_photos( WP_REST_Request $request ): WP_REST_Response { $force = (bool) ( $request->get_param( 'force' ) ?? false ); // Install stock photos and return REST response. $result = $this->stock_photos_obj->install( $force ); if ( ! empty( $result['error'] ) ) { return rest_ensure_response( [ 'result' => false, 'error' => $result['error'], ] ); } return rest_ensure_response( [ 'result' => true, 'pictures' => $result['pictures'] ?? [], ] ); } }