From: Stephen Cameron Date: Tue, 17 Dec 2019 19:49:41 +0000 (+0100) Subject: WIP #3053 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d586e3b0154442256375aa1751c38ead67ad0f82;p=ccv-wordpress.git WIP #3053 --- diff --git a/wp-content/mu-plugins/cube/src/CPT/Person.php b/wp-content/mu-plugins/cube/src/CPT/Person.php new file mode 100644 index 0000000..d6748b6 --- /dev/null +++ b/wp-content/mu-plugins/cube/src/CPT/Person.php @@ -0,0 +1,23 @@ +setIcon('users') + ->setArgument('publicly_queryable', false) // No public page, just used as part of other posts + ->setArgument('supports', ['title']) // No editor for this post type + ->setTitlePlaceholder('Enter full name here') + ->setTitleForm(function() { + $form = \tr_form(); + echo $form->image('Photo'); + }); + }); + } + +} diff --git a/wp-content/mu-plugins/cube/src/CPT/ScientificNews.php b/wp-content/mu-plugins/cube/src/CPT/ScientificNews.php new file mode 100644 index 0000000..a5c9957 --- /dev/null +++ b/wp-content/mu-plugins/cube/src/CPT/ScientificNews.php @@ -0,0 +1,21 @@ +setIcon('flask') + ->setEditorForm(function() { + $form = \tr_form(); + echo $form->gallery('Images'); + echo $form->search('Published By')->setPostType('person'); + }); + }); + } + +} diff --git a/wp-content/mu-plugins/cube/src/Init.php b/wp-content/mu-plugins/cube/src/Init.php index e93ae26..3762fdf 100644 --- a/wp-content/mu-plugins/cube/src/Init.php +++ b/wp-content/mu-plugins/cube/src/Init.php @@ -15,6 +15,8 @@ final class Init { // Marked as final because this class should never be extende return [ Common\Setup::class, Elementor\Setup::class, + CPT\Person::class, + CPT\ScientificNews::class, ]; } diff --git a/wp-content/themes/CCV/resources/views/partials/content-single-scientific_news.blade.php b/wp-content/themes/CCV/resources/views/partials/content-single-scientific_news.blade.php new file mode 100644 index 0000000..9e9ca50 --- /dev/null +++ b/wp-content/themes/CCV/resources/views/partials/content-single-scientific_news.blade.php @@ -0,0 +1,40 @@ +
+ +
+ +
+ {{ __('Publié par') }} +
+ {{-- Todo: get linked post type data for user from published_by ID --}} + {{ tr_posts_field('published_by') }} +
+ + @foreach(tr_posts_field('images') as $image) +
+
{{-- Just here as a proportional sizer thanks to the padding --}}
+
+ @endforeach + +
+ +
+

+ {!! $title !!} +

+ + @php(the_content()) + +

+ + @svg('arrow', 'h-3 mr-2 fill-current') + + +

+
+ + {{-- + + --}} +