Skip to content
Open
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
4 changes: 3 additions & 1 deletion php/context/class-fieldmanager-context-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public function __construct( $title, $post_types, $context = 'normal', $priority
$post_types = array( $post_types );
}

$this->post_types = $post_types;
$this->post_types = array_map( function( $value ) {
return is_string( $value ) ? sanitize_key( $value ) : $value;
}, $post_types );
$this->title = $title;
$this->context = $context;
$this->priority = $priority;
Expand Down
6 changes: 4 additions & 2 deletions php/context/class-fieldmanager-context-quickedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ public function __construct( $title, $post_types, $column_display_callback, $col
$post_types = array( $post_types );
}

$this->post_types = $post_types;
$this->post_types = array_map( function( $value ) {
return is_string( $value ) ? sanitize_key( $value ) : $value;
}, $post_types );
$this->title = $title;
$this->column_title = ! empty( $column_title ) ? $column_title : $title;
$this->column_display_callback = $column_display_callback;
$this->fm = $fm;

if ( is_callable( $column_display_callback ) ) {
foreach ( $post_types as $post_type ) {
foreach ( $this->post_types as $post_type ) {
add_action( 'manage_' . $post_type . '_posts_columns', array( $this, 'add_custom_columns' ) );
}
add_action( 'manage_posts_custom_column', array( $this, 'manage_custom_columns' ), 10, 2 );
Expand Down
2 changes: 2 additions & 0 deletions php/context/class-fieldmanager-context-term.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public function __construct( $args, $taxonomies = array(), $show_on_add = true,
$this->fm = $fm;
}

$this->taxonomies = array_map( 'sanitize_key', $this->taxonomies );

// Iterate through the taxonomies and add the fields to the requested forms.
// Also add handlers for saving the fields and which forms to validate (if enabled).
foreach ( $this->taxonomies as $taxonomy ) {
Expand Down