init
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,15 @@
|
||||
i.mce-i-icon {
|
||||
font: 400 20px/1 dashicons!important;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
speak: none;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
margin-left: -2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.mce-tooltip-inner{overflow: hidden!important;}
|
||||
.image-bg-button{text-align: left!important; background-repeat: no-repeat!important;background-size: auto 100%!important; background-position: right!important;}
|
||||
div[aria-label="Add Shortcodes"]{border:1px solid #627f9a!important;}
|
||||
div[aria-label="Add Shortcodes"] > button > span{color:#627f9a!important;}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/* NEW */
|
||||
add_action('admin_head', 'ux_shortcode_button');
|
||||
function ux_shortcode_button() {
|
||||
global $typenow;
|
||||
// check user permissions
|
||||
if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) {
|
||||
return;
|
||||
}
|
||||
// verify the post type
|
||||
if( ! in_array( $typenow, array( 'post', 'page', 'blocks', 'product' ) ) )
|
||||
return;
|
||||
// check if WYSIWYG is enabled
|
||||
if ( get_user_option('rich_editing') == 'true') {
|
||||
add_filter("mce_external_plugins", "ux_shortcode_add_tinymce_plugin");
|
||||
add_filter('mce_buttons', 'ux_shortcode_insert_button');
|
||||
}
|
||||
}
|
||||
|
||||
function ux_shortcode_add_tinymce_plugin($plugin_array) {
|
||||
$plugin_array['ux_shortcode_insert'] = get_template_directory_uri().'/inc/extensions/flatsome-shortcode-insert/shortcode_insert.js';
|
||||
return $plugin_array;
|
||||
}
|
||||
|
||||
function ux_shortcode_insert_button($buttons) {
|
||||
array_push($buttons, "ux_shortcode_insert");
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
function ux_shortcode_css() {
|
||||
// TODO: Only Load on Edit Page
|
||||
wp_enqueue_style('ux_shortcode_insert_css', get_template_directory_uri().'/inc/extensions/flatsome-shortcode-insert/style.css');
|
||||
}
|
||||
|
||||
add_action('admin_enqueue_scripts', 'ux_shortcode_css');
|
Reference in New Issue
Block a user