abstract-post-modifier.php
1 year ago
base-post-action.php
1 year ago
insert-action.php
1 year ago
post-author-property.php
1 year ago
post-comments-property.php
1 year ago
post-content-property.php
1 year ago
post-date-gmt-property.php
1 year ago
post-date-property.php
1 year ago
post-excerpt-property.php
1 year ago
post-id-property.php
1 year ago
post-meta-property.php
1 year ago
post-modifier.php
1 year ago
post-parent-property.php
1 year ago
post-status-property.php
1 year ago
post-terms-property.php
1 year ago
post-thumbnail-property.php
1 year ago
post-title-property.php
1 year ago
post-type-property.php
1 year ago
trash-action.php
1 year ago
update-action.php
1 year ago
post-thumbnail-property.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Actions_V2\Insert_Post\Properties; |
| 5 | |
| 6 | use Jet_Form_Builder\Actions\Methods\Abstract_Modifier; |
| 7 | use Jet_Form_Builder\Actions\Methods\Base_Object_Property; |
| 8 | |
| 9 | // If this file is called directly, abort. |
| 10 | if ( ! defined( 'WPINC' ) ) { |
| 11 | die; |
| 12 | } |
| 13 | |
| 14 | class Post_Thumbnail_Property extends Base_Object_Property { |
| 15 | |
| 16 | public function get_id(): string { |
| 17 | return '_thumbnail_id'; |
| 18 | } |
| 19 | |
| 20 | public function get_label(): string { |
| 21 | return __( 'Post Thumbnail', 'jet-form-builder' ); |
| 22 | } |
| 23 | |
| 24 | public function get_help(): string { |
| 25 | return __( 'Accepts attachment ID', 'jet-form-builder' ); |
| 26 | } |
| 27 | |
| 28 | public function do_before( string $key, $value, Abstract_Modifier $modifier ) { |
| 29 | parent::do_before( $key, $value, $modifier ); |
| 30 | |
| 31 | if ( empty( $this->value ) ) { |
| 32 | $this->value = - 1; |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 |