| @@ -190,8 +190,110 @@ | ||
| 190 | 190 | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | + * Returns this settings group's programmatic name. | |
| 195 | + * | |
| 196 | + * @since 3.4.0 | |
| 197 | + * | |
| 198 | + * @return string | |
| 199 | + */ | |
| 200 | + public function get_name() { | |
| 201 | + | |
| 202 | + return 'broadcasts'; | |
| 203 | + | |
| 204 | + } | |
| 205 | + | |
| 206 | + /** | |
| 207 | + * Returns the title of this settings group. | |
| 208 | + * | |
| 209 | + * @since 3.4.0 | |
| 210 | + * | |
| 211 | + * @return string | |
| 212 | + */ | |
| 213 | + public function get_title() { | |
| 214 | + | |
| 215 | + return __( 'Broadcasts Settings', 'convertkit' ); | |
| 216 | + | |
| 217 | + } | |
| 218 | + | |
| 219 | + /** | |
| 220 | + * Returns the keys in this settings group that hold credentials or other | |
| 221 | + * sensitive values. | |
| 222 | + * | |
| 223 | + * @since 3.4.0 | |
| 224 | + * | |
| 225 | + * @return string[] | |
| 226 | + */ | |
| 227 | + public function get_secret_keys() { | |
| 228 | + | |
| 229 | + return array(); | |
| 230 | + | |
| 231 | + } | |
| 232 | + | |
| 233 | + /** | |
| 234 | + * Returns the JSON Schema describing this settings group, in the shape | |
| 235 | + * stored by save() / returned by get(), excluding secret keys. | |
| 236 | + * | |
| 237 | + * @since 3.4.0 | |
| 238 | + * | |
| 239 | + * @return array | |
| 240 | + */ | |
| 241 | + public function get_schema() { | |
| 242 | + | |
| 243 | + return array( | |
| 244 | + 'type' => 'object', | |
| 245 | + 'additionalProperties' => false, | |
| 246 | + 'properties' => array( | |
| 247 | + 'enabled' => array( | |
| 248 | + 'type' => 'string', | |
| 249 | + 'enum' => array( '', 'on' ), | |
| 250 | + 'description' => __( 'Whether importing Broadcasts from Kit to WordPress Posts is enabled.', 'convertkit' ), | |
| 251 | + ), | |
| 252 | + 'author_id' => array( | |
| 253 | + 'type' => 'integer', | |
| 254 | + 'minimum' => 1, | |
| 255 | + 'description' => __( 'WordPress User ID to assign as the Post author when importing Broadcasts.', 'convertkit' ), | |
| 256 | + ), | |
| 257 | + 'post_status' => array( | |
| 258 | + 'type' => 'string', | |
| 259 | + 'description' => __( 'WordPress Post status to assign to Posts created from imported Broadcasts (e.g. publish, draft).', 'convertkit' ), | |
| 260 | + ), | |
| 261 | + 'category_id' => array( | |
| 262 | + 'type' => array( 'integer', 'string' ), | |
| 263 | + 'description' => __( 'WordPress Category ID to assign to Posts created from imported Broadcasts. Blank for none.', 'convertkit' ), | |
| 264 | + ), | |
| 265 | + 'import_thumbnail' => array( | |
| 266 | + 'type' => 'string', | |
| 267 | + 'enum' => array( '', 'on' ), | |
| 268 | + 'description' => __( 'Whether to import the Broadcast thumbnail as the Post\'s Featured Image.', 'convertkit' ), | |
| 269 | + ), | |
| 270 | + 'import_images' => array( | |
| 271 | + 'type' => 'string', | |
| 272 | + 'enum' => array( '', 'on' ), | |
| 273 | + 'description' => __( 'Whether to import images referenced in the Broadcast\'s content into the WordPress Media Library.', 'convertkit' ), | |
| 274 | + ), | |
| 275 | + 'published_at_min_date' => array( | |
| 276 | + 'type' => 'string', | |
| 277 | + 'format' => 'date', | |
| 278 | + 'description' => __( 'Earliest published_at date (YYYY-MM-DD) of Broadcasts to import.', 'convertkit' ), | |
| 279 | + ), | |
| 280 | + 'enabled_export' => array( | |
| 281 | + 'type' => 'string', | |
| 282 | + 'enum' => array( '', 'on' ), | |
| 283 | + 'description' => __( 'Whether exporting WordPress Posts to Kit Broadcasts is enabled.', 'convertkit' ), | |
| 284 | + ), | |
| 285 | + 'no_styles' => array( | |
| 286 | + 'type' => 'string', | |
| 287 | + 'enum' => array( '', 'on' ), | |
| 288 | + 'description' => __( 'Whether inline styles on imported Broadcast content should be stripped.', 'convertkit' ), | |
| 289 | + ), | |
| 290 | + ), | |
| 291 | + ); | |
| 292 | + | |
| 293 | + } | |
| 294 | + | |
| 295 | + /** | |
| 194 | 296 | * The default settings, used when the ConvertKit Broadcasts Settings haven't been saved |
| 195 | 297 | * e.g. on a new installation. |
| 196 | 298 | * |
| 197 | 299 | * @since 2.2.9 |