Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
f5aa254
Setup PostMeta classes and register some Movie fields
colinswinney Feb 12, 2025
cff3d1d
Setup Movie meta field plugin
colinswinney Feb 12, 2025
c4e50a2
Add Movie Runtime block
colinswinney Feb 12, 2025
8de6d2d
Edit single Movie template to use bindings and Runtime block
colinswinney Feb 12, 2025
46ddd9c
Add default value for Rating and fallback template values
colinswinney Feb 12, 2025
f14c7ae
Use time element for runtime block
colinswinney Feb 12, 2025
a6576d2
Update taxonomies with static functions
colinswinney Feb 24, 2025
73710d3
Update and add more post meta fields
colinswinney Feb 24, 2025
b218aae
Add movie meta blocks
colinswinney Feb 24, 2025
fdf1a50
Add Group extension for separator
colinswinney Feb 24, 2025
cee51d0
Fix vars
colinswinney Feb 24, 2025
93e5f44
Create block bindings and update template
colinswinney Feb 24, 2025
d552548
Add meta fields, editor panel, blocks, and templates for Person post …
colinswinney Mar 6, 2025
2f8c2c9
Merge pull request #2 from 10up/feature/person-single-template
colinswinney Aug 22, 2025
e50511a
Refactor to use early returns
colinswinney Aug 22, 2025
0128f3d
Fix linting errors
colinswinney Aug 22, 2025
8ab2d12
Update the plugin to use 10up Framework
colinswinney Aug 22, 2025
6844ad1
Fix style lint errors
colinswinney Aug 22, 2025
882a724
Add WP Content Connect and set up movie to person relationship
colinswinney Sep 14, 2025
a68ce50
Remove keywords taxonomy and fix other ones
colinswinney Sep 14, 2025
50ba3ed
Add new meta fields and blocks, delete ones we can't get from API
colinswinney Sep 14, 2025
e3ccada
Delete more meta fields
colinswinney Sep 14, 2025
3f5eef2
Make secondary text color more accessible
colinswinney Sep 14, 2025
e7084c9
Use logical props
colinswinney Sep 14, 2025
26ba42b
Make back button respect current page
colinswinney Sep 14, 2025
85dd49d
Update single movie template to add video with fallback image
colinswinney Sep 14, 2025
286c9eb
Update other templates
colinswinney Sep 14, 2025
1c696e8
Update theme to use 10up Framework
colinswinney Sep 14, 2025
ae75fe2
Fix missing traits
colinswinney Sep 14, 2025
a11a8ea
Remove director block
colinswinney Sep 15, 2025
85bf5f6
Use context to get post id in theme blocks
colinswinney Sep 16, 2025
921a487
Merge origin/feature/move-theme-to-framework into fix/update-blocks-w…
colinswinney Jan 22, 2026
1cbbe10
Merge pull request #5 from 10up/fix/update-blocks-with-context
colinswinney Jan 22, 2026
3a3c7ec
Merge pull request #4 from 10up/feature/move-theme-to-framework
colinswinney Jan 22, 2026
3d7d843
Update .gitignore
colinswinney Jan 22, 2026
428aaea
chore: Rename fueled-movies-complete to fueled-movies
colinswinney Jan 22, 2026
e335699
fix: Restore @view-transition CSS rule for cross-page animations
colinswinney Jan 22, 2026
ee7f8d4
Fix icon imports
colinswinney Jan 22, 2026
d906069
Refactor to use shared components and bundle common dependencies
colinswinney Jan 22, 2026
668eae7
Install Ignite plugins and begin transfer from custom blocks to bindings
colinswinney Jan 23, 2026
611791e
Remove most blocks, relying instead on block bindings
colinswinney Jan 23, 2026
f9909c2
Rm Ignite plugins and move DL blocks to theme, move bindings to own file
colinswinney Jan 24, 2026
0c11619
Add rate movie block
colinswinney Jan 25, 2026
37392d4
Rm WatchProvider taxonomy
colinswinney Jan 29, 2026
3f43990
Add button and group json styles, refine interactivty example
colinswinney Jan 30, 2026
44840c1
Merge branch 'feature/move-theme-to-framework' into feature/movie-pos…
colinswinney Jan 30, 2026
0710abf
Rm shared components webpack config
colinswinney Jan 30, 2026
1369ef6
Add CLI script, make Content Connect MU, use imdb embeds vs youtube
colinswinney Feb 23, 2026
d37b19c
Add 10up block theme
colinswinney Mar 5, 2026
970ac2a
Add clickable card functionality
colinswinney Mar 6, 2026
9bbb8d9
Rename namespaces and packages in new theme so students can easily co…
colinswinney Mar 12, 2026
c6ed8e2
Maintain 10up block theme header part white space
colinswinney Mar 12, 2026
a6916bc
Format the footer part
colinswinney Mar 12, 2026
3b5e02d
Update copyright year
colinswinney Mar 12, 2026
46267e0
Clean up theme.json to allow for customings colors via editor palette
colinswinney Apr 1, 2026
8eff68b
Delete Group style variation
colinswinney Apr 1, 2026
132084e
Fix editor styles of the button secondary variation
colinswinney Apr 1, 2026
ba131ef
Use the 10up block theme index.html as is
colinswinney Apr 1, 2026
4cb53c1
Update card pattern
colinswinney Apr 1, 2026
6eff3e7
Minor chores
colinswinney Apr 1, 2026
b3aec1b
Update blocks to use render.php file names
colinswinney Apr 2, 2026
7a0266d
Update comments
colinswinney Apr 2, 2026
da17253
Update php.yml with correct theme
colinswinney Apr 2, 2026
0636450
Update params
colinswinney Apr 2, 2026
ed50a6d
Rm unused vars in the card
colinswinney Apr 2, 2026
e20354a
Add missing binding
colinswinney Apr 2, 2026
067a7ef
Update text domain strings
colinswinney Apr 2, 2026
08ab6c4
Fix indent
colinswinney Apr 2, 2026
8b3cc9a
Clean up
colinswinney Apr 2, 2026
55c41f8
Add composer desc
colinswinney Apr 2, 2026
a6fe035
Update composer
colinswinney Apr 2, 2026
5a51082
Update CI
colinswinney Apr 2, 2026
26858f7
Use wp_interactivity_data_wp_context
colinswinney Apr 20, 2026
f1a867e
Match theme.json schemas
colinswinney Apr 20, 2026
75827ef
Add filter checks
colinswinney Apr 20, 2026
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
211 changes: 211 additions & 0 deletions mu-plugins/10up-plugin/includes/classes/PostMeta/AbstractPostMeta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<?php
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update this to use the 10up-framework like in the scaffold today?

/**
* AbstractPostMeta post meta
*
* @package TenUpPlugin
*/

namespace TenUpPlugin\PostMeta;

use TenUpPlugin\Module;

/**
* Abstract class for post meta.
*
* Usage:
*
* class FooPostMeta extends AbstractPostMeta {
*
* public $load_order = 5;
*
* const META_KEY = 'foo_post_meta';
*
* public function get_description(): string {
* return __( 'Foo Post Meta', 'tenup' );
* }
*
* public function get_post_types() {
* return TenUpPlugin\PostTypes\Post::get_name();
* }
*
* public function can_register() {
* return true;
* }
* }
*/
abstract class AbstractPostMeta extends Module {

/**
* Used to alter the order in which clases are initialized.
*
* Lower number will be initialized first.
*
* @note This has no correlation to the `init` priority. It's just a way to allow certain classes to be initialized before others.
*
* @var int The priority of the module.
*/
public $load_order = 10;

/**
* Whether the field has key value options.
*
* @var bool
*/
protected $has_key_value_options = false;

/**
* The meta_key name.
*
* @var string|self::META_KEY
*/
const META_KEY = self::META_KEY;

/**
* Default value.
*
* @var array|string|bool|int|null
*/
protected $default_value = null;

/**
* Value type.
* Allowed options: 'string', 'boolean', 'integer', 'number', 'array', 'object'
*
* @var string
*/
protected $type = 'string';

/**
* Save only single or multiple values.
*
* @var bool
*/
protected $single_value_mode = true;

/**
* Disallow empty values.
*
* @var bool
*/
protected $is_required = false;

/**
* Checks whether the Module should run within the current context.
*
* @return bool
*/
abstract public function can_register(): bool;

/**
* Get the meta_key name.
*
* @return string
*/
public static function get_name(): string {
return static::META_KEY;
}

/**
* Get the field description.
*
* @return string
*/
public function get_description(): string {
return '';
}

/**
* Get allowed values for field schema.
*/
public function allowed_values(): array {
return [];
}

/**
* Post types to register the post meta.
*
* @return array
*/
abstract public function get_post_types(): array;

/**
* Get the options.
*
* @return array
*/
public function get_options() {
$options = [
'show_in_rest' => $this->get_schema(),
'single' => $this->single_value_mode,
'type' => $this->type,
];
if ( null !== $this->default_value ) {
$options['default'] = $this->default_value;
}
return $options;
}

/**
* Get the schema.
*
* @return array
*/
public function get_schema(): array {
// Handle allowed values if data is provided in key/value pairs.
if ( $this->has_key_value_options ) {
$values = $this->allowed_values();
$values = array_keys( $values );
$enum = $values;
} else {
$enum = $this->allowed_values();
}

return [
'schema' => [
'type' => $this->type,
'description' => $this->get_description(),
'required' => $this->is_required,
'enum' => $enum,
],
];
}

/**
* Register all post meta fields.
*
* @return void
*/
public function register_all(): void {
foreach ( $this->get_post_types() as $post_type ) {
\register_post_meta(
$post_type,
self::get_name(),
$this->get_options()
);
}
}

/**
* Register hooks and actions.
*
* @uses $this->get_post_types() to get the post types.
* @uses self::get_name() to get the key name.
* @return bool
*/
public function register() {

add_action( 'init', [ $this, 'register_all' ], 20 );
$this->after_register();

return true;
}

/**
* Run any code after the post meta has been registered.
*
* @return void
*/
public function after_register() {
// Register any hooks/filters you need.
}
}
105 changes: 105 additions & 0 deletions mu-plugins/10up-plugin/includes/classes/PostMeta/MovieMPARating.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php
/**
* MovieMPARating post meta
*
* @package TenUpPlugin
*/

namespace TenUpPlugin\PostMeta;

use TenUpPlugin\PostTypes\Movie;

/**
* MovieMPARating meta field.
*/
class MovieMPARating extends AbstractPostMeta {

/**
* The meta_key name.
*
* @var string
*/
const META_KEY = 'tenup_movie_mpa_rating';

/**
* Get the field description.
*
* @return string
*/
public function get_description(): string {
return __( 'Movie MPA Rating', 'tenup' );
}

/**
* Default value.
*
* @var array|string|bool|int|null
*/
protected $default_value = 'Unrated';

/**
* Whether the field has key value options.
*
* @var bool
*/
protected $has_key_value_options = true;

/**
* Get allowed values for field schema.
*/
public function allowed_values(): array {
return [
'Unrated' => 'Unrated',
'G' => 'G',
'PG' => 'PG',
'PG-13' => 'PG-13',
'R' => 'R',
'NC-17' => 'NC-17',
];
}

/**
* Get the post types.
*
* @return array
*/
public function get_post_types(): array {
return [
Movie::get_name(),
];
}

/**
* Checks whether the Module should run within the current context.
*
* @return bool
*/
public function can_register(): bool {
return true;
}

/**
* Add localized script.
*
* @return void
*/
public function add_localized_script() {

wp_localize_script(
'tenup_plugin_admin',
'TenupMovieMPARating',
array(
'options' => $this->allowed_values(),
)
);
}

/**
* Run any code after the post meta has been registered.
*
* @return void
*/
public function after_register() {
add_action( 'admin_enqueue_scripts', [ $this, 'add_localized_script' ] );
}
}
52 changes: 52 additions & 0 deletions mu-plugins/10up-plugin/includes/classes/PostMeta/MoviePlot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* MoviePlot post meta
*
* @package TenUpPlugin
*/

namespace TenUpPlugin\PostMeta;

use TenUpPlugin\PostTypes\Movie;

/**
* MoviePlot meta field.
*/
class MoviePlot extends AbstractPostMeta {

/**
* The meta_key name.
*
* @var string
*/
const META_KEY = 'tenup_movie_plot';

/**
* Get the field description.
*
* @return string
*/
public function get_description(): string {
return __( 'Movie Plot', 'tenup' );
}

/**
* Get the post types.
*
* @return array
*/
public function get_post_types(): array {
return [
Movie::get_name(),
];
}

/**
* Checks whether the Module should run within the current context.
*
* @return bool
*/
public function can_register(): bool {
return true;
}
}
Loading