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