images
3 months ago
convertkit.php
3 months ago
hustle-convertkit-api-intefrace.php
3 months ago
hustle-convertkit-api-v2.php
3 months ago
hustle-convertkit-api.php
3 months ago
hustle-convertkit-form-hooks.php
3 months ago
hustle-convertkit-form-settings.php
5 months ago
hustle-convertkit-v2.php
3 months ago
hustle-convertkit.php
3 months ago
hustle-convertkit-api-intefrace.php
93 lines
| 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | /** |
| 3 | * Hustle_ConvertKit_Api_Interface interface |
| 4 | * |
| 5 | * @package Hustle |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * ConvertKit API Interface |
| 10 | * |
| 11 | * @interface Hustle_ConvertKit_Api_Interface |
| 12 | **/ |
| 13 | interface Hustle_ConvertKit_Api_Interface { |
| 14 | |
| 15 | /** |
| 16 | * Retrieves ConvertKit forms as array of objects |
| 17 | * |
| 18 | * @return array|WP_Error |
| 19 | */ |
| 20 | public function get_forms(); |
| 21 | |
| 22 | /** |
| 23 | * Retrieves ConvertKit subscribers as array of objects |
| 24 | * |
| 25 | * @return array|WP_Error |
| 26 | */ |
| 27 | public function get_subscribers(); |
| 28 | |
| 29 | /** |
| 30 | * Retrieves ConvertKit form's custom fields as array of objects |
| 31 | * |
| 32 | * @return array|WP_Error |
| 33 | */ |
| 34 | public function get_form_custom_fields(); |
| 35 | |
| 36 | /** |
| 37 | * Add new custom fields to subscription |
| 38 | * |
| 39 | * @param array $field_data Fields data. |
| 40 | * @return array|mixed|object|WP_Error |
| 41 | */ |
| 42 | public function create_custom_fields( $field_data ); |
| 43 | |
| 44 | /** |
| 45 | * Add new subscriber |
| 46 | * |
| 47 | * @param string $form_id Form ID. |
| 48 | * @param array $data Data. |
| 49 | * @return array|mixed|object|WP_Error |
| 50 | */ |
| 51 | public function subscribe( $form_id, $data ); |
| 52 | |
| 53 | /** |
| 54 | * Update subscriber |
| 55 | * |
| 56 | * @since 4.0 |
| 57 | * |
| 58 | * @param string $id ID. |
| 59 | * @param array $data Data. |
| 60 | * @return array|mixed|object|WP_Error |
| 61 | */ |
| 62 | public function update_subscriber( $id, $data ); |
| 63 | |
| 64 | /** |
| 65 | * Delete subscriber from the list |
| 66 | * |
| 67 | * @param string $list_id List ID. |
| 68 | * @param string $email Email. |
| 69 | * |
| 70 | * @return bool |
| 71 | */ |
| 72 | public function delete_email( $list_id, $email ); |
| 73 | |
| 74 | /** |
| 75 | * Verify if an email is already a subscriber. |
| 76 | * |
| 77 | * @param string $email Email. |
| 78 | * |
| 79 | * @return object|false Returns data of existing subscriber if exist otherwise false. |
| 80 | **/ |
| 81 | public function is_subscriber( $email ); |
| 82 | |
| 83 | /** |
| 84 | * Verify if an email is already a subscriber in a form. |
| 85 | * |
| 86 | * @param string $email Email. |
| 87 | * @param integer $form_id Form ID. |
| 88 | * |
| 89 | * @return boolean|integer True if the subscriber exists, otherwise false. |
| 90 | **/ |
| 91 | public function is_form_subscriber( $email, $form_id ); |
| 92 | } |
| 93 |