Hey @nht2007,
Can you try adding your filters at a high priority and see if it works? ??
// Lazy Shortcode
function lazyimage_shortcode( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'tieude' => '',
'url' => ''
),
$atts,
'lazyimage'
);
return '<img class="lazy loading" data-src="'.esc_html__($atts['url']).'" alt="'.esc_html__($atts['tieude']).'" title="'.esc_html__($atts['tieude']).'">';
}
add_shortcode( 'lazyimage', 'lazyimage_shortcode' );
// Add TinyMCE button and plugin filters
function lazyimage_tinymce_button() {
if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
add_filter( 'mce_buttons', 'lazyimage_register_tinymce_button', 99999 );
add_filter( 'mce_external_plugins', 'lazyimage_tinymce_button_script', 99999 );
}
}
add_action( 'init', 'lazyimage_tinymce_button' );
Ben
-
This reply was modified 7 years, 11 months ago by
Ben Carlo.