PluginProbe
Scrollsequence – Cinematic Scroll Image Animation Plugin / 1.5.6
Scrollsequence – Cinematic Scroll Image Animation Plugin v1.5.6
1.4.3 1.4.4 1.4.5 1.4.6 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 trunk 0.9.92 0.9.93 0.9.94 0.9.96 1.0.072 1.0.073 All 61 releases
scrollsequence / admin / create-cpt.php

create-cpt.php in Scrollsequence – Cinematic Scroll Image Animation Plugin 1.5.6, at admin/create-cpt.php

89 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * This adds the Scrollsequence CPT
5 *
6 *
7 *
8 */
9
10 $cap_type = 'post';
11 $plural = 'Scrollsequence';
12 $single = 'Scrollsequence';
13 $cpt_name = 'scrollsequence';
14 $opts['can_export'] = TRUE;
15 $opts['capability_type'] = $cap_type;
16 $opts['description'] = '';
17 $opts['exclude_from_search'] = FALSE;
18 $opts['has_archive'] = FALSE;
19 $opts['hierarchical'] = FALSE;
20 $opts['map_meta_cap'] = TRUE;
21 //$opts['menu_icon'] = 'dashicons-format-gallery';
22 $opts['menu_icon'] = 'data:image/svg+xml;base64,' . base64_encode('<svg width="20" height="20" viewBox="-150 -150 1300 1300" xmlns="http://www.w3.org/2000/svg">
23
24
25 <polyline points="162,322 500,500 340,575 0,400 162,322"
26 style="fill:rgb(124,173,62);stroke:rgb(124,173,62);stroke-width:5;" />
27 <polyline points="500,500 500,650 340,575"
28 style="fill:rgb(74,108,47);stroke:rgb(74,108,47);stroke-width:5;"/>
29
30 <polyline points="845,675 500,500, 650,425 1000,600 845,675"
31 style="fill:rgb(124,173,62);stroke:rgb(124,173,62);stroke-width:5;" />
32 <polyline points="500,500, 500,350 650,425"
33 style="fill:rgb(74,108,47);stroke:rgb(74,108,47);stroke-width:5; "/>
34
35 <polyline points="500,0 1000,250, 1000,400 500,150 0,400 0,250 500,0"
36 style="fill:rgb(207,223,218);stroke:rgb(207,223,218);stroke-width:5;"/>
37
38 <polyline points="0,600 500,850 1000,600 1000,750 500,1000 0,750 0,600"
39 style="fill:rgb(207,223,218);stroke:rgb(207,223,218);stroke-width:5;"/>
40
41
42 </svg>');
43
44 $opts['menu_position'] = 25;
45 $opts['public'] = TRUE;
46 $opts['publicly_querable'] = TRUE;
47 $opts['query_var'] = TRUE;
48 $opts['register_meta_box_cb'] = '';
49
50 $opts['rewrite'] = array('slug' => 'scrollsequence','with_front' => false); //Ak mod Aktodo
51 $opts['show_in_admin_bar'] = TRUE;
52 $opts['show_in_menu'] = TRUE;
53 $opts['show_in_nav_menu'] = TRUE;
54
55 // Akmod: Line below turns on gutenberg editor.
56 // (When activated "Scrollsequence_Group" context need to change to "normal" for it to be displayed)
57 //$opts['show_in_rest'] = TRUE;
58
59
60 // When line below is active, and page is saved without title => save does not happen
61 $opts['supports'] = array('title','editor','excerpt','thumbnail','post-formats', 'revisions'); // Ak mod gutenberg
62
63
64 $opts['labels']['add_new'] = esc_html__( "Add New {$single}", 'scrollsequence' );
65 $opts['labels']['add_new_item'] = esc_html__( "Add New {$single}", 'scrollsequence' );
66 $opts['labels']['all_items'] = esc_html__( $plural, 'scrollsequence' );
67 $opts['labels']['edit_item'] = esc_html__( "Edit {$single}" , 'scrollsequence' );
68 $opts['labels']['menu_name'] = esc_html__( $plural, 'scrollsequence' );
69 $opts['labels']['name'] = esc_html__( $plural, 'scrollsequence' );
70 $opts['labels']['name_admin_bar'] = esc_html__( $single, 'scrollsequence' );
71 $opts['labels']['new_item'] = esc_html__( "New {$single}", 'scrollsequence' );
72 $opts['labels']['not_found'] = esc_html__( "No {$plural} Found", 'scrollsequence' );
73 $opts['labels']['not_found_in_trash'] = esc_html__( "No {$plural} Found in Trash", 'scrollsequence' );
74 $opts['labels']['parent_item_colon'] = esc_html__( "Parent {$plural} :", 'scrollsequence' );
75 $opts['labels']['search_items'] = esc_html__( "Search {$plural}", 'scrollsequence' );
76 $opts['labels']['singular_name'] = esc_html__( $single, 'scrollsequence' );
77 $opts['labels']['view_item'] = esc_html__( "View {$single}", 'scrollsequence' );
78 register_post_type( strtolower( $cpt_name ), $opts );
79
80 // When line below is active, and page is saved without title => save does not happen
81 //add_post_type_support($cpt_name, array('excerpt','revisons','thumbnail'));
82
83 //remove_post_type_support( $cpt_name, 'editor'); // THIS REMOVES THE DEFAULT WYSIWIG EDITOR
84
85
86
87
88
89