Syhlver
Forum Replies Created
-
It works great, thanks you for your fast answer !
Okay, so I searched and found where the problem was.
The event to initialize the editor on click on the widget is simply not triggered when we click on the arrow.
So I replaced the event on the class “widget-action” which is not working by “widget-title-action”So replacing this (black-studio-tinymce-widget.js, line 221) :
$( document ).on( 'click', 'div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] .widget-action', function() {by
$( document ).on( 'click', 'div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] .widget-title-action', function() {worked for me 🙂
Forum: Plugins
In reply to: [Black Studio TinyMCE Widget] Auto-embed not workingAnd for the function fAddIdPreviewWidgetPost, it’s better to use it in those hooks (better than show it in each widget) :
add_action( ‘widgets_admin_page’, array( $this, ‘fAddIdPreviewWidgetPost’ ) );
add_action( ‘customize_controls_init’, array( $this, ‘fAddIdPreviewWidgetPost’ ) );Forum: Plugins
In reply to: [Black Studio TinyMCE Widget] Auto-embed not workingSo, I have a solution.
It’s a workaround, but it respond to my needs.For embeding a link, WordPress need a post ID of an existing post.
So my solution is to create a custom post type (not public, not queryable, etc..).
Then, I create a single post for this custom post type (in the code) and I register the given ID in an option.
And finally in each widget form content, I put a hidden input named « post_ID » containing the previously created post ID as value.# —————————————————————-
# Create a private custom post type
# This CPT will only contain a single post. This will be used for links embed preview in widget tinymce editorfunction fCreateHiddenCPT()
{# ———————————————————–
# Register the post type$args = array(
‘public’ => false,
‘publicly_queryable’ => false,
‘show_ui’ => false,
‘query_var’ => false,
‘rewrite’ => false,
‘capability_type’ => ‘post’,
‘hierarchical’ => false,
‘menu_position’ => null,
‘show_in_nav_menus’ => false,
‘has_archive’ => false
);register_post_type(‘hiddencpt’,$args);
}
# ———————————————————–
# Create the single postfunction fCreateSingleHiddenCPT()
{
$queryPost = new WP_Query(‘post_type=hiddencpt’);
$totalPost = $queryPost->post_count;if($totalPost == 0)
{
$argPost = array(‘post_type’ => ‘hiddencpt’);
$idPreviewWidgetPost = wp_insert_post($argPost);// Add the id of the post reference in an option
update_option(‘idPreviewWidgetPost’,$idPreviewWidgetPost);
}
}# ———————————————————–
# For make it working in customize.phpfunction fAddIdPreviewWidgetPost()
{
echo ‘<input type=”hidden” id=”post_ID” name=”post_ID” value=”‘.get_option(‘idPreviewWidgetPost’).'”>’;
}add_action(‘customize_register’, array( $this, ‘fAddIdPreviewWidgetPost’) );
Forum: Plugins
In reply to: [Black Studio TinyMCE Widget] Auto-embed not workingOkay, thanks for your answer, I will see if I can do something to avoid this limitation.
I’ll tell you if I found something !Forum: Plugins
In reply to: [Black Studio TinyMCE Widget] Automatic YouTube Embeds Not WorkingHi,
I pull up this issue as i’m having this problem too.
I’m on a new install of WordPress ( 4.2.2 with Twenty Fifteen) and Black Studio TinyMCE Widget in the last version which is the only plugin enabled.I see that WordPress need a valid post ID for embedding a youtube link in the tinymce editor. (And the widget can’t provide that.)
So it doesn’t work on the widgets.php and also on the customize.php admin page.
Thanks for your help !
Forum: Plugins
In reply to: [Black Studio TinyMCE Widget] Only text (html) editor portion is working.I have fully tested it on a WordPress default theme (twenty fifteen), with the last version of WordPress and the last version of Black Studio TinyMCE Widget (which is the only plugin enabled).
The problem occurs only on the Customizer when :
– I add any new widget > In this case, all TinyMCE widgets are broken (The visual tab become empty, only the html tab is accessible).
– I change the order by drag&drop of a TinyMCE widget > In this case, only the moved widget is brokenForum: Plugins
In reply to: [Black Studio TinyMCE Widget] Only text (html) editor portion is working.It works when I create a first tinymce widget, but when I create another one, all visual tabs of all tinyMCE widgets stop working
Forum: Plugins
In reply to: [Black Studio TinyMCE Widget] Only text (html) editor portion is working.Hi, I have the same problem but only on the Customizer
I have tested it and it works great, thanks !