PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 3.4.1
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v3.4.1
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / WordPress / Templates / CollectionTemplateService.php
CollectionTemplateService.php
51 lines 1000 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace SureCart\WordPress\Templates;
3
4 /**
5 * The template service.
6 */
7 class CollectionTemplateService {
8 /**
9 * The template file/name associations.
10 *
11 * @var array
12 */
13 private $templates = [];
14
15 /**
16 * The post type for the templates.
17 *
18 * @var string
19 */
20 private $type = 'sc_collection';
21
22 /**
23 * Get things going.
24 *
25 * @param array $templates The template file/name associations.
26 */
27 public function __construct( $templates ) {
28 $this->templates = $templates;
29 }
30
31 /**
32 * Bootstrap actions and filters.
33 *
34 * @return void
35 */
36 public function bootstrap() {
37 add_filter( 'theme_' . $this->type . '_templates', [ $this, 'addTemplates' ] );
38 }
39
40 /**
41 * Add the templates to the theme.
42 *
43 * @param array $templates The templates.
44 * @return array
45 */
46 public function addTemplates( $templates ) {
47 $translations['pages/template-surecart-collection.php'] = esc_html__( 'SureCart Layout', 'surecart' );
48 return array_merge( $templates, $this->templates );
49 }
50 }
51