PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.0.2
Shortcodes and extra features for Phlox theme v1.0.2
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / admin / includes / admin-hooks.php
auxin-elements / admin / includes Last commit date
classes 9 years ago metaboxes 9 years ago modules 9 years ago admin-hooks.php 9 years ago admin-the-functions.php 9 years ago index.php 9 years ago
admin-hooks.php
178 lines
1 <?php
2
3
4
5
6 /*-----------------------------------------------------------------------------------*/
7 /* Add shortcode button to tinymce
8 /*-----------------------------------------------------------------------------------*/
9
10 function auxin_register_shortcode_button( $buttons ) {
11 array_push( $buttons, '|', 'phlox_shortcodes_button' );
12 return $buttons;
13 }
14
15 /**
16 * Add the shortcode button to TinyMCE
17 *
18 * @param array $plugin_array
19 * @return array
20 */
21 function auxin_add_elements_tinymce_plugin( $plugin_array ) {
22 $wp_version = get_bloginfo( 'version' );
23
24 $plugin_array['phlox_shortcodes_button'] = AUXELS_ADMIN_URL."/assets/js/tinymce/plugins/auxin-btns.js";
25
26 return $plugin_array;
27 }
28
29
30 function axion_init_shortcode_manager(){
31 if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
32 return;
33
34 add_filter( 'mce_external_plugins', 'auxin_add_elements_tinymce_plugin' );
35 add_filter( 'mce_buttons', 'auxin_register_shortcode_button' );
36 }
37 add_action("init", "axion_init_shortcode_manager");
38
39 /*-----------------------------------------------------------------------------------*/
40 /* Add Editor styles
41 /*-----------------------------------------------------------------------------------*/
42
43 function auxin_register_mce_buttons_style(){
44 wp_register_style('auxin_mce_buttons' , AUXELS_ADMIN_URL. '/assets/css/editor.css', NULL, '1.1');
45 wp_enqueue_style('auxin_mce_buttons');
46 }
47 add_action('admin_enqueue_scripts', 'auxin_register_mce_buttons_style');
48
49
50
51 /*-----------------------------------------------------------------------------------*/
52 /* Adds system status tab in theme about (welcome) page
53 /*-----------------------------------------------------------------------------------*/
54
55 function auxin_about_system_status( $sections ){
56
57 $sections['status'] = array(
58 'label' => __( 'System Status', 'auxin-elements' ),
59 'description' => __( 'The informaition about your WordPress installation which can be helpful for debugging or monitoring your website.', 'auxin-elements'),
60 'callback' => 'auxin_get_about_system_status'
61 );
62
63 return $sections;
64 }
65
66 add_filter( 'auxin_admin_welcome_sections', 'auxin_about_system_status', 100 );
67
68
69
70 /*-----------------------------------------------------------------------------------*/
71 /* Adds subtitle meta field to 'Title setting' tab
72 /*-----------------------------------------------------------------------------------*/
73
74 function auxin_add_metabox_field_to_title_setting_tab( $fields, $id, $type ){
75
76 if( 'general-title' == $id ){
77 array_unshift(
78 $fields,
79 array(
80 'title' => __('Subtitle', THEME_DOMAIN),
81 'description' => __('Second Title (optional). Note: You have to enable "Display Title Bar Section" option in order to display the subtitle.', THEME_DOMAIN),
82 'id' => 'page_subtitle',
83 'type' => 'editor',
84 'default' => ''
85 )
86 );
87 }
88
89 return $fields;
90 }
91 add_filter( 'auxin_metabox_fields', 'auxin_add_metabox_field_to_title_setting_tab', 10, 3 );
92
93
94 /*-----------------------------------------------------------------------------------*/
95 /* Adds Custom JavaScript meta field to 'Advanced setting' tab
96 /*-----------------------------------------------------------------------------------*/
97
98 function auxin_add_metabox_field_to_advanced_setting_tab( $fields, $id, $type ){
99
100 if( 'general-advanced' == $id ){
101 $fields[] = array(
102 'title' => __('Custom JavaScript Code', THEME_DOMAIN),
103 'description' => __('Attention: The following custom JavaScript code will be applied ONLY to this page.', THEME_DOMAIN).'<br />'.
104 __('For defining global JavaScript roles, please use custom javaScript field on option panel.', THEME_DOMAIN ),
105 'id' => 'aux_page_custom_js',
106 'type' => 'code',
107 'mode' => 'javascript',
108 'default' => ''
109 );
110 }
111 return $fields;
112 }
113 add_filter( 'auxin_metabox_fields', 'auxin_add_metabox_field_to_advanced_setting_tab', 10, 3 );
114
115
116
117
118
119
120 /*======================================================================*/
121
122 function auxin_elements_add_post_metabox_models( $models ){
123
124 // Load general metabox models
125 include_once( 'metaboxes/metabox-fields-post-audio.php' );
126 include_once( 'metaboxes/metabox-fields-post-gallery.php' );
127 include_once( 'metaboxes/metabox-fields-post-quote.php' );
128 include_once( 'metaboxes/metabox-fields-post-video.php' );
129
130 $models[] = array(
131 'model' => auxin_metabox_fields_post_gallery(),
132 'priority' => 20
133 );
134
135 $models[] = array(
136 'model' => auxin_metabox_fields_post_video(),
137 'priority' => 22
138 );
139
140 $models[] = array(
141 'model' => auxin_metabox_fields_post_audio(),
142 'priority' => 24
143 );
144
145 $models[] = array(
146 'model' => auxin_metabox_fields_post_quote(),
147 'priority' => 26
148 );
149
150 return $models;
151 }
152
153 add_filter( 'auxin_admin_metabox_models_post', 'auxin_elements_add_post_metabox_models' );
154
155
156 /*-----------------------------------------------------------------------------------*/
157 /* Add theme tab in siteorigin page builder
158 /*-----------------------------------------------------------------------------------*/
159
160 function auxin_add_widget_tabs($tabs) {
161 $tabs[] = array(
162 'title' => THEME_NAME,
163 'filter' => array(
164 'groups' => array('auxin')
165 )
166 );
167
168 if (isset($tabs['recommended'])){
169 unset($tabs['recommended']);
170 }
171
172
173 return $tabs;
174 }
175 add_filter( 'siteorigin_panels_widget_dialog_tabs', 'auxin_add_widget_tabs', 20 );
176
177 // =============================================================================
178