Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@

.vip-workflow-editorial-metadata{order:12}.vip-workflow-text-popover{min-width:248px}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => '24dcbfc6ff2fae106b94');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '51ec95db66e418133b76');

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions modules/editorial-metadata/editorial-metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class EditorialMetadata {
const SUPPORTED_METADATA_TYPES = [
'checkbox',
'text',
'date',
];
const METADATA_TAXONOMY = 'vw_editorial_meta';
const METADATA_POSTMETA_KEY = 'vw_editorial_meta';
Expand Down Expand Up @@ -63,10 +64,6 @@ public static function register_editorial_metadata_terms_as_post_meta(): void {
$post_meta_key = self::get_postmeta_key( $term );
$post_meta_args = self::get_postmeta_args( $term );

// ToDo: If a post type was supported, a post was opened and saved, and then the post type was removed from the supported list,
// the post meta will still exist for new posts of that post type for a short duration.
// It works fine otherwise. This is a limitation of the current implementation.
// Working around this is quite expensive, and is fine for now.
foreach ( VIP_Workflow::instance()->get_supported_post_types() as $post_type ) {
register_post_meta( $post_type, $post_meta_key, $post_meta_args );
}
Expand Down Expand Up @@ -108,25 +105,24 @@ public static function register_editorial_metadata_taxonomy(): void {
*/
public static function setup_install(): void {
InstallUtilities::install_if_first_run( self::SETTINGS_SLUG, function () {
// ToDo: Review the default metadata fields we provide OOB
$default_terms = [
[
'name' => __( 'Assignment', 'vip-workflow' ),
'slug' => 'assignment',
'type' => 'text',
'description' => __( 'What the post needs to cover.', 'vip-workflow' ),
'name' => __( 'Embargo Date', 'vip-workflow' ),
'slug' => 'embargo-date',
'type' => 'date',
'description' => __( 'The date a post can be published.', 'vip-workflow' ),
],
[
'name' => __( 'Needs Photo', 'vip-workflow' ),
'slug' => 'needs-photo',
'type' => 'checkbox',
'description' => __( 'Checked if this post needs a photo.', 'vip-workflow' ),
'name' => __( 'Expiry Date', 'vip-workflow' ),
'slug' => 'expiry-date',
'type' => 'date',
'description' => __( 'The date the content of a post would be marked as expired.', 'vip-workflow' ),
],
[
'name' => __( 'Word Count', 'vip-workflow' ),
'slug' => 'word-count',
'type' => 'text',
'description' => __( 'Required post length in words.', 'vip-workflow' ),
'name' => __( 'Legal Review', 'vip-workflow' ),
'slug' => 'legal-review',
'type' => 'checkbox',
'description' => __( 'This is to be checked once legal has reviewed this post.', 'vip-workflow' ),
],
];

Expand Down Expand Up @@ -457,6 +453,7 @@ public static function get_postmeta_args( WP_Term $term ): array {
case 'checkbox':
$arg_type = 'boolean';
break;
case 'date':
case 'text':
$arg_type = 'string';
break;
Expand Down
7 changes: 7 additions & 0 deletions modules/editorial-metadata/lib/editor.scss
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/* stylelint-disable */
.vip-workflow-editorial-metadata {
order: 12;
}

.vip-workflow-text-popover {
min-width: 248px;
}
Loading